From f11f3fe95d79998dc3d0cb4fdd5d454b524e3e52 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Sat, 21 May 2022 19:58:09 +0200 Subject: [PATCH] Add 'cppkore' library to project --- r5dev/thirdparty/cppnet/LICENSE.md | 674 + r5dev/thirdparty/cppnet/README.md | 2 + r5dev/thirdparty/cppnet/cppkore/Action.h | 3 + r5dev/thirdparty/cppnet/cppkore/Adler32.cpp | 45 + r5dev/thirdparty/cppnet/cppkore/Adler32.h | 12 + .../thirdparty/cppnet/cppkore/AnchorStyles.h | 30 + r5dev/thirdparty/cppnet/cppkore/Animation.cpp | 128 + r5dev/thirdparty/cppnet/cppkore/Animation.h | 62 + .../cppnet/cppkore/AnimationTypes.h | 33 + r5dev/thirdparty/cppnet/cppkore/Appearence.h | 15 + .../thirdparty/cppnet/cppkore/Application.cpp | 116 + r5dev/thirdparty/cppnet/cppkore/Application.h | 37 + .../cppnet/cppkore/AssetRenderer.cpp | 720 + .../thirdparty/cppnet/cppkore/AssetRenderer.h | 165 + .../cppnet/cppkore/AtomicListBase.h | 75 + .../cppnet/cppkore/AtomicQueueBase.h | 132 + .../thirdparty/cppnet/cppkore/AutoScaleMode.h | 13 + .../cppnet/cppkore/AutodeskMaya.cpp | 517 + .../thirdparty/cppnet/cppkore/AutodeskMaya.h | 33 + .../cppnet/cppkore/BinaryReader.cpp | 251 + .../thirdparty/cppnet/cppkore/BinaryReader.h | 72 + .../cppnet/cppkore/BinaryWriter.cpp | 145 + .../thirdparty/cppnet/cppkore/BinaryWriter.h | 61 + r5dev/thirdparty/cppnet/cppkore/Bone.cpp | 140 + r5dev/thirdparty/cppnet/cppkore/Bone.h | 93 + r5dev/thirdparty/cppnet/cppkore/BoneFlags.h | 26 + r5dev/thirdparty/cppnet/cppkore/BorderStyle.h | 17 + .../cppnet/cppkore/BoundsSpecified.h | 21 + .../cppnet/cppkore/BufferedGraphics.cpp | 27 + .../cppnet/cppkore/BufferedGraphics.h | 32 + r5dev/thirdparty/cppnet/cppkore/Button.cpp | 104 + r5dev/thirdparty/cppnet/cppkore/Button.h | 42 + .../thirdparty/cppnet/cppkore/ButtonBase.cpp | 330 + r5dev/thirdparty/cppnet/cppkore/ButtonBase.h | 76 + r5dev/thirdparty/cppnet/cppkore/ButtonFlags.h | 29 + r5dev/thirdparty/cppnet/cppkore/CRC32.cpp | 69 + r5dev/thirdparty/cppnet/cppkore/CRC32.h | 26 + .../cppkore/CacheVirtualItemsEventArgs.cpp | 10 + .../cppkore/CacheVirtualItemsEventArgs.h | 19 + .../cppnet/cppkore/CancelEventArgs.cpp | 15 + .../cppnet/cppkore/CancelEventArgs.h | 18 + r5dev/thirdparty/cppnet/cppkore/CastAsset.cpp | 402 + r5dev/thirdparty/cppnet/cppkore/CastAsset.h | 32 + r5dev/thirdparty/cppnet/cppkore/CastNode.cpp | 222 + r5dev/thirdparty/cppnet/cppkore/CastNode.h | 146 + .../cppnet/cppkore/CharacterCasing.h | 17 + r5dev/thirdparty/cppnet/cppkore/CheckBox.cpp | 188 + r5dev/thirdparty/cppnet/cppkore/CheckBox.h | 72 + .../thirdparty/cppnet/cppkore/CheckBoxImage.h | 92 + r5dev/thirdparty/cppnet/cppkore/CheckState.h | 19 + r5dev/thirdparty/cppnet/cppkore/CloseReason.h | 25 + .../cppnet/cppkore/CoDXAssetExport.cpp | 251 + .../cppnet/cppkore/CoDXAssetExport.h | 33 + .../cppnet/cppkore/ColumnClickEventArgs.cpp | 10 + .../cppnet/cppkore/ColumnClickEventArgs.h | 17 + .../cppnet/cppkore/ColumnHeader.cpp | 158 + .../thirdparty/cppnet/cppkore/ColumnHeader.h | 71 + .../cppnet/cppkore/ColumnHeaderStyle.h | 17 + r5dev/thirdparty/cppnet/cppkore/ComboBox.cpp | 496 + r5dev/thirdparty/cppnet/cppkore/ComboBox.h | 190 + .../thirdparty/cppnet/cppkore/ComboBoxStyle.h | 17 + .../cppnet/cppkore/CompressionMode.h | 13 + r5dev/thirdparty/cppnet/cppkore/Console.cpp | 563 + r5dev/thirdparty/cppnet/cppkore/Console.h | 133 + .../cppnet/cppkore/ConsoleColor.cpp | 23 + .../thirdparty/cppnet/cppkore/ConsoleColor.h | 69 + r5dev/thirdparty/cppnet/cppkore/ConsoleKey.h | 196 + .../cppnet/cppkore/ConsoleKeyInfo.h | 35 + .../cppnet/cppkore/ConsoleStream.cpp | 131 + .../thirdparty/cppnet/cppkore/ConsoleStream.h | 52 + .../cppnet/cppkore/ContainerControl.cpp | 452 + .../cppnet/cppkore/ContainerControl.h | 100 + .../cppnet/cppkore/ContentAlignment.h | 56 + r5dev/thirdparty/cppnet/cppkore/Control.cpp | 2744 ++ r5dev/thirdparty/cppnet/cppkore/Control.h | 574 + .../cppnet/cppkore/ControlCollection.cpp | 143 + .../cppnet/cppkore/ControlCollection.h | 54 + .../thirdparty/cppnet/cppkore/ControlStates.h | 51 + .../thirdparty/cppnet/cppkore/ControlStyles.h | 75 + .../thirdparty/cppnet/cppkore/ControlTypes.h | 23 + .../thirdparty/cppnet/cppkore/CppKore.natvis | 42 + .../thirdparty/cppnet/cppkore/CreateParams.h | 26 + r5dev/thirdparty/cppnet/cppkore/Curve.cpp | 96 + r5dev/thirdparty/cppnet/cppkore/Curve.h | 91 + r5dev/thirdparty/cppnet/cppkore/DDS.cpp | 110 + r5dev/thirdparty/cppnet/cppkore/DDS.h | 55 + .../cppnet/cppkore/DeflateCodec.cpp | 113 + .../thirdparty/cppnet/cppkore/DeflateCodec.h | 23 + .../cppnet/cppkore/DeflateStream.cpp | 219 + .../thirdparty/cppnet/cppkore/DeflateStream.h | 61 + .../thirdparty/cppnet/cppkore/DialogResult.h | 35 + .../cppnet/cppkore/DictionaryBase.h | 573 + r5dev/thirdparty/cppnet/cppkore/Directory.cpp | 299 + r5dev/thirdparty/cppnet/cppkore/Directory.h | 45 + .../cppnet/cppkore/DragDropEffects.h | 26 + .../cppnet/cppkore/DragEventArgs.cpp | 10 + .../thirdparty/cppnet/cppkore/DragEventArgs.h | 31 + .../DrawListViewColumnHeaderEventArgs.cpp | 10 + .../DrawListViewColumnHeaderEventArgs.h | 33 + .../cppkore/DrawListViewItemEventArgs.cpp | 10 + .../cppkore/DrawListViewItemEventArgs.h | 36 + .../cppkore/DrawListViewSubItemEventArgs.cpp | 10 + .../cppkore/DrawListViewSubItemEventArgs.h | 38 + r5dev/thirdparty/cppnet/cppkore/DrawMode.h | 17 + .../cppnet/cppkore/DrawToolTipEventArgs.cpp | 45 + .../cppnet/cppkore/DrawToolTipEventArgs.h | 48 + r5dev/thirdparty/cppnet/cppkore/DrawingBase.h | 269 + .../thirdparty/cppnet/cppkore/DropTarget.cpp | 82 + r5dev/thirdparty/cppnet/cppkore/DropTarget.h | 52 + .../thirdparty/cppnet/cppkore/Environment.cpp | 122 + r5dev/thirdparty/cppnet/cppkore/Environment.h | 52 + r5dev/thirdparty/cppnet/cppkore/EventBase.h | 110 + r5dev/thirdparty/cppnet/cppkore/Exporter.h | 43 + r5dev/thirdparty/cppnet/cppkore/Face.cpp | 25 + r5dev/thirdparty/cppnet/cppkore/Face.h | 27 + r5dev/thirdparty/cppnet/cppkore/File.cpp | 205 + r5dev/thirdparty/cppnet/cppkore/File.h | 66 + r5dev/thirdparty/cppnet/cppkore/FileAccess.h | 18 + r5dev/thirdparty/cppnet/cppkore/FileMode.h | 23 + r5dev/thirdparty/cppnet/cppkore/FileShare.h | 25 + .../thirdparty/cppnet/cppkore/FileStream.cpp | 540 + r5dev/thirdparty/cppnet/cppkore/FileStream.h | 79 + r5dev/thirdparty/cppnet/cppkore/FlatStyle.h | 21 + r5dev/thirdparty/cppnet/cppkore/Font.cpp | 49 + r5dev/thirdparty/cppnet/cppkore/Font.h | 31 + r5dev/thirdparty/cppnet/cppkore/FontArial.h | 557 + r5dev/thirdparty/cppnet/cppkore/Form.cpp | 1182 + r5dev/thirdparty/cppnet/cppkore/Form.h | 251 + .../cppnet/cppkore/FormBorderStyle.h | 25 + .../cppnet/cppkore/FormClosedEventArgs.cpp | 10 + .../cppnet/cppkore/FormClosedEventArgs.h | 18 + .../cppnet/cppkore/FormClosingEventArgs.cpp | 10 + .../cppnet/cppkore/FormClosingEventArgs.h | 19 + .../cppnet/cppkore/FormStartPosition.h | 25 + .../cppnet/cppkore/FormWindowState.h | 17 + r5dev/thirdparty/cppnet/cppkore/GroupBox.cpp | 123 + r5dev/thirdparty/cppnet/cppkore/GroupBox.h | 47 + r5dev/thirdparty/cppnet/cppkore/Half.cpp | 74 + r5dev/thirdparty/cppnet/cppkore/Half.h | 76 + .../cppnet/cppkore/HandledMouseEventArgs.cpp | 10 + .../cppnet/cppkore/HandledMouseEventArgs.h | 20 + .../thirdparty/cppnet/cppkore/HashComparer.h | 23 + r5dev/thirdparty/cppnet/cppkore/HashHelpers.h | 78 + .../cppnet/cppkore/HorizontalAlignment.h | 18 + r5dev/thirdparty/cppnet/cppkore/IOError.cpp | 70 + r5dev/thirdparty/cppnet/cppkore/IOError.h | 35 + r5dev/thirdparty/cppnet/cppkore/Icon.cpp | 70 + r5dev/thirdparty/cppnet/cppkore/Icon.h | 35 + .../cppnet/cppkore/ImmutableStringBase.h | 103 + .../cppnet/cppkore/InternetPortType.h | 14 + .../cppnet/cppkore/InvalidateEventArgs.cpp | 10 + .../cppnet/cppkore/InvalidateEventArgs.h | 19 + .../cppnet/cppkore/ItemActivation.h | 21 + r5dev/thirdparty/cppnet/cppkore/Job.cpp | 40 + r5dev/thirdparty/cppnet/cppkore/Job.h | 35 + .../thirdparty/cppnet/cppkore/JobManager.cpp | 222 + r5dev/thirdparty/cppnet/cppkore/JobManager.h | 72 + r5dev/thirdparty/cppnet/cppkore/JobWorker.cpp | 51 + r5dev/thirdparty/cppnet/cppkore/JobWorker.h | 38 + .../thirdparty/cppnet/cppkore/KaydaraFBX.cpp | 602 + r5dev/thirdparty/cppnet/cppkore/KaydaraFBX.h | 33 + .../cppnet/cppkore/KaydaraFBXContainer.cpp | 538 + .../cppnet/cppkore/KaydaraFBXContainer.h | 126 + .../cppnet/cppkore/KeyEventArgs.cpp | 66 + .../thirdparty/cppnet/cppkore/KeyEventArgs.h | 48 + .../cppnet/cppkore/KeyPressEventArgs.cpp | 20 + .../cppnet/cppkore/KeyPressEventArgs.h | 26 + r5dev/thirdparty/cppnet/cppkore/Keys.h | 399 + r5dev/thirdparty/cppnet/cppkore/Kore.h | 203 + r5dev/thirdparty/cppnet/cppkore/KoreTheme.cpp | 484 + r5dev/thirdparty/cppnet/cppkore/KoreTheme.h | 42 + r5dev/thirdparty/cppnet/cppkore/LZ4Codec.cpp | 75 + r5dev/thirdparty/cppnet/cppkore/LZ4Codec.h | 37 + r5dev/thirdparty/cppnet/cppkore/LZ4Stream.cpp | 277 + r5dev/thirdparty/cppnet/cppkore/LZ4Stream.h | 65 + .../thirdparty/cppnet/cppkore/LZHAMCodec.cpp | 94 + r5dev/thirdparty/cppnet/cppkore/LZHAMCodec.h | 23 + .../thirdparty/cppnet/cppkore/LZO1XCodec.cpp | 77 + r5dev/thirdparty/cppnet/cppkore/LZO1XCodec.h | 23 + r5dev/thirdparty/cppnet/cppkore/Label.cpp | 169 + r5dev/thirdparty/cppnet/cppkore/Label.h | 55 + .../cppnet/cppkore/LabelEditEventArgs.cpp | 15 + .../cppnet/cppkore/LabelEditEventArgs.h | 23 + r5dev/thirdparty/cppnet/cppkore/ListBase.h | 392 + r5dev/thirdparty/cppnet/cppkore/ListView.cpp | 1427 + r5dev/thirdparty/cppnet/cppkore/ListView.h | 335 + .../cppnet/cppkore/ListViewAlignment.h | 21 + .../thirdparty/cppnet/cppkore/ListViewFlags.h | 51 + .../cppnet/cppkore/ListViewItem.cpp | 72 + .../thirdparty/cppnet/cppkore/ListViewItem.h | 60 + .../cppnet/cppkore/ListViewItemStates.h | 21 + ...ualItemsSelectionRangeChangedEventArgs.cpp | 10 + ...rtualItemsSelectionRangeChangedEventArgs.h | 21 + r5dev/thirdparty/cppnet/cppkore/Mangle.cpp | 43 + r5dev/thirdparty/cppnet/cppkore/Mangle.h | 203 + r5dev/thirdparty/cppnet/cppkore/Mangler.cpp | 68 + r5dev/thirdparty/cppnet/cppkore/Mangler.h | 20 + r5dev/thirdparty/cppnet/cppkore/Material.cpp | 16 + r5dev/thirdparty/cppnet/cppkore/Material.h | 65 + r5dev/thirdparty/cppnet/cppkore/MathHelper.h | 36 + r5dev/thirdparty/cppnet/cppkore/Matrix.cpp | 422 + r5dev/thirdparty/cppnet/cppkore/Matrix.h | 75 + .../cppnet/cppkore/MemoryStream.cpp | 228 + .../thirdparty/cppnet/cppkore/MemoryStream.h | 55 + r5dev/thirdparty/cppnet/cppkore/Mesh.cpp | 25 + r5dev/thirdparty/cppnet/cppkore/Mesh.h | 39 + r5dev/thirdparty/cppnet/cppkore/Message.h | 24 + .../thirdparty/cppnet/cppkore/MessageBox.cpp | 208 + r5dev/thirdparty/cppnet/cppkore/MessageBox.h | 50 + .../cppnet/cppkore/MessageBoxButtons.h | 23 + .../cppnet/cppkore/MessageBoxDefaultButton.h | 17 + .../cppnet/cppkore/MessageBoxIcon.h | 29 + .../cppnet/cppkore/MessageBoxOptions.h | 19 + r5dev/thirdparty/cppnet/cppkore/Model.cpp | 146 + r5dev/thirdparty/cppnet/cppkore/Model.h | 84 + .../cppnet/cppkore/ModelFragmentShader.h | 58 + .../cppnet/cppkore/ModelVertexShader.h | 20 + .../thirdparty/cppnet/cppkore/MouseButtons.h | 31 + .../cppnet/cppkore/MouseEventArgs.cpp | 10 + .../cppnet/cppkore/MouseEventArgs.h | 27 + .../cppnet/cppkore/OpenFileDialog.cpp | 122 + .../cppnet/cppkore/OpenFileDialog.h | 22 + .../cppnet/cppkore/OpenGLViewport.cpp | 110 + .../cppnet/cppkore/OpenGLViewport.h | 38 + .../cppnet/cppkore/PaintEventArgs.cpp | 42 + .../cppnet/cppkore/PaintEventArgs.h | 37 + .../cppnet/cppkore/PaintFrameEventArgs.cpp | 10 + .../cppnet/cppkore/PaintFrameEventArgs.h | 18 + r5dev/thirdparty/cppnet/cppkore/Panel.cpp | 57 + r5dev/thirdparty/cppnet/cppkore/Panel.h | 32 + .../thirdparty/cppnet/cppkore/ParallelTask.h | 49 + r5dev/thirdparty/cppnet/cppkore/Path.cpp | 209 + r5dev/thirdparty/cppnet/cppkore/Path.h | 86 + r5dev/thirdparty/cppnet/cppkore/Pattern.cpp | 152 + r5dev/thirdparty/cppnet/cppkore/Pattern.h | 81 + .../cppnet/cppkore/PopupEventArgs.cpp | 10 + .../cppnet/cppkore/PopupEventArgs.h | 28 + r5dev/thirdparty/cppnet/cppkore/Process.cpp | 854 + r5dev/thirdparty/cppnet/cppkore/Process.h | 151 + r5dev/thirdparty/cppnet/cppkore/ProcessInfo.h | 26 + .../thirdparty/cppnet/cppkore/ProcessModule.h | 26 + .../cppnet/cppkore/ProcessReader.cpp | 272 + .../thirdparty/cppnet/cppkore/ProcessReader.h | 82 + .../cppnet/cppkore/ProcessStartInfo.h | 45 + .../cppnet/cppkore/ProcessStream.cpp | 176 + .../thirdparty/cppnet/cppkore/ProcessStream.h | 52 + .../thirdparty/cppnet/cppkore/ProcessThread.h | 21 + .../thirdparty/cppnet/cppkore/ProgressBar.cpp | 211 + r5dev/thirdparty/cppnet/cppkore/ProgressBar.h | 82 + .../cppnet/cppkore/ProgressBarStyle.h | 17 + .../thirdparty/cppnet/cppkore/Quaternion.cpp | 247 + r5dev/thirdparty/cppnet/cppkore/Quaternion.h | 71 + .../thirdparty/cppnet/cppkore/RadioButton.cpp | 162 + r5dev/thirdparty/cppnet/cppkore/RadioButton.h | 58 + r5dev/thirdparty/cppnet/cppkore/Registry.cpp | 11 + r5dev/thirdparty/cppnet/cppkore/Registry.h | 22 + .../thirdparty/cppnet/cppkore/RegistryHive.h | 18 + .../thirdparty/cppnet/cppkore/RegistryKey.cpp | 368 + r5dev/thirdparty/cppnet/cppkore/RegistryKey.h | 218 + .../cppnet/cppkore/RegistryValueType.h | 29 + .../thirdparty/cppnet/cppkore/RegistryView.h | 15 + .../thirdparty/cppnet/cppkore/RenderFont.cpp | 161 + r5dev/thirdparty/cppnet/cppkore/RenderFont.h | 60 + .../cppnet/cppkore/RenderShader.cpp | 105 + .../thirdparty/cppnet/cppkore/RenderShader.h | 33 + .../cppnet/cppkore/RenderViewCamera.cpp | 135 + .../cppnet/cppkore/RenderViewCamera.h | 72 + .../cppkore/RetrieveVirtualItemEventArgs.cpp | 10 + .../cppkore/RetrieveVirtualItemEventArgs.h | 25 + r5dev/thirdparty/cppnet/cppkore/SEAsset.cpp | 594 + r5dev/thirdparty/cppnet/cppkore/SEAsset.h | 32 + .../cppnet/cppkore/SaveFileDialog.cpp | 51 + .../cppnet/cppkore/SaveFileDialog.h | 18 + r5dev/thirdparty/cppnet/cppkore/ScrollBars.h | 19 + .../thirdparty/cppnet/cppkore/SecureString.h | 72 + r5dev/thirdparty/cppnet/cppkore/SeekOrigin.h | 12 + r5dev/thirdparty/cppnet/cppkore/Settings.cpp | 145 + r5dev/thirdparty/cppnet/cppkore/Settings.h | 264 + r5dev/thirdparty/cppnet/cppkore/SortOrder.h | 18 + .../thirdparty/cppnet/cppkore/SpecialFolder.h | 201 + r5dev/thirdparty/cppnet/cppkore/Stream.h | 73 + .../cppnet/cppkore/StreamReader.cpp | 100 + .../thirdparty/cppnet/cppkore/StreamReader.h | 42 + .../cppnet/cppkore/StreamWriter.cpp | 151 + .../thirdparty/cppnet/cppkore/StreamWriter.h | 52 + r5dev/thirdparty/cppnet/cppkore/StringBase.h | 1641 ++ r5dev/thirdparty/cppnet/cppkore/Task.h | 38 + r5dev/thirdparty/cppnet/cppkore/TextBox.cpp | 339 + r5dev/thirdparty/cppnet/cppkore/TextBox.h | 102 + .../thirdparty/cppnet/cppkore/TextBoxBase.cpp | 659 + r5dev/thirdparty/cppnet/cppkore/TextBoxBase.h | 202 + .../thirdparty/cppnet/cppkore/TextBoxFlags.h | 32 + .../cppnet/cppkore/TextFormatFlags.h | 48 + .../thirdparty/cppnet/cppkore/TextReader.cpp | 58 + r5dev/thirdparty/cppnet/cppkore/TextReader.h | 30 + .../cppnet/cppkore/TextRenderer.cpp | 32 + .../thirdparty/cppnet/cppkore/TextRenderer.h | 26 + .../thirdparty/cppnet/cppkore/TextWriter.cpp | 22 + r5dev/thirdparty/cppnet/cppkore/TextWriter.h | 32 + r5dev/thirdparty/cppnet/cppkore/Texture.cpp | 702 + r5dev/thirdparty/cppnet/cppkore/Texture.h | 178 + .../cppnet/cppkore/TextureGPUDecoder.cpp | 359 + .../cppnet/cppkore/TextureGPUDecoder.h | 40 + r5dev/thirdparty/cppnet/cppkore/Thread.cpp | 80 + r5dev/thirdparty/cppnet/cppkore/Thread.h | 63 + r5dev/thirdparty/cppnet/cppkore/ThreadStart.h | 6 + r5dev/thirdparty/cppnet/cppkore/ToolTip.cpp | 777 + r5dev/thirdparty/cppnet/cppkore/ToolTip.h | 157 + r5dev/thirdparty/cppnet/cppkore/ToolTipIcon.h | 19 + r5dev/thirdparty/cppnet/cppkore/UIXButton.cpp | 31 + r5dev/thirdparty/cppnet/cppkore/UIXButton.h | 18 + .../thirdparty/cppnet/cppkore/UIXCheckBox.cpp | 37 + r5dev/thirdparty/cppnet/cppkore/UIXCheckBox.h | 18 + .../thirdparty/cppnet/cppkore/UIXComboBox.cpp | 49 + r5dev/thirdparty/cppnet/cppkore/UIXComboBox.h | 24 + r5dev/thirdparty/cppnet/cppkore/UIXControls.h | 12 + .../thirdparty/cppnet/cppkore/UIXGroupBox.cpp | 23 + r5dev/thirdparty/cppnet/cppkore/UIXGroupBox.h | 18 + r5dev/thirdparty/cppnet/cppkore/UIXLabel.cpp | 24 + r5dev/thirdparty/cppnet/cppkore/UIXLabel.h | 18 + .../thirdparty/cppnet/cppkore/UIXListView.cpp | 39 + r5dev/thirdparty/cppnet/cppkore/UIXListView.h | 29 + .../cppnet/cppkore/UIXListViewHeader.cpp | 70 + .../cppnet/cppkore/UIXListViewHeader.h | 29 + .../cppnet/cppkore/UIXProgressBar.cpp | 26 + .../cppnet/cppkore/UIXProgressBar.h | 18 + .../cppnet/cppkore/UIXRadioButton.cpp | 37 + .../cppnet/cppkore/UIXRadioButton.h | 18 + r5dev/thirdparty/cppnet/cppkore/UIXRenderer.h | 82 + .../thirdparty/cppnet/cppkore/UIXTextBox.cpp | 47 + r5dev/thirdparty/cppnet/cppkore/UIXTextBox.h | 23 + r5dev/thirdparty/cppnet/cppkore/UIXTheme.cpp | 41 + r5dev/thirdparty/cppnet/cppkore/UIXTheme.h | 22 + .../thirdparty/cppnet/cppkore/UIXToolTip.cpp | 21 + r5dev/thirdparty/cppnet/cppkore/UIXToolTip.h | 18 + .../cppnet/cppkore/UnrealEngine.cpp | 277 + .../thirdparty/cppnet/cppkore/UnrealEngine.h | 32 + r5dev/thirdparty/cppnet/cppkore/Uri.cpp | 56 + r5dev/thirdparty/cppnet/cppkore/Uri.h | 32 + r5dev/thirdparty/cppnet/cppkore/ValveSMD.cpp | 113 + r5dev/thirdparty/cppnet/cppkore/ValveSMD.h | 33 + r5dev/thirdparty/cppnet/cppkore/Vector2.cpp | 185 + r5dev/thirdparty/cppnet/cppkore/Vector2.h | 78 + r5dev/thirdparty/cppnet/cppkore/Vector3.cpp | 212 + r5dev/thirdparty/cppnet/cppkore/Vector3.h | 78 + r5dev/thirdparty/cppnet/cppkore/Vertex.cpp | 164 + r5dev/thirdparty/cppnet/cppkore/Vertex.h | 114 + .../cppnet/cppkore/VertexBuffer.cpp | 216 + .../thirdparty/cppnet/cppkore/VertexBuffer.h | 74 + r5dev/thirdparty/cppnet/cppkore/View.h | 23 + r5dev/thirdparty/cppnet/cppkore/WAV.cpp | 109 + r5dev/thirdparty/cppnet/cppkore/WAV.h | 53 + .../cppnet/cppkore/WavefrontOBJ.cpp | 168 + .../thirdparty/cppnet/cppkore/WavefrontOBJ.h | 33 + .../thirdparty/cppnet/cppkore/Win32Error.cpp | 28 + r5dev/thirdparty/cppnet/cppkore/Win32Error.h | 20 + .../thirdparty/cppnet/cppkore/WraithTheme.cpp | 472 + r5dev/thirdparty/cppnet/cppkore/WraithTheme.h | 39 + .../cppnet/cppkore/XNALaraAscii.cpp | 128 + .../thirdparty/cppnet/cppkore/XNALaraAscii.h | 33 + .../cppnet/cppkore/XNALaraBinary.cpp | 107 + .../thirdparty/cppnet/cppkore/XNALaraBinary.h | 33 + r5dev/thirdparty/cppnet/cppkore/XXHash.cpp | 26 + r5dev/thirdparty/cppnet/cppkore/XXHash.h | 35 + r5dev/thirdparty/cppnet/cppkore/ZLibCodec.cpp | 62 + r5dev/thirdparty/cppnet/cppkore/ZLibCodec.h | 23 + .../thirdparty/cppnet/cppkore/ZipArchive.cpp | 445 + r5dev/thirdparty/cppnet/cppkore/ZipArchive.h | 69 + r5dev/thirdparty/cppnet/cppkore/ZipEntry.h | 41 + .../cppnet/cppkore/__ConsoleInit.cpp | 10 + .../thirdparty/cppnet/cppkore/__ConsoleInit.h | 18 + .../cppnet/cppkore/clipboard/clip.cpp | 118 + .../cppnet/cppkore/clipboard/clip.h | 100 + .../cppnet/cppkore/clipboard/clip_lock_impl.h | 30 + .../cppnet/cppkore/clipboard/clip_win.cpp | 279 + r5dev/thirdparty/cppnet/cppkore/resource.h | 16 + r5dev/thirdparty/cppnet/cppkore/stdafx.cpp | Bin 0 -> 40 bytes r5dev/thirdparty/cppnet/cppkore/stdafx.h | Bin 0 -> 1232 bytes r5dev/thirdparty/cppnet/cppkore/stdext.h | 109 + .../cppnet/cppkore_docs/console_colors.txt | 19 + .../cppkore_docs/glew_reference/eglew.h | 2618 ++ .../cppnet/cppkore_docs/glew_reference/glew.h | 23688 ++++++++++++++++ .../cppkore_docs/glew_reference/glxew.h | 1775 ++ .../cppkore_docs/glew_reference/wglew.h | 1447 + .../cppkore_docs/korefunctionbinary.txt | 16 + .../cppnet/cppkore_fonts/Arial.ptrf | Bin 0 -> 131350 bytes .../cppkore_incl/DirectXTex/DirectXTex.h | 792 + .../cppkore_incl/DirectXTex/DirectXTex.inl | 124 + .../cppnet/cppkore_incl/LZ4_XXHash/lz4.h | 631 + .../cppnet/cppkore_incl/LZ4_XXHash/lz4frame.h | 541 + .../cppnet/cppkore_incl/LZ4_XXHash/lz4hc.h | 355 + .../cppnet/cppkore_incl/LZ4_XXHash/xxhash.h | 293 + .../cppnet/cppkore_incl/LZHAM/lzham.h | 779 + .../cppnet/cppkore_incl/LZHAM_ALPHA/lzham.h | 765 + .../cppnet/cppkore_incl/LZO1X/lzoconf.h | 453 + .../cppnet/cppkore_incl/LZO1X/lzodefs.h | 3268 +++ .../cppnet/cppkore_incl/LZO1X/minilzo.h | 106 + .../cppnet/cppkore_incl/ZLib/miniz.h | 476 + .../cppnet/cppkore_incl/ZLib/miniz_common.h | 91 + .../cppnet/cppkore_incl/ZLib/miniz_tdef.h | 190 + .../cppnet/cppkore_incl/ZLib/miniz_tinfl.h | 144 + .../cppnet/cppkore_incl/ZLib/miniz_zip.h | 436 + .../cppnet/cppkore_shaders/preview.frag | 55 + .../cppnet/cppkore_shaders/preview.vert | 29 + r5dev/vproj/libcppkore.vcxproj | 590 + r5dev/vproj/libcppkore.vcxproj.filters | 1280 + r5sdk.sln | 11 + 407 files changed, 86206 insertions(+) create mode 100644 r5dev/thirdparty/cppnet/LICENSE.md create mode 100644 r5dev/thirdparty/cppnet/README.md create mode 100644 r5dev/thirdparty/cppnet/cppkore/Action.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/Adler32.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/Adler32.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/AnchorStyles.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/Animation.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/Animation.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/AnimationTypes.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/Appearence.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/Application.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/Application.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/AssetRenderer.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/AssetRenderer.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/AtomicListBase.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/AtomicQueueBase.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/AutoScaleMode.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/AutodeskMaya.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/AutodeskMaya.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/BinaryReader.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/BinaryReader.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/BinaryWriter.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/BinaryWriter.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/Bone.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/Bone.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/BoneFlags.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/BorderStyle.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/BoundsSpecified.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/BufferedGraphics.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/BufferedGraphics.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/Button.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/Button.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/ButtonBase.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/ButtonBase.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/ButtonFlags.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/CRC32.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/CRC32.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/CacheVirtualItemsEventArgs.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/CacheVirtualItemsEventArgs.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/CancelEventArgs.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/CancelEventArgs.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/CastAsset.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/CastAsset.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/CastNode.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/CastNode.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/CharacterCasing.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/CheckBox.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/CheckBox.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/CheckBoxImage.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/CheckState.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/CloseReason.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/CoDXAssetExport.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/CoDXAssetExport.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/ColumnClickEventArgs.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/ColumnClickEventArgs.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/ColumnHeader.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/ColumnHeader.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/ColumnHeaderStyle.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/ComboBox.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/ComboBox.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/ComboBoxStyle.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/CompressionMode.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/Console.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/Console.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/ConsoleColor.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/ConsoleColor.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/ConsoleKey.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/ConsoleKeyInfo.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/ConsoleStream.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/ConsoleStream.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/ContainerControl.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/ContainerControl.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/ContentAlignment.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/Control.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/Control.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/ControlCollection.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/ControlCollection.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/ControlStates.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/ControlStyles.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/ControlTypes.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/CppKore.natvis create mode 100644 r5dev/thirdparty/cppnet/cppkore/CreateParams.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/Curve.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/Curve.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/DDS.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/DDS.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/DeflateCodec.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/DeflateCodec.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/DeflateStream.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/DeflateStream.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/DialogResult.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/DictionaryBase.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/Directory.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/Directory.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/DragDropEffects.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/DragEventArgs.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/DragEventArgs.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/DrawListViewColumnHeaderEventArgs.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/DrawListViewColumnHeaderEventArgs.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/DrawListViewItemEventArgs.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/DrawListViewItemEventArgs.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/DrawListViewSubItemEventArgs.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/DrawListViewSubItemEventArgs.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/DrawMode.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/DrawToolTipEventArgs.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/DrawToolTipEventArgs.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/DrawingBase.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/DropTarget.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/DropTarget.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/Environment.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/Environment.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/EventBase.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/Exporter.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/Face.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/Face.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/File.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/File.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/FileAccess.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/FileMode.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/FileShare.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/FileStream.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/FileStream.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/FlatStyle.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/Font.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/Font.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/FontArial.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/Form.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/Form.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/FormBorderStyle.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/FormClosedEventArgs.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/FormClosedEventArgs.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/FormClosingEventArgs.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/FormClosingEventArgs.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/FormStartPosition.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/FormWindowState.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/GroupBox.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/GroupBox.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/Half.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/Half.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/HandledMouseEventArgs.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/HandledMouseEventArgs.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/HashComparer.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/HashHelpers.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/HorizontalAlignment.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/IOError.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/IOError.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/Icon.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/Icon.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/ImmutableStringBase.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/InternetPortType.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/InvalidateEventArgs.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/InvalidateEventArgs.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/ItemActivation.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/Job.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/Job.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/JobManager.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/JobManager.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/JobWorker.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/JobWorker.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/KaydaraFBX.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/KaydaraFBX.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/KaydaraFBXContainer.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/KaydaraFBXContainer.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/KeyEventArgs.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/KeyEventArgs.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/KeyPressEventArgs.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/KeyPressEventArgs.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/Keys.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/Kore.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/KoreTheme.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/KoreTheme.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/LZ4Codec.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/LZ4Codec.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/LZ4Stream.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/LZ4Stream.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/LZHAMCodec.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/LZHAMCodec.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/LZO1XCodec.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/LZO1XCodec.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/Label.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/Label.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/LabelEditEventArgs.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/LabelEditEventArgs.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/ListBase.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/ListView.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/ListView.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/ListViewAlignment.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/ListViewFlags.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/ListViewItem.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/ListViewItem.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/ListViewItemStates.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/ListViewVirtualItemsSelectionRangeChangedEventArgs.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/ListViewVirtualItemsSelectionRangeChangedEventArgs.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/Mangle.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/Mangle.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/Mangler.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/Mangler.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/Material.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/Material.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/MathHelper.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/Matrix.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/Matrix.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/MemoryStream.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/MemoryStream.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/Mesh.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/Mesh.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/Message.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/MessageBox.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/MessageBox.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/MessageBoxButtons.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/MessageBoxDefaultButton.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/MessageBoxIcon.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/MessageBoxOptions.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/Model.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/Model.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/ModelFragmentShader.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/ModelVertexShader.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/MouseButtons.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/MouseEventArgs.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/MouseEventArgs.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/OpenFileDialog.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/OpenFileDialog.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/OpenGLViewport.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/OpenGLViewport.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/PaintEventArgs.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/PaintEventArgs.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/PaintFrameEventArgs.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/PaintFrameEventArgs.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/Panel.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/Panel.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/ParallelTask.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/Path.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/Path.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/Pattern.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/Pattern.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/PopupEventArgs.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/PopupEventArgs.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/Process.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/Process.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/ProcessInfo.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/ProcessModule.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/ProcessReader.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/ProcessReader.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/ProcessStartInfo.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/ProcessStream.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/ProcessStream.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/ProcessThread.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/ProgressBar.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/ProgressBar.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/ProgressBarStyle.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/Quaternion.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/Quaternion.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/RadioButton.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/RadioButton.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/Registry.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/Registry.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/RegistryHive.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/RegistryKey.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/RegistryKey.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/RegistryValueType.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/RegistryView.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/RenderFont.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/RenderFont.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/RenderShader.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/RenderShader.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/RenderViewCamera.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/RenderViewCamera.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/RetrieveVirtualItemEventArgs.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/RetrieveVirtualItemEventArgs.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/SEAsset.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/SEAsset.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/SaveFileDialog.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/SaveFileDialog.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/ScrollBars.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/SecureString.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/SeekOrigin.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/Settings.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/Settings.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/SortOrder.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/SpecialFolder.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/Stream.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/StreamReader.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/StreamReader.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/StreamWriter.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/StreamWriter.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/StringBase.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/Task.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/TextBox.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/TextBox.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/TextBoxBase.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/TextBoxBase.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/TextBoxFlags.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/TextFormatFlags.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/TextReader.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/TextReader.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/TextRenderer.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/TextRenderer.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/TextWriter.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/TextWriter.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/Texture.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/Texture.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/TextureGPUDecoder.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/TextureGPUDecoder.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/Thread.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/Thread.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/ThreadStart.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/ToolTip.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/ToolTip.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/ToolTipIcon.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/UIXButton.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/UIXButton.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/UIXCheckBox.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/UIXCheckBox.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/UIXComboBox.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/UIXComboBox.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/UIXControls.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/UIXGroupBox.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/UIXGroupBox.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/UIXLabel.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/UIXLabel.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/UIXListView.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/UIXListView.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/UIXListViewHeader.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/UIXListViewHeader.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/UIXProgressBar.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/UIXProgressBar.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/UIXRadioButton.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/UIXRadioButton.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/UIXRenderer.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/UIXTextBox.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/UIXTextBox.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/UIXTheme.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/UIXTheme.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/UIXToolTip.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/UIXToolTip.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/UnrealEngine.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/UnrealEngine.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/Uri.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/Uri.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/ValveSMD.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/ValveSMD.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/Vector2.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/Vector2.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/Vector3.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/Vector3.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/Vertex.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/Vertex.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/VertexBuffer.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/VertexBuffer.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/View.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/WAV.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/WAV.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/WavefrontOBJ.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/WavefrontOBJ.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/Win32Error.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/Win32Error.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/WraithTheme.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/WraithTheme.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/XNALaraAscii.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/XNALaraAscii.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/XNALaraBinary.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/XNALaraBinary.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/XXHash.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/XXHash.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/ZLibCodec.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/ZLibCodec.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/ZipArchive.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/ZipArchive.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/ZipEntry.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/__ConsoleInit.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/__ConsoleInit.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/clipboard/clip.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/clipboard/clip.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/clipboard/clip_lock_impl.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/clipboard/clip_win.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/resource.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/stdafx.cpp create mode 100644 r5dev/thirdparty/cppnet/cppkore/stdafx.h create mode 100644 r5dev/thirdparty/cppnet/cppkore/stdext.h create mode 100644 r5dev/thirdparty/cppnet/cppkore_docs/console_colors.txt create mode 100644 r5dev/thirdparty/cppnet/cppkore_docs/glew_reference/eglew.h create mode 100644 r5dev/thirdparty/cppnet/cppkore_docs/glew_reference/glew.h create mode 100644 r5dev/thirdparty/cppnet/cppkore_docs/glew_reference/glxew.h create mode 100644 r5dev/thirdparty/cppnet/cppkore_docs/glew_reference/wglew.h create mode 100644 r5dev/thirdparty/cppnet/cppkore_docs/korefunctionbinary.txt create mode 100644 r5dev/thirdparty/cppnet/cppkore_fonts/Arial.ptrf create mode 100644 r5dev/thirdparty/cppnet/cppkore_incl/DirectXTex/DirectXTex.h create mode 100644 r5dev/thirdparty/cppnet/cppkore_incl/DirectXTex/DirectXTex.inl create mode 100644 r5dev/thirdparty/cppnet/cppkore_incl/LZ4_XXHash/lz4.h create mode 100644 r5dev/thirdparty/cppnet/cppkore_incl/LZ4_XXHash/lz4frame.h create mode 100644 r5dev/thirdparty/cppnet/cppkore_incl/LZ4_XXHash/lz4hc.h create mode 100644 r5dev/thirdparty/cppnet/cppkore_incl/LZ4_XXHash/xxhash.h create mode 100644 r5dev/thirdparty/cppnet/cppkore_incl/LZHAM/lzham.h create mode 100644 r5dev/thirdparty/cppnet/cppkore_incl/LZHAM_ALPHA/lzham.h create mode 100644 r5dev/thirdparty/cppnet/cppkore_incl/LZO1X/lzoconf.h create mode 100644 r5dev/thirdparty/cppnet/cppkore_incl/LZO1X/lzodefs.h create mode 100644 r5dev/thirdparty/cppnet/cppkore_incl/LZO1X/minilzo.h create mode 100644 r5dev/thirdparty/cppnet/cppkore_incl/ZLib/miniz.h create mode 100644 r5dev/thirdparty/cppnet/cppkore_incl/ZLib/miniz_common.h create mode 100644 r5dev/thirdparty/cppnet/cppkore_incl/ZLib/miniz_tdef.h create mode 100644 r5dev/thirdparty/cppnet/cppkore_incl/ZLib/miniz_tinfl.h create mode 100644 r5dev/thirdparty/cppnet/cppkore_incl/ZLib/miniz_zip.h create mode 100644 r5dev/thirdparty/cppnet/cppkore_shaders/preview.frag create mode 100644 r5dev/thirdparty/cppnet/cppkore_shaders/preview.vert create mode 100644 r5dev/vproj/libcppkore.vcxproj create mode 100644 r5dev/vproj/libcppkore.vcxproj.filters diff --git a/r5dev/thirdparty/cppnet/LICENSE.md b/r5dev/thirdparty/cppnet/LICENSE.md new file mode 100644 index 00000000..f288702d --- /dev/null +++ b/r5dev/thirdparty/cppnet/LICENSE.md @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/r5dev/thirdparty/cppnet/README.md b/r5dev/thirdparty/cppnet/README.md new file mode 100644 index 00000000..e0940436 --- /dev/null +++ b/r5dev/thirdparty/cppnet/README.md @@ -0,0 +1,2 @@ +# cppnet + It's .NET for C++17 diff --git a/r5dev/thirdparty/cppnet/cppkore/Action.h b/r5dev/thirdparty/cppnet/cppkore/Action.h new file mode 100644 index 00000000..bbd91ebc --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Action.h @@ -0,0 +1,3 @@ +#pragma once + +typedef void(*Action)(); \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Adler32.cpp b/r5dev/thirdparty/cppnet/cppkore/Adler32.cpp new file mode 100644 index 00000000..d25f844c --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Adler32.cpp @@ -0,0 +1,45 @@ +#include "stdafx.h" +#include "Adler32.h" + +uint32_t Hashing::Adler32::ComputeHash(uint32_t adler, const void* ptr, size_t buflen) +{ + if (!ptr) + { + return NULL; + } + + const uint8_t* buffer = static_cast(ptr); + + const unsigned long ADLER_MOD = 65521; + unsigned long s1 = adler & 0xffff, s2 = adler >> 16; + size_t blocklen; + unsigned long i; + + blocklen = buflen % 5552; + while (buflen) + { + for (i = 0; i + 7 < blocklen; i += 8) + { + s1 += buffer[0], s2 += s1; + s1 += buffer[1], s2 += s1; + s1 += buffer[2], s2 += s1; + s1 += buffer[3], s2 += s1; + s1 += buffer[4], s2 += s1; + s1 += buffer[5], s2 += s1; + s1 += buffer[6], s2 += s1; + s1 += buffer[7], s2 += s1; + + buffer += 8; + } + + for (; i < blocklen; ++i) + { + s1 += *buffer++, s2 += s1; + } + + s1 %= ADLER_MOD, s2 %= ADLER_MOD; + buflen -= blocklen; + blocklen = 5552; + } + return (s2 << 16) + s1; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Adler32.h b/r5dev/thirdparty/cppnet/cppkore/Adler32.h new file mode 100644 index 00000000..b27a2c18 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Adler32.h @@ -0,0 +1,12 @@ +#pragma once + +namespace Hashing +{ +// Mark Adler's compact Adler32 hashing algorithm +// Originally from the public domain stb.h header. + class Adler32 + { + public: + static uint32_t ComputeHash(uint32_t adler, const void* ptr, size_t buflen); + }; +} diff --git a/r5dev/thirdparty/cppnet/cppkore/AnchorStyles.h b/r5dev/thirdparty/cppnet/cppkore/AnchorStyles.h new file mode 100644 index 00000000..c8bab1f6 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/AnchorStyles.h @@ -0,0 +1,30 @@ +#pragma once + +#include +#include + +namespace Forms +{ + // Specifies how a control anchors to the edges of its container. + enum class AnchorStyles + { + // The control is anchored to the top edge of its container. + Top = 0x1, + // The control is anchored to the bottom edge of its container. + Bottom = 0x2, + // The control is anchored to the left edge of its container. + Left = 0x4, + // The control is anchored to the right edge of its container. + Right = 0x8, + // The control is not anchored to any edges of its container. + None = 0x0 + }; + + // + // Allow bitwise operations on this enumeration + // + constexpr AnchorStyles operator|(AnchorStyles Lhs, AnchorStyles Rhs) + { + return static_cast(static_cast::type>(Lhs) | static_cast::type>(Rhs)); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Animation.cpp b/r5dev/thirdparty/cppnet/cppkore/Animation.cpp new file mode 100644 index 00000000..02e14434 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Animation.cpp @@ -0,0 +1,128 @@ +#include "stdafx.h" +#include "Animation.h" + +namespace Assets +{ + Animation::Animation() + : Animation(0) + { + } + + Animation::Animation(uint32_t BoneCount) + : Animation(BoneCount, 30.0f) + { + } + + Animation::Animation(uint32_t BoneCount, float FrameRate) + : Bones(BoneCount), Looping(false), FrameRate(FrameRate), Name("error"), TransformSpace(AnimationTransformSpace::Local), RotationInterpolation(AnimationRotationInterpolation::Quaternion) + { + } + + List& Animation::GetNodeCurves(const string& NodeName) + { + if (Curves.ContainsKey(NodeName)) + return Curves[NodeName]; + + Curves.Add(NodeName, List()); + return Curves[NodeName]; + } + + void Animation::AddNotification(const string& Name, uint32_t Frame) + { + if (Notificiations.ContainsKey(Name)) + Notificiations[Name].EmplaceBack(Frame); + + Notificiations.Add(Name, List()); + Notificiations[Name].EmplaceBack(Frame); + } + + const uint32_t Animation::FrameCount(bool Legacy) const + { + uint32_t Result = 0; + + for (auto& Kvp : Curves) + { + for (auto& Curve : Kvp.Value()) + { + if (Legacy) + { + // Used for animation types which do not support non-bone like curves + // So we only have quaternion rotation, translations, and scales + if (Curve.Property == CurveProperty::RotateQuaternion || (Curve.Property >= CurveProperty::TranslateX && Curve.Property <= CurveProperty::TranslateZ) || (Curve.Property >= CurveProperty::ScaleX && Curve.Property <= CurveProperty::ScaleZ)) + { + for (auto& Keyframe : Curve.Keyframes) + Result = max(Result, Keyframe.Frame.Integer32); + } + } + else + { + // Support all curves + for (auto& Keyframe : Curve.Keyframes) + Result = max(Result, Keyframe.Frame.Integer32); + } + } + } + + for (auto& NoteTrack : Notificiations) + for (auto& Note : NoteTrack.Value()) + Result = max(Result, Note); + + // Frame count is the length of the animation in frames + // Frames start at index 0, so we add one to get the count + return Result + 1; + } + + const uint32_t Animation::NotificationCount() const + { + uint32_t Result = 0; + + for (auto& NoteTrack : Notificiations) + Result += NoteTrack.Value().Count(); + + return Result; + } + + void Animation::Scale(float Factor) + { + for (auto& Kvp : Curves) + { + for (auto& Curve : Kvp.Value()) + { + // Translation keyframes are scaled here... + if (Curve.Property >= CurveProperty::TranslateX && Curve.Property <= CurveProperty::TranslateZ) + { + for (auto& Keyframe : Curve.Keyframes) + { + Keyframe.Value.Float *= Factor; + } + } + } + } + + for (auto& Bone : Bones) + { + if (Bone.GetFlag(BoneFlags::HasLocalSpaceMatrices)) + { + Bone.SetLocalPosition(Bone.LocalPosition() * Factor); + } + if (Bone.GetFlag(BoneFlags::HasGlobalSpaceMatrices)) + { + Bone.SetGlobalPosition(Bone.GlobalPosition() * Factor); + } + } + } + + void Animation::RemoveEmptyNodes() + { + for (auto& Kvp : Curves) + { + for (int32_t i = ((int32_t)Kvp.Value().Count() - 1); i >= 0; i--) + { + if (Kvp.Value()[i].Keyframes.Count() == 0) + { + Kvp.Value().RemoveAt(i); + } + } + } + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/Animation.h b/r5dev/thirdparty/cppnet/cppkore/Animation.h new file mode 100644 index 00000000..2c9d63b8 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Animation.h @@ -0,0 +1,62 @@ +#pragma once + +#include +#include +#include "ListBase.h" +#include "DictionaryBase.h" + +// The separate anim parts +#include "Bone.h" +#include "Vector3.h" +#include "Quaternion.h" +#include "AnimationTypes.h" +#include "Curve.h" + +namespace Assets +{ + // A container class that holds 3D animation data. + class Animation + { + public: + // Initialize a blank 3D animation without any known counts. + Animation(); + // Initialize a 3D animation with the given count for bones. + Animation(uint32_t BoneCount); + // Initialize a 3D animation with the given bone count and framerate. + Animation(uint32_t BoneCount, float FrameRate); + + // The name of the animation + string Name; + + // A collection of 3D bones for this animation. (May or may not represent the actual skeleton) + List Bones; + // The collection of curves that make up this animation. + Dictionary> Curves; + // A collection of notifications that may occur. + Dictionary> Notificiations; + + // Gets a reference to a list of node curves. + List& GetNodeCurves(const string& NodeName); + // Adds a notification to the animation. + void AddNotification(const string& Name, uint32_t Frame); + + // Gets the count of frames in the animation. + const uint32_t FrameCount(bool Legacy = false) const; + // Gets the count of notifications in the animation. + const uint32_t NotificationCount() const; + + // Specifies if this animation should loop. + bool Looping; + // The framerate of this animation. + float FrameRate; + // The transformation space of this animation. + AnimationTransformSpace TransformSpace; + // The rotation interpolation mode. + AnimationRotationInterpolation RotationInterpolation; + + // Scales the animation with the given factor. + void Scale(float Factor); + // Removes nodes without keyframes. + void RemoveEmptyNodes(); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/AnimationTypes.h b/r5dev/thirdparty/cppnet/cppkore/AnimationTypes.h new file mode 100644 index 00000000..ad26fce5 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/AnimationTypes.h @@ -0,0 +1,33 @@ +#pragma once + +#include + +namespace Assets +{ + // This enumeration represents the possible animation types + enum class AnimationCurveMode + { + // Animation translations are set to this exact value each frame. + Absolute = 0, + // Animation values are added on to the scene values. + Additive = 1, + // Animation values are relative to rest position in the model. + Relative = 2 + }; + + // This enumeration represents the possible transform spaces + enum class AnimationTransformSpace + { + // All of the curve nodes are in local object space + Local = 0, + // All of the curve nodes are in world space + World = 1, + }; + + // This enumeration represents the interpolation options + enum class AnimationRotationInterpolation + { + Quaternion = 0, + Euler = 1, + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Appearence.h b/r5dev/thirdparty/cppnet/cppkore/Appearence.h new file mode 100644 index 00000000..da942a82 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Appearence.h @@ -0,0 +1,15 @@ +#pragma once + +#include + +namespace Forms +{ + // Specifies the appearance of a control. + enum class Appearence + { + // The default appearance defined by the control. + Normal = 0, + // The appearance of a Windows button. + Button = 1 + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Application.cpp b/r5dev/thirdparty/cppnet/cppkore/Application.cpp new file mode 100644 index 00000000..b69886eb --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Application.cpp @@ -0,0 +1,116 @@ +#include "stdafx.h" +#include "Application.h" + +// We're an application, so, we require GDI+, ComCtl32 +#pragma comment(lib, "Gdiplus.lib") +#pragma comment(lib, "Comctl32.lib") + +namespace Forms +{ + // We haven't initialized it yet... + std::atomic Application::IsGdipInitialized = false; + ULONG_PTR Application::GdipToken = NULL; + + void Application::Run(Form* MainWindow) + { + if (MainWindow == nullptr) + return; + + // Initialize COM + OleInitialize(NULL); + +#if _DEBUG + if (!IsGdipInitialized) + printf("-- Warning: GDI+ has not been initialized before Application::Run() --\n"); +#endif + + // Execute on the main loop + Application::RunMainLoop(MainWindow); + + if (MainWindow) + delete MainWindow; + + // Shutdown COM + OleUninitialize(); + } + + void Application::RunDialog(Form* MainDialog) + { + // We must disable the owner dialog so that we can properly be the focus + auto HwndOwner = GetWindowLongPtr(MainDialog->GetHandle(), GWLP_HWNDPARENT); + if (HwndOwner != NULL) + { + if (IsWindowEnabled((HWND)HwndOwner)) + EnableWindow((HWND)HwndOwner, false); + } + + RunMainLoop(MainDialog); + + // We must re-enable the owner window + if (HwndOwner != NULL) + EnableWindow((HWND)HwndOwner, true); + } + + void Application::EnableVisualStyles() + { + SetProcessDPIAware(); + if (!IsGdipInitialized) + InitializeGdip(); + } + + void Application::RunMainLoop(Form* MainWindow) + { + bool ContinueLoop = true; + + // + // Initialize the main window before starting the message pump... + // + + MainWindow->Show(); + + // + // Loop until any of the conditions are met... + // + + MSG nMSG; + while (ContinueLoop) + { + auto Peeked = PeekMessage(&nMSG, NULL, 0, 0, PM_NOREMOVE); + + if (Peeked) + { + if (!GetMessage(&nMSG, NULL, 0, 0)) + continue; + + TranslateMessage(&nMSG); + DispatchMessage(&nMSG); + + if (MainWindow) + ContinueLoop = !MainWindow->CheckCloseDialog(false); + } + else if (MainWindow == nullptr || MainWindow->GetState(ControlStates::StateDisposed)) + { + break; + } + else if (!PeekMessage(&nMSG, NULL, 0, 0, PM_NOREMOVE)) + { + WaitMessage(); + } + } + } + + void Application::InitializeGdip() + { + IsGdipInitialized = true; + + Gdiplus::GdiplusStartupInput gdipStartup; + Gdiplus::GdiplusStartup(&GdipToken, &gdipStartup, NULL); + } + + void Application::ShutdownGdip() + { + IsGdipInitialized = false; + + Gdiplus::GdiplusShutdown(GdipToken); + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/Application.h b/r5dev/thirdparty/cppnet/cppkore/Application.h new file mode 100644 index 00000000..8ab073fb --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Application.h @@ -0,0 +1,37 @@ +#pragma once + +#include +#include +#include "Form.h" + +namespace Forms +{ + // Provides static methods and properties to manage an application. + class Application + { + public: + // Begins running a standard application message loop on the current + // thread, and makes the specified form visible. + static void Run(Form* MainWindow); + + // Begins running a dialog application loop on the + // current thread, you MUST clean up the dialog after use. + static void RunDialog(Form* MainDialog); + + // Enables the use of visual style components and initializes GDI+. + static void EnableVisualStyles(); + + private: + // Runs the main window loop. + static void RunMainLoop(Form* MainWindow); + + // Whether or not GDI+ has been initialized + static std::atomic IsGdipInitialized; + // The token for GDI+ + static ULONG_PTR GdipToken; + + // Internal cleanup routines + static void InitializeGdip(); + static void ShutdownGdip(); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/AssetRenderer.cpp b/r5dev/thirdparty/cppnet/cppkore/AssetRenderer.cpp new file mode 100644 index 00000000..13a05a0c --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/AssetRenderer.cpp @@ -0,0 +1,720 @@ +#include "stdafx.h" +#include +#include "AssetRenderer.h" +#include "Path.h" +#include "Thread.h" + +// Include the internal font, and shaders +#include "FontArial.h" +#include "ModelFragmentShader.h" +#include "ModelVertexShader.h" + +// We need to include the OpenGL classes +#include "Mangler.h" + +namespace Assets +{ + AssetRenderer::AssetRenderer() + : OpenGLViewport(), _Camera(0.5f* (float)MathHelper::PI, 0.45f* (float)MathHelper::PI, 100.f), _UseWireframe(false), _ShowBones(true), _ShowMaterials(true), _DrawingMode(DrawMode::Model), _DrawInformation{}, _BonePointBuffer(0), _BonePointCount(0), _DrawTexture(0) + { + } + + AssetRenderer::~AssetRenderer() + { + ClearViewModel(); + ClearViewTexture(); + } + + void AssetRenderer::SetViewModel(const Model& Model) + { + this->_DrawingMode = DrawMode::Model; + ClearViewModel(); + ClearViewTexture(); + + for (auto& Submesh : Model.Meshes) + { + auto Draw = DrawObject(); + + glGenVertexArrays(1, &Draw.VertexArrayObject); + glBindVertexArray(Draw.VertexArrayObject); + + // We'll take the POSITION, NORMAL, COLOR, and first UV pair... + const uint32_t Stride = sizeof(Vector3) + sizeof(Vector3) + sizeof(VertexColor) + sizeof(Vector2); + auto VertexBuffer = std::make_unique((uint64_t)Submesh.Vertices.Count() * Stride); + + uint64_t Offset = 0; + for (auto& Vertex : Submesh.Vertices) + { + std::memcpy(&VertexBuffer.get()[Offset], &Vertex.Position(), Stride); + Offset += Stride; + } + + glGenBuffers(1, &Draw.VertexBuffer); + glBindBuffer(GL_ARRAY_BUFFER, Draw.VertexBuffer); + glBufferData(GL_ARRAY_BUFFER, (Stride * (uint64_t)Submesh.Vertices.Count()), VertexBuffer.get(), GL_STATIC_DRAW); + + glGenBuffers(1, &Draw.FaceBuffer); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, Draw.FaceBuffer); + glBufferData(GL_ELEMENT_ARRAY_BUFFER, (uint64_t)Submesh.Faces.Count() * 3 * sizeof(uint32_t), &Submesh.Faces[0], GL_STATIC_DRAW); + + wglSwapIntervalEXT(1); + + Draw.FaceCount = Submesh.Faces.Count(); + Draw.VertexCount = Submesh.Vertices.Count(); + + if (Submesh.MaterialIndices.Count() > 0 && this->_MaterialStreamer != nullptr && Model.Materials.Count() != 0) + { + Assets::Material& Material = Model.Materials[Submesh.MaterialIndices[0]]; + + if (Material.Slots.ContainsKey(MaterialSlotType::Albedo)) + { + auto MaterialDiffuseMap = this->_MaterialStreamer("", Material.Slots[MaterialSlotType::Albedo].second); + if (MaterialDiffuseMap != nullptr) + { + glGenTextures(1, &Draw.Material.AlbedoMap); + this->LoadDXTextureOGL(*MaterialDiffuseMap.get(), Draw.Material.AlbedoMap); + } + } + + if (Material.Slots.ContainsKey(MaterialSlotType::Normal)) + { + auto MaterialNormalMap = this->_MaterialStreamer("", Material.Slots[MaterialSlotType::Normal].second); + if (MaterialNormalMap != nullptr) + { + glGenTextures(1, &Draw.Material.NormalMap); + this->LoadDXTextureOGL(*MaterialNormalMap.get(), Draw.Material.NormalMap); + + } + } + + if (Material.Slots.ContainsKey(MaterialSlotType::Gloss)) + { + auto MaterialGlossMap = this->_MaterialStreamer("", Material.Slots[MaterialSlotType::Gloss].second); + if (MaterialGlossMap != nullptr) + { + glGenTextures(1, &Draw.Material.RoughnessMap); + this->LoadDXTextureOGL(*MaterialGlossMap.get(), Draw.Material.RoughnessMap); + + } + } + + if (Material.Slots.ContainsKey(MaterialSlotType::Specular)) + { + auto MaterialSpecMap = this->_MaterialStreamer("", Material.Slots[MaterialSlotType::Specular].second); + if (MaterialSpecMap != nullptr) + { + glGenTextures(1, &Draw.Material.MetallicMap); + this->LoadDXTextureOGL(*MaterialSpecMap.get(), Draw.Material.MetallicMap); + + } + } + + Draw.LoadedMaterial = true; + } + + this->_DrawObjects.Emplace(Draw); + this->_DrawInformation.VertexCount += Submesh.Vertices.Count(); + this->_DrawInformation.TriangleCount += Submesh.Faces.Count(); + } + + glGenBuffers(1, &this->_BonePointBuffer); + List Positions; + + for (int32_t i = (int32_t)Model.Bones.Count() - 1; i >= 0; i--) + { + auto& CurrentBone = Model.Bones[i]; + + Positions.EmplaceBack(Math::Matrix::TransformVector(CurrentBone.GlobalPosition(), this->_Camera.GetModelMatrix())); + + if (CurrentBone.Parent() > -1) + Positions.EmplaceBack(Math::Matrix::TransformVector(Model.Bones[CurrentBone.Parent()].GlobalPosition(), this->_Camera.GetModelMatrix())); + else + Positions.EmplaceBack(0.f, 0.f, 0.f); + } + + this->_BonePointCount = Positions.Count(); + + glBindBuffer(GL_ARRAY_BUFFER, this->_BonePointBuffer); + glBufferData(GL_ARRAY_BUFFER, sizeof(Math::Vector3) * Positions.Count(), &Positions[0], GL_STATIC_DRAW); + + this->_DrawInformation.BoneCount = Model.Bones.Count(); + this->_DrawInformation.MeshCount = Model.Meshes.Count(); + + // Trigger a resize, then redraw, first redraw needs invalidation... + this->OnResize(); + this->Invalidate(); + } + + void AssetRenderer::SetAssetName(const string& Name) + { + this->_DrawInformation.AssetName = Name; + this->Redraw(); + } + + void AssetRenderer::ClearViewModel() + { + for (auto& Draw : _DrawObjects) + { + glDeleteVertexArrays(1, &Draw.VertexArrayObject); + glDeleteBuffers(1, &Draw.VertexBuffer); + glDeleteBuffers(1, &Draw.FaceBuffer); + + if (Draw.LoadedMaterial) + { + glDeleteTextures(1, &Draw.Material.AlbedoMap); + glDeleteTextures(1, &Draw.Material.AmbientOccluionMap); + glDeleteTextures(1, &Draw.Material.MetallicMap); + glDeleteTextures(1, &Draw.Material.NormalMap); + glDeleteTextures(1, &Draw.Material.RoughnessMap); + } + } + + glDeleteBuffers(1, &this->_BonePointBuffer); + this->_BonePointBuffer = 0; + this->_BonePointCount = 0; + + _DrawObjects.Clear(); + _DrawInformation = {}; + } + + void AssetRenderer::SetMaterialStreamer(MaterialStreamCallback Callback) + { + this->_MaterialStreamer = std::move(Callback); + } + + void AssetRenderer::SetViewTexture(const Texture& Texture) + { + this->_DrawingMode = DrawMode::Texture; + ClearViewTexture(); + ClearViewModel(); + + glGenTextures(1, &this->_DrawTexture); + + // Load into the draw texture slot + this->LoadDXTextureOGL((Assets::Texture&)Texture, this->_DrawTexture); + + this->_DrawInformation.Width = Texture.Width(); + this->_DrawInformation.Height = Texture.Height(); + + // Determine best fit scale to fit the image + float Scale = min((float)this->_ClientWidth / (float)Texture.Width(), (float)this->_ClientHeight / (float)Texture.Height()); + this->_DrawInformation.Scale = min(100, (int)(Scale * 100)); + } + + void AssetRenderer::ClearViewTexture() + { + glDeleteTextures(1, &this->_DrawTexture); + _DrawInformation = {}; + } + + void AssetRenderer::SetUseWireframe(bool Value) + { + if (Value != this->_UseWireframe) + { + this->_UseWireframe = Value; + this->Redraw(); + } + } + + void AssetRenderer::SetShowBones(bool Value) + { + if (Value != this->_ShowBones) + { + this->_ShowBones = Value; + this->Redraw(); + } + } + + void AssetRenderer::SetShowMaterials(bool Value) + { + if (Value != this->_ShowMaterials) + { + this->_ShowMaterials = Value; + this->Redraw(); + } + } + + void AssetRenderer::SetZUpAxis(bool ZUp) + { + if (ZUp) + this->_Camera.SetUpAxis(RenderViewCameraUpAxis::Z); + else + this->_Camera.SetUpAxis(RenderViewCameraUpAxis::Y); + + if (this->GetState(Forms::ControlStates::StateCreated)) + this->Redraw(); + } + + void AssetRenderer::ResetView() + { + this->_Camera.Reset(0.5f * (float)MathHelper::PI, 0.45f * (float)MathHelper::PI, 100.f); + this->Redraw(); + } + + void AssetRenderer::ZoomModelToView() + { + // Using the bounding box, we need to + // TODO: Implement this zoom code + } + + void AssetRenderer::OnRender() + { + // Clear the frame + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + this->RenderBackground(); + + switch (this->_DrawingMode) + { + case DrawMode::Model: + this->RenderGrid(); + this->RenderModel(); + break; + case DrawMode::Texture: + this->RenderTexture(); + break; + } + + this->RenderHUD(); + + // Render the frame + SwapBuffers(this->_DCHandle); + } + + void AssetRenderer::OnResize() + { + glViewport(0, 0, this->_ClientWidth, this->_ClientHeight); + + // Update the projection matrix + this->_Camera.UpdateProjectionMatrix(45.f, (float)this->_ClientWidth, (float)this->_ClientHeight, .1f, 10000.f); + + glMatrixMode(GL_PROJECTION); + glLoadMatrixf(this->_Camera.GetProjectionMatrix().GetMatrix()); + + // Switch back to the modelview matrix + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + + // Ask the control to do the resize event + OpenGLViewport::OnResize(); + } + + void AssetRenderer::OnHandleCreated() + { + OpenGLViewport::OnHandleCreated(); + + // Now, the opengl context is completely valid, we can initialize our font / shaders + this->_RenderFont.LoadFont(FontArial_PTRF, sizeof(FontArial_PTRF)); + +#if _DEBUG + // Grab the root path of the libraries... + auto CppNetPath = IO::Path::GetDirectoryName(IO::Path::GetDirectoryName(__FILE__)); + auto Vert = IO::Path::Combine(CppNetPath, "cppkore_shaders\\preview.vert"); + auto Frag = IO::Path::Combine(CppNetPath, "cppkore_shaders\\preview.frag"); + printf("-- NOTICE: Using debug shaders from disk --\n"); + printf("Vertex: %s\nFrag: %s\n", Vert.ToCString(), Frag.ToCString()); + this->_ModelShader.LoadShader(Vert, Frag); +#else + this->_ModelShader.LoadShader(ModelVertexShader_Src, ModelFragmentShader_Src); +#endif + } + + void AssetRenderer::OnKeyUp(const std::unique_ptr& EventArgs) + { + if (EventArgs->KeyCode() == Forms::Keys::W) + { + this->SetUseWireframe(!this->_UseWireframe); + } + else if (EventArgs->KeyCode() == Forms::Keys::B) + { + this->SetShowBones(!this->_ShowBones); + } + else if (EventArgs->KeyCode() == Forms::Keys::T) + { + this->SetShowMaterials(!this->_ShowMaterials); + } + + OpenGLViewport::OnKeyUp(EventArgs); + } + + void AssetRenderer::OnMouseDown(const std::unique_ptr& EventArgs) + { + this->_TargetMousePosition = Vector2((float)EventArgs->X, (float)EventArgs->Y); + OpenGLViewport::OnMouseDown(EventArgs); + } + + void AssetRenderer::OnMouseMove(const std::unique_ptr& EventArgs) + { + auto IsAltKey = (GetKeyState(VK_MENU) & 0x8000); + + if (EventArgs->Button == Forms::MouseButtons::Left && IsAltKey) + { + float dPhi = ((float)(this->_TargetMousePosition.Y - EventArgs->Y) / 200.f); + float dTheta = ((float)(this->_TargetMousePosition.X - EventArgs->X) / 200.f); + + this->_Camera.Rotate(dTheta, dPhi); + this->Redraw(); + } + else if (EventArgs->Button == Forms::MouseButtons::Middle && IsAltKey) + { + float dx = ((float)(this->_TargetMousePosition.X - EventArgs->X)); + float dy = ((float)(this->_TargetMousePosition.Y - EventArgs->Y)); + + this->_Camera.Pan(dx * .1f, dy * .1f); + this->Redraw(); + } + else if (EventArgs->Button == Forms::MouseButtons::Right && IsAltKey) + { + float dx = ((float)(this->_TargetMousePosition.X - EventArgs->X) / 2.f); + + this->_Camera.Zoom(-dx); + this->Redraw(); + } + + this->_TargetMousePosition = Vector2((float)EventArgs->X, (float)EventArgs->Y); + + OpenGLViewport::OnMouseMove(EventArgs); + } + + void AssetRenderer::OnMouseWheel(const std::unique_ptr& EventArgs) + { + if (this->_DrawingMode == DrawMode::Texture) + { + if (EventArgs->Delta > 0) + this->_DrawInformation.Scale += 3; + else + this->_DrawInformation.Scale -= 3; + this->_DrawInformation.Scale = max(min(200, this->_DrawInformation.Scale), 0); + } + else if (this->_DrawingMode == DrawMode::Model) + { + this->_Camera.Zoom((float)EventArgs->Delta * .04f); + } + + this->Redraw(); + + OpenGLViewport::OnMouseWheel(EventArgs); + } + + void AssetRenderer::RenderBackground() + { + glDisable(GL_DEPTH_TEST); + glDisable(GL_LIGHTING); + glDisable(GL_TEXTURE_2D); + + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + + glBegin(GL_QUADS); + + glColor3f(this->_BackColor.GetR() / 255.f, this->_BackColor.GetG() / 255.f, this->_BackColor.GetB() / 255.f); + + glVertex2f(-1.0, -1.0); + glVertex2f(1.0, -1.0); + glVertex2f(1.0, 1.0); + glVertex2f(-1.0, 1.0); + + glEnd(); + } + + void AssetRenderer::RenderGrid() + { + glMatrixMode(GL_PROJECTION); + glLoadMatrixf(this->_Camera.GetProjectionMatrix().GetMatrix()); + + glMatrixMode(GL_MODELVIEW); + glLoadMatrixf(this->_Camera.GetViewMatrix().GetMatrix()); + + glEnable(GL_DEPTH_TEST); + glDepthFunc(GL_LESS); + + glBegin(GL_LINES); + glLineWidth(1.f); + + auto Size = 5.0f; + auto MinSize = -Size; + auto Step = 0.5f; + + for (GLfloat i = MinSize; i <= Size; i += Step) + { + if (i == 0) + { + glColor3f(0, 0, 0); + } + else + { + glColor3f(.70f, .70f, .70f); + } + + glVertex3f(i, 0, Size); glVertex3f(i, 0, MinSize); + glVertex3f(Size, 0, i); glVertex3f(MinSize, 0, i); + } + + glEnd(); + } + + void AssetRenderer::RenderModel() + { + this->_ModelShader.Use(); + + if (_UseWireframe) + glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); + else + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + + // Calculate and load the matrix + auto Model = this->_Camera.GetModelMatrix(); + auto View = this->_Camera.GetViewMatrix(); + auto Proj = this->_Camera.GetProjectionMatrix(); + + const uint32_t Stride = sizeof(Vector3) + sizeof(Vector3) + sizeof(VertexColor) + sizeof(Vector2); + + glUniformMatrix4fv(this->_ModelShader.GetUniformLocation("model"), 1, GL_FALSE, Model.GetMatrix()); + glUniformMatrix4fv(this->_ModelShader.GetUniformLocation("view"), 1, GL_FALSE, View.GetMatrix()); + glUniformMatrix4fv(this->_ModelShader.GetUniformLocation("projection"), 1, GL_FALSE, Proj.GetMatrix()); + + glEnableVertexAttribArray(0); + glEnableVertexAttribArray(1); + glEnableVertexAttribArray(2); + glEnableVertexAttribArray(3); + + for (auto& Draw : this->_DrawObjects) + { + + if (Draw.LoadedMaterial && this->_ShowMaterials) + { + const GLint DiffuseLoaded = 1; + glUniform1iv(this->_ModelShader.GetUniformLocation("diffuseLoaded"), 1, &DiffuseLoaded); + + + } + else + { + const GLint DiffuseLoaded = 0; + glUniform1iv(this->_ModelShader.GetUniformLocation("diffuseLoaded"), 1, &DiffuseLoaded); + + + } + + + + glEnable(GL_TEXTURE_2D); + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D, Draw.Material.AlbedoMap); + + const GLint DiffuseSlot = 0; + glUniform1iv(this->_ModelShader.GetUniformLocation("diffuseTexture"), 1, &DiffuseSlot); + + + glActiveTexture(GL_TEXTURE1); + glBindTexture(GL_TEXTURE_2D, Draw.Material.NormalMap); + + + const GLint NormalSlot = 1; + glUniform1iv(this->_ModelShader.GetUniformLocation("normalTexture"), 1, &NormalSlot); + + + + glActiveTexture(GL_TEXTURE2); + glBindTexture(GL_TEXTURE_2D, Draw.Material.RoughnessMap); + + + const GLint GlossSlot = 2; + glUniform1iv(this->_ModelShader.GetUniformLocation("glossTexture"), 1, &GlossSlot); + + + + glActiveTexture(GL_TEXTURE3); + glBindTexture(GL_TEXTURE_2D, Draw.Material.MetallicMap); + + + const GLint SpecularSlot = 3; + glUniform1iv(this->_ModelShader.GetUniformLocation("specularTexture"), 1, &SpecularSlot); + + glActiveTexture(GL_TEXTURE0); + + glBindBuffer(GL_ARRAY_BUFFER, Draw.VertexBuffer); + glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, Stride, (void*)0); + glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, Stride, (void*)12); + glVertexAttribPointer(2, 4, GL_UNSIGNED_BYTE, GL_TRUE, Stride, (void*)24); + glVertexAttribPointer(3, 2, GL_FLOAT, GL_FALSE, Stride, (void*)28); + + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, Draw.FaceBuffer); + glDrawElements(GL_TRIANGLES, Draw.FaceCount * 3, GL_UNSIGNED_INT, (void*)0); + } + + glDisableVertexAttribArray(0); + glDisableVertexAttribArray(1); + glDisableVertexAttribArray(2); + glDisableVertexAttribArray(3); + + this->_ModelShader.Detatch(); + + if (this->_ShowBones) + { + glDisable(GL_DEPTH_TEST); + + glColor3f(18 / 255.f, 0, 54 / 255.f); + glBindBuffer(GL_ARRAY_BUFFER, this->_BonePointBuffer); + + glEnableVertexAttribArray(0); + glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, 0); + + glDrawArrays(GL_LINES, 0, this->_BonePointCount); + } + + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + } + + void AssetRenderer::RenderTexture() + { + glMatrixMode(GL_PROJECTION); + glLoadMatrixf(Matrix::CreateOrthographic(0, (float)this->_ClientWidth, (float)this->_ClientHeight, 0, -1, 1).GetMatrix()); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + + glColor3f(1.0f, 1.0f, 1.0f); + glDisable(GL_BLEND); + + float Scale = (float)this->_DrawInformation.Scale / 100.f; + + float ImageWidth = this->_DrawInformation.Width * Scale; + float ImageHeight = this->_DrawInformation.Height * Scale; + + float Width = (ImageWidth); + float Height = (ImageHeight); + float X = (this->_ClientWidth - (float)Width) / 2.0f; + float Y = (this->_ClientHeight - (float)Height) / 2.0f; + + glEnable(GL_TEXTURE_2D); + glBindTexture(GL_TEXTURE_2D, this->_DrawTexture); + glBegin(GL_QUADS); + glTexCoord2i(0, 0); glVertex2f(X, Y); + glTexCoord2i(0, 1); glVertex2f(X, Y + Height); + glTexCoord2i(1, 1); glVertex2f(X + Width, Y + Height); + glTexCoord2i(1, 0); glVertex2f(X + Width, Y); + glEnd(); + } + + void AssetRenderer::RenderHUD() + { + glMatrixMode(GL_PROJECTION); + glLoadMatrixf(Matrix::CreateOrthographic(0, (float)this->_ClientWidth, (float)this->_ClientHeight, 0, -1, 1).GetMatrix()); + + // Scale the font size for dpi aware controls + auto Screen = GetDC(nullptr); + auto Ratio = GetDeviceCaps(Screen, LOGPIXELSX); + ReleaseDC(nullptr, Screen); + + // We based layout on stock 96 dpi, which is 100% scaling on windows + // so scale linearly based on that + const auto Scale = (1.0f - (96.f / (float)Ratio)) + 1.0f; + const auto FontScale = 0.7f * Scale; + + switch (this->_DrawingMode) + { + case DrawMode::Model: + glColor4f(3 / 255.f, 169 / 255.f, 244 / 255.f, 1); + + _RenderFont.RenderString("Model", 22, 22, FontScale); _RenderFont.RenderString(":", 80, 22, FontScale); + _RenderFont.RenderString("Meshes", 22, 38, FontScale); _RenderFont.RenderString(":", 80, 38, FontScale); + _RenderFont.RenderString("Verts", 22, 54, FontScale); _RenderFont.RenderString(":", 80, 54, FontScale); + _RenderFont.RenderString("Tris", 22, 70, FontScale); _RenderFont.RenderString(":", 80, 70, FontScale); + _RenderFont.RenderString("Bones", 22, 86, FontScale); _RenderFont.RenderString(":", 80, 86, FontScale); + + glColor4f(35 / 255.f, 206 / 255.f, 107 / 255.f, 1); + + _RenderFont.RenderString(string((this->_ShowBones) ? "Hide Bones (b), " : "Draw Bones (b), ") + string((this->_ShowMaterials) ? "Shaded View (t), " : "Material View (t), ") + string((this->_UseWireframe) ? "Hide Wireframe (w)" : "Draw Wireframe (w)"), 22, this->_Height - 44.f, FontScale); + + glColor4f(0.9f, 0.9f, 0.9f, 1); + + _RenderFont.RenderString((this->_DrawInformation.AssetName == "") ? string("N/A") : this->_DrawInformation.AssetName, 96, 22, FontScale); + _RenderFont.RenderString(string::Format("%d", this->_DrawInformation.MeshCount), 96, 38, FontScale); + _RenderFont.RenderString(string::Format("%d", this->_DrawInformation.VertexCount), 96, 54, FontScale); + _RenderFont.RenderString(string::Format("%d", this->_DrawInformation.TriangleCount), 96, 70, FontScale); + _RenderFont.RenderString(string::Format("%d", this->_DrawInformation.BoneCount), 96, 86, FontScale); + break; + case DrawMode::Texture: + glColor4f(3 / 255.f, 169 / 255.f, 244 / 255.f, 1); + + _RenderFont.RenderString("Image", 22, 22, FontScale); _RenderFont.RenderString(":", 80, 22, FontScale); + _RenderFont.RenderString("Width", 22, 38, FontScale); _RenderFont.RenderString(":", 80, 38, FontScale); + _RenderFont.RenderString("Height", 22, 54, FontScale); _RenderFont.RenderString(":", 80, 54, FontScale); + _RenderFont.RenderString("Scale", 22, 70, FontScale); _RenderFont.RenderString(":", 80, 70, FontScale); + + glColor4f(0.9f, 0.9f, 0.9f, 1); + + _RenderFont.RenderString((this->_DrawInformation.AssetName == "") ? string("N/A") : this->_DrawInformation.AssetName, 96, 22, FontScale); + _RenderFont.RenderString(string::Format("%d", this->_DrawInformation.Width), 96, 38, FontScale); + _RenderFont.RenderString(string::Format("%d", this->_DrawInformation.Height), 96, 54, FontScale); + _RenderFont.RenderString(string::Format("%d%%", this->_DrawInformation.Scale), 96, 70, FontScale); + break; + } + } + + void AssetRenderer::LoadDXTextureOGL(Texture& Texture, const uint32_t TextureSlot) + { + glBindTexture(GL_TEXTURE_2D, TextureSlot); + + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); + + switch (Texture.Format()) + { + case DXGI_FORMAT::DXGI_FORMAT_BC6H_UF16: + Texture.ConvertToFormat(DXGI_FORMAT_BC1_UNORM); + case DXGI_FORMAT::DXGI_FORMAT_BC1_UNORM: + case DXGI_FORMAT::DXGI_FORMAT_BC1_UNORM_SRGB: + glCompressedTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, Texture.Width(), Texture.Height(), 0, Texture.BlockSize(), Texture.GetPixels()); + break; + case DXGI_FORMAT::DXGI_FORMAT_BC2_UNORM: + case DXGI_FORMAT::DXGI_FORMAT_BC2_UNORM_SRGB: + glCompressedTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, Texture.Width(), Texture.Height(), 0, Texture.BlockSize(), Texture.GetPixels()); + break; + case DXGI_FORMAT::DXGI_FORMAT_BC3_UNORM: + case DXGI_FORMAT::DXGI_FORMAT_BC3_UNORM_SRGB: + glCompressedTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, Texture.Width(), Texture.Height(), 0, Texture.BlockSize(), Texture.GetPixels()); + break; + case DXGI_FORMAT::DXGI_FORMAT_BC4_UNORM: + case DXGI_FORMAT::DXGI_FORMAT_BC4_SNORM: + glCompressedTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_RED_RGTC1, Texture.Width(), Texture.Height(), 0, Texture.BlockSize(), Texture.GetPixels()); + break; + case DXGI_FORMAT::DXGI_FORMAT_BC5_UNORM: + case DXGI_FORMAT::DXGI_FORMAT_BC5_SNORM: + glCompressedTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_RG_RGTC2, Texture.Width(), Texture.Height(), 0, Texture.BlockSize(), Texture.GetPixels()); + break; + case DXGI_FORMAT::DXGI_FORMAT_BC7_UNORM_SRGB: + case DXGI_FORMAT::DXGI_FORMAT_BC7_UNORM: + glCompressedTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_RGBA_BPTC_UNORM, Texture.Width(), Texture.Height(), 0, Texture.BlockSize(), Texture.GetPixels()); + break; + case DXGI_FORMAT::DXGI_FORMAT_R8_UNORM: + glTexImage2D(GL_TEXTURE_2D, 0, GL_RED, Texture.Width(), Texture.Height(), 0, GL_RED, GL_UNSIGNED_BYTE, Texture.GetPixels()); + break; + case DXGI_FORMAT::DXGI_FORMAT_R8G8_UNORM: + glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE_ALPHA, Texture.Width(), Texture.Height(), 0, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, Texture.GetPixels()); + break; + case DXGI_FORMAT::DXGI_FORMAT_R8G8B8A8_UNORM: + case DXGI_FORMAT::DXGI_FORMAT_R8G8B8A8_UNORM_SRGB: + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, Texture.Width(), Texture.Height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, Texture.GetPixels()); + break; + default: +#if _DEBUG + printf("Unsupported DXGI->OGL mapping\n"); + __debugbreak(); +#endif + break; + } + } + + DrawObject::DrawObject() + : VertexArrayObject(0), VertexBuffer(0), FaceBuffer(0), LoadedMaterial(false), FaceCount(0), VertexCount(0), Material{(uint32_t)-1, (uint32_t)-1, (uint32_t)-1, (uint32_t)-1, (uint32_t)-1} + { + } +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/AssetRenderer.h b/r5dev/thirdparty/cppnet/cppkore/AssetRenderer.h new file mode 100644 index 00000000..8232f353 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/AssetRenderer.h @@ -0,0 +1,165 @@ +#pragma once + +#include +#include +#include +#include +#include "Model.h" +#include "Animation.h" +#include "Texture.h" +#include "ListBase.h" +#include "OpenGLViewport.h" +#include "RenderViewCamera.h" +#include "RenderShader.h" +#include "RenderFont.h" + +namespace Assets +{ + // A 3D uniform buffer object + struct DrawObjectMaterial + { + uint32_t AlbedoMap; + uint32_t NormalMap; + uint32_t MetallicMap; + uint32_t RoughnessMap; + uint32_t AmbientOccluionMap; + }; + + // A 3D buffer object that is being drawn. + struct DrawObject + { + uint32_t VertexArrayObject; + uint32_t VertexBuffer; + uint32_t FaceBuffer; + + bool LoadedMaterial; + DrawObjectMaterial Material; + + uint32_t FaceCount; + uint32_t VertexCount; + + DrawObject(); + }; + + enum class DrawMode + { + Model, + Animation, + Texture + }; + + // A 3D asset renderer control. + class AssetRenderer : public Forms::OpenGLViewport + { + public: + AssetRenderer(); + virtual ~AssetRenderer(); + + // Special function to stream in a material image + using MaterialStreamCallback = std::function(const string, const uint64_t)>; + + // Clears the current model, if any, and assigns the new one + void SetViewModel(const Model& Model); + // Clears the current model + void ClearViewModel(); + + // Applies a custom material streamer routine + void SetMaterialStreamer(MaterialStreamCallback Callback); + + // Clears the current texture, if any, and assigns the new one + void SetViewTexture(const Texture& Texture); + // Clears the current texture + void ClearViewTexture(); + + // Sets the name of the model + void SetAssetName(const string& Name); + + // Enable or disable wireframe rendering + void SetUseWireframe(bool Value); + // Enable or disable bone rendering + void SetShowBones(bool Value); + // Enable or disable material rendering + void SetShowMaterials(bool Value); + + // Changes the up axis + void SetZUpAxis(bool ZUp); + + // Resets the current view to the default view + void ResetView(); + // Brings the current model into view + void ZoomModelToView(); + + // We must define base events here + virtual void OnRender(); + virtual void OnResize(); + virtual void OnHandleCreated(); + virtual void OnKeyUp(const std::unique_ptr& EventArgs); + virtual void OnMouseDown(const std::unique_ptr& EventArgs); + virtual void OnMouseMove(const std::unique_ptr& EventArgs); + virtual void OnMouseWheel(const std::unique_ptr& EventArgs); + + private: + // Internal buffers + List _DrawObjects; + + // Internal buffer for texture mode + uint32_t _DrawTexture; + + // Internal bone point buffer + uint32_t _BonePointBuffer; + // Internal bone point count + uint32_t _BonePointCount; + + struct + { + uint32_t VertexCount; + uint32_t TriangleCount; + uint32_t MeshCount; + + uint32_t Width; + uint32_t Height; + + int32_t Scale; + + string AssetName; + + uint32_t BoneCount; + } _DrawInformation; + + DrawMode _DrawingMode; + + // The target mouse position + Vector2 _TargetMousePosition; + + // Function to handle streaming in material images + MaterialStreamCallback _MaterialStreamer; + + // The view camera instance + RenderViewCamera _Camera; + // The shader for the model + RenderShader _ModelShader; + // The render font instance + RenderFont _RenderFont; + + // Whether or not to use wireframe mode + bool _UseWireframe; + // Whether or not to show bones + bool _ShowBones; + // Whether or not to render with materials + bool _ShowMaterials; + + // Internal routine to render the gradient background + void RenderBackground(); + // Internal routine to render the grid + void RenderGrid(); + // Internal routine to render the model + void RenderModel(); + // Internal routine to render the texture + void RenderTexture(); + // Internal routine to render the hud + void RenderHUD(); + + // Internal routine to load a texture to an index + void LoadDXTextureOGL(Texture& Texture, const uint32_t TextureSlot); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/AtomicListBase.h b/r5dev/thirdparty/cppnet/cppkore/AtomicListBase.h new file mode 100644 index 00000000..43e93923 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/AtomicListBase.h @@ -0,0 +1,75 @@ +#pragma once + +#include +#include +#include +#include "ListBase.h" + +template +class AtomicListBase +{ +public: + AtomicListBase(); + ~AtomicListBase() = default; + + void Enqueue(T& Item); + bool Dequeue(T& Item); + + bool IsEmpty() const; + uint32_t Count() const; + +private: + List _List; + + std::atomic _SyncCount; + std::mutex _SyncContext; +}; + +template +inline AtomicListBase::AtomicListBase() + : _SyncCount(0) +{ +} + +template +inline void AtomicListBase::Enqueue(T& Item) +{ + { + std::lock_guard lock(this->_SyncContext); + this->_List.EmplaceBack(Item); + } + + this->_SyncCount++; +} + +template +inline bool AtomicListBase::Dequeue(T& Item) +{ + { + std::lock_guard lock(this->_SyncContext); + const auto Length = this->_List.Count(); + + if (Length > 0) + { + Item = this->_List[Length - 1]; + this->_List.RemoveAt(Length - 1); + + this->_SyncCount--; + return true; + } + } + + return false; +} + +template +inline bool AtomicListBase::IsEmpty() const +{ + return (this->_SyncCount == 0); +} + +template +inline uint32_t AtomicListBase::Count() const +{ + return this->_SyncCount; +} diff --git a/r5dev/thirdparty/cppnet/cppkore/AtomicQueueBase.h b/r5dev/thirdparty/cppnet/cppkore/AtomicQueueBase.h new file mode 100644 index 00000000..7f7d8bca --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/AtomicQueueBase.h @@ -0,0 +1,132 @@ +#pragma once + +#include +#include +#include "ListBase.h" + +struct AtomicSyncContext +{ + std::atomic _declspec(align(std::hardware_constructive_interference_size)) Head; + std::atomic _declspec(align(std::hardware_constructive_interference_size)) Tail; +}; + +template +class AtomicQueueBase +{ +public: + AtomicQueueBase(); + ~AtomicQueueBase() = default; + + bool Enqueue(T& Item, uint32_t Count = 1); + bool Dequeue(T& Item, uint32_t Count = 1); + + bool IsEmpty() const; + uint32_t Count() const; + +private: + AtomicSyncContext _Writer; + AtomicSyncContext _Reader; + + constexpr static uint32_t BufferSize = (2 << 10); + constexpr static uint32_t Mask = BufferSize - 1; + + std::atomic_flag _SpinLock; + T alignas(std::hardware_constructive_interference_size) _Buffer[BufferSize]; +}; + +template +inline AtomicQueueBase::AtomicQueueBase() + : _Writer{ 0, 0 }, _Reader{ 0, 0 }, _Buffer{}, _SpinLock() +{ +} + +template +inline bool AtomicQueueBase::Enqueue(T& Item, uint32_t Count) +{ + uint32_t NextHead, EndTail, NewHead; + + // The queue can fail to insert if it's already full, so you must check the result.. + bool Success = false; + do { + NextHead = _Writer.Head.load(std::memory_order_acquire); + EndTail = _Reader.Tail.load(std::memory_order_acquire); + + // Check if queue is full, yield time slice to other threads + if ((NextHead - EndTail + 1) > Mask) + return false; + + NewHead = NextHead + Count; + Success = _Writer.Head.compare_exchange_weak(NextHead, NewHead, std::memory_order_release); + } while (!Success); + + _Buffer[NextHead & Mask] = Item; + + std::atomic_thread_fence(std::memory_order_release); + while (_Writer.Tail.load(std::memory_order_acquire) != NextHead) + { + // Spin lock wait + while (_SpinLock.test_and_set(std::memory_order_acquire)); + } + + // Set the value and unlock the spin + _Writer.Tail.store(NewHead, std::memory_order_release); + _SpinLock.clear(std::memory_order_release); + + return true; +} + +template +inline bool AtomicQueueBase::Dequeue(T& Item, uint32_t Count) +{ + uint32_t Head, Tail, Next; + + bool Success = false; + do { + Tail = _Reader.Head.load(std::memory_order_acquire); + Head = _Writer.Tail.load(std::memory_order_acquire); + + // Check if the queue is empty, in that case, no result + if (Head == Tail) + return false; + + Next = Tail + Count; + Success = _Reader.Head.compare_exchange_weak(Tail, Next, std::memory_order_release); + } while (!Success); + + Item = _Buffer[Tail & Mask]; + + std::atomic_thread_fence(std::memory_order_acquire); + while (_Reader.Tail.load(std::memory_order_acquire) != Tail) + { + // Spin lock wait + while (_SpinLock.test_and_set(std::memory_order_acquire)); + } + + _Reader.Tail.store(Next, std::memory_order_release); + _SpinLock.clear(std::memory_order_release); + + return true; +} + +template +inline bool AtomicQueueBase::IsEmpty() const +{ + uint32_t Tail = _Reader.Head.load(std::memory_order_acquire); + uint32_t Head = _Writer.Tail.load(std::memory_order_acquire); + + // Check if the queue is empty, in that case, no result + if (Head == Tail) + return true; + + return false; +} + +template +inline uint32_t AtomicQueueBase::Count() const +{ + // We need to subtract where we are writing to + uint32_t Tail = _Reader.Head.load(std::memory_order_acquire); + uint32_t Head = _Writer.Tail.load(std::memory_order_acquire); + + return (Head - Tail); +} diff --git a/r5dev/thirdparty/cppnet/cppkore/AutoScaleMode.h b/r5dev/thirdparty/cppnet/cppkore/AutoScaleMode.h new file mode 100644 index 00000000..1b5b88e6 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/AutoScaleMode.h @@ -0,0 +1,13 @@ +#pragma once + +namespace Forms +{ + // Specifies the auto scaling mode used by a container control. + enum class AutoScaleMode + { + None, + Font, + Dpi, + Inherit + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/AutodeskMaya.cpp b/r5dev/thirdparty/cppnet/cppkore/AutodeskMaya.cpp new file mode 100644 index 00000000..af910ccd --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/AutodeskMaya.cpp @@ -0,0 +1,517 @@ +#include "stdafx.h" +#include "AutodeskMaya.h" + +#include "File.h" +#include "Path.h" +#include "CRC32.h" +#include "StreamWriter.h" +#include "DictionaryBase.h" + +namespace Assets::Exporters +{ + bool AutodeskMaya::ExportAnimation(const Animation& Animation, const string& Path) + { + return false; + } + + bool AutodeskMaya::ExportModel(const Model& Model, const string& Path) + { + auto Writer = IO::StreamWriter(IO::File::Create(Path)); + auto FileName = IO::Path::GetFileNameWithoutExtension(Path); + auto Hash = Hashing::CRC32::HashString(FileName); + + Writer.WriteLine( + "//Maya ASCII 8.5 scene\n\n" + "requires maya \"8.5\";\ncurrentUnit -l centimeter -a degree -t film;\nfileInfo \"application\" \"maya\";\nfileInfo \"product\" \"Maya Unlimited 8.5\";\nfileInfo \"version\" \"8.5\";\nfileInfo \"cutIdentifier\" \"200612162224-692032\";" + "createNode transform -s -n \"persp\";\n\tsetAttr \".v\" no;\n\tsetAttr \".t\" -type \"double3\" 48.186233840145825 37.816674066853686 41.0540421364379 ;\n\tsetAttr \".r\" -type \"double3\" -29.738352729603015 49.400000000000432 0 ;\ncreateNode camera -s -n \"perspShape\" -p \"persp\";\n\tsetAttr -k off \".v\" no;\n\tsetAttr \".fl\" 34.999999999999993;\n\tsetAttr \".fcp\" 10000;\n\tsetAttr \".coi\" 73.724849603665149;\n\tsetAttr \".imn\" -type \"string\" \"persp\";\n\tsetAttr \".den\" -type \"string\" \"persp_depth\";\n\tsetAttr \".man\" -type \"string\" \"persp_mask\";\n\tsetAttr \".hc\" -type \"string\" \"viewSet -p %camera\";\ncreateNode transform -s -n \"top\";\n\tsetAttr \".v\" no;\n\tsetAttr \".t\" -type \"double3\" 0 100.1 0 ;\n\tsetAttr \".r\" -type \"double3\" -89.999999999999986 0 0 ;\ncreateNode camera -s -n \"topShape\" -p \"top\";\n\tsetAttr -k off \".v\" no;\n\tsetAttr \".rnd\" no;\n\tsetAttr \".coi\" 100.1;\n\tsetAttr \".ow\" 30;\n\tsetAttr \".imn\" -type \"string\" \"top\";\n\tsetAttr \".den\" -type \"string\" \"top_depth\";\n\tsetAttr \".man\" -type \"string\" \"top_mask\";\n\tsetAttr \".hc\" -type \"string\" \"viewSet -t %camera\";\n\tsetAttr \".o\" yes;\ncreateNode transform -s -n \"front\";\n\tsetAttr \".v\" no;\n\tsetAttr \".t\" -type \"double3\" 0 0 100.1 ;\ncreateNode camera -s -n \"frontShape\" -p \"front\";\n\tsetAttr -k off \".v\" no;\n\tsetAttr \".rnd\" no;\n\tsetAttr \".coi\" 100.1;\n\tsetAttr \".ow\" 30;\n\tsetAttr \".imn\" -type \"string\" \"front\";\n\tsetAttr \".den\" -type \"string\" \"front_depth\";\n\tsetAttr \".man\" -type \"string\" \"front_mask\";\n\tsetAttr \".hc\" -type \"string\" \"viewSet -f %camera\";\n\tsetAttr \".o\" yes;\ncreateNode transform -s -n \"side\";\n\tsetAttr \".v\" no;\n\tsetAttr \".t\" -type \"double3\" 100.1 0 0 ;\n\tsetAttr \".r\" -type \"double3\" 0 89.999999999999986 0 ;\ncreateNode camera -s -n \"sideShape\" -p \"side\";\n\tsetAttr -k off \".v\" no;\n\tsetAttr \".rnd\" no;\n\tsetAttr \".coi\" 100.1;\n\tsetAttr \".ow\" 30;\n\tsetAttr \".imn\" -type \"string\" \"side\";\n\tsetAttr \".den\" -type \"string\" \"side_depth\";\n\tsetAttr \".man\" -type \"string\" \"side_mask\";\n\tsetAttr \".hc\" -type \"string\" \"viewSet -s %camera\";\n\tsetAttr \".o\" yes;\ncreateNode lightLinker -n \"lightLinker1\";\n\tsetAttr -s 9 \".lnk\";\n\tsetAttr -s 9 \".slnk\";\ncreateNode displayLayerManager -n \"layerManager\";\ncreateNode displayLayer -n \"defaultLayer\";\ncreateNode renderLayerManager -n \"renderLayerManager\";\ncreateNode renderLayer -n \"defaultRenderLayer\";\n\tsetAttr \".g\" yes;\ncreateNode script -n \"sceneConfigurationScriptNode\";\n\tsetAttr \".b\" -type \"string\" \"playbackOptions -min 1 -max 24 -ast 1 -aet 48 \";\n\tsetAttr \".st\" 6;\nselect -ne :time1;\n\tsetAttr \".o\" 1;\nselect -ne :renderPartition;\n\tsetAttr -s 2 \".st\";\nselect -ne :renderGlobalsList1;\nselect -ne :defaultShaderList1;\n\tsetAttr -s 2 \".s\";\nselect -ne :postProcessList1;\n\tsetAttr -s 2 \".p\";\nselect -ne :lightList1;\nselect -ne :initialShadingGroup;\n\tsetAttr \".ro\" yes;\nselect -ne :initialParticleSE;\n\tsetAttr \".ro\" yes;\nselect -ne :hardwareRenderGlobals;\n\tsetAttr \".ctrs\" 256;\n\tsetAttr \".btrs\" 512;\nselect -ne :defaultHardwareRenderGlobals;\n\tsetAttr \".fn\" -type \"string\" \"im\";\n\tsetAttr \".res\" -type \"string\" \"ntsc_4d 646 485 1.333\";\nselect -ne :ikSystem;\n\tsetAttr -s 4 \".sol\";\nconnectAttr \":defaultLightSet.msg\" \"lightLinker1.lnk[0].llnk\";\nconnectAttr \":initialShadingGroup.msg\" \"lightLinker1.lnk[0].olnk\";\nconnectAttr \":defaultLightSet.msg\" \"lightLinker1.lnk[1].llnk\";\nconnectAttr \":initialParticleSE.msg\" \"lightLinker1.lnk[1].olnk\";\nconnectAttr \":defaultLightSet.msg\" \"lightLinker1.slnk[0].sllk\";\nconnectAttr \":initialShadingGroup.msg\" \"lightLinker1.slnk[0].solk\";\nconnectAttr \":defaultLightSet.msg\" \"lightLinker1.slnk[1].sllk\";\nconnectAttr \":initialParticleSE.msg\" \"lightLinker1.slnk[1].solk\";\nconnectAttr \"layerManager.dli[0]\" \"defaultLayer.id\";\nconnectAttr \"renderLayerManager.rlmi[0]\" \"defaultRenderLayer.rlid\";\nconnectAttr \"lightLinker1.msg\" \":lightList1.ln\" -na;" + ); + + Writer.WriteLineFmt( + "createNode transform -n \"%s\";\n" + "setAttr \".ove\" yes;", + (char*)FileName + ); + + uint32_t SubmeshIndex = 0; + + for (auto& Submesh : Model.Meshes) + { + Writer.WriteLineFmt( + "createNode transform -n \"KoreMesh_%08x_%02d\" -p \"%s\";\n" + "setAttr \".rp\" -type \"double3\" 0.000000 0.000000 0.000000 ;\nsetAttr \".sp\" -type \"double3\" 0.000000 0.000000 0.000000 ;\n" + "createNode mesh -n \"MeshShape_%d\" -p \"KoreMesh_%08x_%02d\";\n" + "setAttr -k off \".v\";\nsetAttr \".vir\" yes;\nsetAttr \".vif\" yes;\n" + "setAttr -s %d \".uvst\";", + Hash, SubmeshIndex, (char*)FileName, + SubmeshIndex, Hash, SubmeshIndex, + Submesh.Vertices.UVLayerCount() + ); + + for (uint8_t i = 1; i < Submesh.Vertices.UVLayerCount() + 1; i++) + { + if (Submesh.Vertices.Count() == 1) + { + Writer.WriteFmt( + "setAttr \".uvst[%d].uvsn\" -type \"string\" \"map%d\";\n" + "setAttr -s 1 \".uvst[0].uvsp[0]\" -type \"float2\"", + (i - 1), i + ); + } + else + { + Writer.WriteFmt( + "setAttr \".uvst[%d].uvsn\" -type \"string\" \"map%d\";\n" + "setAttr -s %d \".uvst[0].uvsp[0:%d]\" -type \"float2\"", + (i - 1), i, + Submesh.Vertices.Count(), (Submesh.Vertices.Count() - 1) + ); + } + + for (auto& Vertex : Submesh.Vertices) + { + auto& Layer = Vertex.UVLayers(i - 1); + Writer.WriteFmt(" %f %f", Layer.U, (1 - Layer.V)); + } + + Writer.Write(";\n"); + } + + Writer.WriteFmt( + "setAttr \".cuvs\" -type \"string\" \"map1\";\nsetAttr \".dcol\" yes;\nsetAttr \".dcc\" -type \"string\" \"Ambient+Diffuse\";\nsetAttr \".ccls\" -type \"string\" \"colorSet1\";\nsetAttr \".clst[0].clsn\" -type \"string\" \"colorSet1\";\n" + "setAttr -s %d \".clst[0].clsp\";\n" + "setAttr \".clst[0].clsp[0:%d]\"", + (Submesh.Faces.Count() * 3), + (Submesh.Faces.Count() * 3) - 1 + ); + + for (auto& Face : Submesh.Faces) + { + auto& Vertex1 = Submesh.Vertices[Face[2]].Color(); + auto& Vertex2 = Submesh.Vertices[Face[1]].Color(); + auto& Vertex3 = Submesh.Vertices[Face[0]].Color(); + + Writer.WriteFmt( + " %f %f %f %f" + " %f %f %f %f" + " %f %f %f %f", + Vertex1[0] / 255.f, Vertex1[1] / 255.f, Vertex1[2] / 255.f, Vertex1[3] / 255.f, + Vertex2[0] / 255.f, Vertex2[1] / 255.f, Vertex2[2] / 255.f, Vertex2[3] / 255.f, + Vertex3[0] / 255.f, Vertex3[1] / 255.f, Vertex3[2] / 255.f, Vertex3[3] / 255.f + ); + } + + Writer.WriteLineFmt( + ";\n" + "setAttr \".covm[0]\" 0 1 1;\nsetAttr \".cdvm[0]\" 0 1 1;\nsetAttr -s %d \".vt\";", + Submesh.Vertices.Count() + ); + + if (Submesh.Vertices.Count() == 1) + Writer.Write("setAttr \".vt[0]\""); + else + Writer.WriteFmt("setAttr \".vt[0:%d]\"", Submesh.Vertices.Count() - 1); + + for (auto& Vertex : Submesh.Vertices) + { + auto& Position = Vertex.Position(); + Writer.WriteFmt(" %f %f %f", Position.X, Position.Y, Position.Z); + } + + Writer.WriteFmt( + ";\n" + "setAttr -s %d \".ed\";\n" + "setAttr \".ed[0:%d]\"", + (Submesh.Faces.Count() * 3), + (Submesh.Faces.Count() * 3) - 1 + ); + + for (auto& Face : Submesh.Faces) + Writer.WriteFmt(" %d %d 0 %d %d 0 %d %d 0", Face[2], Face[1], Face[1], Face[0], Face[0], Face[2]); + + Writer.WriteFmt( + ";\n" + "setAttr -s %d \".n\";\n" + "setAttr \".n[0:%d]\" -type \"float3\"", + (Submesh.Faces.Count() * 3), + (Submesh.Faces.Count() * 3) - 1 + ); + + for (auto& Face : Submesh.Faces) + { + auto& Vertex1 = Submesh.Vertices[Face[2]].Normal(); + auto& Vertex2 = Submesh.Vertices[Face[1]].Normal(); + auto& Vertex3 = Submesh.Vertices[Face[0]].Normal(); + + Writer.WriteFmt( + " %f %f %f" + " %f %f %f" + " %f %f %f", + Vertex1.X, Vertex1.Y, Vertex1.Z, + Vertex2.X, Vertex2.Y, Vertex2.Z, + Vertex3.X, Vertex3.Y, Vertex3.Z + ); + } + + Writer.WriteLine(";"); + + if (Submesh.Faces.Count() == 1) + Writer.WriteFmt("setAttr -s %d \".fc[0]\" -type \"polyFaces\"", Submesh.Faces.Count()); + else + Writer.WriteFmt("setAttr -s %d \".fc[0:%d]\" -type \"polyFaces\"", Submesh.Faces.Count(), Submesh.Faces.Count() - 1); + + uint32_t FaceIndex = 0; + + for (auto& Face : Submesh.Faces) + { + Writer.WriteFmt(" f 3 %d %d %d", FaceIndex, (FaceIndex + 1), (FaceIndex + 2)); + + for (uint8_t i = 0; i < Submesh.Vertices.UVLayerCount(); i++) + Writer.WriteFmt(" mu %d 3 %d %d %d", i, Face[2], Face[1], Face[0]); + + Writer.WriteFmt(" mc 0 3 %d %d %d", FaceIndex, (FaceIndex + 1), (FaceIndex + 2)); + + FaceIndex += 3; + } + + Writer.WriteLine( + ";\n" + "setAttr \".cd\" -type \"dataPolyComponent\" Index_Data Edge 0 ;\nsetAttr \".cvd\" -type \"dataPolyComponent\" Index_Data Vertex 0 ;\nsetAttr \".hfd\" -type \"dataPolyComponent\" Index_Data Face 0 ;" + ); + + SubmeshIndex++; + } + + Writer.Write("\n"); + + for (auto& Material : Model.Materials) + { + auto MaterialName = (char*)Material.Name; + + Writer.WriteLineFmt( + "createNode shadingEngine -n \"%sSG\";\n" + "setAttr \".ihi\" 0;\n" + "setAttr \".ro\" yes;\n" + "createNode materialInfo -n \"%sMI\";\r\ncreateNode lambert -n \"%s\";\n" + "createNode place2dTexture -n \"%sP2DT\";", + MaterialName, + MaterialName, MaterialName, + MaterialName + ); + + auto DiffuseTexture = (Material.Slots.ContainsKey(MaterialSlotType::Albedo)) + ? MaterialSlotType::Albedo : (Material.Slots.ContainsKey(MaterialSlotType::Diffuse) ? MaterialSlotType::Diffuse : MaterialSlotType::Invalid); + + if (DiffuseTexture != MaterialSlotType::Invalid) + { + Writer.WriteLineFmt( + "createNode file -n \"%sFILE\";\n" + "setAttr \".ftn\" -type \"string\" \"%s\";", + MaterialName, + (char*)string(Material.Slots[DiffuseTexture].first).Replace("\\", "\\\\") + ); + } + } + + uint32_t LightConnectionIndex = 2; + + for (auto& Material : Model.Materials) + { + auto MaterialName = (char*)Material.Name; + + Writer.WriteLineFmt( + "connectAttr \":defaultLightSet.msg\" \"lightLinker1.lnk[%d].llnk\";\n" + "connectAttr \"%sSG.msg\" \"lightLinker1.lnk[%d].olnk\";\n" + "connectAttr \":defaultLightSet.msg\" \"lightLinker1.slnk[%d].sllk\";\n" + "connectAttr \"%sSG.msg\" \"lightLinker1.slnk[%d].solk\";\n" + "connectAttr \"%s.oc\" \"%sSG.ss\";\n" + "connectAttr \"%sSG.msg\" \"%sMI.sg\";\n" + "connectAttr \"%s.msg\" \"%sMI.m\";", + LightConnectionIndex, + MaterialName, LightConnectionIndex, + LightConnectionIndex, + MaterialName, LightConnectionIndex, + MaterialName, MaterialName, + MaterialName, MaterialName, + MaterialName, MaterialName + ); + + auto DiffuseTexture = (Material.Slots.ContainsKey(MaterialSlotType::Albedo)) + ? MaterialSlotType::Albedo : (Material.Slots.ContainsKey(MaterialSlotType::Diffuse) ? MaterialSlotType::Diffuse : MaterialSlotType::Invalid); + + if (DiffuseTexture != MaterialSlotType::Invalid) + { + Writer.WriteLineFmt( + "connectAttr \"%sFILE.msg\" \"%sMI.t\" -na;\n" + "connectAttr \"%sFILE.oc\" \"%s.c\";\n" + "connectAttr \"%sP2DT.c\" \"%sFILE.c\";\n" + "connectAttr \"%sP2DT.tf\" \"%sFILE.tf\";\n" + "connectAttr \"%sP2DT.rf\" \"%sFILE.rf\";\n" + "connectAttr \"%sP2DT.mu\" \"%sFILE.mu\";\n" + "connectAttr \"%sP2DT.mv\" \"%sFILE.mv\";\n" + "connectAttr \"%sP2DT.s\" \"%sFILE.s\";\n" + "connectAttr \"%sP2DT.wu\" \"%sFILE.wu\";\n" + "connectAttr \"%sP2DT.wv\" \"%sFILE.wv\";\n" + "connectAttr \"%sP2DT.re\" \"%sFILE.re\";\n" + "connectAttr \"%sP2DT.of\" \"%sFILE.of\";\n" + "connectAttr \"%sP2DT.r\" \"%sFILE.ro\";\n" + "connectAttr \"%sP2DT.n\" \"%sFILE.n\";\n" + "connectAttr \"%sP2DT.vt1\" \"%sFILE.vt1\";\n" + "connectAttr \"%sP2DT.vt2\" \"%sFILE.vt2\";\n" + "connectAttr \"%sP2DT.vt3\" \"%sFILE.vt3\";\n" + "connectAttr \"%sP2DT.vc1\" \"%sFILE.vc1\";\n" + "connectAttr \"%sP2DT.o\" \"%sFILE.uv\";\n" + "connectAttr \"%sP2DT.ofs\" \"%sFILE.fs\";\n", + MaterialName, MaterialName, + MaterialName, MaterialName, + MaterialName, MaterialName, + MaterialName, MaterialName, + MaterialName, MaterialName, + MaterialName, MaterialName, + MaterialName, MaterialName, + MaterialName, MaterialName, + MaterialName, MaterialName, + MaterialName, MaterialName, + MaterialName, MaterialName, + MaterialName, MaterialName, + MaterialName, MaterialName, + MaterialName, MaterialName, + MaterialName, MaterialName, + MaterialName, MaterialName, + MaterialName, MaterialName, + MaterialName, MaterialName, + MaterialName, MaterialName, + MaterialName, MaterialName + ); + } + + Writer.WriteLineFmt( + "connectAttr \"%sSG.pa\" \":renderPartition.st\" -na;\n" + "connectAttr \"%s.msg\" \":defaultShaderList1.s\" -na;\n" + "connectAttr \"%sP2DT.msg\" \":defaultRenderUtilityList1.u\" -na;\n" + "connectAttr \"%sFILE.msg\" \":defaultTextureList1.tx\" -na;\n", + MaterialName, + MaterialName, + MaterialName, + MaterialName + ); + + LightConnectionIndex++; + } + + SubmeshIndex = 0; + + for (auto& Submesh : Model.Meshes) + { + Writer.WriteLineFmt( + "setAttr -s %d \"MeshShape_%d.iog\";", + Submesh.Vertices.UVLayerCount(), SubmeshIndex + ); + + for (uint8_t i = 0; i < Submesh.Vertices.UVLayerCount(); i++) + { + if (Submesh.MaterialIndices[i] < 0) + continue; + + Writer.WriteLineFmt( + "connectAttr \"MeshShape_%d.iog[%d]\" \"%sSG.dsm\" -na;", + SubmeshIndex, i, (char*)Model.Materials[Submesh.MaterialIndices[i]].Name + ); + } + + SubmeshIndex++; + } + + Writer.WriteLine( + "createNode transform -n \"Joints\";\nsetAttr \".ove\" yes;\n" + ); + + for (auto& Bone : Model.Bones) + { + if (Bone.Parent() == -1) + Writer.WriteLineFmt("createNode joint -n \"%s\" -p \"Joints\";", (char*)Bone.Name()); + else + Writer.WriteLineFmt("createNode joint -n \"%s\" -p \"%s\";", (char*)Bone.Name(), (char*)Model.Bones[Bone.Parent()].Name()); + + if (Bone.GetFlag(BoneFlags::HasLocalSpaceMatrices)) + { + auto Rotation = Bone.LocalRotation().ToEulerAngles(); + + auto& Position = Bone.LocalPosition(); + auto& Scale = Bone.Scale(); + + Writer.WriteLineFmt( + "addAttr -ci true -sn \"liw\" -ln \"lockInfluenceWeights\" -bt \"lock\" -min 0 -max 1 -at \"bool\";\n" + "setAttr \".uoc\" yes;\n" + "setAttr \".ove\" yes;\n" + "setAttr \".t\" -type \"double3\" %f %f %f ;\n" + "setAttr \".mnrl\" -type \"double3\" -360 -360 -360 ;\n" + "setAttr \".mxrl\" -type \"double3\" 360 360 360 ;\n" + "setAttr \".radi\" 0.50;\n" + "setAttr \".jo\" -type \"double3\" %f %f %f;\n" + "setAttr \".scale\" -type \"double3\" %f %f %f;\n", + Position.X, Position.Y, Position.Z, + Rotation.X, Rotation.Y, Rotation.Z, + Scale.X, Scale.Y, Scale.Z + ); + } + else + { + auto Rotation = Bone.GlobalRotation().ToEulerAngles(); + + auto& Position = Bone.GlobalPosition(); + auto& Scale = Bone.Scale(); + + Writer.WriteLineFmt( + "addAttr -ci true -sn \"liw\" -ln \"lockInfluenceWeights\" -bt \"lock\" -min 0 -max 1 -at \"bool\";\n" + "setAttr \".uoc\" yes;\n" + "setAttr \".ove\" yes;\n" + "setAttr \".it\" no;\n" + "setAttr \".t\" -type \"double3\" %f %f %f ;\n" + "setAttr \".mnrl\" -type \"double3\" -360 -360 -360 ;\n" + "setAttr \".mxrl\" -type \"double3\" 360 360 360 ;\n" + "setAttr \".radi\" 0.50;\n" + "setAttr \".jo\" -type \"double3\" %f %f %f;\n" + "setAttr \".scale\" -type \"double3\" %f %f %f;\n", + Position.X, Position.Y, Position.Z, + Rotation.X, Rotation.Y, Rotation.Z, + Scale.X, Scale.Y, Scale.Z + ); + } + } + + auto Binder = IO::StreamWriter(IO::File::Create(IO::Path::Combine(IO::Path::GetDirectoryName(Path), FileName + "_BIND.mel"))); + + Binder.WriteLine( + "/*\n* Autodesk Maya Bind Script\n*/\n" + ); + + SubmeshIndex = 0; + + for (auto& Submesh : Model.Meshes) + { + Binder.WriteLineFmt( + "global proc KoreMesh_%08x_%02d_BindFunc()\n{\n" + " select -r KoreMesh_%08x_%02d;", + Hash, SubmeshIndex, + Hash, SubmeshIndex + ); + + auto MaximumInfluence = Submesh.Vertices.WeightCount(); + + uint32_t BoneMapIndex = 0; + Dictionary BoneMap; + Dictionary ReverseBoneMap; + List BoneNames; + + for (auto& Vertex : Submesh.Vertices) + { + for (uint8_t i = 0; i < Vertex.WeightCount(); i++) + { + auto& Weight = Vertex.Weights(i); + + if (BoneMap.Add(Weight.Bone, 0)) + { + BoneNames.Add(Model.Bones[Weight.Bone].Name()); + ReverseBoneMap.Add(BoneMapIndex, Weight.Bone); + BoneMapIndex++; + } + } + } + + for (auto& BoneName : BoneNames) + Binder.WriteLineFmt(" select -add %s;", (char*)BoneName); + + Binder.WriteLineFmt( + " newSkinCluster \"-toSelectedBones -mi %d -omi true -dr 5.0 -rui false\";\n" + " string $clu = findRelatedSkinCluster(\"KoreMesh_%08x_%02d\");", + MaximumInfluence, + Hash, SubmeshIndex + ); + + // If we are a complex skin, we need a weight matrix + if (BoneNames.Count() > 1) + { + Binder.WriteFmt(" int $NV = %d;\n matrix $WM[%d][%d] = <<", Submesh.Vertices.Count(), Submesh.Vertices.Count(), BoneNames.Count()); + + for (uint32_t i = 0; i < Submesh.Vertices.Count(); i++) + { + auto Vertex = Submesh.Vertices[i]; + + if (i != 0) + Binder.Write(";"); + + for (uint32_t b = 0; b < BoneNames.Count(); b++) + { + if (b != 0) + Binder.Write(","); + + float WeightValue = 0.0f; + + for (uint8_t w = 0; w < Vertex.WeightCount(); w++) + { + if (Vertex.Weights(w).Bone == ReverseBoneMap[b]) + { + WeightValue = Vertex.Weights(w).Value; + break; + } + } + + if (WeightValue == 0.0f || WeightValue == 1.0f) + Binder.WriteFmt("%d", (uint32_t)WeightValue); + else + Binder.WriteFmt("%f", WeightValue); + } + } + + Binder.WriteLine(">>;"); + Binder.Write(" for ($i = 0; $i < $NV; $i++) {"); + + Binder.WriteFmt(" setAttr($clu + \".weightList[\" + $i + \"].weights[0:%d]\")", BoneNames.Count() - 1); + + for (uint32_t i = 0; i < BoneNames.Count(); i++) + Binder.WriteFmt(" $WM[$i][%d]", i); + + Binder.WriteLine("; }"); + } + + Binder.WriteLine("}\n"); + SubmeshIndex++; + } + + Binder.WriteLine("global proc RunAdvancedScript()\n{"); + + SubmeshIndex = 0; + + for (auto& Submesh : Model.Meshes) + Binder.WriteLineFmt(" catch(KoreMesh_%08x_%02d_BindFunc());", Hash, SubmeshIndex++); + + Binder.WriteLine("}\n\nglobal proc NamespacePurge()\n{\n string $allNodes[] = `ls`;\n for($node in $allNodes) {\n string $buffer[];\n tokenize $node \":\" $buffer;\n string $newName = $buffer[size($buffer)-1];\n catchQuiet(`rename $node $newName`);\n }\n}\n\nprint(\"Currently binding the current model, please wait...\\n\");\nNamespacePurge();\nRunAdvancedScript();\nprint(\"The model has been binded.\\n\");\n"); + + return true; + } + + imstring AutodeskMaya::ModelExtension() + { + return ".ma"; + } + + imstring AutodeskMaya::AnimationExtension() + { + return ".anim"; + } + + ExporterScale AutodeskMaya::ExportScale() + { + return ExporterScale::CM; + } + + bool AutodeskMaya::SupportsAnimations() + { + return true; + } + + bool AutodeskMaya::SupportsModels() + { + return true; + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/AutodeskMaya.h b/r5dev/thirdparty/cppnet/cppkore/AutodeskMaya.h new file mode 100644 index 00000000..dc20f2cb --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/AutodeskMaya.h @@ -0,0 +1,33 @@ +#pragma once + +#include +#include "Exporter.h" + +namespace Assets::Exporters +{ + // The Autodesk Maya exporter + class AutodeskMaya : public Exporter + { + public: + AutodeskMaya() = default; + ~AutodeskMaya() = default; + + // Exports the given animation to the provided path. + virtual bool ExportAnimation(const Animation& Animation, const string& Path); + // Exports the given model to the provided path. + virtual bool ExportModel(const Model& Model, const string& Path); + + // Gets the file extension for this exporters model format. + virtual imstring ModelExtension(); + // Gets the file extension for this exporters animation format. + virtual imstring AnimationExtension(); + + // Gets the required scaling constant for this exporter. + virtual ExporterScale ExportScale(); + + // Gets whether or not the exporter supports animation exporting. + virtual bool SupportsAnimations(); + // Gets whether or not the exporter supports model exporting. + virtual bool SupportsModels(); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/BinaryReader.cpp b/r5dev/thirdparty/cppnet/cppkore/BinaryReader.cpp new file mode 100644 index 00000000..fd91f782 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/BinaryReader.cpp @@ -0,0 +1,251 @@ +#include "stdafx.h" +#include "BinaryReader.h" +#include "Pattern.h" + +namespace IO +{ + BinaryReader::BinaryReader() + : BinaryReader(nullptr, false) + { + } + + BinaryReader::BinaryReader(std::unique_ptr Stream) + : BinaryReader(std::move(Stream), false) + { + } + + BinaryReader::BinaryReader(std::unique_ptr Stream, bool LeaveOpen) + { + this->BaseStream = std::move(Stream); + this->_LeaveOpen = LeaveOpen; + } + + BinaryReader::BinaryReader(Stream* Stream) + : BinaryReader(Stream, false) + { + } + + BinaryReader::BinaryReader(Stream* Stream, bool LeaveOpen) + { + this->BaseStream.reset(Stream); + this->_LeaveOpen = LeaveOpen; + } + + BinaryReader::~BinaryReader() + { + this->Close(); + } + + std::unique_ptr BinaryReader::Read(uint64_t Count, uint64_t& Result) + { + auto Buffer = std::make_unique(Count); + + Result = Read(Buffer.get(), 0, Count); + + return Buffer; + } + + uint64_t BinaryReader::Read(uint8_t* Buffer, uint64_t Index, uint64_t Count) + { + if (!this->BaseStream) + IOError::StreamBaseStream(); + + return this->BaseStream->Read(Buffer, Index, Count); + } + + uint64_t BinaryReader::Read(void* Buffer, uint64_t Index, uint64_t Count) + { + if (!this->BaseStream) + IOError::StreamBaseStream(); + + return this->BaseStream->Read((uint8_t*)Buffer, Index, Count); + } + + string BinaryReader::ReadCString() + { + if (!this->BaseStream) + IOError::StreamBaseStream(); + + string Buffer = ""; + + char Cur = this->Read(); + while ((uint8_t)Cur > 0) + { + Buffer += Cur; + Cur = this->Read(); + } + + return std::move(Buffer); + } + + wstring BinaryReader::ReadWCString() + { + if (!this->BaseStream) + IOError::StreamBaseStream(); + + wstring Buffer = L""; + + wchar_t Cur = this->Read(); + while (Cur != (wchar_t)'\0') + { + Buffer += Cur; + Cur = this->Read(); + } + + return std::move(Buffer); + } + + string BinaryReader::ReadSizeString(uint64_t Size) + { + if (!this->BaseStream) + IOError::StreamBaseStream(); + + auto Buffer = string((uint32_t)Size, '\0'); + this->BaseStream->Read((uint8_t*)&Buffer[0], 0, Size); + + return std::move(Buffer); + } + + string BinaryReader::ReadNetString() + { + if (!this->BaseStream) + IOError::StreamBaseStream(); + + auto Buffer = string(this->ReadVarInt(), '\0'); + this->BaseStream->Read((uint8_t*)&Buffer[0], 0, (uint64_t)Buffer.Length()); + + return std::move(Buffer); + } + + uint32_t BinaryReader::ReadVarInt() + { + uint32_t Count = 0, Shift = 0; + uint8_t Byte; + + do + { + if (Shift == 5 * 7) + return 0; + + Byte = this->Read(); + Count |= (Byte & 0x7F) << Shift; + Shift += 7; + } while ((Byte & 0x80) != 0); + + return Count; + } + + int64_t BinaryReader::SignatureScan(const string& Signature) + { + if (!this->BaseStream) + IOError::StreamBaseStream(); + + auto Sig = Data::Pattern(Signature); + auto Position = this->BaseStream->GetPosition(); + auto Length = this->BaseStream->GetLength(); + auto ChunkSize = (0x5F5E100 + (0x5F5E100 % Sig.DataSize())); + + uint64_t SearchResult = -1, ReadResult = 0, DataRead = 0; + + while (true) + { + auto StartPosition = this->BaseStream->GetPosition(); + auto Buffer = this->Read(ChunkSize, ReadResult); + + auto ChunkResult = Sig.Search(Buffer.get(), 0, ReadResult); + if (ChunkResult > -1) + { + return (DataRead + ChunkResult + StartPosition); + } + DataRead += ReadResult; + + if (ReadResult < ChunkSize) + break; + } + + return SearchResult; + } + + int64_t BinaryReader::SignatureScan(const string& Signature, uint64_t Offset, uint64_t Count) + { + if (!this->BaseStream) + IOError::StreamBaseStream(); + + uint64_t ReadResult = 0; + auto Sig = Data::Pattern(Signature); + this->BaseStream->SetPosition(Offset); + auto Buffer = this->Read(Count, ReadResult); + + auto SearchResult = Sig.Search(Buffer.get(), 0, ReadResult); + + if (SearchResult > -1) + return (SearchResult + Offset); + + return SearchResult; + } + + List BinaryReader::SignatureScanAll(const string & Signature) + { + if (!this->BaseStream) + IOError::StreamBaseStream(); + + auto ResultList = List(); + + auto Sig = Data::Pattern(Signature); + auto Position = this->BaseStream->GetPosition(); + auto Length = this->BaseStream->GetLength(); + auto ChunkSize = (0x5F5E100 + (0x5F5E100 % Sig.DataSize())); + + uint64_t SearchResult = -1, ReadResult = 0, DataRead = 0; + + while (true) + { + auto StartPosition = this->BaseStream->GetPosition(); + auto Buffer = this->Read(ChunkSize, ReadResult); + + auto ChunkResult = Sig.SearchAll(Buffer.get(), 0, ReadResult); + + for (auto& Result : ChunkResult) + ResultList.EmplaceBack(Result + DataRead + StartPosition); + + DataRead += ReadResult; + + if (ReadResult < ChunkSize) + break; + } + + return ResultList; + } + + List BinaryReader::SignatureScanAll(const string & Signature, uint64_t Offset, uint64_t Count) + { + if (!this->BaseStream) + IOError::StreamBaseStream(); + + uint64_t ReadResult = 0; + auto Sig = Data::Pattern(Signature); + this->BaseStream->SetPosition(Offset); + auto Buffer = this->Read(Count, ReadResult); + + auto ResultList = Sig.SearchAll(Buffer.get(), 0, ReadResult); + + for (auto& Result : ResultList) + Result += Offset; + + return ResultList; + } + + Stream* BinaryReader::GetBaseStream() const + { + return this->BaseStream.get(); + } + + void BinaryReader::Close() + { + // Forcefully reset the stream + if (this->_LeaveOpen) + this->BaseStream.release(); + else + this->BaseStream.reset(); + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/BinaryReader.h b/r5dev/thirdparty/cppnet/cppkore/BinaryReader.h new file mode 100644 index 00000000..69fe18cb --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/BinaryReader.h @@ -0,0 +1,72 @@ +#pragma once + +#include +#include "Stream.h" +#include "ListBase.h" +#include "StringBase.h" + +namespace IO +{ + // BinaryReader supports reading binary data streams + class BinaryReader + { + public: + BinaryReader(); + BinaryReader(std::unique_ptr Stream); + BinaryReader(std::unique_ptr Stream, bool LeaveOpen); + BinaryReader(Stream* Stream); + BinaryReader(Stream* Stream, bool LeaveOpen); + ~BinaryReader(); + + template + // Reads data of type T from the stream + T Read() const + { + if (!this->BaseStream) + IOError::StreamBaseStream(); + + T ResultValue{}; + this->BaseStream->Read((uint8_t*)&ResultValue, 0, sizeof(T)); + + return ResultValue; + } + + // Reads data from the stream + std::unique_ptr Read(uint64_t Count, uint64_t& Result); + // Reads data from the stream to the specified buffer + uint64_t Read(uint8_t* Buffer, uint64_t Index, uint64_t Count); + // Reads data from the stream to the specified buffer + uint64_t Read(void* Buffer, uint64_t Index, uint64_t Count); + + // Reads a null-terminated string from the stream + string ReadCString(); + // Reads a wide null-terminated string from the stream + wstring ReadWCString(); + // Reads a size-string from the stream + string ReadSizeString(uint64_t Size); + // Reads a .NET string from the stream + string ReadNetString(); + + // Reads an integer encoded into 7 bits, top bit = read more + uint32_t ReadVarInt(); + + // Scan the stream for a given signature + int64_t SignatureScan(const string& Signature); + // Scan the stream for a given signature + int64_t SignatureScan(const string& Signature, uint64_t Offset, uint64_t Count); + + // Scan the process for a given signature (All occurences) + List SignatureScanAll(const string& Signature); + // Scan the process for a given signature (All occurences) + List SignatureScanAll(const string& Signature, uint64_t Offset, uint64_t Count); + + // Get the underlying stream + Stream* GetBaseStream() const; + // Close the BinaryReader and underlying stream + void Close(); + + private: + std::unique_ptr BaseStream; + bool _LeaveOpen; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/BinaryWriter.cpp b/r5dev/thirdparty/cppnet/cppkore/BinaryWriter.cpp new file mode 100644 index 00000000..255af5dc --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/BinaryWriter.cpp @@ -0,0 +1,145 @@ +#include "stdafx.h" +#include "BinaryWriter.h" + +namespace IO +{ + BinaryWriter::BinaryWriter() + : BinaryWriter(nullptr, false) + { + } + + BinaryWriter::BinaryWriter(std::unique_ptr Stream) + : BinaryWriter(std::move(Stream), false) + { + } + + BinaryWriter::BinaryWriter(std::unique_ptr Stream, bool LeaveOpen) + { + this->BaseStream = std::move(Stream); + this->_LeaveOpen = LeaveOpen; + } + + BinaryWriter::BinaryWriter(Stream* Stream) + : BinaryWriter(Stream, false) + { + } + + BinaryWriter::BinaryWriter(Stream * Stream, bool LeaveOpen) + { + this->BaseStream.reset(Stream); + this->_LeaveOpen = LeaveOpen; + } + + BinaryWriter::~BinaryWriter() + { + this->Close(); + } + + void BinaryWriter::Write(std::unique_ptr& Buffer, uint64_t Count) + { + this->Write(Buffer.get(), 0, Count); + } + + void BinaryWriter::Write(uint8_t* Buffer, uint64_t Index, uint64_t Count) + { + if (!this->BaseStream) + IOError::StreamBaseStream(); + + this->BaseStream->Write(Buffer, Index, Count); + } + + void BinaryWriter::Write(void* Buffer, uint64_t Index, uint64_t Count) + { + if (!this->BaseStream) + IOError::StreamBaseStream(); + + this->BaseStream->Write((uint8_t*)Buffer, Index, Count); + } + + void BinaryWriter::WriteCString(const string& Value) + { + if (!this->BaseStream) + IOError::StreamBaseStream(); + + uint8_t NullBuffer = 0x0; + auto ValueLength = Value.Length(); + + this->BaseStream->Write((uint8_t*)Value.begin(), 0, ValueLength); + + if (ValueLength == 0 || Value[ValueLength - 1] != '\0') + this->BaseStream->Write(&NullBuffer, 0, 1); + } + + void BinaryWriter::WriteWCString(const wstring& Value) + { + if (!this->BaseStream) + IOError::StreamBaseStream(); + + uint16_t NullBuffer = 0x0; + auto ValueLength = Value.Length(); + + this->BaseStream->Write((uint8_t*)Value.begin(), 0, ValueLength * sizeof(wchar_t)); + + if (ValueLength == 0 || Value[ValueLength - 1] != (wchar_t)'\0') + this->BaseStream->Write((uint8_t*)&NullBuffer, 0, sizeof(uint16_t)); + } + + void BinaryWriter::WriteSizeString(const string& Value) + { + if (!this->BaseStream) + IOError::StreamBaseStream(); + + this->BaseStream->Write((uint8_t*)Value.begin(), 0, Value.Length()); + } + + void BinaryWriter::WriteNetString(const string& Value) + { + if (!this->BaseStream) + IOError::StreamBaseStream(); + + auto ValueSize = (uint32_t)Value.Length(); + this->WriteVarInt(ValueSize); + + this->BaseStream->Write((uint8_t*)Value.begin(), 0, ValueSize); + } + + void BinaryWriter::WriteVarInt(uint32_t Value) + { + // Write out 7 bits per byte, highest bit = keep reading + while (Value >= 0x80) + { + this->Write((uint8_t)(Value | 0x80)); + Value >>= 7; + } + + this->Write((uint8_t)Value); + } + + void BinaryWriter::Pad(uint64_t Count) + { + char Padding[0x1000]{}; + + while (Count > 0) + { + auto Want = (Count > 0x1000) ? 0x1000 : Count; + + Write(Padding, 0, Want); + + Count -= Want; + } + } + + Stream* BinaryWriter::GetBaseStream() const + { + return this->BaseStream.get(); + } + + void BinaryWriter::Close() + { + // Forcefully reset the stream + if (this->_LeaveOpen) + this->BaseStream.release(); + else + this->BaseStream.reset(); + } +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/BinaryWriter.h b/r5dev/thirdparty/cppnet/cppkore/BinaryWriter.h new file mode 100644 index 00000000..e4f1d48d --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/BinaryWriter.h @@ -0,0 +1,61 @@ +#pragma once + +#include +#include "Stream.h" +#include "StringBase.h" + +namespace IO +{ + // BinaryWriter supports writing to binary data streams + class BinaryWriter + { + public: + BinaryWriter(); + BinaryWriter(std::unique_ptr Stream); + BinaryWriter(std::unique_ptr Stream, bool LeaveOpen); + BinaryWriter(Stream* Stream); + BinaryWriter(Stream* Stream, bool LeaveOpen); + ~BinaryWriter(); + + template + // Writes data of type T to the stream + void Write(T Value) + { + if (!this->BaseStream) + IOError::StreamBaseStream(); + + this->BaseStream->Write((uint8_t*)&Value, 0, sizeof(T)); + } + + // Writes data to the stream + void Write(std::unique_ptr& Buffer, uint64_t Count); + // Writes data to the stream to the specified buffer + void Write(uint8_t* Buffer, uint64_t Index, uint64_t Count); + // Writes data to the stream to the specified buffer + void Write(void* Buffer, uint64_t Index, uint64_t Count); + + // Writes a null-terminated string to the stream + void WriteCString(const string& Value); + // Writes a wide null-terminated string to the stream + void WriteWCString(const wstring& Value); + // Writes a already predetermined size string to the stream + void WriteSizeString(const string& Value); + // Writes a .NET string to the stream + void WriteNetString(const string& Value); + + // Writes an integer encoded into 7 bits, top bit = read more + void WriteVarInt(uint32_t Value); + + // Writes padding bytes (0x0) to the stream + void Pad(uint64_t Count); + + // Get the underlying stream + Stream* GetBaseStream() const; + // Close the BinaryWriter and underlying stream + void Close(); + + private: + std::unique_ptr BaseStream; + bool _LeaveOpen; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Bone.cpp b/r5dev/thirdparty/cppnet/cppkore/Bone.cpp new file mode 100644 index 00000000..db0992be --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Bone.cpp @@ -0,0 +1,140 @@ +#include "stdafx.h" +#include "Bone.h" + +namespace Assets +{ + Bone::Bone() + : _Parent(-1), _Flags(BoneFlags::HasLocalSpaceMatrices), _LocalSpacePosition(0, 0, 0), _LocalSpaceRotation(0, 0, 0, 1), _GlobalSpacePosition(0, 0, 0), _GlobalSpaceRotation(0, 0, 0, 1), _Scale(1, 1, 1) + { + } + + Bone::Bone(const string& Name) + : Bone(Name, -1, { 0, 0, 0 }, { 0, 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 0, 1 }, { 1, 1, 1 }, BoneFlags::HasLocalSpaceMatrices) + { + } + + Bone::Bone(const string& Name, int32_t ParentIndex) + : Bone(Name, ParentIndex, { 0, 0, 0 }, { 0, 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 0, 1 }, { 1, 1, 1 }, BoneFlags::HasLocalSpaceMatrices) + { + } + + Bone::Bone(const string& Name, int32_t ParentIndex, Vector3 Position, Quaternion Rotation, BoneFlags Flags) + : Bone(Name, ParentIndex) + { + if (((int)Flags & (int)BoneFlags::HasLocalSpaceMatrices) == (int)BoneFlags::HasLocalSpaceMatrices) + { + this->_LocalSpacePosition = Position; + this->_LocalSpaceRotation = Rotation; + } + else + { + this->_GlobalSpacePosition = Position; + this->_GlobalSpaceRotation = Rotation; + } + + this->_Flags = Flags; + } + + Bone::Bone(const string & Name, int32_t ParentIndex, Vector3 Position, Quaternion Rotation, Vector3 Scale, BoneFlags Flags) + : Bone(Name, ParentIndex) + { + if (((int)Flags & (int)BoneFlags::HasLocalSpaceMatrices) == (int)BoneFlags::HasLocalSpaceMatrices) + { + this->_LocalSpacePosition = Position; + this->_LocalSpaceRotation = Rotation; + } + else + { + this->_GlobalSpacePosition = Position; + this->_GlobalSpaceRotation = Rotation; + } + + this->_Scale = Scale; + this->_Flags = Flags; + } + + Bone::Bone(const string& Name, int32_t ParentIndex, Vector3 LocalPosition, Quaternion LocalRotation, Vector3 GlobalPosition, Quaternion GlobalRotation, Vector3 Scale, BoneFlags Flags) + : _Name(Name), _Parent(ParentIndex), _LocalSpacePosition(LocalPosition), _LocalSpaceRotation(LocalRotation), _GlobalSpacePosition(GlobalPosition), _GlobalSpaceRotation(GlobalRotation), _Scale(Scale), _Flags(Flags) + { + } + + bool Bone::GetFlag(BoneFlags Flag) + { + return ((int)this->_Flags & (int)Flag) == (int)Flag; + } + + void Bone::SetFlag(BoneFlags Flags, bool Value) + { + this->_Flags = Value ? (BoneFlags)((int)this->_Flags | (int)Flags) : (BoneFlags)((int)this->_Flags & ~(int)Flags); + } + + const string& Bone::Name() const + { + return this->_Name; + } + + void Bone::SetName(const string& Value) + { + this->_Name = Value; + } + + const int32_t& Bone::Parent() const + { + return this->_Parent; + } + + void Bone::SetParent(int32_t Value) + { + this->_Parent = Value; + } + + const Vector3& Bone::LocalPosition() const + { + return this->_LocalSpacePosition; + } + + void Bone::SetLocalPosition(Vector3 Value) + { + this->_LocalSpacePosition = Value; + } + + const Quaternion& Bone::LocalRotation() const + { + return this->_LocalSpaceRotation; + } + + void Bone::SetLocalRotation(Quaternion Value) + { + this->_LocalSpaceRotation = Value; + } + + const Vector3& Bone::GlobalPosition() const + { + return this->_GlobalSpacePosition; + } + + void Bone::SetGlobalPosition(Vector3 Value) + { + this->_GlobalSpacePosition = Value; + } + + const Quaternion& Bone::GlobalRotation() const + { + return this->_GlobalSpaceRotation; + } + + void Bone::SetGlobalRotation(Quaternion Value) + { + this->_GlobalSpaceRotation = Value; + } + + const Vector3& Bone::Scale() const + { + return this->_Scale; + } + + void Bone::SetScale(Vector3 Value) + { + this->_Scale = Value; + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/Bone.h b/r5dev/thirdparty/cppnet/cppkore/Bone.h new file mode 100644 index 00000000..57ec4f26 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Bone.h @@ -0,0 +1,93 @@ +#pragma once + +#include +#include "StringBase.h" +#include "MathHelper.h" +#include "Vector3.h" +#include "Quaternion.h" +#include "BoneFlags.h" + +namespace Assets +{ + using namespace Math; // All of the matrices classes are in Math::* + + // A container class that holds 3D bone data. + class Bone + { + public: + // Initialize a blank 3D bone. + Bone(); + // Initialize a 3D bone with it's tag name. + Bone(const string& Name); + // Initialize a 3D bone with it's tag name, and parent index. + Bone(const string& Name, int32_t ParentIndex); + // Initialize a 3D bone with it's tag name, parent index, and transposition matrix. + Bone(const string& Name, int32_t ParentIndex, Vector3 Position, Quaternion Rotation, BoneFlags Flags = BoneFlags::HasLocalSpaceMatrices); + // Initialize a 3D bone with it's tag name, parent index, transposition matrix, and scale transform. + Bone(const string& Name, int32_t ParentIndex, Vector3 Position, Quaternion Rotation, Vector3 Scale, BoneFlags Flags = (BoneFlags::HasLocalSpaceMatrices | BoneFlags::HasScale)); + // Initialize a 3D bone with it's tag name, parent index, local and global transposition matrix, and scale transform. + Bone(const string& Name, int32_t ParentIndex, Vector3 LocalPosition, Quaternion LocalRotation, Vector3 GlobalPosition, Quaternion GlobalRotation, Vector3 Scale, BoneFlags Flags = (BoneFlags::HasGlobalSpaceMatrices | BoneFlags::HasLocalSpaceMatrices | BoneFlags::HasScale)); + // Destroy all 3D bone resources. + ~Bone() = default; + + // Ensure that our bone is not copied or assigned to for performance reasons. + Bone(const Bone&) = delete; + + // Gets bone specific flags. + bool GetFlag(BoneFlags Flag); + // Sets bone specific flags. + void SetFlag(BoneFlags Flags, bool Value); + + // Gets the tag name assigned to the bone. + const string& Name() const; + // Sets the tag name assigned to the bone. + void SetName(const string& Value); + + // Gets the parent bone index. + const int32_t& Parent() const; + // Sets the parent bone index. + void SetParent(int32_t Value); + + // Gets the local space position. + const Vector3& LocalPosition() const; + // Sets the local space position. + void SetLocalPosition(Vector3 Value); + + // Gets the local space rotation. + const Quaternion& LocalRotation() const; + // Sets the local space rotation. + void SetLocalRotation(Quaternion Value); + + // Gets the global space position. + const Vector3& GlobalPosition() const; + // Sets the global space position. + void SetGlobalPosition(Vector3 Value); + + // Gets the global space rotation. + const Quaternion& GlobalRotation() const; + // Sets the global space rotation. + void SetGlobalRotation(Quaternion Value); + + // Gets the scale transform. + const Vector3& Scale() const; + // Sets the scale transform. + void SetScale(Vector3 Value); + + private: + // Internal tag name + string _Name; + + // Internal parent index + int32_t _Parent; + + // Internal flags for this bone + BoneFlags _Flags; + + // Internal 3D matrix information for this bone + Vector3 _LocalSpacePosition; + Vector3 _GlobalSpacePosition; + Quaternion _LocalSpaceRotation; + Quaternion _GlobalSpaceRotation; + Vector3 _Scale; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/BoneFlags.h b/r5dev/thirdparty/cppnet/cppkore/BoneFlags.h new file mode 100644 index 00000000..cc6c4998 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/BoneFlags.h @@ -0,0 +1,26 @@ +#pragma once + +#include +#include + +namespace Assets +{ + // This enumeration represents the possible bone flags. + enum class BoneFlags : uint8_t + { + // Whether or not the bone has local space transforms + HasLocalSpaceMatrices = 0x1, + // Whether or not the bone has global space transforms + HasGlobalSpaceMatrices = 0x2, + // Whether or not the bone has a scale transform + HasScale = 0x4 + }; + + // + // Allow bitwise operations on this enumeration + // + constexpr BoneFlags operator|(BoneFlags Lhs, BoneFlags Rhs) + { + return static_cast(static_cast::type>(Lhs) | static_cast::type>(Rhs)); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/BorderStyle.h b/r5dev/thirdparty/cppnet/cppkore/BorderStyle.h new file mode 100644 index 00000000..0beb5785 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/BorderStyle.h @@ -0,0 +1,17 @@ +#pragma once + +#include + +namespace Forms +{ + // Specifies the border style for a control or form. + enum class BorderStyle + { + // No border. + None = 0, + // A single-line border. + FixedSingle = 1, + // A three-dimensional border. + Fixed3D = 2 + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/BoundsSpecified.h b/r5dev/thirdparty/cppnet/cppkore/BoundsSpecified.h new file mode 100644 index 00000000..299f59b3 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/BoundsSpecified.h @@ -0,0 +1,21 @@ +#pragma once + +#include +#include + +namespace Forms +{ + // Specifies the bounds of the control to + // use when defining a control's size and position. + enum class BoundsSpecified : uint32_t + { + X = 0x1, + Y = 0x2, + Width = 0x4, + Height = 0x8, + Location = X | Y, + Size = Width | Height, + All = Location | Size, + None = 0, + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/BufferedGraphics.cpp b/r5dev/thirdparty/cppnet/cppkore/BufferedGraphics.cpp new file mode 100644 index 00000000..3d3eefb1 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/BufferedGraphics.cpp @@ -0,0 +1,27 @@ +#include "stdafx.h" +#include "BufferedGraphics.h" + +namespace Drawing +{ + BufferedGraphics::BufferedGraphics(HDC TargetDC, Drawing::Rectangle TargetRectangle) + : _TargetDC(TargetDC), Rectangle(TargetRectangle) + { + this->Buffer = std::make_unique(TargetRectangle.Width, TargetRectangle.Height); + this->Graphics = std::make_unique(this->Buffer.get()); + } + + void BufferedGraphics::Render() + { + // Render the buffer to the target + auto Gfx = Gdiplus::Graphics::FromHDC(this->_TargetDC); + Gfx->DrawImage(this->Buffer.get(), this->Rectangle); + + // Clean up the graphics object + delete Gfx; + } + + Drawing::Rectangle BufferedGraphics::Region() + { + return Drawing::Rectangle(0, 0, this->Rectangle.Width, this->Rectangle.Height); + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/BufferedGraphics.h b/r5dev/thirdparty/cppnet/cppkore/BufferedGraphics.h new file mode 100644 index 00000000..2805bf1d --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/BufferedGraphics.h @@ -0,0 +1,32 @@ +#pragma once + +#include +#include "DrawingBase.h" + +namespace Drawing +{ + class BufferedGraphics + { + public: + BufferedGraphics(HDC TargetDC, Drawing::Rectangle TargetRectangle); + ~BufferedGraphics() = default; + + // Renders the buffered graphics to the target surface + void Render(); + + // Gets the size of the region + Drawing::Rectangle Region(); + + // The graphics instance for this instance + std::unique_ptr Graphics; + + private: + // Internal buffer to draw to + std::unique_ptr Buffer; + // Internal target handle + HDC _TargetDC; + + // Internal size of the buffer region + Drawing::Rectangle Rectangle; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Button.cpp b/r5dev/thirdparty/cppnet/cppkore/Button.cpp new file mode 100644 index 00000000..44ce3736 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Button.cpp @@ -0,0 +1,104 @@ +#include "stdafx.h" +#include "Button.h" +#include "Form.h" + +namespace Forms +{ + Button::Button() + : ButtonBase(), _DialogResult(DialogResult::None) + { + SetStyle(ControlStyles::StandardClick | ControlStyles::StandardDoubleClick, false); + + // We are a button control + this->_RTTI = ControlTypes::Button; + } + + DialogResult Button::GetDialogResult() + { + return this->_DialogResult; + } + + void Button::SetDialogResult(DialogResult Value) + { + this->_DialogResult = Value; + } + + void Button::PerformClick() + { + if (CanSelect()) + { + ResetFlagsAndPaint(); + OnClick(); + } + } + + void Button::NotifyDefault(bool Value) + { + if (IsDefault() != Value) + SetIsDefault(Value); + } + + void Button::OnClick() + { + auto Form = this->FindForm(); + + if (Form != nullptr) + ((Forms::Form*)Form)->SetDialogResult(this->_DialogResult); + + // Call base event last + ButtonBase::OnClick(); + } + + void Button::OnMouseUp(const std::unique_ptr& EventArgs) + { + if (EventArgs->Button == MouseButtons::Left && GetFlag(ButtonFlags::FlagMousePressed)) + { + auto isMouseDown = GetFlag(ButtonFlags::FlagMouseDown); + + if (GetStyle(ControlStyles::UserPaint)) + { + this->ResetFlagsAndPaint(); + } + + if (isMouseDown) + { + auto Pt = PointToScreen({ (INT)EventArgs->X, (INT)EventArgs->Y }); + + POINT nPt; + nPt.x = Pt.X; + nPt.y = Pt.Y; + + if (WindowFromPoint(nPt) == this->_Handle) + { + if (GetStyle(ControlStyles::UserPaint)) + OnClick(); + + OnMouseClick(EventArgs); + } + } + } + + // Call base event last + ButtonBase::OnMouseUp(EventArgs); + } + + CreateParams Button::GetCreateParams() + { + auto Cp = ButtonBase::GetCreateParams(); + + Cp.ClassName = "BUTTON"; + + if (GetStyle(ControlStyles::UserPaint)) + Cp.Style |= BS_OWNERDRAW; + else + { + Cp.Style |= BS_MULTILINE; + Cp.Style |= BS_PUSHBUTTON; + + if (this->IsDefault()) + Cp.Style |= BS_DEFPUSHBUTTON; + } + + return Cp; + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/Button.h b/r5dev/thirdparty/cppnet/cppkore/Button.h new file mode 100644 index 00000000..a3796de9 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Button.h @@ -0,0 +1,42 @@ +#pragma once + +#include +#include "Control.h" +#include "ButtonBase.h" +#include "DialogResult.h" + +namespace Forms +{ + // Represents a Windows button. + class Button : public ButtonBase + { + public: + Button(); + virtual ~Button() = default; + + // Gets a value that is returned to the + // parent form when the button is clicked. + DialogResult GetDialogResult(); + // Sets a value that is returned to the + // parent form when the button is clicked. + void SetDialogResult(DialogResult Value); + + // Generates a click event for a button. + void PerformClick(); + + // Changes the default action status. + void NotifyDefault(bool Value); + + // We must define base events here + virtual void OnClick(); + virtual void OnMouseUp(const std::unique_ptr& EventArgs); + + protected: + // Get custom control creation parameters for this instance. + virtual CreateParams GetCreateParams(); + + private: + // Internal cached dialog result that this button represents + DialogResult _DialogResult; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/ButtonBase.cpp b/r5dev/thirdparty/cppnet/cppkore/ButtonBase.cpp new file mode 100644 index 00000000..d2c00545 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ButtonBase.cpp @@ -0,0 +1,330 @@ +#include "stdafx.h" +#include "ButtonBase.h" + +namespace Forms +{ + ButtonBase::ButtonBase() + : Control(), _OwnerDraw(false), _Flags((ButtonFlags)0), _FlatStyle(FlatStyle::Standard), _TextAlign(Drawing::ContentAlignment::MiddleCenter) + { + SetStyle(ControlStyles::SupportsTransparentBackColor | + ControlStyles::Opaque | + ControlStyles::ResizeRedraw | + ControlStyles::OptimizedDoubleBuffer | + ControlStyles::CacheText | + ControlStyles::StandardClick, true); + + SetStyle(ControlStyles::UserMouse | + ControlStyles::UserPaint, this->_OwnerDraw); + } + + bool ButtonBase::OwnerDraw() + { + return this->_OwnerDraw; + } + + void ButtonBase::SetOwnerDraw(bool Value) + { + this->_OwnerDraw = Value; + + SetStyle(ControlStyles::UserMouse | ControlStyles::UserPaint, Value); + + UpdateStyles(); + Invalidate(); + } + + Drawing::ContentAlignment ButtonBase::TextAlign() + { + return this->_TextAlign; + } + + void ButtonBase::SetTextAlign(Drawing::ContentAlignment Value) + { + this->_TextAlign = Value; + + if (this->_OwnerDraw) + Invalidate(); + else + UpdateStyles(); + } + + FlatStyle ButtonBase::GetFlatStyle() + { + return this->_FlatStyle; + } + + void ButtonBase::SetFlatStyle(FlatStyle Value) + { + this->_FlatStyle = Value; + + Invalidate(); + + // Force update styles... + SetStyle(ControlStyles::UserMouse | ControlStyles::UserPaint, this->_OwnerDraw); + UpdateStyles(); + } + + bool ButtonBase::IsDefault() + { + return GetFlag(ButtonFlags::FlagIsDefault); + } + + void ButtonBase::SetIsDefault(bool Value) + { + if (IsDefault() != Value) + { + SetFlag(ButtonFlags::FlagIsDefault, Value); + + if (this->_OwnerDraw) + Invalidate(); + else + UpdateStyles(); + } + } + + bool ButtonBase::GetFlag(ButtonFlags Flag) + { + return ((int)this->_Flags & (int)Flag) == (int)Flag; + } + + void ButtonBase::SetFlag(ButtonFlags Flags, bool Value) + { + this->_Flags = Value ? (ButtonFlags)((int)this->_Flags | (int)Flags) : (ButtonFlags)((int)this->_Flags & ~(int)Flags); + } + + void ButtonBase::OnLostFocus() + { + Control::OnLostFocus(); + + // Hitting tab while holding down the space key + SetFlag(ButtonFlags::FlagMouseDown, false); + SetCapture(false); + + Invalidate(); + } + + void ButtonBase::OnGotFocus() + { + Control::OnGotFocus(); + Invalidate(); + } + + void ButtonBase::OnMouseEnter() + { + SetFlag(ButtonFlags::FlagMouseOver, true); + Invalidate(); + + // Call base event last + Control::OnMouseEnter(); + } + + void ButtonBase::OnMouseLeave() + { + SetFlag(ButtonFlags::FlagMouseOver, false); + Invalidate(); + + // Call base event last + Control::OnMouseLeave(); + } + + void ButtonBase::OnEnabledChanged() + { + Control::OnEnabledChanged(); + + if (!Enabled()) + { + SetFlag(ButtonFlags::FlagMouseDown | ButtonFlags::FlagMouseOver, false); + Invalidate(); + } + } + + void ButtonBase::OnTextChanged() + { + Control::OnTextChanged(); + Invalidate(); + } + + void ButtonBase::OnMouseMove(const std::unique_ptr& EventArgs) + { + if (EventArgs->Button != MouseButtons::None && GetFlag(ButtonFlags::FlagMousePressed)) + { + auto CRect = this->ClientRectangle(); + + if (!CRect.Contains(EventArgs->X, EventArgs->Y)) + { + if (GetFlag(ButtonFlags::FlagMouseDown)) + { + SetFlag(ButtonFlags::FlagMouseDown, false); + Invalidate(); + } + } + else + { + if (!GetFlag(ButtonFlags::FlagMouseDown)) + { + SetFlag(ButtonFlags::FlagMouseDown, true); + Invalidate(); + } + } + } + + // Call base event last + Control::OnMouseMove(EventArgs); + } + + void ButtonBase::OnMouseDown(const std::unique_ptr& EventArgs) + { + if (EventArgs->Button == MouseButtons::Left) + { + SetFlag(ButtonFlags::FlagMouseDown | ButtonFlags::FlagMousePressed, true); + Invalidate(); + } + + // Call base event last + Control::OnMouseDown(EventArgs); + } + + void ButtonBase::OnMouseUp(const std::unique_ptr& EventArgs) + { + // Call base event last + Control::OnMouseUp(EventArgs); + } + + void ButtonBase::OnKeyUp(const std::unique_ptr& EventArgs) + { + if (GetFlag(ButtonFlags::FlagMouseDown)) + { + if (this->_OwnerDraw) + ResetFlagsAndPaint(); + else + { + SetFlag(ButtonFlags::FlagMousePressed | ButtonFlags::FlagMouseDown, false); + SendMessageA(this->_Handle, BM_SETSTATE, 0, 0); + } + + if (EventArgs->KeyCode() == Keys::Enter || EventArgs->KeyCode() == Keys::Space) + OnClick(); + + EventArgs->SetHandled(true); + } + + // Call base event last + Control::OnKeyUp(EventArgs); + } + + void ButtonBase::OnKeyDown(const std::unique_ptr& EventArgs) + { + if (EventArgs->KeyData() == Keys::Space) + { + if (!GetFlag(ButtonFlags::FlagMouseDown)) + { + SetFlag(ButtonFlags::FlagMouseDown, true); + + if (!this->_OwnerDraw) + SendMessageA(this->_Handle, BM_SETSTATE, 1, 0); + + Invalidate(); + } + + EventArgs->SetHandled(true); + } + + // Call base event last + Control::OnKeyDown(EventArgs); + } + + void ButtonBase::WndProc(Message& Msg) + { + switch (Msg.Msg) + { + case BM_CLICK: + OnClick(); + return; + } + + if (this->_OwnerDraw) + { + switch (Msg.Msg) + { + case BM_SETSTATE: + break; + + case WM_KILLFOCUS: + case WM_CANCELMODE: + case WM_CAPTURECHANGED: + + if (!GetFlag(ButtonFlags::FlagInButtonUp) && GetFlag(ButtonFlags::FlagMousePressed)) + { + SetFlag(ButtonFlags::FlagMousePressed, false); + + if (GetFlag(ButtonFlags::FlagMouseDown)) + { + SetFlag(ButtonFlags::FlagMouseDown, false); + Invalidate(); + } + } + + Control::WndProc(Msg); + break; + + case WM_LBUTTONUP: + case WM_MBUTTONUP: + case WM_RBUTTONUP: + + SetFlag(ButtonFlags::FlagInButtonUp, true); + Control::WndProc(Msg); + SetFlag(ButtonFlags::FlagInButtonUp, false); + + break; + + default: + Control::WndProc(Msg); + break; + } + } + else + { + if (Msg.Msg == (WM_REFLECT + WM_COMMAND) && HIWORD(Msg.WParam) == BN_CLICKED) + OnClick(); + else + Control::WndProc(Msg); + } + } + + CreateParams ButtonBase::GetCreateParams() + { + auto Cp = Control::GetCreateParams(); + + if (!this->_OwnerDraw) + { + Cp.ExStyle &= ~WS_EX_RIGHT; // Messes up the BM_ Alignment flags + + Cp.Style |= BS_MULTILINE; + + if (IsDefault()) + Cp.Style |= BS_DEFPUSHBUTTON; + + if (((int)this->_TextAlign & (int)Drawing::AnyLeftAlign) != 0) + Cp.Style |= BS_LEFT; + else if (((int)this->_TextAlign & (int)Drawing::AnyRightAlign) != 0) + Cp.Style |= BS_RIGHT; + else + Cp.Style |= BS_CENTER; + + if (((int)this->_TextAlign & (int)Drawing::AnyTopAlign) != 0) + Cp.Style |= BS_TOP; + else if (((int)this->_TextAlign & (int)Drawing::AnyBottomAlign) != 0) + Cp.Style |= BS_BOTTOM; + else + Cp.Style |= BS_VCENTER; + } + + return Cp; + } + + void ButtonBase::ResetFlagsAndPaint() + { + SetFlag(ButtonFlags::FlagMousePressed | ButtonFlags::FlagMouseDown, false); + Invalidate(); + Update(); + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/ButtonBase.h b/r5dev/thirdparty/cppnet/cppkore/ButtonBase.h new file mode 100644 index 00000000..5763187c --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ButtonBase.h @@ -0,0 +1,76 @@ +#pragma once + +#include +#include "Control.h" +#include "FlatStyle.h" +#include "ButtonFlags.h" +#include "ContentAlignment.h" + +namespace Forms +{ + // Implements the basic functionality required by a button control. + class ButtonBase : public Control + { + public: + virtual ~ButtonBase() = default; + + // Gets the drawing mode of the button control. + bool OwnerDraw(); + // Sets the drawing mode of the button control. + void SetOwnerDraw(bool Value); + + // Gets the alignment of the text on the button control. + Drawing::ContentAlignment TextAlign(); + // Sets the alignment of the text on the button control. + void SetTextAlign(Drawing::ContentAlignment Value); + + // Gets the flat style appearance of the button control. + FlatStyle GetFlatStyle(); + // Sets the flat style appearance of the button control. + void SetFlatStyle(FlatStyle Value); + + // Get whether or not this control is the default response. + bool IsDefault(); + // Sets whether or not this control is the default response. + void SetIsDefault(bool Value); + + // We must define base events here + virtual void OnLostFocus(); + virtual void OnGotFocus(); + virtual void OnMouseEnter(); + virtual void OnMouseLeave(); + virtual void OnEnabledChanged(); + virtual void OnTextChanged(); + virtual void OnMouseMove(const std::unique_ptr& EventArgs); + virtual void OnMouseDown(const std::unique_ptr& EventArgs); + virtual void OnMouseUp(const std::unique_ptr& EventArgs); + virtual void OnKeyUp(const std::unique_ptr& EventArgs); + virtual void OnKeyDown(const std::unique_ptr& EventArgs); + + // Override WndProc for specific button messages. + virtual void WndProc(Message& Msg); + + protected: + ButtonBase(); + + // Get custom control creation parameters for this instance. + virtual CreateParams GetCreateParams(); + + // Used for quick re-painting of the button after the pressed state. + void ResetFlagsAndPaint(); + + // Gets button specific flags + bool GetFlag(ButtonFlags Flag); + // Sets button specific flags + void SetFlag(ButtonFlags Flags, bool Value); + + // Whether or not the control will draw itself + bool _OwnerDraw; + // Control specific flags + ButtonFlags _Flags; + // Controls the style of the control + FlatStyle _FlatStyle; + // Controls the alignment of text on the control + Drawing::ContentAlignment _TextAlign; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/ButtonFlags.h b/r5dev/thirdparty/cppnet/cppkore/ButtonFlags.h new file mode 100644 index 00000000..71418b5c --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ButtonFlags.h @@ -0,0 +1,29 @@ +#pragma once + +#include +#include + +namespace Forms +{ + // This enumeration represents the ButtonBase flags... + enum class ButtonFlags + { + FlagMouseOver = 0x0001, + FlagMouseDown = 0x0002, + FlagMousePressed = 0x0004, + FlagInButtonUp = 0x0008, + FlagCurrentlyAnimating = 0x0010, + FlagAutoEllipsis = 0x0020, + FlagIsDefault = 0x0040, + FlagUseMnemonic = 0x0080, + FlagShowToolTip = 0x0100, + }; + + // + // Allow bitwise operations on this enumeration + // + constexpr ButtonFlags operator|(ButtonFlags Lhs, ButtonFlags Rhs) + { + return static_cast(static_cast::type>(Lhs) | static_cast::type>(Rhs)); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/CRC32.cpp b/r5dev/thirdparty/cppnet/cppkore/CRC32.cpp new file mode 100644 index 00000000..e067c686 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/CRC32.cpp @@ -0,0 +1,69 @@ +#include "stdafx.h" +#include "CRC32.h" + +namespace Hashing +{ + // The table of precalculated CRC32 primes. + static constexpr uint32_t CRC32LookupTable[] = + { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, + 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, + 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, + 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, + 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, + 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, + 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c, + 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, + 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, + 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, + 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106, + 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, + 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, + 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, + 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, + 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, + 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, + 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, + 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, + 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, + 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, + 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84, + 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, + 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, + 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, + 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e, + 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, + 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, + 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28, + 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, + 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, + 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, + 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, + 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, + 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, + 0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, + 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, + 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, + 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, + 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d + }; + + uint32_t CRC32::HashString(const string& Input, uint32_t Seed) + { + return ComputeHash((uint8_t*)(char*)Input, 0, Input.Length(), Seed); + } + + uint32_t CRC32::ComputeHash(uint8_t* Input, uint64_t InputOffset, uint64_t InputLength, uint32_t Seed) + { + auto pCur = (uint8_t*)(Input + InputOffset); + + uint32_t _crc = ~Seed; + for (; InputLength--; ++pCur) + _crc = (_crc >> 8) ^ CRC32LookupTable[(_crc ^ *pCur) & 0xFF]; + + return (~_crc); + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/CRC32.h b/r5dev/thirdparty/cppnet/cppkore/CRC32.h new file mode 100644 index 00000000..560e3792 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/CRC32.h @@ -0,0 +1,26 @@ +#pragma once + +#include +#include "StringBase.h" + +namespace Hashing +{ + // A hashing algo that implements CRC32. + class CRC32 + { + public: + + // Computes the hash code of the integral value using CRC32 algo. + template + static uint32_t HashValue(Tinput Input, uint32_t Seed = 0) + { + return ComputeHash((uint8_t*)&Input, 0, sizeof(Tinput), Seed); + } + + // Computes the hash code of the input string using CRC32 algo. + static uint32_t HashString(const string& Input, uint32_t Seed = 0); + + // Computes the hash code using the CRC32 algo. + static uint32_t ComputeHash(uint8_t* Input, uint64_t InputOffset, uint64_t InputLength, uint32_t Seed = 0); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/CacheVirtualItemsEventArgs.cpp b/r5dev/thirdparty/cppnet/cppkore/CacheVirtualItemsEventArgs.cpp new file mode 100644 index 00000000..d03aaad0 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/CacheVirtualItemsEventArgs.cpp @@ -0,0 +1,10 @@ +#include "stdafx.h" +#include "CacheVirtualItemsEventArgs.h" + +namespace Forms +{ + CacheVirtualItemsEventArgs::CacheVirtualItemsEventArgs(int32_t Start, int32_t End) + : StartIndex(Start), EndIndex(End) + { + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/CacheVirtualItemsEventArgs.h b/r5dev/thirdparty/cppnet/cppkore/CacheVirtualItemsEventArgs.h new file mode 100644 index 00000000..3b6ca72c --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/CacheVirtualItemsEventArgs.h @@ -0,0 +1,19 @@ +#pragma once + +#include + +namespace Forms +{ + // Provides data for the CacheVirtualItems event. + class CacheVirtualItemsEventArgs + { + public: + CacheVirtualItemsEventArgs(int32_t Start, int32_t End); + ~CacheVirtualItemsEventArgs() = default; + + // The start of the cache index. + int32_t StartIndex; + // The end of the cache index. + int32_t EndIndex; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/CancelEventArgs.cpp b/r5dev/thirdparty/cppnet/cppkore/CancelEventArgs.cpp new file mode 100644 index 00000000..668e4ea0 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/CancelEventArgs.cpp @@ -0,0 +1,15 @@ +#include "stdafx.h" +#include "CancelEventArgs.h" + +namespace Forms +{ + CancelEventArgs::CancelEventArgs() + : CancelEventArgs(false) + { + } + + CancelEventArgs::CancelEventArgs(bool Cancel) + : Cancel(Cancel) + { + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/CancelEventArgs.h b/r5dev/thirdparty/cppnet/cppkore/CancelEventArgs.h new file mode 100644 index 00000000..91b1f9fa --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/CancelEventArgs.h @@ -0,0 +1,18 @@ +#pragma once + +#include + +namespace Forms +{ + // Provides data for the cancel event. + class CancelEventArgs + { + public: + CancelEventArgs(); + CancelEventArgs(bool Cancel); + ~CancelEventArgs() = default; + + // Gets or sets a value indicating whether the operation should be cancelled. + bool Cancel; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/CastAsset.cpp b/r5dev/thirdparty/cppnet/cppkore/CastAsset.cpp new file mode 100644 index 00000000..9cefd774 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/CastAsset.cpp @@ -0,0 +1,402 @@ +#include "stdafx.h" +#include "CastAsset.h" +#include "CastNode.h" +#include "File.h" +#include "XXHash.h" +#include "BinaryWriter.h" + +namespace Assets::Exporters +{ + struct CastHeader + { + uint32_t Magic; // char[4] cast (0x74736163) + uint32_t Version; // 0x1 + uint32_t RootNodes; // Number of root nodes, which contain various sub nodes if necessary + uint32_t Flags; // Reserved for flags, or padding, whichever is needed + }; + + static_assert(sizeof(CastHeader) == 0x10, "Cast header size mismatch"); + + + bool CastAsset::ExportAnimation(const Animation& Animation, const string& Path) + { + auto Writer = IO::BinaryWriter(IO::File::Create(Path)); + + // Magic, version 1, one root node, no flags. + Writer.Write({ 0x74736163, 0x1, 0x1, 0x0 }); + + // This is the base of the virtual scene + auto Root = CastNode(CastId::Root); + auto& AnimNode = Root.Children.Emplace(CastId::Animation, Hashing::XXHash::HashString("animation")); + auto& SkeletonNode = AnimNode.Children.Emplace(CastId::Skeleton, Hashing::XXHash::HashString("skeleton")); + + AnimNode.Properties.Emplace(CastPropertyId::Float, "fr").AddFloat(Animation.FrameRate); + AnimNode.Properties.Emplace(CastPropertyId::Byte, "lo").AddByte((uint8_t)Animation.Looping); + + for (auto& Bone : Animation.Bones) + { + auto& BoneNode = SkeletonNode.Children.Emplace(CastId::Bone); + + BoneNode.Properties.Emplace(CastPropertyId::String, "n").SetString(Bone.Name()); + BoneNode.Properties.Emplace(CastPropertyId::Integer32, "p").AddInteger32(Bone.Parent()); + + if (Bone.GetFlag(Assets::BoneFlags::HasLocalSpaceMatrices)) + { + BoneNode.Properties.Emplace(CastPropertyId::Vector3, "lp").AddVector3(Bone.LocalPosition()); + BoneNode.Properties.Emplace(CastPropertyId::Vector4, "lr").AddVector4(Bone.LocalRotation()); + } + if (Bone.GetFlag(Assets::BoneFlags::HasGlobalSpaceMatrices)) + { + BoneNode.Properties.Emplace(CastPropertyId::Vector3, "wp").AddVector3(Bone.GlobalPosition()); + BoneNode.Properties.Emplace(CastPropertyId::Vector4, "wr").AddVector4(Bone.GlobalRotation()); + } + if (Bone.GetFlag(Assets::BoneFlags::HasScale)) + { + BoneNode.Properties.Emplace(CastPropertyId::Vector3, "s").AddVector3(Bone.Scale()); + } + } + + for (auto& Kvp : Animation.Curves) + { + for (auto& Curve : Kvp.Value()) + { + auto& CurveNode = AnimNode.Children.Emplace(CastId::Curve, 0); + + CurveNode.Properties.Emplace(CastPropertyId::String, "nn").SetString(Curve.Name); + + constexpr const char* PropertyNameMap[] = { + "ex", + "rq", + "rx", + "ry", + "rz", + "tx", + "ty", + "tz", + "sx", + "sy", + "sz", + "vb" + }; + + constexpr const char* ModeNameMap[] = { + "absolute", + "additive", + "relative" + }; + + CurveNode.Properties.Emplace(CastPropertyId::String, "kp").SetString(PropertyNameMap[(uint32_t)Curve.Property]); + CurveNode.Properties.Emplace(CastPropertyId::String, "m").SetString(ModeNameMap[(uint32_t)Curve.Mode]); + + auto KeyframeValueProperty = CastPropertyId::Float; + + switch (Curve.Property) + { + case CurveProperty::RotateQuaternion: + KeyframeValueProperty = CastPropertyId::Vector4; + break; + + case CurveProperty::RotateX: + case CurveProperty::RotateY: + case CurveProperty::RotateZ: + case CurveProperty::TranslateX: + case CurveProperty::TranslateY: + case CurveProperty::TranslateZ: + case CurveProperty::ScaleX: + case CurveProperty::ScaleY: + case CurveProperty::ScaleZ: + KeyframeValueProperty = CastPropertyId::Float; + break; + + case CurveProperty::Visibility: + KeyframeValueProperty = CastPropertyId::Byte; + break; + } + + auto KeyframeFrameProperty = CastPropertyId::Float; + + if (Curve.IsFrameIntegral()) + { + uint32_t LargestFrameIndex = 0; + for (auto& KeyFrame : Curve.Keyframes) + LargestFrameIndex = max(LargestFrameIndex, KeyFrame.Frame.Integer32); + + if (LargestFrameIndex <= 0xFF) + KeyframeFrameProperty = CastPropertyId::Byte; + else if (LargestFrameIndex <= 0xFFFF) + KeyframeFrameProperty = CastPropertyId::Short; + else + KeyframeFrameProperty = CastPropertyId::Integer32; + } + + auto& KeyFrameBuffer = CurveNode.Properties.Emplace(KeyframeFrameProperty, "kb"); + auto& KeyValueBuffer = CurveNode.Properties.Emplace(KeyframeValueProperty, "kv"); + + for (auto& KeyFrame : Curve.Keyframes) + { + switch (KeyframeFrameProperty) + { + case CastPropertyId::Float: + KeyFrameBuffer.AddFloat(KeyFrame.Frame.Float); + break; + case CastPropertyId::Byte: + KeyFrameBuffer.AddByte((uint8_t)KeyFrame.Frame.Integer32); + break; + case CastPropertyId::Short: + KeyFrameBuffer.AddShort((uint16_t)KeyFrame.Frame.Integer32); + break; + case CastPropertyId::Integer32: + KeyFrameBuffer.AddInteger32(KeyFrame.Frame.Integer32); + break; + } + + switch (Curve.Property) + { + case CurveProperty::RotateQuaternion: + KeyValueBuffer.AddVector4(KeyFrame.Value.Vector4); + break; + + case CurveProperty::RotateX: + case CurveProperty::RotateY: + case CurveProperty::RotateZ: + case CurveProperty::TranslateX: + case CurveProperty::TranslateY: + case CurveProperty::TranslateZ: + case CurveProperty::ScaleX: + case CurveProperty::ScaleY: + case CurveProperty::ScaleZ: + KeyValueBuffer.AddFloat(KeyFrame.Value.Float); + break; + + case CurveProperty::Visibility: + KeyValueBuffer.AddByte(KeyFrame.Value.Byte); + break; + } + } + } + } + + for (auto& Notetrack : Animation.Notificiations) + { + auto& TrackNode = AnimNode.Children.Emplace(CastId::NotificationTrack, Hashing::XXHash::HashString(Notetrack.Key())); + + TrackNode.Properties.Emplace(CastPropertyId::String, "n").SetString(Notetrack.Key()); + + auto& KeyBuffer = TrackNode.Properties.Emplace(CastPropertyId::Integer32, "kb"); + + for (auto& Key : Notetrack.Value()) + KeyBuffer.AddInteger32(Key); + } + + // Finally, serialize the node to the disk + Root.Write(Writer); + + return true; + } + + bool CastAsset::ExportModel(const Model& Model, const string& Path) + { + auto Writer = IO::BinaryWriter(IO::File::Create(Path)); + + // Magic, version 1, one root node, no flags. + Writer.Write({ 0x74736163, 0x1, 0x1, 0x0 }); + + // This is the base of the virtual scene + auto Root = CastNode(CastId::Root); + auto& ModelNode = Root.Children.Emplace(CastId::Model, Hashing::XXHash::HashString("model")); + auto& SkeletonNode = ModelNode.Children.Emplace(CastId::Skeleton, Hashing::XXHash::HashString("skeleton")); + + auto BoneCount = Model.Bones.Count(); + + for (auto& Bone : Model.Bones) + { + auto& BoneNode = SkeletonNode.Children.Emplace(CastId::Bone); + + BoneNode.Properties.Emplace(CastPropertyId::String, "n").SetString(Bone.Name()); + BoneNode.Properties.Emplace(CastPropertyId::Integer32, "p").AddInteger32(Bone.Parent()); + + if (Bone.GetFlag(Assets::BoneFlags::HasLocalSpaceMatrices)) + { + BoneNode.Properties.Emplace(CastPropertyId::Vector3, "lp").AddVector3(Bone.LocalPosition()); + BoneNode.Properties.Emplace(CastPropertyId::Vector4, "lr").AddVector4(Bone.LocalRotation()); + } + if (Bone.GetFlag(Assets::BoneFlags::HasGlobalSpaceMatrices)) + { + BoneNode.Properties.Emplace(CastPropertyId::Vector3, "wp").AddVector3(Bone.GlobalPosition()); + BoneNode.Properties.Emplace(CastPropertyId::Vector4, "wr").AddVector4(Bone.GlobalRotation()); + } + if (Bone.GetFlag(Assets::BoneFlags::HasScale)) + { + BoneNode.Properties.Emplace(CastPropertyId::Vector3, "s").AddVector3(Bone.Scale()); + } + } + + Dictionary MaterialHashMap; + uint32_t MaterialIndex = 0; + + for (auto& Mat : Model.Materials) + { + auto& MatNode = ModelNode.Children.Emplace(CastId::Material, Hashing::XXHash::HashString(Mat.Name)); + + MatNode.Properties.Emplace(CastPropertyId::String, "n").SetString(Mat.Name); + MatNode.Properties.Emplace(CastPropertyId::String, "t").SetString("pbr"); + + for (auto& Kvp : Mat.Slots) + { + auto FileHash = Hashing::XXHash::HashString(Kvp.second.first); + MatNode.Children.Emplace(CastId::File, FileHash).Properties.Emplace(CastPropertyId::String, "p").SetString(Kvp.second.first); + + // Cast material property mapping + constexpr const char* MaterialSlotNames[] = + { + "extra", // Invalid + "albedo", + "diffuse", + "normal", + "specular", + "emissive", + "gloss", + "roughness", + "ao", + "cavity" + }; + + MatNode.Properties.Emplace(CastPropertyId::Integer64, MaterialSlotNames[(uint32_t)Kvp.first]).AddInteger64(FileHash); + } + + MaterialHashMap.Add(MaterialIndex++, MatNode.Hash); + } + + uint32_t MeshIndex = 0; + + for (auto& Mesh : Model.Meshes) + { + auto& MeshNode = ModelNode.Children.Emplace(CastId::Mesh, Hashing::XXHash::HashString(string::Format("mesh%02d", MeshIndex++))); + + MeshNode.Properties.EmplaceBack(CastPropertyId::Vector3, "vp"); + MeshNode.Properties.EmplaceBack(CastPropertyId::Vector3, "vn"); + MeshNode.Properties.EmplaceBack(CastPropertyId::Integer32, "vc"); + + auto VertexCount = Mesh.Vertices.Count(); + + if (VertexCount <= 0xFF) + MeshNode.Properties.EmplaceBack(CastPropertyId::Byte, "f"); + else if (VertexCount <= 0xFFFF) + MeshNode.Properties.EmplaceBack(CastPropertyId::Short, "f"); + else + MeshNode.Properties.EmplaceBack(CastPropertyId::Integer32, "f"); + + // Configure the uv layer count, and maximum influence + MeshNode.Properties.Emplace(CastPropertyId::Byte, "ul").AddByte((uint8_t)Mesh.Vertices.UVLayerCount()); + MeshNode.Properties.Emplace(CastPropertyId::Byte, "mi").AddByte((uint8_t)Mesh.Vertices.WeightCount()); + + if (BoneCount <= 0xFF) + MeshNode.Properties.Emplace(CastPropertyId::Byte, "wb"); + else if (BoneCount <= 0xFFFF) + MeshNode.Properties.Emplace(CastPropertyId::Short, "wb"); + else + MeshNode.Properties.Emplace(CastPropertyId::Integer32, "wb"); + + MeshNode.Properties.Emplace(CastPropertyId::Float, "wv"); + + List UVLayers; + + for (uint8_t i = 0; i < Mesh.Vertices.UVLayerCount(); i++) + MeshNode.Properties.EmplaceBack(CastPropertyId::Vector2, string::Format("u%d", i)); + + auto& VertexPositions = MeshNode.Properties[0]; + auto& VertexNormals = MeshNode.Properties[1]; + auto& VertexColors = MeshNode.Properties[2]; + auto& FaceIndices = MeshNode.Properties[3]; + auto& VertexWeightBones = MeshNode.Properties[6]; + auto& VertexWeightValues = MeshNode.Properties[7]; + + for (auto& Layer : MeshNode.Properties) + { + if (Layer.Name != "ul" && Layer.Name.StartsWith("u")) + UVLayers.Add(&Layer); + } + + for (auto& Vertex : Mesh.Vertices) + { + VertexPositions.AddVector3(Vertex.Position()); + VertexNormals.AddVector3(Vertex.Normal()); + VertexColors.AddInteger32(*(uint32_t*)&Vertex.Color()); + + for (uint8_t i = 0; i < Mesh.Vertices.WeightCount(); i++) + { + if (BoneCount <= 0xFF) + VertexWeightBones.AddByte((uint8_t)Vertex.Weights(i).Bone); + else if (BoneCount <= 0xFFFF) + VertexWeightBones.AddShort((uint16_t)Vertex.Weights(i).Bone); + else + VertexWeightBones.AddInteger32(Vertex.Weights(i).Bone); + + VertexWeightValues.AddFloat(Vertex.Weights(i).Value); + } + + for (uint8_t i = 0; i < Mesh.Vertices.UVLayerCount(); i++) + { + UVLayers[i]->AddVector2(Vertex.UVLayers(i)); + } + } + + for (auto& Face : Mesh.Faces) + { + if (VertexCount <= 0xFF) + { + FaceIndices.AddByte((uint8_t)Face[2]); + FaceIndices.AddByte((uint8_t)Face[1]); + FaceIndices.AddByte((uint8_t)Face[0]); + } + else if (VertexCount <= 0xFFFF) + { + FaceIndices.AddShort((uint16_t)Face[2]); + FaceIndices.AddShort((uint16_t)Face[1]); + FaceIndices.AddShort((uint16_t)Face[0]); + } + else + { + FaceIndices.AddInteger32(Face[2]); + FaceIndices.AddInteger32(Face[1]); + FaceIndices.AddInteger32(Face[0]); + } + } + + if (Mesh.MaterialIndices.Count() > 0 && Mesh.MaterialIndices[0] > -1) + { + MeshNode.Properties.Emplace(CastPropertyId::Integer64, "m").AddInteger64(MaterialHashMap[Mesh.MaterialIndices[0]]); + } + } + + // Finally, serialize the node to the disk + Root.Write(Writer); + + return true; + } + + imstring CastAsset::ModelExtension() + { + return ".cast"; + } + + imstring CastAsset::AnimationExtension() + { + return ".cast"; + } + + ExporterScale CastAsset::ExportScale() + { + return ExporterScale::Default; + } + + bool CastAsset::SupportsAnimations() + { + return true; + } + + bool CastAsset::SupportsModels() + { + return true; + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/CastAsset.h b/r5dev/thirdparty/cppnet/cppkore/CastAsset.h new file mode 100644 index 00000000..28417145 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/CastAsset.h @@ -0,0 +1,32 @@ +#pragma once + +#include +#include "Exporter.h" + +namespace Assets::Exporters +{ + class CastAsset : public Exporter + { + public: + CastAsset() = default; + ~CastAsset() = default; + + // Exports the given animation to the provided path. + virtual bool ExportAnimation(const Animation& Animation, const string& Path); + // Exports the given model to the provided path. + virtual bool ExportModel(const Model& Model, const string& Path); + + // Gets the file extension for this exporters model format. + virtual imstring ModelExtension(); + // Gets the file extension for this exporters animation format. + virtual imstring AnimationExtension(); + + // Gets the required scaling constant for this exporter. + virtual ExporterScale ExportScale(); + + // Gets whether or not the exporter supports animation exporting. + virtual bool SupportsAnimations(); + // Gets whether or not the exporter supports model exporting. + virtual bool SupportsModels(); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/CastNode.cpp b/r5dev/thirdparty/cppnet/cppkore/CastNode.cpp new file mode 100644 index 00000000..6902298d --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/CastNode.cpp @@ -0,0 +1,222 @@ +#include "stdafx.h" +#include "CastNode.h" + +namespace Assets::Exporters +{ + CastProperty::CastProperty() + : Identifier(CastPropertyId::Byte) + { + } + + CastProperty::CastProperty(CastPropertyId Id, const char* Name) + : Identifier(Id), Name(Name) + { + // All property names are lower-case + this->Name = this->Name.ToLower(); + } + + const uint32_t CastProperty::Length() const + { + switch (this->Identifier) + { + case CastPropertyId::Byte: return sizeof(CastPropertyHeader) + this->Name.Length() + (sizeof(uint8_t) * this->IntegralValues.Count()); + case CastPropertyId::Short: return sizeof(CastPropertyHeader) + this->Name.Length() + (sizeof(uint16_t) * this->IntegralValues.Count()); + case CastPropertyId::Integer32: return sizeof(CastPropertyHeader) + this->Name.Length() + (sizeof(uint32_t) * this->IntegralValues.Count()); + case CastPropertyId::Integer64: return sizeof(CastPropertyHeader) + this->Name.Length() + (sizeof(uint64_t) * this->IntegralValues.Count()); + case CastPropertyId::Float: return sizeof(CastPropertyHeader) + this->Name.Length() + (sizeof(float) * this->IntegralValues.Count()); + case CastPropertyId::Double: return sizeof(CastPropertyHeader) + this->Name.Length() + (sizeof(double) * this->IntegralValues.Count()); + case CastPropertyId::Vector2 : return sizeof(CastPropertyHeader) + this->Name.Length() + (sizeof(Math::Vector2) * this->IntegralValues.Count()); + case CastPropertyId::Vector3: return sizeof(CastPropertyHeader) + this->Name.Length() + (sizeof(Math::Vector3) * this->IntegralValues.Count()); + case CastPropertyId::Vector4: return sizeof(CastPropertyHeader) + this->Name.Length() + (sizeof(Math::Quaternion) * this->IntegralValues.Count()); + case CastPropertyId::String: return sizeof(CastPropertyHeader) + this->Name.Length() + (StringValue.Length() + sizeof(uint8_t)); + default: return 0; + } + } + + void CastProperty::Write(IO::BinaryWriter& Writer) const + { + auto Size = (this->Identifier == CastPropertyId::String) ? 1 : this->IntegralValues.Count(); + Writer.Write({this->Identifier, (uint16_t)this->Name.Length(), Size}); + Writer.Write(&this->Name[0], 0, this->Name.Length()); + + switch (this->Identifier) + { + case CastPropertyId::Byte: + for (auto& Value : this->IntegralValues) + Writer.Write(Value.Byte); + break; + case CastPropertyId::Short: + for (auto& Value : this->IntegralValues) + Writer.Write(Value.Short); + break; + case CastPropertyId::Integer32: + for (auto& Value : this->IntegralValues) + Writer.Write(Value.Integer32); + break; + case CastPropertyId::Integer64: + for (auto& Value : this->IntegralValues) + Writer.Write(Value.Integer64); + break; + case CastPropertyId::Float: + for (auto& Value : this->IntegralValues) + Writer.Write(Value.Float); + break; + case CastPropertyId::Double: + for (auto& Value : this->IntegralValues) + Writer.Write(Value.Double); + break; + case CastPropertyId::Vector2: + for (auto& Value : this->IntegralValues) + Writer.Write(Value.Vector2); + break; + case CastPropertyId::Vector3: + for (auto& Value : this->IntegralValues) + Writer.Write(Value.Vector3); + break; + case CastPropertyId::Vector4: + for (auto& Value : this->IntegralValues) + Writer.Write(Value.Vector4); + break; + case CastPropertyId::String: + Writer.WriteCString(this->StringValue); + break; + } + } + + void CastProperty::AddByte(uint8_t Value) + { + this->IntegralValues.EmplaceBack(Value); + } + + void CastProperty::AddShort(uint16_t Value) + { + this->IntegralValues.EmplaceBack(Value); + } + + void CastProperty::AddInteger32(uint32_t Value) + { + this->IntegralValues.EmplaceBack(Value); + } + + void CastProperty::AddInteger64(uint64_t Value) + { + this->IntegralValues.EmplaceBack(Value); + } + + void CastProperty::AddFloat(float Value) + { + this->IntegralValues.EmplaceBack(Value); + } + + void CastProperty::AddDouble(double Value) + { + this->IntegralValues.EmplaceBack(Value); + } + + void CastProperty::AddVector2(Math::Vector2 Value) + { + this->IntegralValues.EmplaceBack(Value); + } + + void CastProperty::AddVector3(Math::Vector3 Value) + { + this->IntegralValues.EmplaceBack(Value); + } + + void CastProperty::AddVector4(Math::Quaternion Value) + { + this->IntegralValues.EmplaceBack(Value); + } + + void CastProperty::SetString(const string& Value) + { + this->StringValue = Value; + } + + CastNode::CastNode() + : Identifier(CastId::Root), Hash(0) + { + } + + CastNode::CastNode(CastId Id) + : Identifier(Id), Hash(0) + { + } + + CastNode::CastNode(CastId Id, uint64_t Hash) + : Identifier(Id), Hash(Hash) + { + } + + const uint32_t CastNode::Length() const + { + uint32_t Result = sizeof(CastNodeHeader); + + for (auto& Child : this->Children) + Result += Child.Length(); + for (auto& Property : this->Properties) + Result += Property.Length(); + + return Result; + } + + void CastNode::Write(IO::BinaryWriter& Writer) const + { + Writer.Write({this->Identifier, this->Length(), this->Hash, this->Properties.Count(), this->Children.Count()}); + + for (auto& Prop : Properties) + Prop.Write(Writer); + for (auto& Child : Children) + Child.Write(Writer); + } + + CastPropertyUnion::CastPropertyUnion() + : Vector4(0,0,0,0) + { + } + + CastPropertyUnion::CastPropertyUnion(uint8_t Value) + : Byte(Value) + { + } + + CastPropertyUnion::CastPropertyUnion(uint16_t Value) + : Short(Value) + { + } + + CastPropertyUnion::CastPropertyUnion(uint32_t Value) + : Integer32(Value) + { + } + + CastPropertyUnion::CastPropertyUnion(uint64_t Value) + : Integer64(Value) + { + } + + CastPropertyUnion::CastPropertyUnion(float Value) + : Float(Value) + { + } + + CastPropertyUnion::CastPropertyUnion(double Value) + : Double(Value) + { + } + + CastPropertyUnion::CastPropertyUnion(Math::Vector2 Value) + : Vector2(Value) + { + } + + CastPropertyUnion::CastPropertyUnion(Math::Vector3 Value) + : Vector3(Value) + { + } + + CastPropertyUnion::CastPropertyUnion(Math::Quaternion Value) + : Vector4(Value) + { + } +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/CastNode.h b/r5dev/thirdparty/cppnet/cppkore/CastNode.h new file mode 100644 index 00000000..522741d1 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/CastNode.h @@ -0,0 +1,146 @@ +#pragma once + +#include +#include "Vector2.h" +#include "Vector3.h" +#include "Quaternion.h" +#include "StringBase.h" +#include "ListBase.h" +#include "BinaryWriter.h" + +namespace Assets::Exporters +{ + enum class CastId : uint32_t + { + Root = 0x746F6F72, + Model = 0x6C646F6D, + Mesh = 0x6873656D, + Skeleton = 0x6C656B73, + Bone = 0x656E6F62, + Animation = 0x6D696E61, + Curve = 0x76727563, + NotificationTrack = 0x6669746E, + Material = 0x6C74616D, + File = 0x656C6966, + }; + + enum class CastPropertyId : uint16_t + { + Byte = 'b', // + Short = 'h', // + Integer32 = 'i', // + Integer64 = 'l', // + + Float = 'f', // + Double = 'd', // + + String = 's', // Null terminated UTF-8 string + + Vector2 = 'v2', // Float precision vector XY + Vector3 = 'v3', // Float precision vector XYZ + Vector4 = 'v4' // Float precision vector XYZW + }; + + struct CastNodeHeader + { + CastId Identifier; // Used to signify which class this node uses + uint32_t NodeSize; // Size of all data and sub data following the node + uint64_t NodeHash; // Unique hash, like an id, used to link nodes together + uint32_t PropertyCount; // The count of properties + uint32_t ChildCount; // The count of direct children nodes + + // We must read until the node size hits, and that means we are done. + // The nodes are in a stack layout, so it's easy to load, FILO order. + }; + + struct CastPropertyHeader + { + CastPropertyId Identifier; // The element type of this property + uint16_t NameSize; // The size of the name of this property + uint32_t ArrayLength; // The number of elements this property contains (1 for single) + + // Following is UTF-8 string lowercase, size of namesize, NOT null terminated + // cast_property[ArrayLength] array of data + }; + + union CastPropertyUnion + { + uint8_t Byte; + uint16_t Short; + uint32_t Integer32; + uint64_t Integer64; + + float Float; + double Double; + + Math::Vector2 Vector2; + Math::Vector3 Vector3; + Math::Quaternion Vector4; + + CastPropertyUnion(); + + explicit CastPropertyUnion(uint8_t Value); + explicit CastPropertyUnion(uint16_t Value); + explicit CastPropertyUnion(uint32_t Value); + explicit CastPropertyUnion(uint64_t Value); + explicit CastPropertyUnion(float Value); + explicit CastPropertyUnion(double Value); + explicit CastPropertyUnion(Math::Vector2 Value); + explicit CastPropertyUnion(Math::Vector3 Value); + explicit CastPropertyUnion(Math::Quaternion Value); + }; + + static_assert(sizeof(CastNodeHeader) == 0x18, "CastNode header size mismatch"); + static_assert(sizeof(CastPropertyHeader) == 0x8, "CastProperty header size mismatch"); + static_assert(sizeof(CastPropertyUnion) == 0x10, "CastProperty union size mismatch"); + + class CastProperty + { + public: + CastProperty(); + explicit CastProperty(CastPropertyId Id, const char* Name); + + const uint32_t Length() const; + + void Write(IO::BinaryWriter& Writer) const; + + void AddByte(uint8_t Value); + void AddShort(uint16_t Value); + void AddInteger32(uint32_t Value); + void AddInteger64(uint64_t Value); + + void AddFloat(float Value); + void AddDouble(double Value); + + void AddVector2(Math::Vector2 Value); + void AddVector3(Math::Vector3 Value); + void AddVector4(Math::Quaternion Value); + + void SetString(const string& Value); + + CastPropertyId Identifier; + string Name; + + private: + List IntegralValues; + string StringValue; + }; + + class CastNode + { + public: + CastNode(); + CastNode(CastId Id); + CastNode(CastId Id, uint64_t Hash); + + const uint32_t Length() const; + + void Write(IO::BinaryWriter& Writer) const; + + CastId Identifier; + uint64_t Hash; + + List Properties; + List Children; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/CharacterCasing.h b/r5dev/thirdparty/cppnet/cppkore/CharacterCasing.h new file mode 100644 index 00000000..3e3e9292 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/CharacterCasing.h @@ -0,0 +1,17 @@ +#pragma once + +#include + +namespace Forms +{ + // Specifies the case of characters in a Textbox control. + enum class CharacterCasing + { + // The case of characters is left unchanged. + Normal = 0, + // Converts all characters to uppercase. + Upper = 1, + // Converts all characters to lowercase. + Lower = 2, + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/CheckBox.cpp b/r5dev/thirdparty/cppnet/cppkore/CheckBox.cpp new file mode 100644 index 00000000..76401cd5 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/CheckBox.cpp @@ -0,0 +1,188 @@ +#include "stdafx.h" +#include "CheckBox.h" + +namespace Forms +{ + CheckBox::CheckBox() + : ButtonBase(), _AutoCheck(true), _ThreeState(false), _Appearence(Appearence::Normal), _CheckState(CheckState::Unchecked) + { + SetStyle(ControlStyles::StandardClick | ControlStyles::StandardDoubleClick, false); + this->SetTextAlign(Drawing::ContentAlignment::MiddleLeft); + + // We are a checkbox control + this->_RTTI = ControlTypes::CheckBox; + } + + Appearence CheckBox::GetAppearence() + { + return this->_Appearence; + } + + void CheckBox::SetAppearence(Appearence Value) + { + if (this->_Appearence != Value) + { + this->_Appearence = Value; + + if (this->_OwnerDraw) + Refresh(); + else + UpdateStyles(); + + OnAppearenceChanged(); + } + } + + bool CheckBox::AutoCheck() + { + return this->_AutoCheck; + } + + void CheckBox::SetAutoCheck(bool Value) + { + this->_AutoCheck = Value; + } + + bool CheckBox::Checked() + { + return _CheckState != CheckState::Unchecked; + } + + void CheckBox::SetChecked(bool Value) + { + this->SetCheckState((Value) ? CheckState::Checked : CheckState::Unchecked); + } + + CheckState CheckBox::GetCheckState() + { + return _CheckState; + } + + void CheckBox::SetCheckState(CheckState Value) + { + if (_CheckState != Value) + { + bool oChecked = Checked(); + + _CheckState = Value; + + if (GetState(ControlStates::StateCreated)) + SendMessageA(this->_Handle, BM_SETCHECK, (int)_CheckState, 0); + + if (oChecked != Checked()) + { + OnCheckedChanged(); + } + + OnCheckStateChanged(); + } + } + + bool CheckBox::ThreeState() + { + return _ThreeState; + } + + void CheckBox::SetThreeState(bool Value) + { + _ThreeState = Value; + } + + void CheckBox::OnClick() + { + if (_AutoCheck) + { + switch (_CheckState) + { + case CheckState::Unchecked: + SetCheckState(CheckState::Checked); + break; + case CheckState::Checked: + if (_ThreeState) + SetCheckState(CheckState::Indeterminate); + else + SetCheckState(CheckState::Unchecked); + break; + default: + SetCheckState(CheckState::Unchecked); + break; + } + } + + // Call base event last + ButtonBase::OnClick(); + } + + void CheckBox::OnAppearenceChanged() + { + AppearenceChanged.RaiseEvent(this); + } + + void CheckBox::OnCheckedChanged() + { + CheckedChanged.RaiseEvent(this); + } + + void CheckBox::OnCheckStateChanged() + { + if (this->_OwnerDraw) + Refresh(); + + CheckStateChanged.RaiseEvent(this); + } + + void CheckBox::OnHandleCreated() + { + SendMessageA(this->_Handle, BM_SETCHECK, (int)_CheckState, NULL); + + // We must call base event last + Control::OnHandleCreated(); + } + + void CheckBox::OnMouseUp(const std::unique_ptr& EventArgs) + { + if (EventArgs->Button == MouseButtons::Left && GetFlag(ButtonFlags::FlagMousePressed)) + { + if (GetFlag(ButtonFlags::FlagMouseDown)) + { + auto Pt = PointToScreen({ (INT)EventArgs->X, (INT)EventArgs->Y }); + + POINT nPt; + nPt.x = Pt.X; + nPt.y = Pt.Y; + + if (WindowFromPoint(nPt) == this->_Handle) + { + ResetFlagsAndPaint(); + + if (this->Capture()) + OnClick(); + + OnMouseClick(EventArgs); + } + } + } + + // Call base event last + ButtonBase::OnMouseUp(EventArgs); + } + + CreateParams CheckBox::GetCreateParams() + { + auto Cp = ButtonBase::GetCreateParams(); + + Cp.ClassName = "BUTTON"; + + if (GetStyle(ControlStyles::UserPaint)) + Cp.Style |= BS_OWNERDRAW; + else + { + Cp.Style |= BS_3STATE; + + if (this->_Appearence == Appearence::Button) + Cp.Style |= BS_PUSHLIKE; + } + + return Cp; + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/CheckBox.h b/r5dev/thirdparty/cppnet/cppkore/CheckBox.h new file mode 100644 index 00000000..f6d0438b --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/CheckBox.h @@ -0,0 +1,72 @@ +#pragma once + +#include +#include "Control.h" +#include "Appearence.h" +#include "ButtonBase.h" +#include "CheckState.h" +#include "ContentAlignment.h" + +namespace Forms +{ + // Represents a Windows check box. + class CheckBox : public ButtonBase + { + public: + CheckBox(); + virtual ~CheckBox() = default; + + // Gets the value that determines the appearance of a check box control. + Appearence GetAppearence(); + // Sets the value that determines the appearance of a check box control. + void SetAppearence(Appearence Value); + + // Gets a value indicating whether the check box automatically checks itself. + bool AutoCheck(); + // Sets a value indicating whether the check box automatically checks itself. + void SetAutoCheck(bool Value); + + // Gets a value indicating whether the check box is checked. + bool Checked(); + // Sets a value indicating whether the check box is checked. + void SetChecked(bool Value); + + // Gets a value indicating whether the check box is checked. + CheckState GetCheckState(); + // Sets a value indicating whether the check box is checked. + void SetCheckState(CheckState Value); + + // Gets a value indicating whether the check box will allow three check states rather than two. + bool ThreeState(); + // Sets a value indicating whether the check box will allow three check states rather than two. + void SetThreeState(bool Value); + + // We must define base events here + virtual void OnClick(); + virtual void OnAppearenceChanged(); + virtual void OnCheckedChanged(); + virtual void OnCheckStateChanged(); + virtual void OnHandleCreated(); + virtual void OnMouseUp(const std::unique_ptr& EventArgs); + + // We must define event handlers here + EventBase AppearenceChanged; + EventBase CheckedChanged; + EventBase CheckStateChanged; + + protected: + // Get custom control creation parameters for this instance. + virtual CreateParams GetCreateParams(); + + private: + // Whether or not the control handles checking itself. + bool _AutoCheck; + // Whether or not the control handles three checked states. + bool _ThreeState; + + // The appearence of the control. + Appearence _Appearence; + // The checked state of the control. + CheckState _CheckState; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/CheckBoxImage.h b/r5dev/thirdparty/cppnet/cppkore/CheckBoxImage.h new file mode 100644 index 00000000..40763ac1 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/CheckBoxImage.h @@ -0,0 +1,92 @@ +#pragma once + +constexpr const unsigned char CheckBoxImage_Src[] = +{ + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x10, 0x00, 0x20, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x0E, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x59, 0xFF, 0xFF, + 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x49, 0xFF, 0xFF, + 0xFF, 0xFA, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, + 0xFF, 0x63, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x3B, 0xFF, 0xFF, + 0xFF, 0xF6, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0x5B, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x2F, 0xFF, 0xFF, + 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0xFF, 0xFF, + 0xFF, 0x7E, 0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFC, 0xFF, 0xFF, 0xFF, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x24, 0xFF, 0xFF, + 0xFF, 0xE8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, + 0xFF, 0x56, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x37, 0xFF, 0xFF, + 0xFF, 0xF2, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0xFF, 0xFF, + 0xFF, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, + 0xFF, 0xD4, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x3E, 0xFF, 0xFF, 0xFF, 0xF5, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0xFF, 0xFF, 0xFF, 0x44, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x8B, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, + 0xFF, 0x44, 0xFF, 0xFF, 0xFF, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xF5, 0xFF, 0xFF, 0xFF, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, + 0xFF, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x4B, 0xFF, 0xFF, + 0xFF, 0xFA, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF2, 0xFF, 0xFF, + 0xFF, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x53, 0xFF, 0xFF, 0xFF, 0xFC, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0x31, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, + 0xFF, 0x5B, 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xEB, 0xFF, 0xFF, 0xFF, 0x2B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x63, 0xFF, 0xFF, + 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC8, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x6C, 0xFF, 0xFF, 0xFF, 0xF7, 0xFF, 0xFF, + 0xFF, 0x6B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/CheckState.h b/r5dev/thirdparty/cppnet/cppkore/CheckState.h new file mode 100644 index 00000000..56570d13 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/CheckState.h @@ -0,0 +1,19 @@ +#pragma once + +#include + +namespace Forms +{ + // Specifies the state of a control, + // such as a check box, that can be checked, unchecked, or + // set to an indeterminate state. + enum class CheckState + { + // The control is unchecked. + Unchecked = 0, + // The control is checked. + Checked = 1, + // The control is indeterminate. An indeterminate control generally has a shaded appearance. + Indeterminate = 2 + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/CloseReason.h b/r5dev/thirdparty/cppnet/cppkore/CloseReason.h new file mode 100644 index 00000000..f6556657 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/CloseReason.h @@ -0,0 +1,25 @@ +#pragma once + +#include + +namespace Forms +{ + // Specifies the reason for the Form Closing. + enum class CloseReason + { + // No reason for closure of the Form. + None = 0, + // In the process of shutting down, Windows has closed the application. + WindowsShutDown = 1, + // The parent form of this MDI form is closing. + MdiFormClosing = 2, + // The user has clicked the close button on the form window, selected Close from the window's control menu or hit Alt + F4 + UserClosing = 3, + // The Microsoft Windows Task Manager is closing the application. + TaskManagerClosing = 4, + // A form is closing because its owner is closing. + FormOwnerClosing = 5, + // A form is closing because Application.Exit() was called. + ApplicationExitCall = 6 + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/CoDXAssetExport.cpp b/r5dev/thirdparty/cppnet/cppkore/CoDXAssetExport.cpp new file mode 100644 index 00000000..becc1f76 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/CoDXAssetExport.cpp @@ -0,0 +1,251 @@ +#include "stdafx.h" +#include "CoDXAssetExport.h" + +#include "File.h" +#include "Path.h" +#include "Matrix.h" +#include "StreamWriter.h" + +namespace Assets::Exporters +{ + bool CoDXAssetExport::ExportAnimation(const Animation& Animation, const string& Path) + { + return false; + } + + bool CoDXAssetExport::ExportModel(const Model& Model, const string& Path) + { + auto Writer = IO::StreamWriter(IO::File::Create(Path)); + + Writer.WriteLine( + "MODEL\nVERSION 6\n" + ); + + Writer.WriteLineFmt("NUMBONES %d", Model.Bones.Count()); + + uint32_t BoneIndex = 0; + + for (auto& Bone : Model.Bones) + { + Writer.WriteLineFmt("BONE %d %d \"%s\"", BoneIndex, Bone.Parent(), (char*)Bone.Name()); + BoneIndex++; + } + + Writer.Write("\n"); + BoneIndex = 0; + + for (auto& Bone : Model.Bones) + { + auto Rotation = ::Math::Matrix::CreateFromQuaternion(Bone.GlobalRotation()); + + auto& Position = Bone.GlobalPosition(); + auto& Scale = Bone.Scale(); + + Writer.WriteLineFmt( + "BONE %d\n" + "OFFSET %f, %f, %f\n" + "SCALE %f, %f, %f\n" + "X %f, %f, %f\n" + "Y %f, %f, %f\n" + "Z %f, %f, %f\n", + BoneIndex, + Position.X, Position.Y, Position.Z, + Scale.X, Scale.Y, Scale.Z, + MathHelper::Clamp(Rotation.Mat(0, 0), -1.f, 1.f), MathHelper::Clamp(Rotation.Mat(0, 1), -1.f, 1.f), MathHelper::Clamp(Rotation.Mat(0, 2), -1.f, 1.f), + MathHelper::Clamp(Rotation.Mat(1, 0), -1.f, 1.f), MathHelper::Clamp(Rotation.Mat(1, 1), -1.f, 1.f), MathHelper::Clamp(Rotation.Mat(1, 2), -1.f, 1.f), + MathHelper::Clamp(Rotation.Mat(2, 0), -1.f, 1.f), MathHelper::Clamp(Rotation.Mat(2, 1), -1.f, 1.f), MathHelper::Clamp(Rotation.Mat(2, 2), -1.f, 1.f) + ); + + BoneIndex++; + } + + auto TotalVertexCount = Model.VertexCount(); + auto TotalFaceCount = Model.FaceCount(); + + if (TotalVertexCount > UINT16_MAX) + Writer.WriteLineFmt("NUMVERTS32 %d", TotalVertexCount); + else + Writer.WriteLineFmt("NUMVERTS %d", TotalVertexCount); + + uint32_t VertexIndex = 0; + + for (auto& Submesh : Model.Meshes) + { + for (auto& Vertex : Submesh.Vertices) + { + auto& Position = Vertex.Position(); + + if (TotalVertexCount > UINT16_MAX) + Writer.WriteLineFmt( + "VERT32 %d\n" + "OFFSET %f, %f, %f", + VertexIndex, + Position.X, Position.Y, Position.Z + ); + else + Writer.WriteLineFmt( + "VERT %d\n" + "OFFSET %f, %f, %f", + VertexIndex, + Position.X, Position.Y, Position.Z + ); + + if (Vertex.WeightCount() == 1) + Writer.WriteLineFmt( + "BONES 1\n" + "BONE %d 1.0\n", + Vertex.Weights(0).Bone + ); + else + { + Writer.WriteLineFmt("BONES %d", Vertex.WeightCount()); + + for (uint8_t i = 0; i < Vertex.WeightCount(); i++) + Writer.WriteLineFmt("BONE %d %f", Vertex.Weights(i).Bone, Vertex.Weights(i).Value); + + Writer.Write("\n"); + } + + VertexIndex++; + } + } + + Writer.WriteLineFmt("NUMFACES %d", TotalFaceCount); + + uint32_t SubmeshIndex = 0; + VertexIndex = 0; + + for (auto& Submesh : Model.Meshes) + { + for (auto& Face : Submesh.Faces) + { + if (SubmeshIndex > UINT8_MAX || Submesh.MaterialIndices[0] > UINT8_MAX) + Writer.WriteLineFmt("TRI16 %d %d 0 0", SubmeshIndex, Submesh.MaterialIndices[0]); + else + Writer.WriteLineFmt("TRI %d %d 0 0", SubmeshIndex, Submesh.MaterialIndices[0]); + + // + // Face vertex [2] + // + + Writer.WriteLineFmt((TotalVertexCount > UINT16_MAX) ? "VERT32 %d" : "VERT %d", (Face[2] + VertexIndex)); + + auto& Face1Normal = Submesh.Vertices[Face[2]].Normal(); + auto& Face1Color = Submesh.Vertices[Face[2]].Color(); + + Writer.WriteFmt( + "NORMAL %f %f %f\n" + "COLOR %f %f %f %f\n" + "UV %d", + Face1Normal.X, Face1Normal.Y, Face1Normal.Z, + Face1Color[0], Face1Color[1], Face1Color[2], Face1Color[3], + Submesh.Vertices.UVLayerCount() + ); + + for (uint8_t i = 0; i < Submesh.Vertices.UVLayerCount(); i++) + Writer.WriteFmt(" %f %f", Submesh.Vertices[Face[2]].UVLayers(i).U, Submesh.Vertices[Face[2]].UVLayers(i).V); + Writer.Write("\n"); + + // + // Face vertex [0] + // + + Writer.WriteLineFmt((TotalVertexCount > UINT16_MAX) ? "VERT32 %d" : "VERT %d", (Face[0] + VertexIndex)); + + auto& Face2Normal = Submesh.Vertices[Face[0]].Normal(); + auto& Face2Color = Submesh.Vertices[Face[0]].Color(); + + Writer.WriteFmt( + "NORMAL %f %f %f\n" + "COLOR %f %f %f %f\n" + "UV %d", + Face2Normal.X, Face2Normal.Y, Face2Normal.Z, + Face2Color[0], Face2Color[1], Face2Color[2], Face2Color[3], + Submesh.Vertices.UVLayerCount() + ); + + for (uint8_t i = 0; i < Submesh.Vertices.UVLayerCount(); i++) + Writer.WriteFmt(" %f %f", Submesh.Vertices[Face[0]].UVLayers(i).U, Submesh.Vertices[Face[0]].UVLayers(i).V); + Writer.Write("\n"); + + // + // Face vertex [1] + // + + Writer.WriteLineFmt((TotalVertexCount > UINT16_MAX) ? "VERT32 %d" : "VERT %d", (Face[1] + VertexIndex)); + + auto& Face3Normal = Submesh.Vertices[Face[1]].Normal(); + auto& Face3Color = Submesh.Vertices[Face[1]].Color(); + + Writer.WriteFmt( + "NORMAL %f %f %f\n" + "COLOR %f %f %f %f\n" + "UV %d", + Face3Normal.X, Face3Normal.Y, Face3Normal.Z, + Face3Color[0], Face3Color[1], Face3Color[2], Face3Color[3], + Submesh.Vertices.UVLayerCount() + ); + + for (uint8_t i = 0; i < Submesh.Vertices.UVLayerCount(); i++) + Writer.WriteFmt(" %f %f", Submesh.Vertices[Face[1]].UVLayers(i).U, Submesh.Vertices[Face[1]].UVLayers(i).V); + Writer.Write("\n"); + } + + VertexIndex += Submesh.Vertices.Count(); + SubmeshIndex++; + } + + Writer.WriteLineFmt("\nNUMOBJECTS %d", Model.Meshes.Count()); + SubmeshIndex = 0; + + for (auto& Submesh : Model.Meshes) + Writer.WriteLineFmt("OBJECT %d \"KoreMesh_%d\"", SubmeshIndex, SubmeshIndex++); + Writer.Write("\n"); + + Writer.WriteLineFmt("NUMMATERIALS %d", Model.Materials.Count()); + + uint32_t MaterialIndex = 0; + + for (auto& Material : Model.Materials) + { + Writer.WriteFmt("MATERIAL %d \"%s\" \"Phong\" \"", MaterialIndex, (char*)Material.Name); + + if (Material.Slots.ContainsKey(MaterialSlotType::Albedo)) + Writer.WriteFmt("color:%s", (char*)Material.Slots[MaterialSlotType::Albedo].first); + else if (Material.Slots.ContainsKey(MaterialSlotType::Diffuse)) + Writer.WriteFmt("color:%s", (char*)Material.Slots[MaterialSlotType::Diffuse].first); + + Writer.WriteLine("\"\nCOLOR 0.000000 0.000000 0.000000 1.000000\nTRANSPARENCY 0.000000 0.000000 0.000000 1.000000\nAMBIENTCOLOR 1.000000 1.000000 1.000000 1.000000\nINCANDESCENCE 0.000000 0.000000 0.000000 1.000000\nCOEFFS 0.800000 0.000000\nGLOW 0.000000 0\nREFRACTIVE 6 1.000000\nSPECULARCOLOR 0.500000 0.500000 0.500000 1.000000\nREFLECTIVECOLOR 0.000000 0.000000 0.000000 1.000000\nREFLECTIVE 1 0.500000\nBLINN -1.000000 -1.000000\nPHONG 20.000000"); + + MaterialIndex++; + } + + return true; + } + + imstring CoDXAssetExport::ModelExtension() + { + return ".xmodel_export"; + } + + imstring CoDXAssetExport::AnimationExtension() + { + return ".xanim_export"; + } + + ExporterScale CoDXAssetExport::ExportScale() + { + // Call of Duty uses inches as the primary scale constant. + return ExporterScale::Inch; + } + + bool CoDXAssetExport::SupportsAnimations() + { + return true; + } + + bool CoDXAssetExport::SupportsModels() + { + return true; + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/CoDXAssetExport.h b/r5dev/thirdparty/cppnet/cppkore/CoDXAssetExport.h new file mode 100644 index 00000000..749ae029 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/CoDXAssetExport.h @@ -0,0 +1,33 @@ +#pragma once + +#include +#include "Exporter.h" + +namespace Assets::Exporters +{ + // The Call of Duty XAsset Export exporter + class CoDXAssetExport : public Exporter + { + public: + CoDXAssetExport() = default; + ~CoDXAssetExport() = default; + + // Exports the given animation to the provided path. + virtual bool ExportAnimation(const Animation& Animation, const string& Path); + // Exports the given model to the provided path. + virtual bool ExportModel(const Model& Model, const string& Path); + + // Gets the file extension for this exporters model format. + virtual imstring ModelExtension(); + // Gets the file extension for this exporters animation format. + virtual imstring AnimationExtension(); + + // Gets the required scaling constant for this exporter. + virtual ExporterScale ExportScale(); + + // Gets whether or not the exporter supports animation exporting. + virtual bool SupportsAnimations(); + // Gets whether or not the exporter supports model exporting. + virtual bool SupportsModels(); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/ColumnClickEventArgs.cpp b/r5dev/thirdparty/cppnet/cppkore/ColumnClickEventArgs.cpp new file mode 100644 index 00000000..c1a81f34 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ColumnClickEventArgs.cpp @@ -0,0 +1,10 @@ +#include "stdafx.h" +#include "ColumnClickEventArgs.h" + +namespace Forms +{ + ColumnClickEventArgs::ColumnClickEventArgs(int32_t Column) + : Column(Column) + { + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/ColumnClickEventArgs.h b/r5dev/thirdparty/cppnet/cppkore/ColumnClickEventArgs.h new file mode 100644 index 00000000..80a29829 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ColumnClickEventArgs.h @@ -0,0 +1,17 @@ +#pragma once + +#include + +namespace Forms +{ + // Provides data for the OnColumnClick event. + class ColumnClickEventArgs + { + public: + ColumnClickEventArgs(int32_t Column); + ~ColumnClickEventArgs() = default; + + // The index of the column that was clicked. + const int32_t Column; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/ColumnHeader.cpp b/r5dev/thirdparty/cppnet/cppkore/ColumnHeader.cpp new file mode 100644 index 00000000..ed9c847f --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ColumnHeader.cpp @@ -0,0 +1,158 @@ +#include "stdafx.h" +#include "ColumnHeader.h" +#include "ListView.h" + +namespace Forms +{ + ColumnHeader::ColumnHeader() + : ColumnHeader("") + { + } + + ColumnHeader::ColumnHeader(const string& Text) + : ColumnHeader(Text, 60) + { + } + + ColumnHeader::ColumnHeader(const string& Text, int32_t Width) + : ColumnHeader(Text, Width, HorizontalAlignment::Left) + { + } + + ColumnHeader::ColumnHeader(const string& Text, int32_t Width, HorizontalAlignment Alignment) + : _Text(Text), _Width(Width), _TextAlign(Alignment), _OwnerListView(nullptr), _IndexInternal(-1) + { + } + + int32_t ColumnHeader::Index() const + { + if (_OwnerListView != nullptr) + return _OwnerListView->Columns.IndexOf(*this); + + return -1; + } + + int32_t ColumnHeader::DisplayIndex() + { + return this->_IndexInternal; + } + + void ColumnHeader::SetDisplayIndex(int32_t Value) + { + if (this->_OwnerListView == nullptr) + { + this->_IndexInternal = Value; + return; + } + + auto LowDI = min(this->_IndexInternal, Value); + auto HiDI = max(this->_IndexInternal, Value); + auto ColsOrder = std::make_unique(_OwnerListView->Columns.Count()); + + bool HdrMovedForward = Value > this->_IndexInternal; + ColumnHeader* MovedHdr = nullptr; + + for (uint32_t i = 0; i < _OwnerListView->Columns.Count(); i++) + { + auto& Hdr = _OwnerListView->Columns[i]; + if (Hdr.DisplayIndex() == _IndexInternal) + MovedHdr = &Hdr; + else if (Hdr.DisplayIndex() >= LowDI && Hdr.DisplayIndex() <= HiDI) + Hdr._IndexInternal -= HdrMovedForward ? 1 : -1; + + if (i != this->Index()) + ColsOrder[Hdr._IndexInternal] = i; + } + + if (MovedHdr != nullptr) + { + MovedHdr->_IndexInternal = Value; + ColsOrder[MovedHdr->_IndexInternal] = MovedHdr->Index(); + } + + SetDisplayIndices(ColsOrder, _OwnerListView->Columns.Count()); + } + + void ColumnHeader::SetDisplayIndexInternal(int32_t Value) + { + this->_IndexInternal = Value; + } + + const string& ColumnHeader::Text() const + { + return this->_Text; + } + + void ColumnHeader::SetText(const string& Value) + { + _Text = Value; + + if (_OwnerListView) + _OwnerListView->SetColumnInfo(LVCF_TEXT, *this); + } + + int32_t ColumnHeader::Width() const + { + if (_OwnerListView != nullptr && _OwnerListView->GetState(Forms::ControlStates::StateCreated) && _OwnerListView->GetState(ControlStates::StateCreated)) + { + auto HwndHdr = (HWND)SendMessageA(_OwnerListView->GetHandle(), LVM_GETHEADER, NULL, NULL); + if (HwndHdr != NULL) + { + auto NativeItemCount = (int32_t)SendMessageA(HwndHdr, HDM_GETITEMCOUNT, NULL, NULL); + auto Idx = Index(); + if (Idx < NativeItemCount) + return (int32_t)SendMessageA(_OwnerListView->GetHandle(), LVM_GETCOLUMNWIDTH, (WPARAM)Idx, 0); + } + } + + return this->_Width; + } + + void ColumnHeader::SetWidth(int32_t Value) + { + _Width = Value; + + if (_OwnerListView) + _OwnerListView->SetColumnWidth(this->Index(), _Width); + } + + HorizontalAlignment ColumnHeader::TextAlign() const + { + return this->_TextAlign; + } + + void ColumnHeader::SetTextAlign(HorizontalAlignment Value) + { + if (_TextAlign != Value) + { + _TextAlign = Value; + + if (_OwnerListView) + { + _OwnerListView->SetColumnInfo(LVCF_FMT, *this); + _OwnerListView->Invalidate(); + } + } + } + + ListView* ColumnHeader::GetListView() + { + return this->_OwnerListView; + } + + void ColumnHeader::SetListView(ListView* Owner) + { + this->_OwnerListView = Owner; + } + + bool ColumnHeader::operator==(const ColumnHeader& Rhs) + { + return (this->_IndexInternal == Rhs._IndexInternal && this->_Text == Rhs._Text && this->_TextAlign == Rhs._TextAlign); + } + + void ColumnHeader::SetDisplayIndices(const std::unique_ptr& Cols, int32_t Count) + { + if (this->_OwnerListView != nullptr && this->_OwnerListView->GetState(ControlStates::StateCreated)) + SendMessageA(this->_OwnerListView->GetHandle(), LVM_SETCOLUMNORDERARRAY, (WPARAM)Count, (LPARAM)Cols.get()); + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/ColumnHeader.h b/r5dev/thirdparty/cppnet/cppkore/ColumnHeader.h new file mode 100644 index 00000000..6443061f --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ColumnHeader.h @@ -0,0 +1,71 @@ +#pragma once + +#include +#include "StringBase.h" +#include "HorizontalAlignment.h" + +namespace Forms +{ + // Externally defined so we don't conflict + class ListView; + + // Displays a single column header in a ListView control. + class ColumnHeader + { + public: + ColumnHeader(); + ColumnHeader(const string& Text); + ColumnHeader(const string& Text, int32_t Width); + ColumnHeader(const string& Text, int32_t Width, HorizontalAlignment Alignment); + ~ColumnHeader() = default; + + // The index of this column. + int32_t Index() const; + + // The index of this column as it is displayed. + int32_t DisplayIndex(); + // The index of this column as it is displayed. + void SetDisplayIndex(int32_t Value); + + // Sets the display index without reflowing others. + void SetDisplayIndexInternal(int32_t Value); + + // The text displayed in the column header. + const string& Text() const; + // The text displayed in the column header. + void SetText(const string& Value); + + // The width of the column in pixels. + int32_t Width() const; + // The width of the column in pixels. + void SetWidth(int32_t Value); + + // The horizontal alignment of the text contained in this column. + HorizontalAlignment TextAlign() const; + // The horizontal alignment of the text contained in this column. + void SetTextAlign(HorizontalAlignment Value); + + // Returns the ListView control that this column is displayed in. May be null. + ListView* GetListView(); + // Sets the ListView control that this column is displayed in. + void SetListView(ListView* Owner); + + // Custom equality operator + bool operator==(const ColumnHeader& Rhs); + + private: + // Internal cached properties + ListView* _OwnerListView; + + // Width and index + int32_t _Width; + int32_t _IndexInternal; + + // Text to display + string _Text; + HorizontalAlignment _TextAlign; + + // Set the display indices of the ListView columns. + void SetDisplayIndices(const std::unique_ptr& Cols, int32_t Count); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/ColumnHeaderStyle.h b/r5dev/thirdparty/cppnet/cppkore/ColumnHeaderStyle.h new file mode 100644 index 00000000..faef2d00 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ColumnHeaderStyle.h @@ -0,0 +1,17 @@ +#pragma once + +#include + +namespace Forms +{ + // Specifies how ListView column headers behave. + enum class ColumnHeaderStyle + { + // No visible column header. + None = 0, + // Visible column header that does not respond to clicking. + NonClickable = 1, + // Visible column header that responds to clicking. + Clickable = 2 + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/ComboBox.cpp b/r5dev/thirdparty/cppnet/cppkore/ComboBox.cpp new file mode 100644 index 00000000..d0ebaf1d --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ComboBox.cpp @@ -0,0 +1,496 @@ +#include "stdafx.h" +#include "ComboBox.h" + +namespace Forms +{ + ComboBox::ComboBox() + : Control(), Items(this), _DrawMode(DrawMode::Normal), _FlatStyle(FlatStyle::Standard), _DropDownStyle(ComboBoxStyle::DropDown), _IntegralHeight(true), _DropDownWidth(-1), _DropDownHeight(-1), _MaxDropDownItems(8), _MaximumLength(SHRT_MAX), _SelectedIndex(-1), _ChildEdit(nullptr), _ChildListBox(nullptr) + { + SetStyle(ControlStyles::UserPaint | + ControlStyles::UseTextForAccessibility | + ControlStyles::StandardClick, false); + + // Default back color is different... + this->_BackColor = Drawing::GetSystemColor(Drawing::SystemColors::Window); + // We are a ComboBox control. + this->_RTTI = ControlTypes::ComboBox; + } + + DrawMode ComboBox::GetDrawMode() + { + return this->_DrawMode; + } + + void ComboBox::SetDrawMode(DrawMode Value) + { + if (_DrawMode != Value) + { + _DrawMode = Value; + UpdateStyles(); + } + } + + uint32_t ComboBox::DropDownWidth() + { + if (_DropDownWidth > -1) + return _DropDownWidth; + + return _Width; + } + + void ComboBox::SetDropDownWidth(uint32_t Value) + { + _DropDownWidth = (int32_t)Value; + + if (GetState(ControlStates::StateCreated)) + SendMessageA(this->_Handle, CB_SETDROPPEDWIDTH, (WPARAM)Value, NULL); + } + + uint32_t ComboBox::DropDownHeight() + { + if (_DropDownHeight > -1) + return _DropDownHeight; + + return 106; // Default drop down height... + } + + void ComboBox::SetDropDownHeight(uint32_t Value) + { + _DropDownHeight = (int32_t)Value; + SetIntegralHeight(false); + } + + bool ComboBox::DroppedDown() + { + if (GetState(ControlStates::StateCreated)) + return (SendMessageA(this->_Handle, CB_GETDROPPEDSTATE, NULL, NULL) != 0); + + return false; + } + + void ComboBox::SetDroppedDown(bool Value) + { + if (GetState(ControlStates::StateCreated)) + SendMessageA(this->_Handle, CB_SHOWDROPDOWN, Value ? -1 : 0, NULL); + } + + FlatStyle ComboBox::GetFlatStyle() + { + return this->_FlatStyle; + } + + void ComboBox::SetFlatStyle(FlatStyle Value) + { + if (_FlatStyle != Value) + { + _FlatStyle = Value; + UpdateStyles(); + } + } + + bool ComboBox::IntegralHeight() + { + return this->_IntegralHeight; + } + + void ComboBox::SetIntegralHeight(bool Value) + { + if (_IntegralHeight != Value) + { + _IntegralHeight = Value; + UpdateStyles(); + } + } + + int32_t ComboBox::ItemHeight() + { + return (int32_t)SendMessageA(this->_Handle, CB_GETITEMHEIGHT, NULL, NULL); + } + + void ComboBox::SetItemHeight(int32_t Value) + { + if (_DrawMode == DrawMode::OwnerDrawFixed) + { + SendMessageA(this->_Handle, CB_SETITEMHEIGHT, (WPARAM)-1, (LPARAM)Value); + SendMessageA(this->_Handle, CB_SETITEMHEIGHT, (WPARAM)0, (LPARAM)Value); + } + else if (_DrawMode == DrawMode::OwnerDrawVariable) + { + SendMessageA(this->_Handle, CB_SETITEMHEIGHT, (WPARAM)-1, (LPARAM)Value); + + for (uint32_t i = 0; i < Items.Count(); i++) + SendMessageA(this->_Handle, CB_SETITEMHEIGHT, (WPARAM)i, (LPARAM)Value); + } + } + + uint8_t ComboBox::MaxDropDownItems() + { + return this->_MaxDropDownItems; + } + + void ComboBox::SetMaxDropDownItems(uint8_t Value) + { + this->_MaxDropDownItems = Value; + } + + uint32_t ComboBox::MaxLength() + { + return this->_MaximumLength; + } + + void ComboBox::SetMaxLength(uint32_t Value) + { + if (_MaximumLength != Value) + { + _MaximumLength = Value; + + if (GetState(ControlStates::StateCreated)) + SendMessageA(this->_Handle, CB_LIMITTEXT, (WPARAM)Value, NULL); + } + } + + int32_t ComboBox::SelectedIndex() + { + if (GetState(ControlStates::StateCreated)) + return (int32_t)SendMessageA(this->_Handle, CB_GETCURSEL, NULL, NULL); + + return this->_SelectedIndex; + } + + void ComboBox::SetSelectedIndex(int32_t Value) + { + if (GetState(ControlStates::StateCreated)) + SendMessageA(this->_Handle, CB_SETCURSEL, (WPARAM)Value, NULL); + else + _SelectedIndex = Value; + + OnTextChanged(); + + OnSelectedIndexChanged(); + OnSelectedItemChanged(); + } + + string ComboBox::SelectedText() + { + if (_DropDownStyle == ComboBoxStyle::DropDownList) + return ""; + + return Text().Substring(SelectionStart(), SelectionLength()); + } + + void ComboBox::SetSelectedText(const string& Value) + { + if (_DropDownStyle != ComboBoxStyle::DropDownList) + { + if (GetState(ControlStates::StateCreated)) + SendMessageA(this->_ChildEdit, EM_REPLACESEL, (WPARAM)-1, (LPARAM)(const char*)Value); + } + } + + int32_t ComboBox::SelectionLength() + { + int32_t End = 0; + int32_t Start = 0; + SendMessageA(this->_Handle, CB_GETEDITSEL, (WPARAM)&Start, (WPARAM)&End); + + return End - Start; + } + + void ComboBox::SetSelectionLength(int32_t Value) + { + Select(SelectionStart(), Value); + } + + int32_t ComboBox::SelectionStart() + { + int32_t Value = 0; + SendMessageA(this->_Handle, CB_GETEDITSEL, (WPARAM)&Value, NULL); + + return Value; + } + + void ComboBox::SetSelectionStart(int32_t Value) + { + Select(Value, SelectionLength()); + } + + ComboBoxStyle ComboBox::DropDownStyle() + { + return this->_DropDownStyle; + } + + void ComboBox::SetDropDownStyle(ComboBoxStyle Value) + { + if (_DropDownStyle != Value) + { + _DropDownStyle = Value; + + if (GetState(ControlStates::StateCreated)) + UpdateStyles(); + } + } + + void ComboBox::Select(int32_t Start, int32_t Length) + { + int32_t End = Start + Length; + SendMessageA(this->_Handle, CB_SETEDITSEL, NULL, MAKELPARAM(Start, End)); + } + + void ComboBox::OnHandleCreated() + { + if (_MaximumLength > 0) + SendMessageA(this->_Handle, CB_LIMITTEXT, (WPARAM)_MaximumLength, NULL); + + if (_DropDownStyle != ComboBoxStyle::DropDownList) + { + auto Hwnd = GetWindow(this->_Handle, GW_CHILD); + if (Hwnd != NULL) + { + if (_DropDownStyle == ComboBoxStyle::Simple) + { + _ChildListBox = Hwnd; + Hwnd = GetWindow(Hwnd, GW_HWNDNEXT); + } + + _ChildEdit = Hwnd; + } + } + + if (_DropDownWidth > -1) + SendMessageA(this->_Handle, CB_SETDROPPEDWIDTH, (WPARAM)_DropDownWidth, NULL); + + // If we have items, add them now + for (auto& Item : Items) + this->NativeAdd((const char*)Item); + + if (_SelectedIndex > -1) + { + SendMessageA(this->_Handle, CB_SETCURSEL, (WPARAM)_SelectedIndex, NULL); + _SelectedIndex = -1; + } + + // We must call the base event last + Control::OnHandleCreated(); + } + + void ComboBox::OnSelectedItemChanged() + { + SelectedItemChanged.RaiseEvent(this); + } + + void ComboBox::OnSelectedIndexChanged() + { + SelectedIndexChanged.RaiseEvent(this); + } + + void ComboBox::OnDropDownClosed() + { + DropDownClosed.RaiseEvent(this); + } + + void ComboBox::WndProc(Message& Msg) + { + switch (Msg.Msg) + { + case WM_CTLCOLOREDIT: + case WM_CTLCOLORLISTBOX: + Msg.Result = InitializeDCForWmCtlColor((HDC)Msg.WParam, Msg.Msg); + break; + case WM_REFLECT + WM_COMMAND: + WmReflectCommand(Msg); + break; + default: + Control::WndProc(Msg); + break; + } + } + + CreateParams ComboBox::GetCreateParams() + { + auto Cp = Control::GetCreateParams(); + + Cp.ClassName = "COMBOBOX"; + Cp.Style |= WS_VSCROLL | CBS_HASSTRINGS | CBS_AUTOHSCROLL; + + if (!_IntegralHeight) + Cp.Style |= CBS_NOINTEGRALHEIGHT; + + switch (_FlatStyle) + { + case FlatStyle::Popup: + case FlatStyle::Flat: + Cp.ExStyle |= WS_EX_STATICEDGE; + default: + Cp.ExStyle |= WS_EX_CLIENTEDGE; + break; + } + + switch (_DropDownStyle) + { + case ComboBoxStyle::Simple: + Cp.Style |= CBS_SIMPLE; + break; + case ComboBoxStyle::DropDown: + Cp.Style |= CBS_DROPDOWN; + break; + case ComboBoxStyle::DropDownList: + Cp.Style |= CBS_DROPDOWNLIST; + break; + } + + switch (_DrawMode) + { + case DrawMode::OwnerDrawFixed: + Cp.Style |= CBS_OWNERDRAWFIXED; + break; + case DrawMode::OwnerDrawVariable: + Cp.Style |= CBS_OWNERDRAWVARIABLE; + break; + } + + return Cp; + } + + uintptr_t ComboBox::InitializeDCForWmCtlColor(HDC Dc, int32_t Message) + { + if ((Message == WM_CTLCOLORSTATIC)) + { + return (uintptr_t)0; + } + else if ((Message == WM_CTLCOLORLISTBOX) && GetStyle(ControlStyles::UserPaint)) + { + SetTextColor(Dc, this->ForeColor().ToCOLORREF()); + SetBkColor(Dc, this->BackColor().ToCOLORREF()); + + return BackColorBrush(); + } + else + { + return Control::InitializeDCForWmCtlColor(Dc, Message); + } + } + + int32_t ComboBox::NativeAdd(const char* Value) + { + return (int32_t)SendMessageA(this->_Handle, CB_ADDSTRING, NULL, (LPARAM)Value); + } + + void ComboBox::NativeClear() + { + string Saved; + + if (_DropDownStyle != ComboBoxStyle::DropDownList) + Saved = this->WindowText(); + + SendMessageA(this->_Handle, CB_RESETCONTENT, NULL, NULL); + + if (!string::IsNullOrEmpty(Saved)) + this->SetWindowText(Saved); + } + + int32_t ComboBox::NativeInsert(int32_t Index, const char* Value) + { + return (int32_t)SendMessageA(this->_Handle, CB_INSERTSTRING, (WPARAM)Index, (LPARAM)Value); + } + + void ComboBox::NativeRemoveAt(int32_t Index) + { + if (_DropDownStyle == ComboBoxStyle::DropDownList && SelectedIndex() == Index) + Invalidate(); + + SendMessageA(this->_Handle, CB_DELETESTRING, (WPARAM)Index, NULL); + } + + void ComboBox::WmReflectCommand(Message& Msg) + { + switch ((int16_t)HIWORD(Msg.WParam)) + { + case CBN_EDITCHANGE: + OnTextChanged(); + break; + case CBN_SELCHANGE: + OnSelectedIndexChanged(); + OnSelectedItemChanged(); + break; + case CBN_CLOSEUP: + OnDropDownClosed(); + break; + } + } + + ComboBox::ComboBoxItemCollection::ComboBoxItemCollection(ComboBox* Owner) + : _Owner(Owner), _Items() + { + } + + void ComboBox::ComboBoxItemCollection::Add(const imstring& Value) + { + _Items.EmplaceBack(Value); + + if (_Owner->GetState(ControlStates::StateCreated)) + _Owner->NativeAdd(Value); + } + + void ComboBox::ComboBoxItemCollection::Insert(int32_t Index, const imstring& Value) + { + _Items.Insert(Index, Value); + + if (_Owner->GetState(ControlStates::StateCreated)) + _Owner->NativeInsert(Index, Value); + } + + void ComboBox::ComboBoxItemCollection::Clear() + { + _Items.Clear(); + + if (_Owner->GetState(ControlStates::StateCreated)) + _Owner->NativeClear(); + } + + bool ComboBox::ComboBoxItemCollection::Contains(const imstring & Value) + { + return (IndexOf(Value) > -1); + } + + int32_t ComboBox::ComboBoxItemCollection::IndexOf(const imstring& Value) + { + auto Str = string(Value); + auto Res = _Items.IndexOf(Str); + + if (Res == List::InvalidPosition) + return -1; + + return Res; + } + + void ComboBox::ComboBoxItemCollection::RemoveAt(int32_t Index) + { + if (_Owner->GetState(ControlStates::StateCreated)) + _Owner->NativeRemoveAt(Index); + + _Items.RemoveAt(Index); + } + + void ComboBox::ComboBoxItemCollection::Remove(const imstring& Value) + { + auto Index = IndexOf(Value); + + if (Index > -1) + RemoveAt(Index); + } + + uint32_t ComboBox::ComboBoxItemCollection::Count() + { + return _Items.Count(); + } + + string* ComboBox::ComboBoxItemCollection::begin() const + { + return _Items.begin(); + } + + string* ComboBox::ComboBoxItemCollection::end() const + { + return _Items.end(); + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/ComboBox.h b/r5dev/thirdparty/cppnet/cppkore/ComboBox.h new file mode 100644 index 00000000..c2e4daa8 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ComboBox.h @@ -0,0 +1,190 @@ +#pragma once + +#include +#include "Control.h" +#include "StringBase.h" +#include "ListBase.h" +#include "ImmutableStringBase.h" +#include "DrawMode.h" +#include "FlatStyle.h" +#include "ComboBoxStyle.h" + +namespace Forms +{ + // Displays an editing field and a list control. + class ComboBox : public Control + { + public: + ComboBox(); + virtual ~ComboBox() = default; + + // Gets whether the control is drawn by Windows or by the user. + DrawMode GetDrawMode(); + // Sets whether the control is drawn by Windows or by the user. + void SetDrawMode(DrawMode Value); + + // Gets the width of the drop down box in a combo box. + uint32_t DropDownWidth(); + // Sets the width of the drop down box in a combo box. + void SetDropDownWidth(uint32_t Value); + + // Gets the Height of the drop down box in a combo box. + uint32_t DropDownHeight(); + // Sets the Height of the drop down box in a combo box. + void SetDropDownHeight(uint32_t Value); + + // Indicates whether the DropDown of the combo is currently dropped down. + bool DroppedDown(); + // Sets whether the DropDown of the combo is currently dropped down. + void SetDroppedDown(bool Value); + + // Gets the flat style appearance of the button control. + FlatStyle GetFlatStyle(); + // Sets the flat style appearance of the button control. + void SetFlatStyle(FlatStyle Value); + + // Gets if the combo should avoid showing partial Items. + bool IntegralHeight(); + // Sets if the combo should avoid showing partial Items. + void SetIntegralHeight(bool Value); + + // Gets the height of an item in the combo box. + int32_t ItemHeight(); + // Sets the height of an item in the combo box. + void SetItemHeight(int32_t Value); + + // Gets the maximum number of items to be shown in the dropdown portion + // of the ComboBox. This number can be between 1 and 100. + uint8_t MaxDropDownItems(); + // Sets the maximum number of items to be shown in the dropdown portion + // of the ComboBox. This number can be between 1 and 100. + void SetMaxDropDownItems(uint8_t Value); + + // Gets the maximum length of the text the user may type into the edit control of a combo box. + uint32_t MaxLength(); + // Sets the maximum length of the text the user may type into the edit control of a combo box. + void SetMaxLength(uint32_t Value); + + // Gets the [zero based] index of the currently selected item in the combos list. + // Note If the value of index is -1, then the ComboBox is + // set to have no selection. + int32_t SelectedIndex(); + // Sets the [zero based] index of the currently selected item in the combos list. + // Note If the value of index is -1, then the ComboBox is + // set to have no selection. + void SetSelectedIndex(int32_t Value); + + // Gets the selected text in the edit component of the ComboBox. + string SelectedText(); + // Sets the selected text in the edit component of the ComboBox. + void SetSelectedText(const string& Value); + + // Gets length, in characters, of the selection in the editbox. + int32_t SelectionLength(); + // Sets length, in characters, of the selection in the editbox. + void SetSelectionLength(int32_t Value); + + // Gets the [zero-based] index of the first character in the current text selection. + int32_t SelectionStart(); + // Sets the [zero-based] index of the first character in the current text selection. + void SetSelectionStart(int32_t Value); + + // Gets the type of combo that we are right now. + ComboBoxStyle DropDownStyle(); + // Sets the type of combo that we are right now. + void SetDropDownStyle(ComboBoxStyle Value); + + // Selects the text in the editable portion of the ComboBox at the + void Select(int32_t Start, int32_t Length); + + // The items contained in the combo box. + struct ComboBoxItemCollection + { + ComboBoxItemCollection(ComboBox* Owner); + ~ComboBoxItemCollection() = default; + + // Adds an item to the combo box. + void Add(const imstring& Value); + // Inserts an item to the combo box. + void Insert(int32_t Index, const imstring& Value); + // Removes all items from the combo box. + void Clear(); + // Checks if the combo box contains the value. + bool Contains(const imstring& Value); + // Gets the index of the item, if any. + int32_t IndexOf(const imstring& Value); + // Removes an item at the specified index. + void RemoveAt(int32_t Index); + // Removes an item from the combo box. + void Remove(const imstring& Value); + // Gets the count of items in the combo box. + uint32_t Count(); + + // Iterater classes + string* begin() const; + string* end() const; + + protected: + // Internal references + ComboBox* _Owner; + List _Items; + } Items; + + // We must define control event bases here + virtual void OnHandleCreated(); + virtual void OnSelectedItemChanged(); + virtual void OnSelectedIndexChanged(); + virtual void OnDropDownClosed(); + + // We must define event handlers here + EventBase SelectedItemChanged; + EventBase SelectedIndexChanged; + EventBase DropDownClosed; + + // Override WndProc for specific combo box messages. + virtual void WndProc(Message& Msg); + + protected: + // Get custom control creation parameters for this instance. + virtual CreateParams GetCreateParams(); + + // Sets the text and background colors of the DC, and returns the background HBRUSH. + virtual uintptr_t InitializeDCForWmCtlColor(HDC Dc, int32_t Message); + + // Internal routine to add an item. + int32_t NativeAdd(const char* Value); + // Internal routine to clear the items. + void NativeClear(); + // Internal routine to insert an item. + int32_t NativeInsert(int32_t Index, const char* Value); + // Internal routine to remove an item. + void NativeRemoveAt(int32_t Index); + + private: + // Internal cached flags + FlatStyle _FlatStyle; + DrawMode _DrawMode; + ComboBoxStyle _DropDownStyle; + + // Internal show partial items + bool _IntegralHeight; + + // Internal size of dropdown + int32_t _DropDownWidth; + int32_t _DropDownHeight; + int32_t _SelectedIndex; + + // Internal children + HWND _ChildEdit; + HWND _ChildListBox; + + // Internal maximum items + uint8_t _MaxDropDownItems; + + // Internal maximun length + uint32_t _MaximumLength; + + // We must define each window message handler here... + void WmReflectCommand(Message& Msg); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/ComboBoxStyle.h b/r5dev/thirdparty/cppnet/cppkore/ComboBoxStyle.h new file mode 100644 index 00000000..d789dc31 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ComboBoxStyle.h @@ -0,0 +1,17 @@ +#pragma once + +#include + +namespace Forms +{ + // Specifies the ComboBox style. + enum class ComboBoxStyle + { + // The text portion is editable. The list portion is always visible. + Simple = 0, + // The text portion is editable. The user must click the arrow button to display the list portion. + DropDown = 1, + // The user cannot directly edit the text portion. The user must click the arrow button to display the list portion. + DropDownList = 2 + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/CompressionMode.h b/r5dev/thirdparty/cppnet/cppkore/CompressionMode.h new file mode 100644 index 00000000..71cfe6ae --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/CompressionMode.h @@ -0,0 +1,13 @@ +#pragma once + +#include + +namespace Compression +{ + // Which mode of operation we are performing + enum class CompressionMode + { + Compress, + Decompress + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Console.cpp b/r5dev/thirdparty/cppnet/cppkore/Console.cpp new file mode 100644 index 00000000..e2baaed5 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Console.cpp @@ -0,0 +1,563 @@ +#include "stdafx.h" +#include "Console.h" +#include "ConsoleStream.h" + +namespace System +{ + // This holds the global std handle for the input stream + __ConsoleInit Console::ConsoleInstance = __ConsoleInit(); + + enum class ControlKeyState + { + RightAltPressed = 0x0001, + LeftAltPressed = 0x0002, + RightCtrlPressed = 0x0004, + LeftCtrlPressed = 0x0008, + ShiftPressed = 0x0010, + NumLockOn = 0x0020, + ScrollLockOn = 0x0040, + CapsLockOn = 0x0080, + EnhancedKey = 0x0100 + }; + + void Console::Beep() + { + ::Beep(800, 200); + } + + void Console::Beep(uint32_t Frequency, uint32_t Duration) + { + ::Beep(Frequency, Duration); + } + + void Console::Clear() + { + auto hStdOut = ((IO::ConsoleStream*)ConsoleInstance.Out.GetBaseStream())->GetStreamHandle(); + + CONSOLE_SCREEN_BUFFER_INFO cSBI{}; + GetConsoleScreenBufferInfo(hStdOut, &cSBI); + + COORD cScreen{}; + int conSize = (cSBI.dwSize.X * cSBI.dwSize.Y); + + DWORD nCellsWritten = 0; + FillConsoleOutputCharacterA(hStdOut, ' ', conSize, cScreen, &nCellsWritten); + + nCellsWritten = 0; + FillConsoleOutputAttribute(hStdOut, FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED, conSize, cScreen, &nCellsWritten); + + SetConsoleCursorPosition(hStdOut, cScreen); + } + + void Console::ClearLine() + { + auto hStdOut = ((IO::ConsoleStream*)ConsoleInstance.Out.GetBaseStream())->GetStreamHandle(); + + CONSOLE_SCREEN_BUFFER_INFO cSBI{}; + GetConsoleScreenBufferInfo(hStdOut, &cSBI); + + cSBI.dwCursorPosition.X = 0; + + DWORD nCellsWritten = 0; + FillConsoleOutputCharacterA(hStdOut, ' ', cSBI.dwSize.X, cSBI.dwCursorPosition, &nCellsWritten); + + SetConsoleCursorPosition(hStdOut, cSBI.dwCursorPosition); + } + + void Console::ResetColor() + { + Console::SetColors(ConsoleColor::Gray, ConsoleColor::Black); + } + + void Console::SetForegroundColor(ConsoleColor Color) + { + auto hStdOut = ((IO::ConsoleStream*)ConsoleInstance.Out.GetBaseStream())->GetStreamHandle(); + + CONSOLE_SCREEN_BUFFER_INFO cSBI{}; + GetConsoleScreenBufferInfo(hStdOut, &cSBI); + + auto nColor = Console::ConsoleColorToColorAttribute(Color, false); + + int16_t Attrs = cSBI.wAttributes; + + Attrs &= ~((int16_t)Console::ForegroundMask); + Attrs = (int16_t)(((uint32_t)(uint16_t)Attrs) | ((uint32_t)(uint16_t)nColor)); + + SetConsoleTextAttribute(hStdOut, Attrs); + } + + void Console::SetBackgroundColor(ConsoleColor Color) + { + auto hStdOut = ((IO::ConsoleStream*)ConsoleInstance.Out.GetBaseStream())->GetStreamHandle(); + + CONSOLE_SCREEN_BUFFER_INFO cSBI{}; + GetConsoleScreenBufferInfo(hStdOut, &cSBI); + + auto nColor = Console::ConsoleColorToColorAttribute(Color, true); + + int16_t Attrs = cSBI.wAttributes; + + Attrs &= ~((int16_t)Console::BackgroundMask); + Attrs = (int16_t)(((uint32_t)(uint16_t)Attrs) | ((uint32_t)(uint16_t)nColor)); + + SetConsoleTextAttribute(hStdOut, Attrs); + } + + void Console::SetColors(ConsoleColor Foreground, ConsoleColor Background) + { + auto hStdOut = ((IO::ConsoleStream*)ConsoleInstance.Out.GetBaseStream())->GetStreamHandle(); + + CONSOLE_SCREEN_BUFFER_INFO cSBI{}; + GetConsoleScreenBufferInfo(hStdOut, &cSBI); + + auto nColor = Console::ConsoleColorToColorAttribute(Foreground, false); + auto nColor2 = Console::ConsoleColorToColorAttribute(Background, true); + + int16_t Attrs = cSBI.wAttributes; + + Attrs &= ~((int16_t)Console::ForegroundMask); + Attrs = (int16_t)(((uint32_t)(uint16_t)Attrs) | ((uint32_t)(uint16_t)nColor)); + + Attrs &= ~((int16_t)Console::BackgroundMask); + Attrs = (int16_t)(((uint32_t)(uint16_t)Attrs) | ((uint32_t)(uint16_t)nColor2)); + + SetConsoleTextAttribute(hStdOut, Attrs); + } + + void Console::SetBufferSize(uint32_t Width, uint32_t Height) + { + COORD cScreen; + cScreen.X = (SHORT)Width; + cScreen.Y = (SHORT)Height; + + SetConsoleScreenBufferSize(((IO::ConsoleStream*)ConsoleInstance.Out.GetBaseStream())->GetStreamHandle(), cScreen); + } + + void Console::SetCursorPosition(uint32_t Left, uint32_t Right) + { + auto hStdOut = ((IO::ConsoleStream*)ConsoleInstance.Out.GetBaseStream())->GetStreamHandle(); + + COORD cScreen; + cScreen.X = (SHORT)Left; + cScreen.Y = (SHORT)Right; + + SetConsoleCursorPosition(hStdOut, cScreen); + } + + void Console::SetWindowSize(uint32_t Width, uint32_t Height) + { + auto hStdOut = ((IO::ConsoleStream*)ConsoleInstance.Out.GetBaseStream())->GetStreamHandle(); + + CONSOLE_SCREEN_BUFFER_INFO cSBI{}; + GetConsoleScreenBufferInfo(hStdOut, &cSBI); + + COORD cScreen; + cScreen.X = cSBI.dwSize.X; + cScreen.Y = cSBI.dwSize.Y; + + bool nBufferResize = false; + if (cSBI.dwSize.X < (SHORT)(cSBI.srWindow.Left + Width)) + { + cScreen.X = (SHORT)(cSBI.srWindow.Left + Width); + nBufferResize = true; + } + if (cSBI.dwSize.Y < (SHORT)(cSBI.srWindow.Top + Height)) + { + cScreen.Y = (SHORT)(cSBI.srWindow.Top + Height); + nBufferResize = true; + } + + if (nBufferResize) + SetConsoleScreenBufferSize(hStdOut, cScreen); + + SMALL_RECT srWindow = cSBI.srWindow; + srWindow.Bottom = (SHORT)(srWindow.Top + Height - 1); + srWindow.Right = (SHORT)(srWindow.Left + Width - 1); + + auto hResult = SetConsoleWindowInfo(hStdOut, true, &srWindow); + if (!hResult) + SetConsoleScreenBufferSize(hStdOut, cSBI.dwSize); + } + + void Console::SetWindowPosition(uint32_t Left, uint32_t Top) + { + auto hStdOut = ((IO::ConsoleStream*)ConsoleInstance.Out.GetBaseStream())->GetStreamHandle(); + + CONSOLE_SCREEN_BUFFER_INFO cSBI{}; + GetConsoleScreenBufferInfo(hStdOut, &cSBI); + + SMALL_RECT srWindow = cSBI.srWindow; + + srWindow.Bottom -= (SHORT)(srWindow.Top - Top); + srWindow.Right -= (SHORT)(srWindow.Left - Left); + srWindow.Left = (SHORT)Left; + srWindow.Top = (SHORT)Top; + + SetConsoleWindowInfo(hStdOut, TRUE, &srWindow); + } + + void Console::SetFontSize(uint32_t Width, uint32_t Height, uint32_t Weight) + { + auto hStdOut = ((IO::ConsoleStream*)ConsoleInstance.Out.GetBaseStream())->GetStreamHandle(); + + CONSOLE_FONT_INFOEX cFont; + cFont.cbSize = sizeof(cFont); + + GetCurrentConsoleFontEx(hStdOut, false, &cFont); + + cFont.dwFontSize.X = Width; + cFont.dwFontSize.Y = Height; + cFont.FontWeight = Weight; + + SetCurrentConsoleFontEx(hStdOut, false, &cFont); + } + + void Console::SetTitle(const string& Value) + { + SetConsoleTitleA((const char*)Value); + } + + void Console::SetTitle(const char* Value) + { + SetConsoleTitleA(Value); + } + + void Console::SetCursorVisible(bool Visible) + { + auto hStdOut = ((IO::ConsoleStream*)ConsoleInstance.Out.GetBaseStream())->GetStreamHandle(); + + CONSOLE_CURSOR_INFO cCI{}; + GetConsoleCursorInfo(hStdOut, &cCI); + + cCI.bVisible = Visible; + + SetConsoleCursorInfo(hStdOut, &cCI); + } + + void Console::MoveBufferArea(uint32_t SourceLeft, uint32_t SourceTop, uint32_t SourceWidth, uint32_t SourceHeight, uint32_t TargetLeft, uint32_t TargetTop, char SourceChar, ConsoleColor SourceForeColor, ConsoleColor SourceBackColor) + { + auto hStdOut = ((IO::ConsoleStream*)ConsoleInstance.Out.GetBaseStream())->GetStreamHandle(); + + CONSOLE_SCREEN_BUFFER_INFO cSBI{}; + GetConsoleScreenBufferInfo(hStdOut, &cSBI); + + COORD BufferSize = cSBI.dwSize; + COORD BufferCoord{}; + SMALL_RECT ReadRegion{}; + + if (SourceWidth == 0 || SourceHeight == 0) + return; + + auto CharBuffer = std::make_unique(SourceWidth * SourceHeight); + + BufferSize.X = (SHORT)SourceWidth; + BufferSize.Y = (SHORT)SourceHeight; + ReadRegion.Left = (SHORT)SourceLeft; + ReadRegion.Right = (SHORT)(SourceLeft + SourceWidth - 1); + ReadRegion.Top = (SHORT)SourceTop; + ReadRegion.Bottom = (SHORT)(SourceTop + SourceHeight - 1); + + ReadConsoleOutput(hStdOut, CharBuffer.get(), BufferSize, BufferCoord, &ReadRegion); + + COLORREF NativeColor = (Console::ConsoleColorToColorAttribute(SourceBackColor, true) | Console::ConsoleColorToColorAttribute(SourceForeColor, false)); + DWORD nWrite = 0; + + COORD WriteCoord{}; + WriteCoord.X = (SHORT)SourceLeft; + + SHORT Attr = (SHORT)NativeColor; + for (uint32_t i = SourceTop; i < (SourceTop + SourceHeight); i++) + { + WriteCoord.Y = (SHORT)i; + + FillConsoleOutputCharacterA(hStdOut, SourceChar, SourceWidth, WriteCoord, &nWrite); + FillConsoleOutputAttribute(hStdOut, Attr, SourceWidth, WriteCoord, &nWrite); + } + + SMALL_RECT WriteRegion{}; + WriteRegion.Left = (SHORT)TargetLeft; + WriteRegion.Right = (SHORT)(TargetLeft + SourceWidth); + WriteRegion.Top = (SHORT)TargetTop; + WriteRegion.Bottom = (SHORT)(TargetTop + SourceHeight); + + WriteConsoleOutput(hStdOut, CharBuffer.get(), BufferSize, BufferCoord, &WriteRegion); + } + + void Console::SetMaximizeBoxVisible(bool Visible) + { + auto hConsole = GetConsoleWindow(); + auto Style = GetWindowLong(hConsole, GWL_STYLE); + + if (Visible) + Style |= WS_MAXIMIZEBOX; + else + Style &= ~WS_MAXIMIZEBOX; + + SetWindowLong(hConsole, GWL_STYLE, Style); + } + + void Console::SetMinimizeBoxVisible(bool Visible) + { + auto hConsole = GetConsoleWindow(); + auto Style = GetWindowLong(hConsole, GWL_STYLE); + + if (Visible) + Style |= WS_MINIMIZEBOX; + else + Style &= ~WS_MINIMIZEBOX; + + SetWindowLong(hConsole, GWL_STYLE, Style); + } + + void Console::SetWindowResizable(bool Resizable) + { + auto hConsole = GetConsoleWindow(); + auto Style = GetWindowLong(hConsole, GWL_STYLE); + + if (Resizable) + Style |= WS_SIZEBOX; + else + Style &= ~WS_SIZEBOX; + + SetWindowLong(hConsole, GWL_STYLE, Style); + } + + void Console::CenterWindow() + { + auto hConsole = GetConsoleWindow(); + auto hMonitor = MonitorFromWindow(hConsole, MONITOR_DEFAULTTONEAREST); + + if (hMonitor) + { + MONITORINFO Info; + Info.cbSize = sizeof(Info); + + if (GetMonitorInfo(hMonitor, &Info)) + { + RECT cRect{}; + GetWindowRect(hConsole, &cRect); + + auto Width = (cRect.right - cRect.left); + auto Height = (cRect.bottom - cRect.top); + + auto X = (Info.rcWork.left + Info.rcWork.right) / 2 - Width / 2; + auto Y = (Info.rcWork.top + Info.rcWork.bottom) / 2 - Height / 2; + + SetWindowPos(hConsole, NULL, X, Y, 0, 0, SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOSIZE); + } + } + } + + void Console::RemapConsoleColor(ConsoleColor Source, uint8_t R, uint8_t G, uint8_t B) + { + auto hStdOut = ((IO::ConsoleStream*)ConsoleInstance.Out.GetBaseStream())->GetStreamHandle(); + + CONSOLE_SCREEN_BUFFER_INFOEX cBuffer; + cBuffer.cbSize = sizeof(cBuffer); + GetConsoleScreenBufferInfoEx(hStdOut, &cBuffer); + + // GetConsoleScreenBufferInfoEx returns one short here, so we keep resizing each time... + cBuffer.srWindow.Bottom++; + cBuffer.srWindow.Right++; + + cBuffer.ColorTable[(int8_t)Source] = RGB(R, G, B); + + SetConsoleScreenBufferInfoEx(hStdOut, &cBuffer); + } + + void Console::RemapAllConsoleColors(std::initializer_list Colors) + { + static_assert(sizeof(Colors) == 16, "You must specify all 16 colors"); + + auto hStdOut = ((IO::ConsoleStream*)ConsoleInstance.Out.GetBaseStream())->GetStreamHandle(); + + CONSOLE_SCREEN_BUFFER_INFOEX cBuffer; + cBuffer.cbSize = sizeof(cBuffer); + GetConsoleScreenBufferInfoEx(hStdOut, &cBuffer); + + // GetConsoleScreenBufferInfoEx returns one short here, so we keep resizing each time... + cBuffer.srWindow.Bottom++; + cBuffer.srWindow.Right++; + + std::memcpy(cBuffer.ColorTable, Colors.begin(), sizeof(uint32_t) * 16); + + SetConsoleScreenBufferInfoEx(hStdOut, &cBuffer); + } + + string Console::GetTitle() + { + char Buffer[2048]{}; + GetConsoleTitleA(Buffer, 2048); // Honestly it would be too big at 256... + + return string(Buffer); + } + + bool Console::GetCursorVisible() + { + auto hStdOut = ((IO::ConsoleStream*)ConsoleInstance.Out.GetBaseStream())->GetStreamHandle(); + + CONSOLE_CURSOR_INFO cCI{}; + GetConsoleCursorInfo(hStdOut, &cCI); + + return cCI.bVisible; + } + + ConsoleColor Console::GetForegroundColor() + { + auto hStdOut = ((IO::ConsoleStream*)ConsoleInstance.Out.GetBaseStream())->GetStreamHandle(); + + CONSOLE_SCREEN_BUFFER_INFO cSBI{}; + GetConsoleScreenBufferInfo(hStdOut, &cSBI); + + return Console::ColorAttributeToConsoleColor((int16_t)(cSBI.wAttributes & Console::ForegroundMask)); + } + + ConsoleColor Console::GetBackgroundColor() + { + auto hStdOut = ((IO::ConsoleStream*)ConsoleInstance.Out.GetBaseStream())->GetStreamHandle(); + + CONSOLE_SCREEN_BUFFER_INFO cSBI{}; + GetConsoleScreenBufferInfo(hStdOut, &cSBI); + + return Console::ColorAttributeToConsoleColor((int16_t)(cSBI.wAttributes & Console::BackgroundMask)); + } + + void Console::Header(const char* Heading, ConsoleColor Color) + { + Console::SetColors(Color, ConsoleColor::DarkGray); + + auto sLen = strlen(Heading); + + char HeaderBuffer[21]; + std::memset(HeaderBuffer + 1, ' ', 19); + + HeaderBuffer[0] = '['; + HeaderBuffer[20] = (char)0; + HeaderBuffer[sLen + 1] = ']'; + + std::memcpy(HeaderBuffer + 1, Heading, sLen); + + ConsoleInstance.Out.Write((const char*)HeaderBuffer); + + Console::ResetColor(); + + ConsoleInstance.Out.Write(": "); + } + + void Console::Progress(const char* Heading, ConsoleColor Color, uint32_t Width, uint32_t Progress) + { + Progress = min(Progress, 100); + + ConsoleInstance.Out.Write("\r"); + Console::Header(Heading, Color); + + string Buffer(Width + 2, '\0', false); + Buffer.Append("["); + + uint32_t Blocks = min((uint32_t)((Progress / 100.f) * Width), Width); + for (uint32_t i = 0; i < Width; i++) + { + if (i < Blocks) + Buffer.Append("="); + else if (i == Blocks) + Buffer.Append(">"); + else + Buffer.Append(" "); + } + + Buffer.Append("]"); + + ConsoleInstance.Out.Write(Buffer); + } + + int32_t Console::Read() + { + return ConsoleInstance.In.Read(); + } + + ConsoleKeyInfo Console::ReadKey(bool Intercept) + { + INPUT_RECORD iRecord{}; + DWORD rRead = 0; + + auto hStdIn = ((IO::ConsoleStream*)ConsoleInstance.In.GetBaseStream())->GetStreamHandle(); + + while (true) + { + ReadConsoleInputA(hStdIn, &iRecord, 1, &rRead); + + int16_t kCode = iRecord.Event.KeyEvent.wVirtualKeyCode; + + if (!IsKeyDownEvent(iRecord)) + if (kCode != AltVKCode) + continue; + + char Ch = (char)iRecord.Event.KeyEvent.uChar.AsciiChar; + + if (Ch == 0) + if (IsModKey(iRecord)) + continue; + + ConsoleKey key = (ConsoleKey)kCode; + if (IsAltKeyDown(iRecord) && ((key >= ConsoleKey::NumPad0 && key <= ConsoleKey::NumPad9) || (key == ConsoleKey::Clear) || (key == ConsoleKey::Insert) || (key >= ConsoleKey::PageUp && key <= ConsoleKey::DownArrow))) + continue; + + // We passed all checks + break; + } + + // Calculate key status + auto State = iRecord.Event.KeyEvent.dwControlKeyState; + bool Shift = (State & (uint32_t)ControlKeyState::ShiftPressed) != 0; + bool Alt = (State & ((uint32_t)ControlKeyState::LeftAltPressed | (uint32_t)ControlKeyState::RightAltPressed)) != 0; + bool Control = (State & ((uint32_t)ControlKeyState::LeftCtrlPressed | (uint32_t)ControlKeyState::RightCtrlPressed)) != 0; + + if (!Intercept) + { + char iBuffer[] = { iRecord.Event.KeyEvent.uChar.AsciiChar, 0 }; + Console::Write(iBuffer); + } + + return ConsoleKeyInfo((char)iRecord.Event.KeyEvent.uChar.AsciiChar, (ConsoleKey)iRecord.Event.KeyEvent.wVirtualKeyCode, Shift, Alt, Control); + } + + string Console::ReadLine() + { + return ConsoleInstance.In.ReadLine(); + } + + bool Console::IsKeyDownEvent(INPUT_RECORD iRecord) + { + return (iRecord.EventType == KEY_EVENT && iRecord.Event.KeyEvent.bKeyDown); + } + + bool Console::IsModKey(INPUT_RECORD iRecord) + { + int16_t keyCode = iRecord.Event.KeyEvent.wVirtualKeyCode; + + return ((keyCode >= 0x10 && keyCode <= 0x12) || keyCode == 0x14 || keyCode == 0x90 || keyCode == 0x91); + } + + bool Console::IsAltKeyDown(INPUT_RECORD iRecord) + { + return ((iRecord.Event.KeyEvent.dwControlKeyState) & ((uint32_t)ControlKeyState::LeftAltPressed | (uint32_t)ControlKeyState::RightAltPressed)) != 0; + } + + ConsoleColor Console::ColorAttributeToConsoleColor(int16_t Attribute) + { + if ((Attribute & Console::BackgroundMask) != 0) + Attribute = (int32_t)(((int32_t)Attribute) >> 4); + + return ConsoleColor(Attribute); + } + + int16_t Console::ConsoleColorToColorAttribute(ConsoleColor Color, bool isBackground) + { + auto Result = (int16_t)Color; + + if (isBackground) + Result = (int16_t)((int32_t)Result << 4); + + return Result; + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/Console.h b/r5dev/thirdparty/cppnet/cppkore/Console.h new file mode 100644 index 00000000..d1d35dda --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Console.h @@ -0,0 +1,133 @@ +#pragma once + +#include +#include +#include "StringBase.h" +#include "ConsoleKey.h" +#include "ConsoleColor.h" +#include "__ConsoleInit.h" +#include "ConsoleKeyInfo.h" + +namespace System +{ + class Console + { + public: + // Trigger a standard console beep sound + static void Beep(); + // Trigger a custom console beep sound + static void Beep(uint32_t Frequency, uint32_t Duration); + // Clears the console window + static void Clear(); + // Clears the current console line + static void ClearLine(); + // Resets the colors + static void ResetColor(); + + // Sets the foreground color + static void SetForegroundColor(ConsoleColor Color); + // Sets the background color + static void SetBackgroundColor(ConsoleColor Color); + // Sets both colors + static void SetColors(ConsoleColor Foreground, ConsoleColor Background); + + // Sets the console buffer size + static void SetBufferSize(uint32_t Width, uint32_t Height); + // Moves the cursor to the specified position + static void SetCursorPosition(uint32_t Left, uint32_t Right); + // Changes the size of the console window + static void SetWindowSize(uint32_t Width, uint32_t Height); + // Changes the position of the console window + static void SetWindowPosition(uint32_t Left, uint32_t Top); + // Changes the font of the console window + static void SetFontSize(uint32_t Width, uint32_t Height, uint32_t Weight); + // Sets the window title + static void SetTitle(const string& Value); + // Sets the window title + static void SetTitle(const char* Value); + // Sets whether or not the cursor is visible + static void SetCursorVisible(bool Visible); + + // Moves the specified area in the buffer to another location + static void MoveBufferArea(uint32_t SourceLeft, uint32_t SourceTop, uint32_t SourceWidth, uint32_t SourceHeight, uint32_t TargetLeft, uint32_t TargetTop, char SourceChar, ConsoleColor SourceForeColor = ConsoleColor::Gray, ConsoleColor SourceBackColor = ConsoleColor::Black); + + // Sets whether or not the maximize box is visible + static void SetMaximizeBoxVisible(bool Visible); + // Sets whether or not the minimize box is visible + static void SetMinimizeBoxVisible(bool Visible); + // Make the window resizable + static void SetWindowResizable(bool Resizable); + + // Centers the console window on the current screen + static void CenterWindow(); + + // Reassign an existing console color + static void RemapConsoleColor(ConsoleColor Source, uint8_t R, uint8_t G, uint8_t B); + // Reassign all existing console colors + static void RemapAllConsoleColors(std::initializer_list Colors); + + // Gets the window title + static string GetTitle(); + // Gets whether or not the cursor is visible + static bool GetCursorVisible(); + // Gets the current foreground color + static ConsoleColor GetForegroundColor(); + // Gets the current background color + static ConsoleColor GetBackgroundColor(); + + // Writes text to the console + template + static void Write(const char* Format, TArgs&&... Args); + // Writes a line to the console + template + static void WriteLine(const char* Format = nullptr, TArgs&&... Args); + + // Writes a heading to the console + static void Header(const char* Heading, ConsoleColor Color); + // Generates a progress bar in the console + static void Progress(const char* Heading, ConsoleColor Color, uint32_t Width, uint32_t Progress); + + // Read a character + static int32_t Read(); + // Reads a key + static ConsoleKeyInfo ReadKey(bool Intercept = false); + // Reads a line from the console + static string ReadLine(); + + private: + + // Internal routine for IsKeyDown event + static bool IsKeyDownEvent(INPUT_RECORD iRecord); + // Internal routine for IsModKey event + static bool IsModKey(INPUT_RECORD iRecord); + // Internal routine for IsAltKeyDown event + static bool IsAltKeyDown(INPUT_RECORD iRecord); + + // Internal routine to convert an internal console color to a ConsoleColor + static ConsoleColor ColorAttributeToConsoleColor(int16_t Attribute); + // Internal routine to convert a ConsoleColor to an internal console color + static int16_t ConsoleColorToColorAttribute(ConsoleColor Color, bool isBackground); + + // Internal console handle + static __ConsoleInit ConsoleInstance; + + // The alternate virtual key code + static constexpr int16_t AltVKCode = 0x12; + + // Masks for internal data + static constexpr int16_t ForegroundMask = 0xf; + static constexpr int16_t BackgroundMask = 0xf0; + }; + + template + inline void Console::Write(const char* Format, TArgs&&... Args) + { + ConsoleInstance.Out.WriteFmt(Format, std::forward(Args)...); + } + + template + inline void Console::WriteLine(const char* Format, TArgs&&... Args) + { + ConsoleInstance.Out.WriteLineFmt(Format, std::forward(Args)...); + } +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/ConsoleColor.cpp b/r5dev/thirdparty/cppnet/cppkore/ConsoleColor.cpp new file mode 100644 index 00000000..e1f234b8 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ConsoleColor.cpp @@ -0,0 +1,23 @@ +#include "stdafx.h" +#include "ConsoleColor.h" + +namespace System +{ + // Predefine the existing colors + ConsoleColor ConsoleColor::Black = ConsoleColor(0); + ConsoleColor ConsoleColor::DarkBlue = ConsoleColor(1); + ConsoleColor ConsoleColor::DarkGreen = ConsoleColor(2); + ConsoleColor ConsoleColor::DarkCyan = ConsoleColor(3); + ConsoleColor ConsoleColor::DarkRed = ConsoleColor(4); + ConsoleColor ConsoleColor::DarkMagenta = ConsoleColor(5); + ConsoleColor ConsoleColor::DarkYellow = ConsoleColor(6); + ConsoleColor ConsoleColor::Gray = ConsoleColor(7); + ConsoleColor ConsoleColor::DarkGray = ConsoleColor(8); + ConsoleColor ConsoleColor::Blue = ConsoleColor(9); + ConsoleColor ConsoleColor::Green = ConsoleColor(10); + ConsoleColor ConsoleColor::Cyan = ConsoleColor(11); + ConsoleColor ConsoleColor::Red = ConsoleColor(12); + ConsoleColor ConsoleColor::Magenta = ConsoleColor(13); + ConsoleColor ConsoleColor::Yellow = ConsoleColor(14); + ConsoleColor ConsoleColor::White = ConsoleColor(15); +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/ConsoleColor.h b/r5dev/thirdparty/cppnet/cppkore/ConsoleColor.h new file mode 100644 index 00000000..4fccba40 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ConsoleColor.h @@ -0,0 +1,69 @@ +#pragma once + +#include + +namespace System +{ + // This represents the colors that can be used for console text foreground and background colors. + struct ConsoleColor + { + union + { + uint32_t NativeIndex; + uint32_t Color; + }; + + constexpr ConsoleColor() + : NativeIndex(0) + { + } + + // Construct a ConsoleColor from the built-in index + constexpr ConsoleColor(uint32_t Index) + : NativeIndex(Index) + { + } + + // Construct a new ConsoleColor from the given RGB + constexpr ConsoleColor(uint8_t R, uint8_t G, uint8_t B) + : Color(((uint32_t)(((uint8_t)(R) | ((uint16_t)((uint8_t)(G)) << 8)) | (((uint32_t)(uint8_t)(B)) << 16)))) + { + } + + constexpr operator const uint32_t(void) const + { + return (uint32_t)NativeIndex; + } + constexpr operator const int32_t(void) const + { + return (int32_t)NativeIndex; + } + constexpr operator const int8_t(void) const + { + return (int8_t)NativeIndex; + } + constexpr operator const int16_t(void) const + { + return (int16_t)NativeIndex; + } + + static ConsoleColor Black; + static ConsoleColor DarkBlue; + static ConsoleColor DarkGreen; + static ConsoleColor DarkCyan; + static ConsoleColor DarkRed; + static ConsoleColor DarkMagenta; + static ConsoleColor DarkYellow; + static ConsoleColor Gray; + static ConsoleColor DarkGray; + static ConsoleColor Blue; + static ConsoleColor Green; + static ConsoleColor Cyan; + static ConsoleColor Red; + static ConsoleColor Magenta; + static ConsoleColor Yellow; + static ConsoleColor White; + }; + + static_assert(sizeof(ConsoleColor) == 4, "System::ConsoleColor size mismatch, expected 4!"); +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/ConsoleKey.h b/r5dev/thirdparty/cppnet/cppkore/ConsoleKey.h new file mode 100644 index 00000000..8cf96ccc --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ConsoleKey.h @@ -0,0 +1,196 @@ +#pragma once + +#include + +namespace System +{ + // This enumeration represents characters returned from a keyboard. + enum class ConsoleKey : int16_t + { + Backspace = 0x8, + Tab = 0x9, + // 0xA, // Reserved + // 0xB, // Reserved + Clear = 0xC, + Enter = 0xD, + // 0E-0F, // Undefined + // SHIFT = 0x10, + // CONTROL = 0x11, + // Alt = 0x12, + Pause = 0x13, + // CAPSLOCK = 0x14, + // Kana = 0x15, // Ime Mode + // Hangul = 0x15, // Ime Mode + // 0x16, // Undefined + // Junja = 0x17, // Ime Mode + // Final = 0x18, // Ime Mode + // Hanja = 0x19, // Ime Mode + // Kanji = 0x19, // Ime Mode + // 0x1A, // Undefined + Escape = 0x1B, + // Convert = 0x1C, // Ime Mode + // NonConvert = 0x1D, // Ime Mode + // Accept = 0x1E, // Ime Mode + // ModeChange = 0x1F, // Ime Mode + Spacebar = 0x20, + PageUp = 0x21, + PageDown = 0x22, + End = 0x23, + Home = 0x24, + LeftArrow = 0x25, + UpArrow = 0x26, + RightArrow = 0x27, + DownArrow = 0x28, + Select = 0x29, + Print = 0x2A, + Execute = 0x2B, + PrintScreen = 0x2C, + Insert = 0x2D, + Delete = 0x2E, + Help = 0x2F, + D0 = 0x30, // 0 through 9 + D1 = 0x31, + D2 = 0x32, + D3 = 0x33, + D4 = 0x34, + D5 = 0x35, + D6 = 0x36, + D7 = 0x37, + D8 = 0x38, + D9 = 0x39, + // 3A-40 , // Undefined + A = 0x41, + B = 0x42, + C = 0x43, + D = 0x44, + E = 0x45, + F = 0x46, + G = 0x47, + H = 0x48, + I = 0x49, + J = 0x4A, + K = 0x4B, + L = 0x4C, + M = 0x4D, + N = 0x4E, + O = 0x4F, + P = 0x50, + Q = 0x51, + R = 0x52, + S = 0x53, + T = 0x54, + U = 0x55, + V = 0x56, + W = 0x57, + X = 0x58, + Y = 0x59, + Z = 0x5A, + LeftWindows = 0x5B, // Microsoft Natural keyboard + RightWindows = 0x5C, // Microsoft Natural keyboard + Applications = 0x5D, // Microsoft Natural keyboard + // 5E , // Reserved + Sleep = 0x5F, // Computer Sleep Key + NumPad0 = 0x60, + NumPad1 = 0x61, + NumPad2 = 0x62, + NumPad3 = 0x63, + NumPad4 = 0x64, + NumPad5 = 0x65, + NumPad6 = 0x66, + NumPad7 = 0x67, + NumPad8 = 0x68, + NumPad9 = 0x69, + Multiply = 0x6A, + Add = 0x6B, + Separator = 0x6C, + Subtract = 0x6D, + Decimal = 0x6E, + Divide = 0x6F, + F1 = 0x70, + F2 = 0x71, + F3 = 0x72, + F4 = 0x73, + F5 = 0x74, + F6 = 0x75, + F7 = 0x76, + F8 = 0x77, + F9 = 0x78, + F10 = 0x79, + F11 = 0x7A, + F12 = 0x7B, + F13 = 0x7C, + F14 = 0x7D, + F15 = 0x7E, + F16 = 0x7F, + F17 = 0x80, + F18 = 0x81, + F19 = 0x82, + F20 = 0x83, + F21 = 0x84, + F22 = 0x85, + F23 = 0x86, + F24 = 0x87, + // 88-8F, // Undefined + // NumberLock = 0x90, + // ScrollLock = 0x91, + // 0x92, // OEM Specific + // 97-9F , // Undefined + // LeftShift = 0xA0, + // RightShift = 0xA1, + // LeftControl = 0xA2, + // RightControl = 0xA3, + // LeftAlt = 0xA4, + // RightAlt = 0xA5, + BrowserBack = 0xA6, // Windows 2000/XP + BrowserForward = 0xA7, // Windows 2000/XP + BrowserRefresh = 0xA8, // Windows 2000/XP + BrowserStop = 0xA9, // Windows 2000/XP + BrowserSearch = 0xAA, // Windows 2000/XP + BrowserFavorites = 0xAB, // Windows 2000/XP + BrowserHome = 0xAC, // Windows 2000/XP + VolumeMute = 0xAD, // Windows 2000/XP + VolumeDown = 0xAE, // Windows 2000/XP + VolumeUp = 0xAF, // Windows 2000/XP + MediaNext = 0xB0, // Windows 2000/XP + MediaPrevious = 0xB1, // Windows 2000/XP + MediaStop = 0xB2, // Windows 2000/XP + MediaPlay = 0xB3, // Windows 2000/XP + LaunchMail = 0xB4, // Windows 2000/XP + LaunchMediaSelect = 0xB5, // Windows 2000/XP + LaunchApp1 = 0xB6, // Windows 2000/XP + LaunchApp2 = 0xB7, // Windows 2000/XP + // B8-B9, // Reserved + Oem1 = 0xBA, // Misc characters, varies by keyboard. For US standard, ;: + OemPlus = 0xBB, // Misc characters, varies by keyboard. For US standard, + + OemComma = 0xBC, // Misc characters, varies by keyboard. For US standard, , + OemMinus = 0xBD, // Misc characters, varies by keyboard. For US standard, - + OemPeriod = 0xBE, // Misc characters, varies by keyboard. For US standard, . + Oem2 = 0xBF, // Misc characters, varies by keyboard. For US standard, /? + Oem3 = 0xC0, // Misc characters, varies by keyboard. For US standard, `~ + // 0xC1, // Reserved + // D8-DA, // Unassigned + Oem4 = 0xDB, // Misc characters, varies by keyboard. For US standard, [{ + Oem5 = 0xDC, // Misc characters, varies by keyboard. For US standard, \| + Oem6 = 0xDD, // Misc characters, varies by keyboard. For US standard, ]} + Oem7 = 0xDE, // Misc characters, varies by keyboard. For US standard, + Oem8 = 0xDF, // Used for miscellaneous characters; it can vary by keyboard + // 0xE0, // Reserved + // 0xE1, // OEM specific + Oem102 = 0xE2, // Win2K/XP: Either angle or backslash on RT 102-key keyboard + // 0xE3, // OEM specific + Process = 0xE5, // Windows: IME Process Key + // 0xE6, // OEM specific + Packet = 0xE7, // Win2K/XP: Used to pass Unicode chars as if keystrokes + // 0xE8, // Unassigned + // 0xE9, // OEM specific + Attention = 0xF6, + CrSel = 0xF7, + ExSel = 0xF8, + EraseEndOfFile = 0xF9, + Play = 0xFA, + Zoom = 0xFB, + NoName = 0xFC, // Reserved + Pa1 = 0xFD, + OemClear = 0xFE, + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/ConsoleKeyInfo.h b/r5dev/thirdparty/cppnet/cppkore/ConsoleKeyInfo.h new file mode 100644 index 00000000..afe81b27 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ConsoleKeyInfo.h @@ -0,0 +1,35 @@ +#pragma once + +#include +#include "ConsoleKey.h" + +namespace System +{ + // Control key modifiers + enum class ConsoleModifiers : uint8_t + { + None = 0, + Alt = 1, + Shift = 2, + Control = 4 + }; + + // Information about the current keystroke + struct ConsoleKeyInfo + { + char KeyChar; + ConsoleKey Key; + ConsoleModifiers Modifiers; + + ConsoleKeyInfo(char kChar, ConsoleKey Key, bool Shift, bool Alt, bool Control) + : KeyChar(kChar), Key(Key), Modifiers(ConsoleModifiers::None) + { + if (Shift) + *(uint8_t*)&Modifiers |= (uint8_t)ConsoleModifiers::Shift; + if (Alt) + *(uint8_t*)&Modifiers |= (uint8_t)ConsoleModifiers::Alt; + if (Control) + *(uint8_t*)&Modifiers |= (uint8_t)ConsoleModifiers::Control; + } + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/ConsoleStream.cpp b/r5dev/thirdparty/cppnet/cppkore/ConsoleStream.cpp new file mode 100644 index 00000000..f37f7d36 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ConsoleStream.cpp @@ -0,0 +1,131 @@ +#include "stdafx.h" +#include "ConsoleStream.h" + +namespace IO +{ + ConsoleStream::ConsoleStream(HANDLE StreamHandle, FileAccess Access) + : _Handle(StreamHandle) + { + this->_CanRead = (((uint8_t)Access & (uint8_t)FileAccess::Read) == (uint8_t)FileAccess::Read); + this->_CanRead = (((uint8_t)Access & (uint8_t)FileAccess::Write) == (uint8_t)FileAccess::Write); + this->_IsPipe = (GetFileType(StreamHandle) == FILE_TYPE_PIPE); + } + + ConsoleStream::~ConsoleStream() + { + this->Close(); + } + + void ConsoleStream::Seek(uint64_t Offset, SeekOrigin Origin) + { + IOError::StreamNoSeekSupport(); + } + + uint64_t ConsoleStream::Read(uint8_t* Buffer, uint64_t Offset, uint64_t Count) + { + // Wait for available input... + ConsoleStream::WaitForAvailableConsoleInput(this->_Handle, this->_IsPipe); + + DWORD bRead = 0; + ReadFile(this->_Handle, Buffer + Offset, (DWORD)Count, &bRead, NULL); + + return bRead; + } + + uint64_t ConsoleStream::Read(uint8_t * Buffer, uint64_t Offset, uint64_t Count, uint64_t Position) + { + IOError::StreamNoSeekSupport(); + + return 0; + } + + void ConsoleStream::Write(uint8_t* Buffer, uint64_t Offset, uint64_t Count) + { + DWORD bWrite = 0; + WriteFile(this->_Handle, Buffer + Offset, (DWORD)Count, &bWrite, NULL); + } + + void ConsoleStream::Write(uint8_t * Buffer, uint64_t Offset, uint64_t Count, uint64_t Position) + { + IOError::StreamNoSeekSupport(); + } + + HANDLE ConsoleStream::GetStreamHandle() const + { + return this->_Handle; + } + + void ConsoleStream::Close() + { + this->_Handle = nullptr; + this->_CanRead = false; + this->_CanWrite = false; + } + + void ConsoleStream::Flush() + { + } + + bool ConsoleStream::CanRead() + { + return this->_CanRead; + } + + bool ConsoleStream::CanWrite() + { + return this->_CanWrite; + } + + bool ConsoleStream::CanSeek() + { + return false; + } + + bool ConsoleStream::GetIsEndOfFile() + { + return false; + } + + uint64_t ConsoleStream::GetLength() + { + return 0; + } + uint64_t ConsoleStream::GetPosition() + { + return 0; + } + + void ConsoleStream::SetLength(uint64_t Length) + { + IOError::StreamNoSeekSupport(); + } + + void ConsoleStream::SetPosition(uint64_t Position) + { + IOError::StreamNoSeekSupport(); + } + + void ConsoleStream::WaitForAvailableConsoleInput(HANDLE hHandle, bool IsPipe) + { + bool sWait = false; + + if (IsPipe) + { + + DWORD cBytesRead, cTotalBytesAvailable, cBytesLeftThisMessage; + auto Result = PeekNamedPipe(hHandle, NULL, 0, &cBytesRead, &cTotalBytesAvailable, &cBytesLeftThisMessage); + if (Result != 0) + { + sWait = (cTotalBytesAvailable > 0); + } + else + { + auto eCode = GetLastError(); + sWait = eCode == ERROR_BROKEN_PIPE || eCode == ERROR_NO_DATA || eCode == ERROR_PIPE_NOT_CONNECTED; + } + } + + if (!sWait) + WaitForSingleObjectEx(hHandle, INFINITE, TRUE); + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/ConsoleStream.h b/r5dev/thirdparty/cppnet/cppkore/ConsoleStream.h new file mode 100644 index 00000000..d8fe42f8 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ConsoleStream.h @@ -0,0 +1,52 @@ +#pragma once + +#include "Stream.h" +#include "FileMode.h" +#include "FileAccess.h" +#include "FileShare.h" +#include + +namespace IO +{ + // ConsoleStream supports reading and writing from stdin/out + class ConsoleStream : public Stream + { + public: + ConsoleStream(HANDLE StreamHandle, FileAccess Access); + virtual ~ConsoleStream(); + + // Implement Getters and Setters + virtual bool CanRead(); + virtual bool CanWrite(); + virtual bool CanSeek(); + virtual bool GetIsEndOfFile(); + virtual uint64_t GetLength(); + virtual uint64_t GetPosition(); + virtual void SetLength(uint64_t Length); + virtual void SetPosition(uint64_t Position); + + // Implement functions + virtual void Close(); + virtual void Flush(); + virtual void Seek(uint64_t Offset, SeekOrigin Origin); + virtual uint64_t Read(uint8_t* Buffer, uint64_t Offset, uint64_t Count); + virtual uint64_t Read(uint8_t* Buffer, uint64_t Offset, uint64_t Count, uint64_t Position); + virtual void Write(uint8_t* Buffer, uint64_t Offset, uint64_t Count); + virtual void Write(uint8_t* Buffer, uint64_t Offset, uint64_t Count, uint64_t Position); + + // Retreive the internal stream handle + virtual HANDLE GetStreamHandle() const; + + private: + // FileMode flags cached + bool _CanRead; + bool _CanWrite; + bool _IsPipe; + + // Internal routine to wait for input + static void WaitForAvailableConsoleInput(HANDLE hHandle, bool IsPipe); + + // The handle + HANDLE _Handle; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/ContainerControl.cpp b/r5dev/thirdparty/cppnet/cppkore/ContainerControl.cpp new file mode 100644 index 00000000..fc079f25 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ContainerControl.cpp @@ -0,0 +1,452 @@ +#include "stdafx.h" +#include "ContainerControl.h" +#include "Form.h" + +namespace Forms +{ + ContainerControl::ContainerControl() + : Control(), _ActiveControl(nullptr), _FocusedControl(nullptr), _AutoScaleDimensions{}, _CurrentAutoScaleDimensions{}, _AutoScaleMode(AutoScaleMode::Inherit), _ScalingNeededOnLayout(false) + { + SetStyle(ControlStyles::AllPaintingInWmPaint, false); + } + + Control* ContainerControl::ActiveControl() + { + return this->_ActiveControl; + } + + void ContainerControl::SetActiveControl(Control* Value) + { + SetActiveControlInternal(Value); + } + + bool ContainerControl::ActivateControl(Control* Value) + { + return ActivateControlInternal(Value, true); + } + + Drawing::SizeF ContainerControl::AutoScaleDimensions() + { + return this->_AutoScaleDimensions; + } + + void ContainerControl::SetAutoScaleDimensions(Drawing::SizeF Size) + { + this->_AutoScaleDimensions = Size; + if (!this->_AutoScaleDimensions.Empty()) + { + this->LayoutScalingNeeded(); + } + } + + Drawing::SizeF ContainerControl::CurrentAutoScaleDimensions() + { + if (this->_CurrentAutoScaleDimensions.Empty()) + { + switch (this->_AutoScaleMode) + { + case AutoScaleMode::Font: + this->_CurrentAutoScaleDimensions = this->GetFontAutoScaleDimensions(); + break; + case AutoScaleMode::Dpi: + // TODO: Handle dpi related scaling values... + break; + + default: + this->_CurrentAutoScaleDimensions = this->AutoScaleDimensions(); + break; + } + } + + return this->_CurrentAutoScaleDimensions; + } + + AutoScaleMode ContainerControl::AutoScaleMode() + { + return this->_AutoScaleMode; + } + + void ContainerControl::SetAutoScaleMode(Forms::AutoScaleMode Mode) + { + bool ScalingRequired = false; + + if (Mode != this->_AutoScaleMode) + { + if (_AutoScaleMode != Forms::AutoScaleMode::Inherit) + { + this->_AutoScaleDimensions = Drawing::SizeF{}; + } + + this->_AutoScaleMode = Mode; + ScalingRequired = true; + } + + // TODO: OnAutoScaleModeChanged(); + + if (ScalingRequired) + this->LayoutScalingNeeded(); + } + + void ContainerControl::WndProc(Message& Msg) + { + switch (Msg.Msg) + { + case WM_SETFOCUS: + WmSetFocus(Msg); + break; + default: + Control::WndProc(Msg); + break; + } + } + + CreateParams ContainerControl::GetCreateParams() + { + auto Cp = Control::GetCreateParams(); + Cp.ExStyle |= WS_EX_CONTROLPARENT; + + return Cp; + } + + bool ContainerControl::IsContainerControl() + { + return true; + } + + void ContainerControl::WmSetFocus(Message& Msg) + { + if (_ActiveControl != nullptr) + { + if (!_ActiveControl->Visible()) + this->OnGotFocus(); + + FocusActiveControlInternal(); + } + else + { + if (_Parent != nullptr) + { + ContainerControl* C = (ContainerControl*)_Parent->GetContainerControl(); + if (C != nullptr) + { + if (!C->ActivateControlInternal(this, true)) + return; + } + } + + Control::WndProc(Msg); + } + } + + void ContainerControl::LayoutScalingNeeded() + { + this->EnableRequiredScaling(this, true); + this->_ScalingNeededOnLayout = true; + } + + void ContainerControl::EnableRequiredScaling(Control *Ctrl, bool Enable) + { + Ctrl->SetRequiredScalingEnabled(Enable); + + if (!Ctrl->GetStyle(ControlStyles::ContainerControl) || Ctrl->Controls() == nullptr) + return; + + uint32_t ControlCount = Ctrl->Controls()->Count(); + auto& ControlList = *Ctrl->Controls().get(); + + for (uint32_t i = 0; i < ControlCount; i++) + { + EnableRequiredScaling(ControlList[i], Enable); + } + } + + void ContainerControl::PerformNeededAutoScaleOnLayout() + { + if (this->_ScalingNeededOnLayout) + { + this->PerformAutoScale(this->_ScalingNeededOnLayout, false); + } + } + + void ContainerControl::PerformAutoScale(bool IncludeBounds, bool ExcludeBounds) + { + bool Suspended = false; + + if (this->_AutoScaleMode != AutoScaleMode::None && this->_AutoScaleMode != AutoScaleMode::Inherit) + { + // TODO: SuspendAllLayout(this) + Suspended = true; + + Drawing::SizeF Included{}; + Drawing::SizeF Excluded{}; + + if (IncludeBounds) + Included = this->AutoScaleFactor(); + if (ExcludeBounds) + Excluded = this->AutoScaleFactor(); + + this->Scale(Included, Excluded, this); + this->_AutoScaleDimensions = this->CurrentAutoScaleDimensions(); + } + + if (IncludeBounds) + { + this->_ScalingNeededOnLayout = false; + this->EnableRequiredScaling(this, false); + } + + if (Suspended) + { + // TODO: ResumeAllLayout(this, false); + } + } + + Drawing::SizeF ContainerControl::GetFontAutoScaleDimensions() + { + Drawing::SizeF Result{}; + + auto hDC = CreateCompatibleDC(nullptr); + auto CurrentFont = this->GetFont(); + auto OldFont = SelectObject(hDC, CurrentFont->GetFontHandle()); + + TEXTMETRICA Tm{}; + GetTextMetricsA(hDC, &Tm); + + Result.Height = (float)Tm.tmHeight; + + if ((Tm.tmPitchAndFamily & TMPF_FIXED_PITCH) != 0) + { + constexpr const char* FontMeasureString = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + const uint32_t FontMeasureSize = (uint32_t)strlen(FontMeasureString); + + SIZE Sz{}; + GetTextExtentPoint32A(hDC, FontMeasureString, FontMeasureSize, &Sz); + Result.Width = (float)(int)std::roundf(((float)Sz.cx) / ((float)FontMeasureSize)); + } + else + { + Result.Width = (float)Tm.tmAveCharWidth; + } + + SelectObject(hDC, OldFont); + DeleteDC(hDC); + + return Result; + } + + bool ContainerControl::ActivateControlInternal(Control* Ctrl, bool Originator) + { + bool Result = true; + bool UpdateContainerActiveControl = false; + + ContainerControl* Cc = nullptr; + Control* Parent = this->_Parent; + + if (Parent != nullptr) + { + Cc = (ContainerControl*)Parent->GetContainerControl(); + + if (Cc != nullptr) + { + UpdateContainerActiveControl = (Cc->ActiveControl() != this); + } + } + + if (Ctrl != _ActiveControl || UpdateContainerActiveControl) + { + if (UpdateContainerActiveControl) + { + if (!Cc->ActivateControlInternal(this, false)) + return false; + } + + Result = AssignActiveControlInternal((Ctrl == this) ? nullptr : Ctrl); + } + + if (Originator) + { + // TODO: ScrollActiveControlIntoView(); + } + + return Result; + } + + bool ContainerControl::AssignActiveControlInternal(Control* Ctrl) + { + if (_ActiveControl != Ctrl) + { + _ActiveControl = Ctrl; + // TODO: UpdateFocusedControl(); + + if (_ActiveControl == Ctrl) + { + auto FormCtrl = (Form*)FindForm(); + if (FormCtrl != nullptr) + FormCtrl->UpdateDefaultButton(); + } + } + else + { + _FocusedControl = _ActiveControl; + } + + return (_ActiveControl == Ctrl); + } + + void ContainerControl::Select(bool Directed, bool Forward) + { + bool CorrectParentActiveControl = true; + if (this->_Parent != nullptr) + { + auto C = (ContainerControl*)this->_Parent->GetContainerControl(); + if (C != nullptr) + { + C->SetActiveControl(this); + CorrectParentActiveControl = (C->ActiveControl() == this); + } + } + + if (Directed && CorrectParentActiveControl) + SelectNextControl(nullptr, Forward, true, true, false); + } + + void ContainerControl::Scale(Drawing::SizeF IncludedFactor, Drawing::SizeF ExcludedFactor, Control* Ctrl) + { + if (this->_AutoScaleMode == AutoScaleMode::Inherit) + { + Control::Scale(IncludedFactor, ExcludedFactor, Ctrl); + } + else + { + Drawing::SizeF OurExcludedFactor = ExcludedFactor; + Drawing::SizeF ChildIncludedFactor = IncludedFactor; + + if (!OurExcludedFactor.Empty()) + OurExcludedFactor = this->AutoScaleFactor(); + + // If we're not supposed to be scaling, don't scale the internal ones either. + if (this->AutoScaleMode() == AutoScaleMode::None) + ChildIncludedFactor = this->AutoScaleFactor(); + + Drawing::SizeF OurExternalContainerFactor = OurExcludedFactor; + + if (!ExcludedFactor.Empty() && this->_Parent != nullptr) + { + OurExternalContainerFactor = Drawing::SizeF{}; + + if ((Ctrl != this)) + { + OurExternalContainerFactor = ExcludedFactor; + } + } + + ScaleControl(IncludedFactor, OurExternalContainerFactor, Ctrl); + ScaleChildControls(ChildIncludedFactor, OurExcludedFactor, Ctrl); + } + } + + void ContainerControl::OnLayoutResuming(bool PerformLayout) + { + this->PerformNeededAutoScaleOnLayout(); + Control::OnLayoutResuming(PerformLayout); + } + + void ContainerControl::OnChildLayoutResuming(Control* Child, bool PerformLayout) + { + Control::OnChildLayoutResuming(Child, PerformLayout); + + // Do not scale children if AutoScaleMode is set to Dpi + if (/*DpiHelper.EnableSinglePassScalingOfDpiForms &&*/ (this->_AutoScaleMode == AutoScaleMode::Dpi)) + { + return; + } + + // Perform scaling of the child control + if (!PerformLayout && this->_AutoScaleMode != AutoScaleMode::None && this->_AutoScaleMode != AutoScaleMode::Inherit && this->_ScalingNeededOnLayout) + { + Child->Scale(this->AutoScaleFactor(), Drawing::SizeF{}, this); + } + } + + void ContainerControl::FocusActiveControlInternal() + { + if (_ActiveControl != nullptr && _ActiveControl->Visible()) + { + auto FocusHandle = GetFocus(); + if (FocusHandle == NULL || FocusHandle != _ActiveControl->GetHandle()) + SetFocus(_ActiveControl->GetHandle()); + } + else + { + ContainerControl* Cc = this; + while (Cc != nullptr && !Cc->Visible()) + { + auto Parent = Cc->Parent(); + if (Parent != nullptr) + Cc = (ContainerControl*)Parent->GetContainerControl(); + else + break; + } + + if (Cc != nullptr && Cc->Visible()) + SetFocus(Cc->GetHandle()); + } + } + + void ContainerControl::SetActiveControlInternal(Control* Value) + { + if (_ActiveControl != Value || (Value != nullptr && !Value->Focused())) + { + bool Result = false; + ContainerControl* Cc = nullptr; + + if (Value != nullptr && Value->Parent() != nullptr) + { + Cc = (ContainerControl*)Value->Parent()->GetContainerControl(); + } + + if (Cc != nullptr) + { + Result = ActivateControlInternal(Value, false); + } + else + { + Result = AssignActiveControlInternal(Value); + } + + if (Cc != nullptr && Result) + { + ContainerControl* CcAncestor = this; + while (CcAncestor->_Parent != nullptr && CcAncestor->_Parent->GetContainerControl() != nullptr) + CcAncestor = (ContainerControl*)CcAncestor->_Parent->GetContainerControl(); + + if (CcAncestor->ContainsFocus() /*&& Value is NOT USERCONTROL!!*/) + Cc->FocusActiveControlInternal(); + } + } + } + + Control* ContainerControl::ParentFormInternal() + { + if (this->_Parent != nullptr) + return this->_Parent->FindForm(); + + if (this->_RTTI == ControlTypes::Form) + return nullptr; + + return FindForm(); + } + + Drawing::SizeF ContainerControl::AutoScaleFactor() + { + auto Current = this->CurrentAutoScaleDimensions(); + auto Saved = this->AutoScaleDimensions(); + + if (Saved.Empty()) + { + return Drawing::SizeF(1.f, 1.f); + } + + return Drawing::SizeF(Current.Width / Saved.Width, Current.Height / Saved.Height); + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/ContainerControl.h b/r5dev/thirdparty/cppnet/cppkore/ContainerControl.h new file mode 100644 index 00000000..220a0a16 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ContainerControl.h @@ -0,0 +1,100 @@ +#pragma once + +#include "Control.h" +#include "AutoScaleMode.h" + +namespace Forms +{ + // TODO: Process [*] Key functions, virtual... + + class ContainerControl : public Control + { + public: + ContainerControl(); + virtual ~ContainerControl() = default; + + // Indicates the current active control on the container control. + Control* ActiveControl(); + // Indicates the current active control on the container control. + void SetActiveControl(Control* Value); + + // Activates a control + bool ActivateControl(Control* Value); + + // Represents the DPI or Font setting that the control has been scaled to or designed at. + Drawing::SizeF AutoScaleDimensions(); + // Represents the DPI or Font setting that the control has been scaled to or designed at. + void SetAutoScaleDimensions(Drawing::SizeF Size); + + // Gets the current auto scale ratio. + Drawing::SizeF CurrentAutoScaleDimensions(); + + // Determines the scaling mode of this control. + AutoScaleMode AutoScaleMode(); + // Determines the scaling mode of this control. + void SetAutoScaleMode(Forms::AutoScaleMode Mode); + + // Override WndProc for specific form messages. + virtual void WndProc(Message& Msg); + + protected: + // Get custom control creation parameters for this instance. + virtual CreateParams GetCreateParams(); + // Make sure we set this so we know if we are a container. + virtual bool IsContainerControl(); + + // Internal routine to active a control. + bool ActivateControlInternal(Control* Ctrl, bool Originator); + // Internal routine to set active control. + bool AssignActiveControlInternal(Control* Ctrl); + + // Internal selection routine + virtual void Select(bool Directed, bool Forward); + // Internal routine to scale a control + virtual void Scale(Drawing::SizeF IncludedFactor, Drawing::SizeF ExcludedFactor, Control* Ctrl); + // Internal layout resuming routine + virtual void OnLayoutResuming(bool PerformLayout); + // Internal child layout resuming routine + virtual void OnChildLayoutResuming(Control* Child, bool PerformLayout); + + // Sets focus to the active control. + void FocusActiveControlInternal(); + + // Internal routine to set a control as active. + void SetActiveControlInternal(Control* Value); + + // Gets the parent form, if any. + Control* ParentFormInternal(); + + // Fetches the auto scale ratio for the given settings. + Drawing::SizeF AutoScaleFactor(); + + private: + // Internal cached flags + Control* _ActiveControl; + Control* _FocusedControl; + + Drawing::SizeF _AutoScaleDimensions; + Drawing::SizeF _CurrentAutoScaleDimensions; + + Forms::AutoScaleMode _AutoScaleMode; + bool _ScalingNeededOnLayout; + + // We must define each window message handler here... + void WmSetFocus(Message& Msg); + + // Internal routine to enable scaling on child controls. + void LayoutScalingNeeded(); + // Internal routine to set scaling flag. + void EnableRequiredScaling(Control* Ctrl, bool Enable); + + // Internal routine to determinalistically perform scaling. + void PerformNeededAutoScaleOnLayout(); + + // Performs scaling of this control. Scaling works by scaling all children of this control. + void PerformAutoScale(bool IncludeBounds, bool ExcludeBounds); + + // Internal routine to calculate the font scale ratio. + Drawing::SizeF GetFontAutoScaleDimensions(); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/ContentAlignment.h b/r5dev/thirdparty/cppnet/cppkore/ContentAlignment.h new file mode 100644 index 00000000..d903a4b9 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ContentAlignment.h @@ -0,0 +1,56 @@ +#pragma once + +#include + +namespace Drawing +{ + // Specifies alignment of content on the drawing surface. + enum class ContentAlignment + { + // Content is vertically aligned at the top, and horizontally + // aligned on the left. + TopLeft = 0x001, + // Content is vertically aligned at the top, and + // horizontally aligned at the center. + TopCenter = 0x002, + // Content is vertically aligned at the top, and + // horizontally aligned on the right. + TopRight = 0x004, + // Content is vertically aligned in the middle, and + // horizontally aligned on the left. + MiddleLeft = 0x010, + // Content is vertically aligned in the middle, and + // horizontally aligned at the center. + MiddleCenter = 0x020, + // Content is vertically aligned in the middle, and horizontally aligned on the + // right. + MiddleRight = 0x040, + // Content is vertically aligned at the bottom, and horizontally aligned on the + // left. + BottomLeft = 0x100, + // Content is vertically aligned at the bottom, and horizontally aligned at the + // center. + BottomCenter = 0x200, + // Content is vertically aligned at the bottom, and horizontally aligned on the right. + BottomRight = 0x400, + }; + + // + // Allow bitwise operations on this enumeration + // + constexpr ContentAlignment operator|(ContentAlignment Lhs, ContentAlignment Rhs) + { + return static_cast(static_cast::type>(Lhs) | static_cast::type>(Rhs)); + }; + + // + // Content alignment masks + // + + constexpr static ContentAlignment AnyRightAlign = ContentAlignment::TopRight | ContentAlignment::MiddleRight | ContentAlignment::BottomRight; + constexpr static ContentAlignment AnyLeftAlign = ContentAlignment::TopLeft | ContentAlignment::MiddleLeft | ContentAlignment::BottomLeft; + constexpr static ContentAlignment AnyTopAlign = ContentAlignment::TopLeft | ContentAlignment::TopCenter | ContentAlignment::TopRight; + constexpr static ContentAlignment AnyBottomAlign = ContentAlignment::BottomLeft | ContentAlignment::BottomCenter | ContentAlignment::BottomRight; + constexpr static ContentAlignment AnyMiddleAlign = ContentAlignment::MiddleLeft | ContentAlignment::MiddleCenter | ContentAlignment::MiddleRight; + constexpr static ContentAlignment AnyCenterAlign = ContentAlignment::TopCenter | ContentAlignment::MiddleCenter | ContentAlignment::BottomCenter; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Control.cpp b/r5dev/thirdparty/cppnet/cppkore/Control.cpp new file mode 100644 index 00000000..39df9c59 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Control.cpp @@ -0,0 +1,2744 @@ +#include "stdafx.h" +#include "Control.h" +#include "ContainerControl.h" + +// System::Drawing* +#include "DrawingBase.h" +#include "BufferedGraphics.h" + +namespace Forms +{ + // Custom message index cache + uint32_t Control::WM_MOUSEENTER = 0; + uint32_t Control::WM_INVOKEUI = 0; + + // GDI+ palette for rendering + HPALETTE Control::HalftonePalette = nullptr; + + Control::Control() + : _Handle(nullptr), _WndProcBase(NULL), _RTTI(ControlTypes::Control), _Parent(nullptr), _MinimumHeight(0), _MinimumWidth(0), _MaximumHeight(0), _MaximumWidth(0), _Anchor(AnchorStyles::Top | AnchorStyles::Left), _AnchorDeltas(), _Font(nullptr), _BackColor(Drawing::GetSystemColor(Drawing::SystemColors::Control)), _ForeColor(Drawing::GetSystemColor(Drawing::SystemColors::ControlText)), _BackColorBrush(0), _TabIndex(0),\ + _ControlStates((ControlStates)0), _ControlStyles((ControlStyles)0), _ClientWidth(0), _ClientHeight(0), _Width(0), _Height(0), _X(0), _Y(0), _RequiredScalingEnabled(false), _RequiredScaling(BoundsSpecified::All), _LayoutSuspendCount(0) + { + if (Control::WM_INVOKEUI == 0 || Control::WM_MOUSEENTER == 0) + { + Control::WM_MOUSEENTER = RegisterWindowMessageA("KoreMouseEnter"); + Control::WM_INVOKEUI = RegisterWindowMessageA("KoreUIInvoke"); + } + + SetState(ControlStates::StateVisible | + ControlStates::StateEnabled | + ControlStates::StateTabstop | + ControlStates::StateCausesValidation, true); + + SetStyle(ControlStyles::AllPaintingInWmPaint | + ControlStyles::UserPaint | + ControlStyles::StandardClick | + ControlStyles::StandardDoubleClick | + ControlStyles::UseTextForAccessibility | + ControlStyles::Selectable, true); + } + + Control::~Control() + { + this->Dispose(); + } + + void Control::Show() + { + SetVisible(true); + } + + void Control::Hide() + { + SetVisible(false); + } + + void Control::WndProc(Message& Msg) + { + // + // This is the base processor for every single control, we support all windows control events here + // + + switch (Msg.Msg) + { + case WM_CLOSE: + WmClose(Msg); + break; + case WM_MOVE: + WmMove(Msg); + break; + case WM_WINDOWPOSCHANGED: + WmWindowPosChanged(Msg); + break; + case WM_PARENTNOTIFY: + WmParentNotify(Msg); + break; + case WM_ERASEBKGND: + WmEraseBkgnd(Msg); + break; + case WM_COMMAND: + WmCommand(Msg); + break; + case WM_SHOWWINDOW: + WmShowWindow(Msg); + break; + case WM_PAINT: + if (GetStyle(ControlStyles::UserPaint)) + WmPaint(Msg); + else + DefWndProc(Msg); + break; + case WM_LBUTTONDBLCLK: + WmMouseDown(Msg, MouseButtons::Left, 2); + if (GetStyle(ControlStyles::StandardDoubleClick)) + SetState(ControlStates::StateDoubleClickFired, true); + break; + case WM_LBUTTONDOWN: + WmMouseDown(Msg, MouseButtons::Left, 1); + break; + case WM_LBUTTONUP: + WmMouseUp(Msg, MouseButtons::Left, 1); + break; + case WM_RBUTTONDBLCLK: + WmMouseDown(Msg, MouseButtons::Right, 2); + if (GetStyle(ControlStyles::StandardDoubleClick)) + SetState(ControlStates::StateDoubleClickFired, true); + break; + case WM_RBUTTONDOWN: + WmMouseDown(Msg, MouseButtons::Right, 1); + break; + case WM_RBUTTONUP: + WmMouseUp(Msg, MouseButtons::Right, 1); + break; + case WM_MBUTTONDBLCLK: + WmMouseDown(Msg, MouseButtons::Middle, 2); + if (GetStyle(ControlStyles::StandardDoubleClick)) + SetState(ControlStates::StateDoubleClickFired, true); + break; + case WM_MBUTTONDOWN: + WmMouseDown(Msg, MouseButtons::Middle, 1); + break; + case WM_MBUTTONUP: + WmMouseUp(Msg, MouseButtons::Middle, 1); + break; + case WM_SETCURSOR: + WmSetCursor(Msg); + break; + case WM_MOUSEMOVE: + WmMouseMove(Msg); + break; + case WM_MOUSELEAVE: + WmMouseLeave(Msg); + break; + case WM_MOUSEHOVER: + WmMouseHover(Msg); + break; + case WM_CHAR: + case WM_KEYDOWN: + case WM_SYSKEYDOWN: + case WM_KEYUP: + case WM_SYSKEYUP: + WmKeyChar(Msg); + break; + case WM_QUERYNEWPALETTE: + WmQueryNewPalette(Msg); + break; + case WM_NOTIFY: + WmNotify(Msg); + break; + case WM_NOTIFYFORMAT: + WmNotifyFormat(Msg); + break; + case WM_CAPTURECHANGED: + WmCaptureChanged(Msg); + break; + case WM_KILLFOCUS: + WmKillFocus(Msg); + break; + case WM_SETFOCUS: + WmSetFocus(Msg); + break; + case WM_MOUSEWHEEL: + // TrackMouseEvent doesn't handle MouseWheel properly + ResetMouseEventArgs(); + WmMouseWheel(Msg); + break; + + // Handle all CTLCOLOR messages and reflected ones + case WM_CTLCOLORBTN: + case WM_CTLCOLORDLG: + case WM_CTLCOLORMSGBOX: + case WM_CTLCOLORSCROLLBAR: + case WM_CTLCOLOREDIT: + case WM_CTLCOLORLISTBOX: + case WM_CTLCOLORSTATIC: + case WM_REFLECT + WM_CTLCOLORBTN: + case WM_REFLECT + WM_CTLCOLORDLG: + case WM_REFLECT + WM_CTLCOLORMSGBOX: + case WM_REFLECT + WM_CTLCOLORSCROLLBAR: + case WM_REFLECT + WM_CTLCOLOREDIT: + case WM_REFLECT + WM_CTLCOLORLISTBOX: + case WM_REFLECT + WM_CTLCOLORSTATIC: + WmCtlColorControl(Msg); + break; + + default: + + // + // Handle the events which aren't constant... + // + + if (Msg.Msg == WM_MOUSEENTER) + { + WmMouseEnter(Msg); + break; + } + else if (Msg.Msg == WM_INVOKEUI) + { + WmInvokeOnUIThread(Msg); + break; + } + + //dprintf("WinDBG: Unhandled WndProc: %d {0x%x} hWnd 0x%llx class 0x%llx\n", Msg, Msg, (intptr_t)hWnd, (uintptr_t)this); + + // + // Default logic will proxy off the message to the proper base WndProc + // + + DefWndProc(Msg); + break; + } + } + + void Control::CreateControl(Control* Parent) + { + // Prevent duplicate calls to CreateControl() + if (GetState(ControlStates::StateCreated)) + return; + + this->_Parent = Parent; + + // Get control params and register the class + auto Cp = this->GetCreateParams(); + auto NeedsSubclass = false; + auto CName = Control::RegisterWndClass((const char*)Cp.ClassName, Cp.ClassStyle, NeedsSubclass); + + // Create the control + this->_Handle = CreateWindowExA(Cp.ExStyle, (const char*)CName, (const char*)Cp.Caption, Cp.Style, Cp.X, Cp.Y, Cp.Width, Cp.Height, (this->_Parent) ? this->_Parent->GetHandle() : NULL, NULL, GetModuleHandle(NULL), (LPVOID)this); + + // Ensure we have a class pointer reference + this->_WndProcBase = (NeedsSubclass) ? SetWindowLongPtrA(this->_Handle, GWLP_WNDPROC, (intptr_t)&Control::InternalWndProc) : NULL; + SetWindowLongPtrA(this->_Handle, GWLP_USERDATA, (intptr_t)this); + + // Setup the default font if none was previously set + if (this->_Font == nullptr) + this->_Font = std::make_unique(this->_Handle, (HFONT)GetStockObject(DEFAULT_GUI_FONT)); + // Notify the window of the font selection + SendMessageA(this->_Handle, WM_SETFONT, (WPARAM)this->_Font->GetFontHandle(), NULL); + + // Setup the state + SetState(ControlStates::StateCreated, true); + + // Notify the handle was made, and is setup + OnHandleCreated(); + + // Update bounds + UpdateBounds(); + } + + bool Control::Focus() + { + if (CanFocus()) + SetFocus(this->_Handle); + + return Focused(); + } + + bool Control::Focused() + { + return (this->_Handle != nullptr) && (GetFocus() == this->_Handle); + } + + bool Control::Enabled() + { + if (!GetState(ControlStates::StateEnabled)) + return false; + else if (this->_Parent == nullptr) + return true; + + return this->_Parent->Enabled(); + } + + void Control::SetEnabled(bool Value) + { + bool oValue = Enabled(); + SetState(ControlStates::StateEnabled, Value); + + if (oValue != Value) + { + if (!Value) + SelectNextIfFocused(); + + OnEnabledChanged(); + } + } + + bool Control::AllowDrop() + { + return GetState(ControlStates::StateAllowDrop); + } + + void Control::SetAllowDrop(bool Value) + { + if (GetState(ControlStates::StateAllowDrop) != Value) + { + SetState(ControlStates::StateAllowDrop, Value); + SetAcceptDrops(Value); + } + } + + bool Control::Visible() + { + return GetVisibleCore(); + } + + void Control::SetVisible(bool Value) + { + SetVisibleCore(Value); + } + + bool Control::CanFocus() + { + if (this->_Handle == nullptr) + return false; + + return (IsWindowVisible(this->_Handle)) && (IsWindowEnabled(this->_Handle)); + } + + bool Control::CanSelect() + { + if (!GetStyle(ControlStyles::Selectable)) + return false; + + for (Control* Ctl = this; Ctl != nullptr; Ctl = Ctl->_Parent) + { + if (!Ctl->Enabled() || !Ctl->Visible()) + return false; + } + + return true; + } + + bool Control::ContainsFocus() + { + if (!GetState(ControlStates::StateCreated)) + return false; + + auto FocusHwnd = GetFocus(); + + if (FocusHwnd == NULL) + return false; + if (FocusHwnd == this->_Handle) + return true; + if (IsChild(this->_Handle, FocusHwnd)) + return true; + + return false; + } + + void Control::SuspendLayout() + { + this->_LayoutSuspendCount++; + + if (this->_LayoutSuspendCount == 1) + { + // Not needed right now for dpi scaling... + // TODO: OnLayoutSuspended(); + } + } + + void Control::ResumeLayout(bool PerformLayout) + { + bool PerformedLayout = false; + + if (_LayoutSuspendCount > 0) + { + if (_LayoutSuspendCount == 1) + { + _LayoutSuspendCount++; + + try + { + OnLayoutResuming(PerformLayout); + _LayoutSuspendCount--; + } + catch(...) + { + _LayoutSuspendCount--; + } + } + + _LayoutSuspendCount--; + + if (_LayoutSuspendCount == 0 && GetState(ControlStates::StateLayoutDeferred) && PerformLayout) + { + this->PerformLayout(); + PerformedLayout = true; + } + } + } + + bool Control::DoubleBuffered() + { + return GetStyle(ControlStyles::OptimizedDoubleBuffer); + } + + void Control::SetDoubleBuffered(bool Value) + { + SetStyle(ControlStyles::OptimizedDoubleBuffer, Value); + } + + bool Control::Capture() + { + return GetState(ControlStates::StateCreated) && GetCapture() == this->_Handle; + } + + void Control::SetCapture(bool Value) + { + if (Capture() == Value) + return; + + if (Value) + ::SetCapture(this->_Handle); + else + ::ReleaseCapture(); + } + + AnchorStyles Control::Anchor() + { + return _Anchor; + } + + void Control::SetAnchor(AnchorStyles Value) + { + // Get the initial rectangle... + this->UpdateInitialPos(); + + // Apply the anchor value... + this->_Anchor = Value; + + // Ensure delta is set... + UpdateDeltas(); + + // If we are a container control, enumerate children, call SetAnchor(Anchor()); + if (GetStyle(ControlStyles::ContainerControl) && this->_Controls != nullptr) + { + // Store the counts on the stack + uint32_t ControlCount = this->_Controls->Count(); + auto& ControlList = *this->_Controls.get(); + + for (uint32_t i = 0; i < ControlCount; i++) + { + auto Child = ControlList[i]; + Child->SetAnchor(Child->_Anchor); + } + } + } + + uint32_t Control::TabIndex() + { + return this->_TabIndex; + } + + void Control::SetTabIndex(uint32_t Value) + { + if (this->_TabIndex != Value) + { + this->_TabIndex = Value; + // TODO: OnTabIndexChanged(); + } + } + + Drawing::Point Control::Location() + { + return Drawing::Point(this->_X, this->_Y); + } + + void Control::SetLocation(Drawing::Point Value) + { + SetBounds(Value.X, Value.Y, this->_Width, this->_Height); + UpdateInitialPos(); + } + + Drawing::Size Control::Size() + { + return Drawing::Size(this->_Width, this->_Height); + } + + void Control::SetSize(Drawing::Size Value) + { + SetBounds(this->_X, this->_Y, Value.Width, Value.Height); + UpdateInitialPos(); + } + + Drawing::Size Control::MaximumSize() + { + return Drawing::Size(this->_MaximumWidth, this->_MaximumHeight); + } + + void Control::SetMaximumSize(Drawing::Size Value) + { + this->_MaximumWidth = Value.Width; + this->_MaximumHeight = Value.Height; + + // TODO: OnMaximumSizeChanged(); / Trigger reflow... + } + + Drawing::Size Control::MinimumSize() + { + return Drawing::Size(this->_MinimumWidth, this->_MinimumHeight); + } + + void Control::SetMinimumSize(Drawing::Size Value) + { + this->_MinimumWidth = Value.Width; + this->_MinimumHeight = Value.Height; + + // TODO: OnMinimumSizeChanged(); + } + + Drawing::Color Control::BackColor() + { + return this->_BackColor; + } + + void Control::SetBackColor(Drawing::Color Color) + { + this->_BackColor = Color; + OnBackColorChanged(); + } + + Drawing::Color Control::ForeColor() + { + return this->_ForeColor; + } + + void Control::SetForeColor(Drawing::Color Color) + { + this->_ForeColor = Color; + OnForeColorChanged(); + } + + Drawing::Font* Control::GetFont() + { + if (this->_Font != nullptr) + return this->_Font.get(); + + // Set to system wide default fault + this->_Font = std::make_unique(this->_Handle, (HFONT)GetStockObject(DEFAULT_GUI_FONT)); + + return this->_Font.get(); + } + + void Control::SetFont(Drawing::Font* Font) + { + this->_Font.reset(Font); + OnFontChanged(); + } + + Control* Control::Parent() + { + return this->_Parent; + } + + void Control::SetParent(Control* Value) + { + _Parent = Value; + + if (_Parent && _Parent->GetState(ControlStates::StateCreated)) + ::SetParent(this->_Handle, _Parent->_Handle); + } + + Drawing::Rectangle Control::ClientRectangle() + { + return Drawing::Rectangle(0, 0, this->_ClientWidth, this->_ClientHeight); + } + + Drawing::Size Control::ClientSize() + { + return Drawing::Size(this->_ClientWidth, this->_ClientHeight); + } + + void Control::SetClientSize(Drawing::Size Value) + { + SetSize(SizeFromClientSize(Value.Width, Value.Height)); + _ClientWidth = Value.Width; + _ClientHeight = Value.Height; + OnClientSizeChanged(); + } + + Drawing::Point Control::PointToScreen(const Drawing::Point& Point) + { + POINT Pt; + Pt.x = Point.X; + Pt.y = Point.Y; + + MapWindowPoints(this->_Handle, NULL, &Pt, 1); + + return Drawing::Point(Pt.x, Pt.y); + } + + Drawing::Point Control::PointToClient(const Drawing::Point& Point) + { + POINT Pt; + Pt.x = Point.X; + Pt.y = Point.Y; + + MapWindowPoints(NULL, this->_Handle, &Pt, 1); + + return Drawing::Point(Pt.x, Pt.y); + } + + Drawing::Rectangle Control::RectangleToScreen(const Drawing::Rectangle& Rect) + { + RECT Rc; + Rc.left = Rect.X; + Rc.top = Rect.Y; + Rc.right = (Rect.X + Rect.Width); + Rc.bottom = (Rect.Y + Rect.Height); + + MapWindowPoints(this->_Handle, NULL, (LPPOINT)&Rc, 2); + + return Drawing::Rectangle(Rc.left, Rc.top, (Rc.right - Rc.left), (Rc.bottom - Rc.top)); + } + + Drawing::Rectangle Control::RectangleToClient(const Drawing::Rectangle & Rect) + { + RECT Rc; + Rc.left = Rect.X; + Rc.top = Rect.Y; + Rc.right = (Rect.X + Rect.Width); + Rc.bottom = (Rect.Y + Rect.Height); + + MapWindowPoints(NULL, this->_Handle, (LPPOINT)&Rc, 2); + + return Drawing::Rectangle(Rc.left, Rc.top, (Rc.right - Rc.left), (Rc.bottom - Rc.top)); + } + + string Control::Text() + { + return this->WindowText(); + } + + void Control::SetText(const string& Value) + { + this->SetWindowText(Value); + OnTextChanged(); + } + + void Control::BringToFront() + { + if (_Parent != nullptr) + _Parent->_Controls->SetChildIndex(this, 0); + else if (GetState(ControlStates::StateCreated) && GetState(ControlStates::StateTopLevel) && IsWindowEnabled(this->_Handle)) + SetWindowPos(this->_Handle, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); + } + + void Control::SendToBack() + { + if (_Parent != nullptr) + _Parent->_Controls->SetChildIndex(this, -1); + else if (GetState(ControlStates::StateCreated) && GetState(ControlStates::StateTopLevel)) + SetWindowPos(this->_Handle, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); + } + + bool Control::GetStyle(ControlStyles Flag) + { + return ((int)this->_ControlStyles & (int)Flag) == (int)Flag; + } + + void Control::SetStyle(ControlStyles Flags, bool Value) + { + this->_ControlStyles = Value ? (ControlStyles)((int)this->_ControlStyles | (int)Flags) : (ControlStyles)((int)this->_ControlStyles & ~(int)Flags); + } + + bool Control::GetState(ControlStates Flag) + { + return ((int)this->_ControlStates & (int)Flag) == (int)Flag; + } + + void Control::SetState(ControlStates Flags, bool Value) + { + this->_ControlStates = Value ? (ControlStates)((int)this->_ControlStates | (int)Flags) : (ControlStates)((int)this->_ControlStates & ~(int)Flags); + } + + void Control::Invalidate(bool InvalidateChildren) + { + if (GetState(ControlStates::StateCreated)) + { + if (InvalidateChildren) + RedrawWindow(this->_Handle, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_ALLCHILDREN); + else + InvalidateRect(this->_Handle, nullptr, !GetStyle(ControlStyles::Opaque)); + + OnInvalidated(std::make_unique(this->ClientRectangle())); + } + } + + void Control::Invoke(Action Method) + { + SendMessageA(this->_Handle, WM_INVOKEUI, NULL, (LPARAM)Method); + } + + bool Control::InvokeRequired() + { + DWORD Pid; + DWORD HwndThread = GetWindowThreadProcessId(this->_Handle, &Pid); + DWORD CurrentThread = GetCurrentThreadId(); + + return (HwndThread != CurrentThread); + } + + void Control::Update() + { + UpdateWindow(this->_Handle); + } + + void Control::Refresh() + { + Invalidate(true); + Update(); + } + + HWND Control::GetHandle() + { + return this->_Handle; + } + + ControlTypes Control::GetType() + { + return this->_RTTI; + } + + Control* Control::FindForm() + { + auto Cur = this; + + while (Cur != nullptr && (Cur->_RTTI != ControlTypes::Form)) + Cur = Cur->_Parent; + + return Cur; + } + + Control* Control::GetContainerControl() + { + Control* C = this; + + while (C != nullptr && (!IsFocusManagingContainerControl(C))) + C = C->_Parent; + + return C; + } + + Control* Control::GetNextControl(Control* Ctrl, bool Forward) + { + if (!Contains(Ctrl)) + Ctrl = this; + + if (Forward) + { + if (this->_Controls != nullptr && this->_Controls->Count() > 0 && (Ctrl == this || !IsFocusManagingContainerControl(Ctrl))) + { + auto Found = Ctrl->GetFirstChildcontrolInTabOrder(true); + if (Found != nullptr) + return Found; + } + + while (Ctrl != this) + { + uint32_t TargetIndex = Ctrl->_TabIndex; + bool HitCtrl = false; + Control* Found = nullptr; + Control* P = Ctrl->_Parent; + + uint32_t ParentControlCount = 0; + + auto& ParentControls = *P->_Controls.get(); + + if (P->_Controls != nullptr) + ParentControlCount = ParentControls.Count(); + + for (uint32_t i = 0; i < ParentControlCount; i++) + { + if (ParentControls[i] != Ctrl) + { + if (ParentControls[i]->_TabIndex >= TargetIndex) + { + if (Found == nullptr || Found->_TabIndex > ParentControls[i]->_TabIndex) + { + if (ParentControls[i]->_TabIndex != TargetIndex || HitCtrl) + Found = ParentControls[i]; + } + } + } + else + { + HitCtrl = true; + } + } + + if (Found != nullptr) + return Found; + + Ctrl = Ctrl->_Parent; + } + } + else + { + if (Ctrl != this) + { + uint32_t TargetIndex = Ctrl->_TabIndex; + bool HitCtrl = false; + Control* Found = nullptr; + Control* P = Ctrl->_Parent; + + uint32_t ParentControlCount = 0; + + auto& ParentControls = *P->_Controls.get(); + + if (P->_Controls != nullptr) + ParentControlCount = ParentControls.Count(); + + for (int32_t i = (int32_t)ParentControlCount - 1; i >= 0; i--) + { + if (ParentControls[i] != Ctrl) + { + if (ParentControls[i]->_TabIndex <= TargetIndex) + { + if (Found == nullptr || Found->_TabIndex < ParentControls[i]->_TabIndex) + { + if (ParentControls[i]->_TabIndex != TargetIndex || HitCtrl) + Found = ParentControls[i]; + } + } + } + else + { + HitCtrl = true; + } + } + + if (Found != nullptr) + Ctrl = Found; + else + { + if (P == this) + return nullptr; + else + return P; + } + } + + auto CtrlControls = this->_Controls.get(); + + while (CtrlControls != nullptr && CtrlControls->Count() > 0 && (Ctrl == this || !IsFocusManagingContainerControl(Ctrl))) + { + auto Found = Ctrl->GetFirstChildcontrolInTabOrder(false); + if (Found != nullptr) + { + Ctrl = Found; + CtrlControls = Ctrl->_Controls.get(); + } + else + { + break; + } + } + } + + return (Ctrl == this) ? nullptr : Ctrl; + } + + bool Control::Contains(Control* Ctrl) + { + while (Ctrl != nullptr) + { + Ctrl = Ctrl->_Parent; + if (Ctrl == nullptr) + return false; + if (Ctrl == this) + return true; + } + + return false; + } + + const std::unique_ptr& Control::Controls() + { + return this->_Controls; + } + + void Control::Select() + { + Select(false, false); + } + + bool Control::SelectNextControl(Control* Ctrl, bool Forward, bool TabStopOnly, bool Nested, bool Wrap) + { + auto NextCtrl = this->GetNextSelectableControl(Ctrl, Forward, TabStopOnly, Nested, Wrap); + if (NextCtrl != nullptr) + { + NextCtrl->Select(true, Forward); + return true; + } + + return false; + } + + void Control::UpdateZOrder() + { + if (_Parent != nullptr) + _Parent->UpdateChildZOrder(this); + } + + void Control::DefWndProc(Message& Msg) + { + // We must properly proxy off the WndProc if we have a base... + + if (this->_WndProcBase != NULL) + Msg.Result = CallWindowProcA((WNDPROC)this->_WndProcBase, (HWND)Msg.HWnd, Msg.Msg, Msg.WParam, Msg.LParam); + else + Msg.Result = DefWindowProcA((HWND)Msg.HWnd, Msg.Msg, Msg.WParam, Msg.LParam); + } + + void Control::OnPaint(const std::unique_ptr& EventArgs) + { + Paint.RaiseEvent(EventArgs, this); + } + + void Control::OnPaintBackground(const std::unique_ptr& EventArgs) + { + // Fill the back color of this control + if (this->BackColor().GetA() == 255) + { + auto DC = (EventArgs->NativeHandle() != nullptr) ? EventArgs->NativeHandle() : EventArgs->Graphics->GetHDC(); + + RECT Rc{ EventArgs->ClipRectangle.GetLeft(), EventArgs->ClipRectangle.GetTop(), EventArgs->ClipRectangle.GetRight(), EventArgs->ClipRectangle.GetBottom() }; + FillRect(DC, &Rc, (HBRUSH)this->BackColorBrush()); + + if (EventArgs->NativeHandle() == nullptr) + EventArgs->Graphics->ReleaseHDC(DC); + } + else + { + auto t = Drawing::SolidBrush(this->BackColor()); + EventArgs->Graphics->FillRectangle(&t, EventArgs->ClipRectangle); + } + } + + void Control::OnEnabledChanged() + { + if (this->_Handle != nullptr) + { + EnableWindow(this->_Handle, this->Enabled()); + + // User-paint controls should repaint when their enabled state changes + if (GetStyle(ControlStyles::UserPaint)) + { + Invalidate(); + Update(); + } + } + + EnabledChanged.RaiseEvent(this); + } + + void Control::OnClick() + { + Click.RaiseEvent(this); + } + + void Control::OnDoubleClick() + { + DoubleClick.RaiseEvent(this); + } + + void Control::OnMouseClick(const std::unique_ptr& EventArgs) + { + MouseClick.RaiseEvent(EventArgs, this); + } + + void Control::OnMouseDoubleClick(const std::unique_ptr& EventArgs) + { + MouseDoubleClick.RaiseEvent(EventArgs, this); + } + + void Control::OnMouseUp(const std::unique_ptr& EventArgs) + { + MouseUp.RaiseEvent(EventArgs, this); + } + + void Control::OnMouseDown(const std::unique_ptr& EventArgs) + { + MouseDown.RaiseEvent(EventArgs, this); + } + + void Control::OnMouseMove(const std::unique_ptr& EventArgs) + { + MouseMove.RaiseEvent(EventArgs, this); + } + + void Control::OnInvalidated(const std::unique_ptr& EventArgs) + { + Invalidated.RaiseEvent(EventArgs, this); + } + + void Control::OnMouseWheel(const std::unique_ptr& EventArgs) + { + MouseWheel.RaiseEvent(EventArgs, this); + } + + void Control::OnKeyPress(const std::unique_ptr& EventArgs) + { + KeyPress.RaiseEvent(EventArgs, this); + } + + void Control::OnKeyUp(const std::unique_ptr& EventArgs) + { + KeyUp.RaiseEvent(EventArgs, this); + } + + void Control::OnKeyDown(const std::unique_ptr& EventArgs) + { + KeyDown.RaiseEvent(EventArgs, this); + } + + void Control::OnDragEnter(const std::unique_ptr& EventArgs) + { + DragEnter.RaiseEvent(EventArgs, this); + } + + void Control::OnDragOver(const std::unique_ptr& EventArgs) + { + DragOver.RaiseEvent(EventArgs, this); + } + + void Control::OnDragDrop(const std::unique_ptr& EventArgs) + { + DragDrop.RaiseEvent(EventArgs, this); + } + + void Control::OnDragLeave() + { + DragLeave.RaiseEvent(this); + } + + void Control::OnFontChanged() + { + Invalidate(); + + if (GetState(ControlStates::StateCreated)) + SendMessageA(this->_Handle, WM_SETFONT, (WPARAM)this->_Font->GetFontHandle(), NULL); + + FontChanged.RaiseEvent(this); + } + + void Control::OnVisibleChanged() + { + if (this->Visible()) + SetState(ControlStates::StateTrackingMouseEvent, false); + + VisibleChanged.RaiseEvent(this); + + // TODO: If we are a contianer control, we must enumerate children and call + // OnParentVisibleChanged(); + // https://referencesource.microsoft.com/#System.Windows.Forms/winforms/Managed/System/WinForms/Control.cs,8578 + } + + void Control::OnHandleCreated() + { + // Restore drag drop ability + SetAcceptDrops(AllowDrop()); + + // We must create the controls here if we are a container control + if (GetStyle(ControlStyles::ContainerControl) && this->_Controls != nullptr) + { + // Store the counts on the stack + uint32_t ControlCount = this->_Controls->Count(); + auto& ControlList = *this->_Controls.get(); + + for (uint32_t i = 0; i < ControlCount; i++) + { + if (!ControlList[i]->GetState(ControlStates::StateCreated)) + ControlList[i]->CreateControl(this); + } + + SetAnchor(this->_Anchor); + } + + HandleCreated.RaiseEvent(this); + } + + void Control::OnHandleDestroyed() + { + HandleDestroyed.RaiseEvent(this); + } + + void Control::OnTextChanged() + { + TextChanged.RaiseEvent(this); + } + + void Control::OnMouseEnter() + { + MouseEnter.RaiseEvent(this); + } + + void Control::OnMouseLeave() + { + MouseLeave.RaiseEvent(this); + } + + void Control::OnMouseHover() + { + MouseHover.RaiseEvent(this); + } + + void Control::OnLostFocus() + { + LostFocus.RaiseEvent(this); + } + + void Control::OnGotFocus() + { + GotFocus.RaiseEvent(this); + } + + void Control::OnStyleChanged() + { + StyleChanged.RaiseEvent(this); + } + + void Control::OnLocationChanged() + { + LocationChanged.RaiseEvent(this); + } + + void Control::OnSizeChanged() + { + OnResize(); + + SizeChanged.RaiseEvent(this); + } + + void Control::OnResize() + { + if (GetStyle(ControlStyles::ResizeRedraw)) + Invalidate(); + + PerformLayout(); + + Resize.RaiseEvent(this); + } + + void Control::OnClientSizeChanged() + { + ClientSizeChanged.RaiseEvent(this); + } + + void Control::OnMouseCaptureChanged() + { + MouseCaptureChanged.RaiseEvent(this); + } + + void Control::OnBackColorChanged() + { + if (_BackColorBrush != (uintptr_t)0) + { + if (GetState(ControlStates::StateOwnCtlBrush)) + DeleteObject((HGDIOBJ)_BackColorBrush); + + _BackColorBrush = (uintptr_t)0; + } + + Invalidate(); + BackColorChanged.RaiseEvent(this); + } + + void Control::OnForeColorChanged() + { + Invalidate(); + ForeColorChanged.RaiseEvent(this); + } + + HPALETTE Control::SetUpPalette(HDC Dc, bool Force, bool RealizePalette) + { + if (Control::HalftonePalette == nullptr) + Control::HalftonePalette = Gdiplus::Graphics::GetHalftonePalette(); + + auto Result = SelectPalette(Dc, Control::HalftonePalette, (Force ? FALSE : TRUE)); + + if (Result != nullptr && RealizePalette) + ::RealizePalette(Dc); + + return Result; + } + + MouseButtons Control::GetMouseButtons() + { + auto Result = (MouseButtons)0; + + if (GetKeyState((int)Keys::LButton) < 0) + Result = Result | MouseButtons::Left; + if (GetKeyState((int)Keys::RButton) < 0) + Result = Result | MouseButtons::Right; + if (GetKeyState((int)Keys::MButton) < 0) + Result = Result | MouseButtons::Middle; + if (GetKeyState((int)Keys::XButton1) < 0) + Result = Result | MouseButtons::XButton1; + if (GetKeyState((int)Keys::XButton2) < 0) + Result = Result | MouseButtons::XButton2; + + return Result; + } + + Drawing::Point Control::GetMousePosition() + { + POINT Pt{}; + GetCursorPos(&Pt); + + return Drawing::Point(Pt.x, Pt.y); + } + + Keys Control::GetModifierKeys() + { + uint32_t Result = 0; + + if (GetKeyState((int)Keys::ShiftKey) < 0) + Result |= (int)Keys::Shift; + if (GetKeyState((int)Keys::ControlKey) < 0) + Result |= (int)Keys::Control; + if (GetKeyState((int)Keys::Menu) < 0) + Result |= (int)Keys::Alt; + + return (Keys)Result; + } + + void Control::UpdateBounds() + { + RECT Rc{}; + GetClientRect(this->_Handle, &Rc); + + if (!this->_AnchorDeltas.InitialRectSet && GetState(ControlStates::StateTopLevel)) + { + std::memcpy(&this->_AnchorDeltas.InitialRect, &Rc, sizeof(Rc)); + this->_AnchorDeltas.InitialRectSet = true; + } + + auto ClientWidth = Rc.right; + auto ClientHeight = Rc.bottom; + + GetWindowRect(this->_Handle, &Rc); + + UpdateDeltas(); + + if (!GetState(ControlStates::StateTopLevel)) + MapWindowPoints(NULL, GetParent(this->_Handle), (LPPOINT)&Rc, 2); + + if (!this->_AnchorDeltas.InitialRectSet && !GetState(ControlStates::StateTopLevel)) + { + std::memcpy(&this->_AnchorDeltas.InitialRect, &Rc, sizeof(Rc)); + this->_AnchorDeltas.InitialRectSet = true; + } + + UpdateBounds(Rc.left, Rc.top, Rc.right - Rc.left, Rc.bottom - Rc.top, ClientWidth, ClientHeight); + } + + void Control::UpdateBounds(uint32_t X, uint32_t Y, uint32_t Width, uint32_t Height, uint32_t ClientWidth, uint32_t ClientHeight) + { + bool nLocation = this->_X != X || this->_Y != Y; + bool nSize = this->_Width != Width || this->_Height != Height || + this->_ClientWidth != ClientWidth || this->_ClientHeight != ClientHeight; + + this->_X = X; + this->_Y = Y; + this->_Width = Width; + this->_Height = Height; + this->_ClientWidth = ClientWidth; + this->_ClientHeight = ClientHeight; + + if (nLocation) + OnLocationChanged(); + + if (nSize) + { + OnSizeChanged(); + OnClientSizeChanged(); + } + } + + void Control::UpdateBounds(uint32_t X, uint32_t Y, uint32_t Width, uint32_t Height) + { + RECT Rect{}; + + auto Cp = this->GetCreateParams(); + + AdjustWindowRectEx(&Rect, Cp.Style, false, Cp.ExStyle); + + int ClientWidth = Width - (Rect.right - Rect.left); + int ClientHeight = Height - (Rect.bottom - Rect.top); + + UpdateBounds(X, Y, Width, Height, ClientWidth, ClientHeight); + } + + void Control::SetBounds(uint32_t X, uint32_t Y, uint32_t Width, uint32_t Height) + { + if (!GetState(ControlStates::StateCreated)) + UpdateBounds(X, Y, Width, Height); + else + { + if (!GetState(ControlStates::StateSizeLockedByOS)) + { + auto Flags = SWP_NOZORDER | SWP_NOACTIVATE; + + if (this->_X == X && this->_Y==Y) + Flags |= SWP_NOMOVE; + if (this->_Width == Width && this->_Height == Height) + Flags |= SWP_NOSIZE; + + ::SetWindowPos(this->_Handle, NULL, X, Y, Width, Height, Flags); + } + } + } + + void Control::UpdateDeltas() + { + bool AnchorLeft = ((int)this->_Anchor & (int)AnchorStyles::Left) == (int)AnchorStyles::Left; + bool AnchorRight = ((int)this->_Anchor & (int)AnchorStyles::Right) == (int)AnchorStyles::Right; + bool AnchorTop = ((int)this->_Anchor & (int)AnchorStyles::Top) == (int)AnchorStyles::Top; + bool AnchorBottom = ((int)this->_Anchor & (int)AnchorStyles::Bottom) == (int)AnchorStyles::Bottom; + + if (AnchorLeft && AnchorRight) + { + this->_AnchorDeltas.XMoveFrac = 0.f; + this->_AnchorDeltas.XSizeFrac = 1.f; + } + else if (AnchorLeft) + { + this->_AnchorDeltas.XMoveFrac = 0.f; + this->_AnchorDeltas.XSizeFrac = 0.f; + } + else if (AnchorRight) + { + this->_AnchorDeltas.XMoveFrac = 1.f; + this->_AnchorDeltas.XSizeFrac = 0.f; + } + else + { + this->_AnchorDeltas.XMoveFrac = 0.5f; + this->_AnchorDeltas.XSizeFrac = 0.f; + } + + if (AnchorTop && AnchorBottom) + { + this->_AnchorDeltas.YMoveFrac = 0.f; + this->_AnchorDeltas.YSizeFrac = 1.f; + } + else if (AnchorTop) + { + this->_AnchorDeltas.YMoveFrac = 0.f; + this->_AnchorDeltas.YSizeFrac = 0.f; + } + else if (AnchorBottom) + { + this->_AnchorDeltas.YMoveFrac = 1.f; + this->_AnchorDeltas.YSizeFrac = 0.f; + } + else + { + this->_AnchorDeltas.YMoveFrac = 0.5f; + this->_AnchorDeltas.YSizeFrac = 0.f; + } + } + + void Control::UpdateInitialPos() + { + // Get the initial rectangle... + if (GetState(ControlStates::StateTopLevel)) + { + ::GetClientRect(this->_Handle, &this->_AnchorDeltas.InitialRect); + } + else + { + ::GetWindowRect(this->_Handle, &this->_AnchorDeltas.InitialRect); + ::MapWindowPoints(NULL, GetParent(this->_Handle), (LPPOINT)&this->_AnchorDeltas.InitialRect, 2); + } + } + + void Control::Select(bool Directed, bool Forward) + { + auto C = (ContainerControl*)GetContainerControl(); + + if (C != nullptr) + C->SetActiveControl(this); + } + + void Control::Scale(Drawing::SizeF IncludedFactor, Drawing::SizeF ExcludedFactor, Control* Ctrl) + { + ScaleControl(IncludedFactor, ExcludedFactor, Ctrl); + ScaleChildControls(IncludedFactor, ExcludedFactor, Ctrl); + PerformLayout(); + } + + void Control::OnLayoutResuming(bool PerformLayout) + { + if (this->_Parent != nullptr) + { + this->_Parent->OnChildLayoutResuming(this, PerformLayout); + } + } + + void Control::OnChildLayoutResuming(Control* Child, bool PerformLayout) + { + if (this->_Parent != nullptr) + { + this->_Parent->OnChildLayoutResuming(Child, PerformLayout); + } + } + + uint32_t Control::WindowStyle() + { + return GetWindowLong(this->_Handle, GWL_STYLE); + } + + void Control::SetWindowStyle(uint32_t Value) + { + SetWindowLong(this->_Handle, GWL_STYLE, Value); + } + + uint32_t Control::WindowExStyle() + { + return GetWindowLong(this->_Handle, GWL_EXSTYLE); + } + + void Control::SetWindowExStyle(uint32_t Value) + { + SetWindowLong(this->_Handle, GWL_EXSTYLE, Value); + } + + Drawing::Size Control::SizeFromClientSize(int32_t Width, int32_t Height) + { + RECT Rc{ 0, 0, Width, Height }; + auto Cp = GetCreateParams(); + + AdjustWindowRectEx(&Rc, Cp.Style, FALSE, Cp.ExStyle); + + return Drawing::Size(Rc.right - Rc.left, Rc.bottom - Rc.top); + } + + Drawing::Size Control::ScaleSize(Drawing::Size Start, float X, float Y) + { + Drawing::Size Result = Start; + + if (!GetStyle(ControlStyles::FixedWidth)) + { + Result.Width = (int)std::roundf((float)Result.Width * X); + } + if (!GetStyle(ControlStyles::FixedHeight)) + { + Result.Height = (int)std::roundf((float)Result.Height * Y); + } + + return Result; + } + + void Control::ScaleControl(Drawing::SizeF IncludedFactor, Drawing::SizeF ExcludedFactor, Control* Ctrl) + { + auto IncludedSpecified = BoundsSpecified::None; + auto ExcludedSpecified = BoundsSpecified::None; + + if (!IncludedFactor.Empty()) + { + IncludedSpecified = this->_RequiredScaling; + } + + if (!ExcludedFactor.Empty()) + { + ExcludedSpecified = (BoundsSpecified)(~(uint32_t)this->_RequiredScaling & (uint32_t)BoundsSpecified::All); + } + + if (IncludedSpecified != BoundsSpecified::None) + { + ScaleControl(IncludedFactor, IncludedSpecified); + } + + if (ExcludedSpecified != BoundsSpecified::None) + { + ScaleControl(ExcludedFactor, ExcludedSpecified); + } + + if (!IncludedFactor.Empty()) + { + this->_RequiredScaling = BoundsSpecified::None; + } + } + + void Control::ScaleChildControls(Drawing::SizeF IncludedFactor, Drawing::SizeF ExcludedFactor, Control* Ctrl) + { + // Must be container + if (this->_Controls == nullptr) + return; + + // Store the counts on the stack + uint32_t ControlCount = this->_Controls->Count(); + auto& ControlList = *this->_Controls.get(); + + for (uint32_t i = 0; i < ControlCount; i++) + ControlList[i]->Scale(IncludedFactor, ExcludedFactor, Ctrl); + } + + void Control::ScaleControl(Drawing::SizeF Factor, BoundsSpecified Specified) + { + auto Cp = this->GetCreateParams(); + RECT Adornments{}; + AdjustWindowRectEx(&Adornments, Cp.Style, FALSE, Cp.ExStyle); + + auto MinSize = this->MinimumSize(); + auto MaxSize = this->MaximumSize(); + + this->SetMinimumSize({ 0, 0 }); + this->SetMaximumSize({ 0, 0 }); + + auto ScaledBounds = this->GetScaledBounds(Drawing::Rectangle(this->Location(), this->Size()), Factor, Specified); + + auto AdornmentSize = Drawing::Size(Adornments.right - Adornments.left, Adornments.bottom - Adornments.top); + if (!MinSize.Empty()) + { + MinSize = MinSize - AdornmentSize; + MinSize = this->ScaleSize(Drawing::UnionSizes(Drawing::Size{}, MinSize), Factor.Width, Factor.Height) + AdornmentSize; + } + if (!MaxSize.Empty()) + { + MaxSize = MaxSize - AdornmentSize; + MaxSize = this->ScaleSize(Drawing::UnionSizes(Drawing::Size{}, MaxSize), Factor.Width, Factor.Height) + AdornmentSize; + } + + auto FMaxSize = Drawing::ConvertZeroToUnbounded(MaxSize); + auto ScaledSize = Drawing::IntersectSizes({ ScaledBounds.Width, ScaledBounds.Height }, FMaxSize); + ScaledSize = Drawing::UnionSizes(ScaledSize, MinSize); + + this->SetBounds(ScaledBounds.X, ScaledBounds.Y, ScaledSize.Width, ScaledSize.Height); + + this->SetMinimumSize(MinSize); + this->SetMaximumSize(MaxSize); + } + + Drawing::Rectangle Control::GetScaledBounds(Drawing::Rectangle Bounds, Drawing::SizeF Factor, BoundsSpecified Specified) + { + // We should not include the window adornments in our calculation, + // because windows scales them for us. + RECT Adornments{}; + auto Cp = this->GetCreateParams(); + AdjustWindowRectEx(&Adornments, Cp.Style, FALSE, Cp.ExStyle); + + float Dx = Factor.Width; + float Dy = Factor.Height; + + int32_t Sx = Bounds.X; + int32_t Sy = Bounds.Y; + + // Don't reposition top level controls. Also, if we're in + // design mode, don't reposition the root component. + bool ScaleLoc = !GetState(ControlStates::StateTopLevel); + + if (ScaleLoc) + { + if (((uint32_t)Specified & (uint32_t)BoundsSpecified::X) != 0) + { + Sx = (int)std::roundf(Bounds.X * Dx); + } + + if (((uint32_t)Specified & (uint32_t)BoundsSpecified::Y) != 0) + { + Sy = (int)std::roundf(Bounds.Y * Dy); + } + } + + int32_t Sw = Bounds.Width; + int32_t Sh = Bounds.Height; + + if (!GetStyle(ControlStyles::FixedWidth) && ((uint32_t)Specified & (uint32_t)BoundsSpecified::Width) != 0) + { + auto adornmentWidth = (Adornments.right - Adornments.left); + auto localWidth = Bounds.Width - adornmentWidth; + Sw = (int)std::roundf(localWidth * Dx) + adornmentWidth; + } + if (!GetStyle(ControlStyles::FixedHeight) && ((uint32_t)Specified & (uint32_t)BoundsSpecified::Height) != 0) + { + auto adornmentHeight = (Adornments.bottom - Adornments.top); + auto localHeight = Bounds.Height - adornmentHeight; + Sh = (int)std::roundf(localHeight * Dy) + adornmentHeight; + } + + return Drawing::Rectangle(Sx, Sy, Sw, Sh); + } + + uintptr_t Control::BackColorBrush() + { + if (_BackColorBrush != (uintptr_t)0) + return _BackColorBrush; + + if (_Parent != nullptr && _Parent->BackColor().ToCOLORREF() == BackColor().ToCOLORREF()) + return _Parent->BackColorBrush(); + + auto Color = this->BackColor(); + auto ColorWin = Drawing::ColorToWin32(Color); + + // Convert the color to a system color if possible... + int i = 0; + for (; i <= 30; i++) + { + auto SysColor = GetSysColor(i); + if (SysColor == ColorWin) + break; + } + + if (i <= 30) + { + _BackColorBrush = (uintptr_t)GetSysColorBrush(i); + SetState(ControlStates::StateOwnCtlBrush, false); + } + else + { + _BackColorBrush = (uintptr_t)CreateSolidBrush(Color.ToCOLORREF()); + SetState(ControlStates::StateOwnCtlBrush, true); + } + + return _BackColorBrush; + } + + bool Control::RequiredScalingEnabled() + { + return this->_RequiredScalingEnabled; + } + + void Control::SetRequiredScalingEnabled(bool Value) + { + this->_RequiredScalingEnabled = Value; + } + + string Control::WindowText() + { + if (!GetState(ControlStates::StateCreated)) + return _Text; + + auto Length = GetWindowTextLengthA(this->_Handle); + auto Result = string(Length); + + GetWindowTextA(this->_Handle, (char*)Result, Length + 1); + + return Result; + } + + void Control::SetWindowText(const string& Value) + { + if (GetState(ControlStates::StateCreated)) + SetWindowTextA(this->_Handle, (char*)Value); + else + _Text = Value; + } + + void Control::UpdateStyles() + { + if (GetState(ControlStates::StateCreated)) + { + auto Cp = this->GetCreateParams(); + + auto WinStyle = WindowStyle(); + auto ExStyle = WindowExStyle(); + + if (GetState(ControlStates::StateVisible)) + Cp.Style |= WS_VISIBLE; + + if (WinStyle != Cp.Style) + SetWindowStyle(Cp.Style); + if (ExStyle != Cp.ExStyle) + SetWindowExStyle(Cp.ExStyle); + + SetWindowPos(this->_Handle, NULL, 0, 0, 0, 0, SWP_DRAWFRAME | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER); + + Invalidate(true); + } + + OnStyleChanged(); + } + + void Control::SetAcceptDrops(bool Accept) + { + if (Accept != GetState(ControlStates::StateDropTarget) && GetState(ControlStates::StateCreated)) + { + if (Accept) + { + this->_DropTarget = std::make_unique(this); + RegisterDragDrop(this->_Handle, (LPDROPTARGET)this->_DropTarget.get()); + } + else + { + RevokeDragDrop(this->_Handle); + this->_DropTarget.reset(); + } + + SetState(ControlStates::StateDropTarget, Accept); + } + } + + void Control::ResetMouseEventArgs() + { + if (GetState(ControlStates::StateTrackingMouseEvent)) + { + SetState(ControlStates::StateTrackingMouseEvent, false); + + if (!GetState(ControlStates::StateTrackingMouseEvent)) + { + SetState(ControlStates::StateTrackingMouseEvent, true); + + TRACKMOUSEEVENT mEvt{}; + mEvt.cbSize = sizeof(mEvt); + mEvt.dwFlags = TME_LEAVE | TME_HOVER; + mEvt.hwndTrack = this->_Handle; + + TrackMouseEvent(&mEvt); + } + } + } + + void Control::DestroyHandle() + { + if (_Handle != nullptr) + { + DestroyWindow(_Handle); + _Handle = nullptr; + } + } + + void Control::PerformLayout() + { + // This only applies if we house controls + if (!GetStyle(ControlStyles::ContainerControl) || this->_Controls == nullptr) + return; + + // We may need to not layout here... + if (this->_LayoutSuspendCount > 0) + { + SetState(ControlStates::StateLayoutDeferred, true); + return; + } + + // By default, we will move all controls at once + HDWP DeferHandle = nullptr; + + // Store the counts on the stack + uint32_t ControlCount = this->_Controls->Count(); + auto& ControlList = *this->_Controls.get(); + + RECT nRect{}; + ::GetClientRect(this->_Handle, &nRect); + + // Calculate delta, must be signed integer + int32_t DeltaX = ((nRect.right - nRect.left) - (this->_AnchorDeltas.InitialRect.right - this->_AnchorDeltas.InitialRect.left)); + int32_t DeltaY = ((nRect.bottom - nRect.top) - (this->_AnchorDeltas.InitialRect.bottom - this->_AnchorDeltas.InitialRect.top)); + + for (uint32_t i = 0; i < ControlCount; i++) + { + auto Child = ControlList[i]; + auto ChildHwnd = Child->GetHandle(); + + // Important: we must never defer null handles, OR the tooltip + // otherwise the defer will never commit the changes... + if (ChildHwnd == nullptr || Child->_RTTI == ControlTypes::ToolTip) + continue; + + auto& ChildDeltas = Child->_AnchorDeltas; + + RECT RcNew(ChildDeltas.InitialRect); + ::OffsetRect(&RcNew, (int32_t)(DeltaX * ChildDeltas.XMoveFrac), (int32_t)(DeltaY * ChildDeltas.YMoveFrac)); + + RcNew.right += (int32_t)(DeltaX * ChildDeltas.XSizeFrac); + RcNew.bottom += (int32_t)(DeltaY * ChildDeltas.YSizeFrac); + + auto Width = (RcNew.right - RcNew.left); + auto Height = (RcNew.bottom - RcNew.top); + + // Ensure we are within bounds, if necessary + auto Minimum = Child->MinimumSize(); + auto Maximum = Child->MaximumSize(); + + if (!Minimum.Empty()) + { + Width = max(Minimum.Width, Width); + Height = max(Minimum.Height, Height); + } + + if (!Maximum.Empty()) + { + Width = min(Maximum.Width, Width); + Height = min(Maximum.Height, Height); + } + + if (DeferHandle == nullptr) + DeferHandle = BeginDeferWindowPos(ControlCount); + + auto Flags = SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOZORDER; + + // For controls with children that don't resize, we can speed this up by not invalidating the client rect + if (ChildDeltas.XSizeFrac != 0.0f || ChildDeltas.YSizeFrac != 0.0f) + Flags |= SWP_NOCOPYBITS; + + DeferWindowPos(DeferHandle, ChildHwnd, NULL, RcNew.left, RcNew.top, Width, Height, Flags); + } + + // Layout was performed, we can mark completed + SetState(ControlStates::StateLayoutDeferred | ControlStates::StateLayoutIsDirty, false); + + // End rendering + if (DeferHandle != nullptr) + EndDeferWindowPos(DeferHandle); + } + + bool Control::ProcessKeyMessage(Message& Msg) + { + if (this->_Parent != nullptr && this->_Parent->ProcessKeyPreview(Msg)) + return true; + + return ProcessKeyEventArgs(Msg); + } + + bool Control::ProcessKeyPreview(Message& Msg) + { + return this->_Parent == nullptr ? false : this->_Parent->ProcessKeyPreview(Msg); + } + + bool Control::ProcessKeyEventArgs(Message& Msg) + { + // Define the events globally for reuse in events + std::unique_ptr KeyEvent = nullptr; + std::unique_ptr KeyPressEvent = nullptr; + uintptr_t NewWParam = 0; + + if (Msg.Msg == WM_CHAR || Msg.Msg == WM_SYSCHAR) + { + KeyPressEvent = std::make_unique((char)Msg.WParam); + OnKeyPress(KeyPressEvent); + NewWParam = (uintptr_t)KeyPressEvent->KeyChar; + } + else + { + KeyEvent = std::make_unique((Keys)((int)Msg.WParam | (int)GetModifierKeys())); + if (Msg.Msg == WM_KEYDOWN || Msg.Msg == WM_SYSKEYDOWN) + OnKeyDown(KeyEvent); + else + OnKeyUp(KeyEvent); + } + + if (KeyPressEvent != nullptr) + { + Msg.WParam = NewWParam; + return KeyPressEvent->Handled(); + } + else if (KeyEvent != nullptr) + { + if (KeyEvent->SuppressKeyPress()) + { + RemovePendingMessages(WM_CHAR, WM_CHAR); + RemovePendingMessages(WM_SYSCHAR, WM_SYSCHAR); + } + + return KeyEvent->Handled(); + } + + // Security just incase we don't handle IME stuff... + return false; + } + + bool Control::GetVisibleCore() + { + if (!GetState(ControlStates::StateVisible)) + return false; + else if (this->_Parent == nullptr) + return true; + else + return this->_Parent->Visible(); + } + + void Control::SetVisibleCore(bool Value) + { + if (Visible() != Value) + { + bool fChange = false; + + if (GetState(ControlStates::StateTopLevel)) + { + if (Value) + ShowWindow(this->_Handle, SW_SHOW); + } + else if (this->_Handle != nullptr || Value && this->_Parent != nullptr && this->_Parent->GetState(ControlStates::StateCreated)) + { + SetState(ControlStates::StateVisible, Value); + fChange = true; + + SetWindowPos(this->_Handle, NULL, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | (Value ? SWP_SHOWWINDOW : SWP_HIDEWINDOW)); + } + + if (Visible() != Value) + { + SetState(ControlStates::StateVisible, Value); + fChange = true; + } + + if (fChange) + { + OnVisibleChanged(); + } + } + else + { + if (!GetState(ControlStates::StateVisible) && !Value && this->_Handle != nullptr) + { + if (!IsWindowVisible(this->_Handle)) + return; + } + + SetState(ControlStates::StateVisible, Value); + + if (this->_Handle != nullptr) + SetWindowPos(this->_Handle, NULL, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | (Value ? SWP_SHOWWINDOW : SWP_HIDEWINDOW)); + } + } + + CreateParams Control::GetCreateParams() + { + CreateParams Result{}; + + Result.X = this->_X; + Result.Y = this->_Y; + Result.Width = this->_Width; + Result.Height = this->_Height; + Result.Caption = this->_Text; + + Result.Style = WS_CLIPCHILDREN; + if (GetStyle(ControlStyles::ContainerControl)) + Result.ExStyle |= WS_EX_CONTROLPARENT; + Result.ClassStyle = CS_DBLCLKS; + + if (!GetState(ControlStates::StateTopLevel)) + { + Result.Parent = (this->_Parent != nullptr) ? (uintptr_t)this->_Parent->GetHandle() : (uintptr_t)0; + Result.Style |= WS_CHILD | WS_CLIPSIBLINGS; + } + + if (GetState(ControlStates::StateTabstop)) + Result.Style |= WS_TABSTOP; + if (GetState(ControlStates::StateVisible)) + Result.Style |= WS_VISIBLE; + + if (!Enabled()) + Result.Style |= WS_DISABLED; + + return Result; + } + + LRESULT Control::InternalWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) + { + // Catch WM_CREATE here so that we can properly set the class pointer + if (Msg == WM_CREATE) + { + auto ControlClassPtr = (Control*)(((LPCREATESTRUCT)lParam)->lpCreateParams); + SetWindowLongPtrA(hWnd, GWLP_USERDATA, (LONG_PTR)ControlClassPtr); + } + + // Fetch the class data + auto ClassPtr = GetWindowLongPtrA(hWnd, GWLP_USERDATA); + auto ControlMessage = Message(hWnd, Msg, wParam, lParam); + + // Reflect into the proper WndProc + if (ClassPtr == NULL) + ControlMessage.Result = (uintptr_t)DefWindowProcA(hWnd, Msg, wParam, lParam); + else + ((Control*)ClassPtr)->WndProc(ControlMessage); + + return (LRESULT)ControlMessage.Result; + } + + void Control::AddControl(Control* Ctrl) + { + // Prepare to add the control, if we are created, create it, otherwise, wait + this->_Controls->Add(Ctrl); + + // Check to initialize the control + if (GetState(ControlStates::StateCreated)) + { + Ctrl->CreateControl(this); + SetAnchor(this->_Anchor); + } + } + + void Control::Dispose() + { + SetState(ControlStates::StateDisposing, true); + + if (GetState(ControlStates::StateOwnCtlBrush) && _BackColorBrush != (uintptr_t)0) + { + DeleteObject((HGDIOBJ)_BackColorBrush); + _BackColorBrush = (uintptr_t)0; + } + + this->DestroyHandle(); + + OnHandleDestroyed(); + + SetState(ControlStates::StateDisposed, true); + SetState(ControlStates::StateDisposing, false); + } + + uintptr_t Control::InitializeDCForWmCtlColor(HDC Dc, int32_t Message) + { + if (!GetStyle(ControlStyles::UserPaint)) + { + SetTextColor(Dc, this->ForeColor().ToCOLORREF()); + SetBkColor(Dc, this->BackColor().ToCOLORREF()); + + return BackColorBrush(); + } + else + { + return (uintptr_t)GetStockObject(HOLLOW_BRUSH); + } + } + + bool Control::IsContainerControl() + { + return false; + } + + HRGN Control::CreateCopyOfRgn(HRGN InRgn) + { + RECT Rect{}; + HRGN DestRgn; + + if (InRgn) + { + DestRgn = CreateRectRgnIndirect(&Rect); + + if (CombineRgn(DestRgn, InRgn, NULL, RGN_COPY) != ERROR) + return DestRgn; + + DeleteObject(DestRgn); + } + + return NULL; + } + + void Control::WmMouseDown(Message& Msg, MouseButtons Button, uint32_t Clicks) + { + // Track that a key is pressed + SetState(ControlStates::StateMousePressed, true); + + // Check for control message processing + if (!GetStyle(ControlStyles::UserMouse)) + DefWndProc(Msg); + else + { + // DefWndProc would normally set focus to the control, but + // since we're skipping DefWndProc, we need to do it ourselves. + if (Button == MouseButtons::Left && GetStyle(ControlStyles::Selectable)) + this->Focus(); + } + + // TODO: If not State2(MAINTAINSOWNCAPTUREMODE) + SetCapture(true); + + if (this->Enabled()) + OnMouseDown(std::make_unique(Button, Clicks, LOWORD(Msg.LParam), HIWORD(Msg.LParam), 0)); + } + + void Control::WmMouseUp(Message& Msg, MouseButtons Button, uint32_t Clicks) + { + POINT Point; + Point.x = LOWORD(Msg.LParam); + Point.y = HIWORD(Msg.LParam); + + MapWindowPoints(this->_Handle, NULL, &Point, 1); // Faster Control::PointToScreen(); + + // Check for control message processing + if (!GetStyle(ControlStyles::UserMouse)) + { + DefWndProc(Msg); + } + else + { + // DefWndProc would normally trigger a context menu here + // (for a right button click), but since we're skipping DefWndProc + // we have to do it ourselves. + if (Button == MouseButtons::Right) + SendMessageA(this->_Handle, WM_CONTEXTMENU, (WPARAM)this->_Handle, MAKELPARAM(0, 0)); + } + + // Track whether or not it was a real click + bool fClick = false; + + if (GetStyle(ControlStyles::StandardClick)) + { + if (GetState(ControlStates::StateMousePressed) && WindowFromPoint(Point) == this->_Handle) + fClick = true; + } + + if (fClick) + { + if (!GetState(ControlStates::StateDoubleClickFired)) + { + OnClick(); + OnMouseClick(std::make_unique(Button, Clicks, LOWORD(Msg.LParam), HIWORD(Msg.LParam), 0)); + } + else + { + OnDoubleClick(); + OnMouseDoubleClick(std::make_unique(Button, 2, LOWORD(Msg.LParam), HIWORD(Msg.LParam), 0)); + } + } + + // Call MouseUp after the click event + OnMouseUp(std::make_unique(Button, Clicks, LOWORD(Msg.LParam), HIWORD(Msg.LParam), 0)); + + // Reset the states + SetState(ControlStates::StateDoubleClickFired | + ControlStates::StateMousePressed | + ControlStates::StateValidationCancelled, false); + + SetCapture(false); + } + + void Control::WmMouseEnter(Message& Msg) + { + DefWndProc(Msg); + OnMouseEnter(); + } + + void Control::WmMouseLeave(Message& Msg) + { + // We stop tracking once we leave the element + SetState(ControlStates::StateTrackingMouseEvent, false); + + DefWndProc(Msg); + OnMouseLeave(); + } + + void Control::WmMouseHover(Message& Msg) + { + DefWndProc(Msg); + OnMouseHover(); + } + + void Control::WmClose(Message& Msg) + { + if (this->_Parent != nullptr) + { + HWND ParentHandle = this->_Handle; + HWND LastParentHandle = ParentHandle; + + while (ParentHandle != nullptr) + { + LastParentHandle = ParentHandle; + ParentHandle = GetParent(ParentHandle); + + auto Style = GetWindowLongA(LastParentHandle, GWL_STYLE); + + if ((Style & WS_CHILD) == 0) + break; + } + + if (LastParentHandle != nullptr) + PostMessageA(LastParentHandle, WM_CLOSE, NULL, NULL); + } + + DefWndProc(Msg); + } + + void Control::WmEraseBkgnd(Message& Msg) + { + if (GetStyle(ControlStyles::UserPaint)) + { + if (!GetStyle(ControlStyles::AllPaintingInWmPaint)) + { + uintptr_t Dc = Msg.WParam; + if (Dc == NULL) + { + Msg.Result = (uintptr_t)0; + return; + } + + RECT rcClient{}; + GetClientRect(this->_Handle, &rcClient); + + OnPaintBackground(std::make_unique((HDC)Dc, Drawing::Rectangle(rcClient.left, rcClient.top, rcClient.right - rcClient.left, rcClient.bottom - rcClient.top))); + } + + Msg.Result = (uintptr_t)1; + } + else + { + DefWndProc(Msg); + } + } + + void Control::WmPaint(Message& Msg) + { + auto IsDoubleBuffered = this->DoubleBuffered() || GetStyle(ControlStyles::AllPaintingInWmPaint) && GetStyle(ControlStyles::DoubleBuffer | ControlStyles::UserPaint); + + HWND hWnd = nullptr; + HDC Dc = nullptr; + PAINTSTRUCT Ps{}; + Drawing::Rectangle Clip; + bool NeedsDisposeDc = false; + + if (Msg.WParam == NULL) + { + hWnd = this->_Handle; + Dc = BeginPaint(hWnd, &Ps); + + if (!Dc) + return; + NeedsDisposeDc = true; + + Clip = Drawing::Rectangle(Ps.rcPaint.left, Ps.rcPaint.top, Ps.rcPaint.right - Ps.rcPaint.left, Ps.rcPaint.bottom - Ps.rcPaint.top); + } + else + { + Dc = (HDC)Msg.WParam; + Clip = this->ClientRectangle(); + } + + if (!IsDoubleBuffered || (Clip.Width > 0 && Clip.Height > 0)) + { + HPALETTE OldPal = nullptr; + std::unique_ptr BufferedGraphics; + std::unique_ptr PaintEvent; + Drawing::GraphicsState State = NULL; + + if (IsDoubleBuffered || Msg.WParam == NULL) + OldPal = SetUpPalette(Dc, false, false); + + if (IsDoubleBuffered) + { + BufferedGraphics = std::make_unique(Dc, this->ClientRectangle()); + } + + if (BufferedGraphics != nullptr) + { + BufferedGraphics->Graphics->SetClip(Clip); + PaintEvent = std::make_unique(BufferedGraphics->Graphics.get(), Clip); + State = PaintEvent->Graphics->Save(); + } + else + { + PaintEvent = std::make_unique(Dc, Clip); + } + + if ((Msg.WParam == NULL) && GetStyle(ControlStyles::AllPaintingInWmPaint) || IsDoubleBuffered) + OnPaintBackground(PaintEvent); + + if (State != NULL) + PaintEvent->Graphics->Restore(State); + else + PaintEvent->ResetGraphics(); + + OnPaint(PaintEvent); + + if (BufferedGraphics != nullptr) + { + BufferedGraphics->Render(); + PaintEvent->Graphics.release(); + } + + if (OldPal != nullptr) + SelectPalette(Dc, OldPal, FALSE); + } + + if (NeedsDisposeDc) + EndPaint(hWnd, &Ps); + } + + void Control::WmCreate(Message& Msg) + { + DefWndProc(Msg); + } + + void Control::WmShowWindow(Message& Msg) + { + DefWndProc(Msg); + + if (!GetState(ControlStates::StateRecreate)) + { + bool isVisible = (Msg.WParam != NULL); + bool oVisibleProperty = Visible(); + + if (isVisible) + { + // This doesn't match .NET because we don't create the control here, we just ensure the bit is set + SetState(ControlStates::StateVisible, true); + } + else + { + bool pVisible = GetState(ControlStates::StateTopLevel); + if (this->_Parent != nullptr) + pVisible = this->_Parent->Visible(); + + if (pVisible) + SetState(ControlStates::StateVisible, false); + } + + if (!GetState(ControlStates::StateParentRecreating) && (oVisibleProperty != isVisible)) + OnVisibleChanged(); + } + } + + void Control::WmMove(Message& Msg) + { + DefWndProc(Msg); + UpdateBounds(); + } + + void Control::WmParentNotify(Message& Msg) + { + auto Mid = LOWORD(Msg.WParam); + HWND hWnd = nullptr; + + switch (Mid) + { + case WM_CREATE: + hWnd = (HWND)Msg.LParam; + break; + case WM_DESTROY: + break; + default: + hWnd = GetDlgItem(this->_Handle, HIWORD(Msg.WParam)); + break; + } + + if (hWnd == nullptr || !ReflectMessageInternal(hWnd, Msg)) + DefWndProc(Msg); + } + + void Control::WmCommand(Message& Msg) + { + if (Msg.LParam == NULL) + { + // TODO: Command.DispatchID(); + } + else + { + if (ReflectMessageInternal((HWND)Msg.LParam, Msg)) + return; + } + + DefWndProc(Msg); + } + + void Control::WmQueryNewPalette(Message& Msg) + { + auto Dc = GetDC(this->_Handle); + + SetUpPalette(Dc, true, true); + + ReleaseDC(this->_Handle, Dc); + + Invalidate(true); + Msg.Result = (uintptr_t)1; + + DefWndProc(Msg); + } + + void Control::WmNotify(Message& Msg) + { + auto nMDR = (NMHDR*)Msg.LParam; + + if (!ReflectMessageInternal(nMDR->hwndFrom, Msg)) + { + if (nMDR->code == TTN_SHOW) + { + SendMessageA(nMDR->hwndFrom, WM_REFLECT + Msg.Msg, (WPARAM)Msg.WParam, (LPARAM)Msg.LParam); + return; + } + + if (nMDR->code == TTN_POP) + SendMessageA(nMDR->hwndFrom, WM_REFLECT + Msg.Msg, (WPARAM)Msg.WParam, (LPARAM)Msg.LParam); + + DefWndProc(Msg); + } + } + + void Control::WmNotifyFormat(Message& Msg) + { + if (!ReflectMessageInternal((HWND)Msg.WParam, Msg)) + DefWndProc(Msg); + } + + void Control::WmCaptureChanged(Message& Msg) + { + OnMouseCaptureChanged(); + DefWndProc(Msg); + } + + void Control::WmCtlColorControl(Message& Msg) + { + auto ControlPtr = GetWindowLongPtrA((HWND)Msg.LParam, GWLP_USERDATA); + if (ControlPtr != NULL) + { + Msg.Result = ((Control*)ControlPtr)->InitializeDCForWmCtlColor((HDC)Msg.WParam, Msg.Msg); + if (Msg.Result != NULL) + return; + } + + DefWndProc(Msg); + } + + void Control::WmKillFocus(Message& Msg) + { + DefWndProc(Msg); + OnLostFocus(); + } + + void Control::WmSetFocus(Message& Msg) + { + ContainerControl* C = (ContainerControl*)GetContainerControl(); + + if (C != nullptr) + { + if (!C->ActivateControl(this)) + return; + } + + DefWndProc(Msg); + OnGotFocus(); + } + + void Control::WmMouseMove(Message& Msg) + { + if (!GetState(ControlStates::StateTrackingMouseEvent)) + { + SetState(ControlStates::StateTrackingMouseEvent, true); + + TRACKMOUSEEVENT mEvent{}; + mEvent.cbSize = sizeof(mEvent); + mEvent.dwFlags = TME_LEAVE | TME_HOVER; + mEvent.hwndTrack = this->_Handle; + + TrackMouseEvent(&mEvent); + + if (!GetState(ControlStates::StateMouseEnterPending)) + SendMessageA(this->_Handle, WM_MOUSEENTER, 0, 0); + else + SetState(ControlStates::StateMouseEnterPending, false); + } + + if (!GetStyle(ControlStyles::UserMouse)) + DefWndProc(Msg); + else + OnMouseMove(std::make_unique(Control::GetMouseButtons(), 0, (int16_t)LOWORD(Msg.LParam), (int16_t)HIWORD(Msg.LParam), 0)); + } + + void Control::WmSetCursor(Message& Msg) + { + if ((HWND)Msg.WParam == this->_Handle && LOWORD(Msg.LParam) == HTCLIENT) + { + // TODO: Cursor.CursorInternal = Cursor; + // Remove defwndproc... + DefWndProc(Msg); + } + else + { + DefWndProc(Msg); + } + } + + void Control::WmMouseWheel(Message& Msg) + { + auto mPoint = this->PointToClient({ LOWORD(Msg.LParam), HIWORD(Msg.LParam) }); + + auto eArgs = std::make_unique(MouseButtons::None, 0, mPoint.X, mPoint.Y, (int16_t)HIWORD(Msg.WParam)); + + OnMouseWheel(eArgs); + if (!eArgs->Handled) + { + DefWndProc(Msg); + } + } + + void Control::WmKeyChar(Message& Msg) + { + if (ProcessKeyMessage(Msg)) + return; + + DefWndProc(Msg); + } + + void Control::WmWindowPosChanged(Message& Msg) + { + DefWndProc(Msg); + UpdateBounds(); + + if (this->_Parent != nullptr && GetParent(this->_Handle) == this->_Parent->GetHandle() && !GetState(ControlStates::StateNoZOrder)) + { + auto wPos = (WINDOWPOS*)Msg.LParam; + if ((wPos->flags & SWP_NOZORDER) == 0) + { + this->_Parent->UpdateChildControlIndex(this); + } + } + } + + void Control::WmInvokeOnUIThread(Message& Msg) + { + if (Msg.LParam == NULL) + return; + + // Invoke the function here + ((void(*)(void))Msg.LParam)(); + } + + void Control::RemovePendingMessages(uint32_t MsgMin, uint32_t MsgMax) + { + MSG Msg{}; + while (PeekMessageA(&Msg, this->_Handle, MsgMin, MsgMax, PM_REMOVE)); + } + + void Control::UpdateChildZOrder(Control* Ctrl) + { + if (!GetState(ControlStates::StateCreated) || Ctrl->_Parent != this) + return; + + HWND PrevHandle = (HWND)HWND_TOP; + auto& ControlList = *this->_Controls.get(); + + for (int32_t i = this->_Controls->IndexOf(Ctrl); --i >= 0;) + { + Control* C = ControlList[i]; + if (C->GetState(ControlStates::StateCreated) && C->_Parent == this) + { + PrevHandle = C->_Handle; + break; + } + } + + if (GetWindow(Ctrl->_Handle, GW_HWNDPREV) != PrevHandle) + { + SetState(ControlStates::StateNoZOrder, true); + SetWindowPos(Ctrl->_Handle, PrevHandle, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); + SetState(ControlStates::StateNoZOrder, false); + } + } + + void Control::UpdateChildControlIndex(Control* Ctrl) + { + // TODO: If we implement a tab control, we MUST prevent this from continuing here... + // See: https://referencesource.microsoft.com/#System.Windows.Forms/winforms/Managed/System/WinForms/Control.cs,12635 + + int32_t NewIndex = 0; + int32_t CurIndex = this->_Controls->IndexOf(Ctrl); + auto Hwnd = Ctrl->_Handle; + + while ((Hwnd = GetWindow(Hwnd, GW_HWNDPREV)) != NULL) + { + Control* C = Control::FromHandle(Hwnd); + if (C != nullptr) + { + NewIndex = this->_Controls->IndexOf(C) + 1; + break; + } + } + + if (NewIndex > CurIndex) + NewIndex--; + + if (NewIndex != CurIndex) + this->_Controls->SetChildIndex(Ctrl, NewIndex); + } + + void Control::SelectNextIfFocused() + { + if (ContainsFocus() && this->_Parent != nullptr) + { + auto C = (ContainerControl*)this->_Parent->GetContainerControl(); + + if (C != nullptr) + C->SelectNextControl(this, true, true, true, true); + } + } + + Control* Control::GetNextSelectableControl(Control* Ctrl, bool Forward, bool TabStopOnly, bool Nested, bool Wrap) + { + if (!Contains(Ctrl) || !Nested && Ctrl->_Parent != this) + Ctrl = nullptr; + + bool AlreadyWrapped = false; + Control* Start = Ctrl; + + do + { + Ctrl = GetNextControl(Ctrl, Forward); + if (Ctrl == nullptr) + { + if (!Wrap) + break; + if (AlreadyWrapped) + return nullptr; + + AlreadyWrapped = true; + } + else + { + if (Ctrl->CanSelect() && (Nested || Ctrl->_Parent == this)) // TODO: TabStopOnly / TabStop... + return Ctrl; + } + } while (Ctrl != Start); + + return nullptr; + } + + Control* Control::GetFirstChildcontrolInTabOrder(bool Forward) + { + if (this->_Controls == nullptr) + return nullptr; + + Control* Found = nullptr; + auto& ControlList = *this->_Controls.get(); + + if (Forward) + { + for (uint32_t i = 0; i < this->_Controls->Count(); i++) + { + if (Found == nullptr || Found->_TabIndex > ControlList[i]->_TabIndex) + Found = ControlList[i]; + } + } + else + { + for (int32_t i = (int32_t)this->_Controls->Count() - 1; i >= 0; i--) + { + if (Found == nullptr || Found->_TabIndex < ControlList[i]->_TabIndex) + Found = ControlList[i]; + } + } + + return Found; + } + + Control* Control::FromHandle(HWND hWnd) + { + if (hWnd == NULL) + return nullptr; + + return (Control*)GetWindowLongPtrA(hWnd, GWLP_USERDATA); + } + + Control* Control::FromChildHandle(HWND hWnd) + { + while (hWnd != NULL) + { + auto Ctrl = Control::FromHandle(hWnd); + if (Ctrl != nullptr) + return Ctrl; + + hWnd = GetAncestor(hWnd, GA_PARENT); + } + + return nullptr; + } + + bool Control::ReflectMessageInternal(HWND hWnd, Message& Msg) + { + auto Control = GetWindowLongPtrA(hWnd, GWLP_USERDATA); + if (Control == NULL) + return false; + + Msg.Result = SendMessageA(hWnd, WM_REFLECT + Msg.Msg, Msg.WParam, Msg.LParam); + + return true; + } + + bool Control::IsFocusManagingContainerControl(Control* Ctrl) + { + return ((Ctrl->GetStyle(ControlStyles::ContainerControl) && Ctrl->IsContainerControl())); + } + + string Control::RegisterWndClass(const char* ClassName, DWORD ClassStyle, bool& Subclass) + { + // Check for a built-in class name... + WNDCLASSEXA ExInfo{}; + ExInfo.cbSize = sizeof(WNDCLASSEXA); + + // Default windows classes + const char* const DefWndClasses[] = + { + "Button", // A standard button, checkbox, radio, etc + "ComboBox", // A combobox control + "Edit", // A textbox / multiline edit box + "ListBox", // A listbox control + "MDIClient", // MDIClient child window + "ScrollBar", // A scrollbar + "Static", // Any static text + "msctls_progress32", // A progress bar + "tooltips_class32", // Creates tooltip controls + "msctls_trackbar32", // Creates a range slider control + "msctls_updown32", // Creates an integral range edit box + "SysListView32", // Creates listview controls, extended listbox + "SysTabControl32", // Creates a tabcontrol + "SysTreeView32", // Creates a treeview control + }; + + for (auto& Class : DefWndClasses) + { + if (_strnicmp(ClassName, Class, strlen(ClassName)) == 0) + { + Subclass = true; + return ClassName; + } + } + + // Check if we already registered this class... + if (GetClassInfoExA(GetModuleHandle(NULL), ClassName, &ExInfo)) + { + // This is an existing class... + if (ExInfo.style == ClassStyle && ExInfo.lpfnWndProc == (WNDPROC)&Control::InternalWndProc) + return ClassName; + + // We need to make a modified class, using the ClassName + Style + auto nClassName = string(ClassName) + string::Format(".%x", ClassStyle); + + ExInfo.style = ClassStyle; + ExInfo.lpszClassName = (const char*)nClassName; + ExInfo.hCursor = LoadCursor(NULL, IDC_ARROW); + + Subclass = true; + + RegisterClassExA(&ExInfo); + + return nClassName; + } + else + { + // This is a non-existing class, register everything + ExInfo.style = ClassStyle; + ExInfo.lpszClassName = ClassName; + ExInfo.lpfnWndProc = (WNDPROC)&Control::InternalWndProc; + ExInfo.hInstance = GetModuleHandle(NULL); + ExInfo.hbrBackground = (HBRUSH)GetStockObject(HOLLOW_BRUSH); + ExInfo.hCursor = LoadCursor(NULL, IDC_ARROW); + + Subclass = false; + + RegisterClassExA(&ExInfo); + + return string(ClassName); + } + } +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Control.h b/r5dev/thirdparty/cppnet/cppkore/Control.h new file mode 100644 index 00000000..f3ff9b83 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Control.h @@ -0,0 +1,574 @@ +#pragma once + +#include +#include +#include +#include +#include "Keys.h" +#include "Font.h" +#include "Action.h" +#include "Message.h" +#include "DropTarget.h" +#include "EventBase.h" +#include "StringBase.h" +#include "ControlTypes.h" +#include "AnchorStyles.h" +#include "CreateParams.h" +#include "MouseButtons.h" +#include "ControlStyles.h" +#include "ControlStates.h" +#include "KeyEventArgs.h" +#include "PaintEventArgs.h" +#include "MouseEventArgs.h" +#include "ControlCollection.h" +#include "BoundsSpecified.h" +#include "InvalidateEventArgs.h" +#include "DragEventArgs.h" +#include "KeyPressEventArgs.h" +#include "HandledMouseEventArgs.h" + +// Used for reflection messages +#define WM_REFLECT (WM_USER + 0x1C00) + +// Undocumented flags +#define DCX_USESTYLE 0x00010000 +#define DCX_NODELETERGN 0x00040000 + +// Remove built-in macros +#undef SetWindowText +#undef DrawText + +namespace Forms +{ + // Defines the base class for controls, which are components + // with visual representation. + class Control + { + public: + Control(); + virtual ~Control(); + + // Makes the control display by setting the visible property to true. + virtual void Show(); + // Hides the control by setting the visible property to false. + virtual void Hide(); + + // Creates a new instance of the specified control with the given parent. + virtual void CreateControl(Control* Parent = nullptr); + + // Attempts to set focus to this control. + bool Focus(); + // Indicates whether the control has focus. + bool Focused(); + // Indicates whether the control can receive focus. + bool CanFocus(); + // Indicates whether the control can be selected. + bool CanSelect(); + + // Indicates whether the control or one of it's children currently has focus. + bool ContainsFocus(); + + // Suspends the control layout functionality. + void SuspendLayout(); + // Resumes layout functionality. + void ResumeLayout(bool PerformLayout = true); + + // Indicates whether the control is currently enabled. + bool Enabled(); + // Indicates whether the control is currently enabled. + void SetEnabled(bool Value); + + // The AllowDrop property. If AllowDrop is set to true then + // this control will allow drag and drop operations and events to be used. + bool AllowDrop(); + // The AllowDrop property. If AllowDrop is set to true then + // this control will allow drag and drop operations and events to be used. + void SetAllowDrop(bool Value); + + // Indicates whether the control is visible. + bool Visible(); + // Indicates whether the control is visible. + void SetVisible(bool Value); + + // This will enable or disable double buffering. + bool DoubleBuffered(); + // This will enable or disable double buffering. + void SetDoubleBuffered(bool Value); + + // Indicates whether the control has captured the mouse. + bool Capture(); + // Indicates whether the control has captured the mouse. + void SetCapture(bool Value); + + // The current value of the anchor property. The anchor property + // determines which edges of the control are anchored to the container's + // edges. + AnchorStyles Anchor(); + // The current value of the anchor property. The anchor property + // determines which edges of the control are anchored to the container's + // edges. + void SetAnchor(AnchorStyles Value); + + // The tab index of this control. + uint32_t TabIndex(); + // The tab index of this control. + void SetTabIndex(uint32_t Value); + + // The location of this control. + Drawing::Point Location(); + // The location of this control. + void SetLocation(Drawing::Point Value); + + // The size of the control. + Drawing::Size Size(); + // The size of the control. + void SetSize(Drawing::Size Value); + + // The maximum size of the control. + Drawing::Size MaximumSize(); + // The maximum size of the control. + void SetMaximumSize(Drawing::Size Value); + + // The minimum size of the control. + Drawing::Size MinimumSize(); + // The minimum size of the control. + void SetMinimumSize(Drawing::Size Value); + + // The background color of this control. + Drawing::Color BackColor(); + // The background color of this control. + void SetBackColor(Drawing::Color Color); + + // The foreground color of the control. + Drawing::Color ForeColor(); + // The foreground color of the control. + void SetForeColor(Drawing::Color Color); + + // Retrieves the current font for this control. + Drawing::Font* GetFont(); + // Retrieves the current font for this control. + void SetFont(Drawing::Font* Font); + + // The parent of this control. + Control* Parent(); + // The parent of this control. + void SetParent(Control* Value); + + // The client rect of the control. + Drawing::Rectangle ClientRectangle(); + + // The size of the clientRect. + Drawing::Size ClientSize(); + // The size of the clientRect. + void SetClientSize(Drawing::Size Value); + + // Computes the location of the client point in screen coords. + Drawing::Point PointToScreen(const Drawing::Point& Point); + // Computes the location of the screen point in client coords. + Drawing::Point PointToClient(const Drawing::Point& Point); + + // Computes the location of the client rectangle in screen coords. + Drawing::Rectangle RectangleToScreen(const Drawing::Rectangle& Rect); + // Computes the location of the screen rectangle in client coords. + Drawing::Rectangle RectangleToClient(const Drawing::Rectangle& Rect); + + // Gets the current text associated with this control. + virtual string Text(); + // Sets the current text associated with this control. + virtual void SetText(const string& Value); + + // Brings this control to the front of the z-order. + void BringToFront(); + // Sends this control to the back of the z-order. + void SendToBack(); + + // Style flags attached to this control. + bool GetStyle(ControlStyles Flag); + // Style flags attached to this control. + void SetStyle(ControlStyles Flags, bool Value); + + // State flags attached to this control. + bool GetState(ControlStates Flag); + // State flags attached to this control. + void SetState(ControlStates Flags, bool Value); + + // Invalidates the control and causes a paint message to be sent to the control. + void Invalidate(bool InvalidateChildren = false); + + // Executes a delegate on the thread that owns the control's underlying window handle. + void Invoke(Action Method); + // Gets whether or not an invoke is required. + bool InvokeRequired(); + + // Forces the control to paint any currently invalid areas. + void Update(); + // Forces the control to invalidate and immediately repaint itself and children. + void Refresh(); + + // Returns the native handle of this control + HWND GetHandle(); + // Returns the type of this control + ControlTypes GetType(); + + // Retrieves the form that the control is on. + Control* FindForm(); + // Retrieves the container control that we have, if any. + Control* GetContainerControl(); + // Retrieves the next control in the tab order of child controls. + Control* GetNextControl(Control* Ctrl, bool Forward); + + // Verifies if a control is a child of this control. + bool Contains(Control* Ctrl); + + // Returns a reference to this controls child collection, if available + const std::unique_ptr& Controls(); + + // Activates this control. + void Select(); + // Selects the next control following Ctrl. + bool SelectNextControl(Control* Ctrl, bool Forward, bool TabStopOnly, bool Nested, bool Wrap); + + // Updates this control in it's parent's z-order. + void UpdateZOrder(); + + // Invokes the default window procedure associated with this Window. It is + // an error to call this method when the Handle property is zero. + void DefWndProc(Message& Msg); + + // We must define control event bases here + virtual void OnPaint(const std::unique_ptr& EventArgs); + virtual void OnPaintBackground(const std::unique_ptr& EventArgs); + virtual void OnMouseClick(const std::unique_ptr& EventArgs); + virtual void OnMouseDoubleClick(const std::unique_ptr& EventArgs); + virtual void OnMouseUp(const std::unique_ptr& EventArgs); + virtual void OnMouseDown(const std::unique_ptr& EventArgs); + virtual void OnMouseMove(const std::unique_ptr& EventArgs); + virtual void OnInvalidated(const std::unique_ptr& EventArgs); + virtual void OnMouseWheel(const std::unique_ptr& EventArgs); + virtual void OnKeyPress(const std::unique_ptr& EventArgs); + virtual void OnKeyUp(const std::unique_ptr& EventArgs); + virtual void OnKeyDown(const std::unique_ptr& EventArgs); + virtual void OnDragEnter(const std::unique_ptr& EventArgs); + virtual void OnDragOver(const std::unique_ptr& EventArgs); + virtual void OnDragDrop(const std::unique_ptr& EventArgs); + virtual void OnDragLeave(); + virtual void OnFontChanged(); + virtual void OnVisibleChanged(); + virtual void OnHandleCreated(); + virtual void OnHandleDestroyed(); + virtual void OnTextChanged(); + virtual void OnMouseEnter(); + virtual void OnMouseLeave(); + virtual void OnMouseHover(); + virtual void OnLostFocus(); + virtual void OnGotFocus(); + virtual void OnStyleChanged(); + virtual void OnLocationChanged(); + virtual void OnSizeChanged(); + virtual void OnResize(); + virtual void OnClientSizeChanged(); + virtual void OnMouseCaptureChanged(); + virtual void OnBackColorChanged(); + virtual void OnForeColorChanged(); + virtual void OnClick(); + virtual void OnDoubleClick(); + virtual void OnEnabledChanged(); + + // We must define event handlers here + EventBase Click; + EventBase DoubleClick; + EventBase MouseEnter; + EventBase MouseLeave; + EventBase MouseHover; + EventBase SizeChanged; + EventBase Resize; + EventBase LostFocus; + EventBase GotFocus; + EventBase TextChanged; + EventBase FontChanged; + EventBase HandleCreated; + EventBase HandleDestroyed; + EventBase EnabledChanged; + EventBase VisibleChanged; + EventBase LocationChanged; + EventBase BackColorChanged; + EventBase ForeColorChanged; + EventBase StyleChanged; + EventBase ClientSizeChanged; + EventBase MouseCaptureChanged; + EventBase DragLeave; + EventBase&, Control*)> DragEnter; + EventBase&, Control*)> DragDrop; + EventBase&, Control*)> DragOver; + EventBase&, Control*)> KeyUp; + EventBase&, Control*)> KeyDown; + EventBase&, Control*)> KeyPress; + EventBase&, Control*)> Paint; + EventBase&, Control*)> MouseUp; + EventBase&, Control*)> MouseDown; + EventBase&, Control*)> MouseMove; + EventBase&, Control*)> MouseClick; + EventBase&, Control*)> MouseDoubleClick; + EventBase&, Control*)> Invalidated; + EventBase&, Control*)> MouseWheel; + + // The standard windows message pump for this control. + virtual void WndProc(Message& Msg); + + // Routine to get the default GDI+ palette for a control. + static HPALETTE SetUpPalette(HDC Dc, bool Force, bool RealizePalette); + // Gets the current state of the mouse buttons. + static MouseButtons GetMouseButtons(); + // Gets the current position of the mouse in screen coordinates. + static Drawing::Point GetMousePosition(); + // Retrieves the current state of the modifier keys. + static Keys GetModifierKeys(); + + // Determines if the required scaling property is enabled + bool RequiredScalingEnabled(); + // Determines if the required scaling property is enabled + void SetRequiredScalingEnabled(bool Value); + + // Routine to scale a control + virtual void Scale(Drawing::SizeF IncludedFactor, Drawing::SizeF ExcludedFactor, Control* Ctrl); + + protected: + // The control handle + HWND _Handle; + // The control base windows proc + LONG_PTR _WndProcBase; + + // The RTTI type of this control + ControlTypes _RTTI; + + // The parent control if any + Control* _Parent; + + // A collection of children controls, if we are a container control + std::unique_ptr _Controls; + + // Internal size caching + uint32_t _X; + uint32_t _Y; + uint32_t _Width; + uint32_t _Height; + uint32_t _ClientWidth; + uint32_t _ClientHeight; + + // Internal tab index caching + uint32_t _TabIndex; + + // Internal min/max size caching + uint32_t _MaximumWidth; + uint32_t _MaximumHeight; + uint32_t _MinimumWidth; + uint32_t _MinimumHeight; + + // Internal text caching + string _Text; + + // Contains the anchor information... + struct AnchorDeltasCache + { + float XMoveFrac; + float YMoveFrac; + float XSizeFrac; + float YSizeFrac; + RECT InitialRect; + bool InitialRectSet; + } _AnchorDeltas; + + // Internal layout anchor + AnchorStyles _Anchor; + + // Control base colors + Drawing::Color _BackColor; + Drawing::Color _ForeColor; + + // Control brush, if any + uintptr_t _BackColorBrush; + + // Control base font + std::unique_ptr _Font; + + // Updates the bounds of the control based on the handle the control is bound to. + void UpdateBounds(); + // Updates the bounds of the control based on the bounds passed in. + void UpdateBounds(uint32_t X, uint32_t Y, uint32_t Width, uint32_t Height, uint32_t ClientWidth, uint32_t ClientHeight); + // Updates the bounds of the control based on the bounds passed in. + void UpdateBounds(uint32_t X, uint32_t Y, uint32_t Width, uint32_t Height); + // Sets the bounds of the control. + void SetBounds(uint32_t X, uint32_t Y, uint32_t Width, uint32_t Height); + // Updates the deltas of the control based on the anchor + void UpdateDeltas(); + // Updates the initial position based on anchor + void UpdateInitialPos(); + + // Internal selection routine + virtual void Select(bool Directed, bool Forward); + // Internal layout resuming routine + virtual void OnLayoutResuming(bool PerformLayout); + // Internal child layout resuming routine + virtual void OnChildLayoutResuming(Control* Child, bool PerformLayout); + + // Gets the current control window style + uint32_t WindowStyle(); + // Sets the current controls window style + void SetWindowStyle(uint32_t Value); + // Gets the current control extended style + uint32_t WindowExStyle(); + // Sets the current controls extended style + void SetWindowExStyle(uint32_t Value); + + // Internal routine to calculate client size into size + Drawing::Size SizeFromClientSize(int32_t Width, int32_t Height); + + // Internal routine to scale a size, based on control limitations + Drawing::Size ScaleSize(Drawing::Size Start, float X, float Y); + // Internal routine to scale a control, calculating bounds + void ScaleControl(Drawing::SizeF IncludedFactor, Drawing::SizeF ExcludedFactor, Control* Ctrl); + // Internal routine to scale child controls, calculating bounds + void ScaleChildControls(Drawing::SizeF IncludedFactor, Drawing::SizeF ExcludedFactor, Control* Ctrl); + + // Internal routine to scale a control by factor + virtual void ScaleControl(Drawing::SizeF Factor, BoundsSpecified Specified); + // Internal routine to scale a bounds by a factor + virtual Drawing::Rectangle GetScaledBounds(Drawing::Rectangle Bounds, Drawing::SizeF Factor, BoundsSpecified Specified); + + // The GDI brush for our background color. + uintptr_t BackColorBrush(); + + // Gets the current text of the Window + virtual string WindowText(); + // Sets the current text of the Window + virtual void SetWindowText(const string& Value); + + // Updates the control styles... + void UpdateStyles(); + + // Registers the control drop target. + void SetAcceptDrops(bool Accept); + + // Resets the mouse leave listeners. + void ResetMouseEventArgs(); + + // Destroys the window handle + void DestroyHandle(); + + // Performs layout of child controls based on their anchors. + virtual void PerformLayout(); + // Processes a key message. + virtual bool ProcessKeyMessage(Message& Msg); + // Previews a key message. + virtual bool ProcessKeyPreview(Message& Msg); + // Processes a key message and properly generates key events. + virtual bool ProcessKeyEventArgs(Message& Msg); + + // Internal routine to get control visibility. + virtual bool GetVisibleCore(); + // Internal routine to change control visibility. + virtual void SetVisibleCore(bool Value); + + // Gets the CreateParams for this control instance. + virtual CreateParams GetCreateParams(); + + // An internal routine that is the root window message processor. + static LRESULT CALLBACK InternalWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); + + // Used when the control can house other controls. + virtual void AddControl(Control* Ctrl); + + // Used to properly clean up the control. + virtual void Dispose(); + + // Sets the text and background colors of the DC, and returns the background HBRUSH. + virtual uintptr_t InitializeDCForWmCtlColor(HDC Dc, int32_t Message); + + // Custom message index cache + static uint32_t WM_MOUSEENTER; + static uint32_t WM_INVOKEUI; + + // GDI+ palette for rendering + static HPALETTE HalftonePalette; + + // Whether or not we are a container + virtual bool IsContainerControl(); + + // GDI region copying + static HRGN CreateCopyOfRgn(HRGN InRgn); + + // Constructs a control from a handle + static Control* FromHandle(HWND hWnd); + // Constructs a control from a child handle + static Control* FromChildHandle(HWND hWnd); + + private: + // The control styles + ControlStyles _ControlStyles; + // The control states + ControlStates _ControlStates; + + // Total count of suspended layout transactions + uint8_t _LayoutSuspendCount; + + // Whether or not DPI/Font scaling is required + bool _RequiredScalingEnabled; + // Required scaling mode + BoundsSpecified _RequiredScaling; + + // The control drag drop interface + std::unique_ptr _DropTarget; + + // We must define each window message handler here... + void WmMouseDown(Message& Msg, MouseButtons Button, uint32_t Clicks); + void WmMouseUp(Message& Msg, MouseButtons Button, uint32_t Clicks); + void WmMouseEnter(Message& Msg); + void WmMouseLeave(Message& Msg); + void WmMouseHover(Message& Msg); + void WmClose(Message& Msg); + void WmEraseBkgnd(Message& Msg); + void WmPaint(Message& Msg); + void WmCreate(Message& Msg); + void WmShowWindow(Message& Msg); + void WmMove(Message& Msg); + void WmParentNotify(Message& Msg); + void WmCommand(Message& Msg); + void WmQueryNewPalette(Message& Msg); + void WmNotify(Message& Msg); + void WmNotifyFormat(Message& Msg); + void WmCaptureChanged(Message& Msg); + void WmCtlColorControl(Message& Msg); + void WmKillFocus(Message& Msg); + void WmSetFocus(Message& Msg); + void WmMouseMove(Message& Msg); + void WmSetCursor(Message& Msg); + void WmMouseWheel(Message& Msg); + void WmKeyChar(Message& Msg); + void WmWindowPosChanged(Message& Msg); + void WmInvokeOnUIThread(Message& Msg); + + // Removes pending messages from the message queue. + void RemovePendingMessages(uint32_t MsgMin, uint32_t MsgMax); + + // Internal routine to update a child's z-order. + void UpdateChildZOrder(Control* Ctrl); + // Internal routine to update a childs index in the control array. + void UpdateChildControlIndex(Control* Ctrl); + + // This is called recursively when visibility is changed for a control. + void SelectNextIfFocused(); + + // Internal routine to find the next available control. + Control* GetNextSelectableControl(Control* Ctrl, bool Forward, bool TabStopOnly, bool Nested, bool Wrap); + // Internal routine to get the first child in tab order. + Control* GetFirstChildcontrolInTabOrder(bool Forward); + + // Internal routine used to reflect messages up from a top level control. + static bool ReflectMessageInternal(HWND hWnd, Message& Msg); + // Internal routine to check for a container control + static bool IsFocusManagingContainerControl(Control* Ctrl); + + // Internal routine to make sure a class is registered + static string RegisterWndClass(const char* ClassName, DWORD ClassStyle, bool& Subclass); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/ControlCollection.cpp b/r5dev/thirdparty/cppnet/cppkore/ControlCollection.cpp new file mode 100644 index 00000000..916afcb2 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ControlCollection.cpp @@ -0,0 +1,143 @@ +#include "stdafx.h" +#include "ControlCollection.h" +#include "Control.h" + +namespace Forms +{ + ControlCollection::~ControlCollection() + { + // We own the control as soon as the collection takes ahold of it... + for (auto& Ctrl : this->_Controls) + delete Ctrl; + } + + void ControlCollection::Add(Control* Ctrl) + { + this->_Controls.Add(Ctrl); + } + + void ControlCollection::Remove(Control* Ctrl) + { + if (Ctrl == nullptr) + return; + + this->_Controls.Remove(Ctrl); + delete Ctrl; + } + + void ControlCollection::RemoveAt(uint32_t Index) + { + if (Index < this->_Controls.Count()) + { + auto Ptr = this->_Controls[Index]; + this->_Controls.RemoveAt(Index); + delete Ptr; + } + } + + int32_t ControlCollection::IndexOf(Control* Ctrl) + { + auto Result = this->_Controls.IndexOf(Ctrl); + + return (Result == List::InvalidPosition) ? -1 : (int32_t)Result; + } + + bool ControlCollection::Contains(Control* Ctrl) + { + return IndexOf(Ctrl) > -1; + } + + void ControlCollection::SetChildIndex(Control* Ctrl, int32_t Index) + { + auto CurrentIndex = IndexOf(Ctrl); + + if (CurrentIndex == Index || CurrentIndex == -1) + return; + + if (Index >= (int32_t)Count() || Index == -1) + { + Index = Count() - 1; + } + + MoveElement(Ctrl, CurrentIndex, Index); + Ctrl->UpdateZOrder(); + } + + uint32_t ControlCollection::Count() + { + return this->_Controls.Count(); + } + + Control* ControlCollection::operator[](size_t Index) + { + return (Control*)this->_Controls[Index]; + } + + Control* ControlCollection::begin() const noexcept + { + return (Control*)this->_Controls.begin(); + } + + Control* ControlCollection::end() const noexcept + { + return (Control*)this->_Controls.end(); + } + + void ControlCollection::MoveElement(Control* Ctrl, int32_t CurrentIndex, int32_t NewIndex) + { + int32_t Delta = NewIndex - CurrentIndex; + + switch (Delta) + { + case -1: + case 1: + this->_Controls[CurrentIndex] = this->_Controls[NewIndex]; + break; + + default: + { + int32_t Start = 0; + int32_t Dest = 0; + + if (Delta > 0) + { + Start = CurrentIndex + 1; + Dest = NewIndex; + } + else + { + Start = NewIndex; + Dest = NewIndex + 1; + + Delta = -Delta; + } + + CopyElement(Start, Dest, Delta); + } + break; + } + + this->_Controls[NewIndex] = Ctrl; + } + + void ControlCollection::CopyElement(int32_t SourceIndex, int32_t DestinationIndex, uint32_t Length) + { + if (SourceIndex < DestinationIndex) + { + SourceIndex = SourceIndex + Length; + DestinationIndex = DestinationIndex + Length; + + for (; Length > 0; Length--) + { + this->_Controls[--DestinationIndex] = this->_Controls[--SourceIndex]; + } + } + else + { + for (; Length > 0; Length--) + { + this->_Controls[DestinationIndex++] = this->_Controls[SourceIndex++]; + } + } + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/ControlCollection.h b/r5dev/thirdparty/cppnet/cppkore/ControlCollection.h new file mode 100644 index 00000000..860fb610 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ControlCollection.h @@ -0,0 +1,54 @@ +#pragma once + +#include +#include +#include "ListBase.h" + +namespace Forms +{ + // We can't create a circle dependency here, so we define an empty class for use later... + class Control; + + // Contains a collection of child controls for a ContainerControl + class ControlCollection + { + public: + ControlCollection() = default; + ~ControlCollection(); + + // Adds the specified control to the collection. + void Add(Control* Ctrl); + // Removes the specified control from the collection. + void Remove(Control* Ctrl); + // Removes the specified control by index from the collection. + void RemoveAt(uint32_t Index); + + // Gets the index of the control in the collection. + int32_t IndexOf(Control* Ctrl); + // Checks if this collection contains the control. + bool Contains(Control* Ctrl); + + // Sets the index of the specified child control. + void SetChildIndex(Control* Ctrl, int32_t Index); + + // Returns the count of controls + uint32_t Count(); + + // Array index operator + Control* operator[](size_t Index); + + // Iterator definitions, for for(& :) loop + Control* begin() const noexcept; + Control* end() const noexcept; + + private: + + // An internal pointer list of controls + List _Controls; + + // Internal routine to move a control + void MoveElement(Control* Ctrl, int32_t CurrentIndex, int32_t NewIndex); + // Internal routine to copy controls + void CopyElement(int32_t SourceIndex, int32_t DestinationIndex, uint32_t Length); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/ControlStates.h b/r5dev/thirdparty/cppnet/cppkore/ControlStates.h new file mode 100644 index 00000000..de6cb41a --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ControlStates.h @@ -0,0 +1,51 @@ +#pragma once + +#include +#include + +namespace Forms +{ + // Specifies control states. + enum class ControlStates + { + StateCreated = 0x00000001, + StateVisible = 0x00000002, + StateEnabled = 0x00000004, + StateTabstop = 0x00000008, + StateRecreate = 0x00000010, + StateModal = 0x00000020, + StateAllowDrop = 0x00000040, + StateDropTarget = 0x00000080, + StateNoZOrder = 0x00000100, + StateLayoutDeferred = 0x00000200, + StateUseWaitCursor = 0x00000400, + StateDisposed = 0x00000800, + StateDisposing = 0x00001000, + StateMouseEnterPending = 0x00002000, + StateTrackingMouseEvent = 0x00004000, + StateThreadMarshallPending = 0x00008000, + StateSizeLockedByOS = 0x00010000, + StateCausesValidation = 0x00020000, + StateCreatingHandle = 0x00040000, + StateTopLevel = 0x00080000, + StateISACCESSIBLE = 0x00100000, + StateOwnCtlBrush = 0x00200000, + StateExceptionWhilePainting = 0x00400000, + StateLayoutIsDirty = 0x00800000, + StateCheckedHost = 0x01000000, + StateHostedInDialog = 0x02000000, + StateDoubleClickFired = 0x04000000, + StateMousePressed = 0x08000000, + StateValidationCancelled = 0x10000000, + StateParentRecreating = 0x20000000, + StateMirrored = 0x40000000, + }; + + // + // Allow bitwise operations on this enumeration + // + constexpr ControlStates operator|(ControlStates Lhs, ControlStates Rhs) + { + return static_cast(static_cast::type>(Lhs) | static_cast::type>(Rhs)); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/ControlStyles.h b/r5dev/thirdparty/cppnet/cppkore/ControlStyles.h new file mode 100644 index 00000000..a6d9bbe7 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ControlStyles.h @@ -0,0 +1,75 @@ +#pragma once + +#include +#include + +namespace Forms +{ + // Specifies control functionality. + enum class ControlStyles + { + // Indicates whether the control is a container-like control. + ContainerControl = 0x00000001, + // The control paints itself; WM_PAINT and WM_ERASEBKGND messages are not passed + // on to the underlying NativeWindow. + UserPaint = 0x00000002, + // If specified, a PaintBackground event will not be raised, OnPaintBackground will not be called, + // and Invalidate() will not invalidate the background of the HWND. + Opaque = 0x00000004, + // The control is completely redrawn when it is resized. + ResizeRedraw = 0x00000010, + // The control has a fixed width. + FixedWidth = 0x00000020, + // The control has a fixed height. + FixedHeight = 0x00000040, + // If set, windows forms calls OnClick and raises the Click event when the control is clicked + // (unless it's the second click of a double-click and StandardDoubleClick is specified). + // Regardless of this style, the control may call OnClick directly. + StandardClick = 0x00000100, + // The control can get the focus. + Selectable = 0x00000200, + // The control does its own mouse processing; WM_MOUSEDOWN, WM_MOUSEMOVE, and WM_MOUSEUP messages are not passed + // on to the underlying NativeWindow. + UserMouse = 0x00000400, + // If the BackColor is set to a color whose alpha component is + // less than 255 (i.e., BackColor.A < 255), OnPaintBackground will simulate transparency + // by asking its parent control to paint our background. This is not true transparency -- + // if there is another control between us and our parent, we will not show the control in the middle. + SupportsTransparentBackColor = 0x00000800, + // If set, windows forms calls OnDoubleClick and raises the DoubleClick event when the control is double clicked. + // Regardless of whether it is set, the control may call OnDoubleClick directly. + // This style is ignored if StandardClick is not set. + StandardDoubleClick = 0x00001000, + // If true, WM_ERASEBKGND is ignored, and both OnPaintBackground and OnPaint are called directly from + // WM_PAINT. This generally reduces flicker, but can cause problems if other controls + // send WM_ERASEBKGND messages to us. (This is sometimes done to achieve a pseudo-transparent effect similar to + // ControlStyles.SupportsTransparentBackColor; for instance, ToolBar with flat appearance does this). + // This style only makes sense if UserPaint is true. + AllPaintingInWmPaint = 0x00002000, + // If true, the control keeps a copy of the text rather than going to the hWnd for the + // text every time. This improves performance but makes it difficult to keep the control + // and hWnd's text synchronized. + // This style defaults to false. + CacheText = 0x00004000, + // If true, the OnNotifyMessage method will be called for every message sent to + // the control's WndProc. + // This style defaults to false. + EnableNotifyMessage = 0x00008000, + // If set, control painting is double buffered (OBSOLETE, Use OptimizedDoubleBuffer). + DoubleBuffer = 0x00010000, + // If set, all control painting will be double buffered. + OptimizedDoubleBuffer = 0x00020000, + // If this style is set, and there is a value in the control's Text property, that value will be + // used to determine the control's default Active Accessibility name and shortcut key. Otherwise, + // the text of the preceding Label control will be used instead. + UseTextForAccessibility = 0x00040000, + }; + + // + // Allow bitwise operations on this enumeration + // + constexpr ControlStyles operator|(ControlStyles Lhs, ControlStyles Rhs) + { + return static_cast(static_cast::type>(Lhs) | static_cast::type>(Rhs)); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/ControlTypes.h b/r5dev/thirdparty/cppnet/cppkore/ControlTypes.h new file mode 100644 index 00000000..73d4598e --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ControlTypes.h @@ -0,0 +1,23 @@ +#pragma once + +#include + +namespace Forms +{ + // Represents the internal RTTI classes for the Forms controls + enum class ControlTypes : uint8_t + { + Control = 0, + Button = 1, + Label = 2, + CheckBox = 3, + RadioButton = 4, + GroupBox = 5, + Form = 6, + Panel = 7, + ListView = 8, + ComboBox = 9, + ToolTip = 10, + TextBox = 11, + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/CppKore.natvis b/r5dev/thirdparty/cppnet/cppkore/CppKore.natvis new file mode 100644 index 00000000..15424767 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/CppKore.natvis @@ -0,0 +1,42 @@ + + + + + _StoreSize + _BufferSize + + _StoreSize + _Buffer + + + + + empty + {_Buffer} + + _StoreSize + _BufferSize + _Buffer + + + + + _Count + _BucketLength + + _Count + _Entries._Mypair._Myval2 + + + + + + ((DirectX::ScratchImage*)DirectXImage)->m_metadata.width + ((DirectX::ScratchImage*)DirectXImage)->m_metadata.height + ((DirectX::ScratchImage*)DirectXImage)->m_metadata.mipLevels + ((DirectX::ScratchImage*)DirectXImage)->m_metadata.format + ((DirectX::ScratchImage*)DirectXImage)->m_metadata.dimension + ((DirectX::ScratchImage*)DirectXImage) + + + \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/CreateParams.h b/r5dev/thirdparty/cppnet/cppkore/CreateParams.h new file mode 100644 index 00000000..878e90ad --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/CreateParams.h @@ -0,0 +1,26 @@ +#pragma once + +#include +#include "StringBase.h" + +namespace Forms +{ + // A structure that contains the CreateWindow parameters for this control. + struct CreateParams + { + string ClassName; + string Caption; + + uint32_t Style; + uint32_t ExStyle; + uint32_t ClassStyle; + + uint32_t X; + uint32_t Y; + uint32_t Width; + uint32_t Height; + + uintptr_t Parent; + uintptr_t Param; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Curve.cpp b/r5dev/thirdparty/cppnet/cppkore/Curve.cpp new file mode 100644 index 00000000..810c3f2c --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Curve.cpp @@ -0,0 +1,96 @@ +#include "stdafx.h" +#include "Curve.h" + +namespace Assets +{ + Curve::Curve() + : Curve("", CurveProperty::Extra, AnimationCurveMode::Absolute) + { + } + + Curve::Curve(const string& Name, CurveProperty Property) + : Curve(Name, Property, AnimationCurveMode::Absolute) + { + } + + Curve::Curve(const string& Name, CurveProperty Property, AnimationCurveMode Mode) + : Name(Name), Property(Property), Mode(Mode), _IsFrameIntegral(true) + { + } + + bool Curve::IsFrameIntegral() const + { + return this->_IsFrameIntegral; + } + + void Curve::SetFrameIntegral(bool Value) + { + if (this->_IsFrameIntegral != Value) + { + this->_IsFrameIntegral = Value; + + for (auto& Key : Keyframes) + { + if (Value) + Key.Frame.Integer32 = (uint32_t)Key.Frame.Float; + else + Key.Frame.Float = (float)Key.Frame.Integer32; + } + } + } + + CurveValue::CurveValue(uint8_t Value) + : Byte(Value) + { + } + + CurveValue::CurveValue(uint32_t Value) + : Integer32(Value) + { + } + + CurveValue::CurveValue(float Value) + : Float(Value) + { + } + + CurveValue::CurveValue(Math::Quaternion Value) + : Vector4(Value) + { + } + + CurveFrame::CurveFrame(uint32_t Value) + : Integer32(Value) + { + } + + CurveFrame::CurveFrame(float Value) + : Float(Value) + { + } + + CurveKeyframe::CurveKeyframe() + : Frame(0u), Value({0, 0, 0, 0}) + { + } + + CurveKeyframe::CurveKeyframe(uint32_t Frame, float Value) + : Frame(Frame), Value(Value) + { + } + + CurveKeyframe::CurveKeyframe(float Frame, float Value) + : Frame(Frame), Value(Value) + { + } + + CurveKeyframe::CurveKeyframe(uint32_t Frame, Math::Quaternion Value) + : Frame(Frame), Value(Value) + { + } + + CurveKeyframe::CurveKeyframe(float Frame, Math::Quaternion Value) + : Frame(Frame), Value(Value) + { + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/Curve.h b/r5dev/thirdparty/cppnet/cppkore/Curve.h new file mode 100644 index 00000000..085d36ec --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Curve.h @@ -0,0 +1,91 @@ +#pragma once + +#include +#include "StringBase.h" +#include "ListBase.h" +#include "Vector3.h" +#include "Quaternion.h" +#include "AnimationTypes.h" + +namespace Assets +{ + // The property of the node being animated + enum class CurveProperty + { + Extra, + RotateQuaternion, + RotateX, + RotateY, + RotateZ, + TranslateX, + TranslateY, + TranslateZ, + ScaleX, + ScaleY, + ScaleZ, + Visibility, + }; + + union CurveFrame + { + uint32_t Integer32; + float Float; + + explicit CurveFrame(uint32_t Value); + explicit CurveFrame(float Value); + }; + + union CurveValue + { + uint8_t Byte; + uint32_t Integer32; + float Float; + Math::Quaternion Vector4; + + explicit CurveValue(uint8_t Value); + explicit CurveValue(uint32_t Value); + explicit CurveValue(float Value); + explicit CurveValue(Math::Quaternion Value); + }; + + // A keyframe is a pair of frame time and value at that specific frame time + struct CurveKeyframe + { + CurveFrame Frame; + CurveValue Value; + + CurveKeyframe(); + explicit CurveKeyframe(uint32_t Frame, float Value); + explicit CurveKeyframe(float Frame, float Value); + explicit CurveKeyframe(uint32_t Frame, Math::Quaternion Value); + explicit CurveKeyframe(float Frame, Math::Quaternion Value); + }; + + // Represents a 3D animation curve for a specific node->property. + class Curve + { + public: + Curve(); + Curve(const string& Name, CurveProperty Property); + Curve(const string& Name, CurveProperty Property, AnimationCurveMode Mode); + + // The node name of this curve. + string Name; + // The property of the node for the curve. + CurveProperty Property; + + // Whether or not the frame is an integer, or floating point value. (Default: true) + bool IsFrameIntegral() const; + // Sets whether or not the frame is an integer, or floating point value. + void SetFrameIntegral(bool Value); + + // A list of keyframes that make up this curve + List Keyframes; + // The mode to apply each curve value using (Default: Absolute) + AnimationCurveMode Mode; + + private: + // Internal cached values + bool _IsFrameIntegral; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/DDS.cpp b/r5dev/thirdparty/cppnet/cppkore/DDS.cpp new file mode 100644 index 00000000..22022588 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/DDS.cpp @@ -0,0 +1,110 @@ +#include "stdafx.h" +#include "DDS.h" + +#include "..\cppkore_incl\DirectXTex\DirectXTex.h" + +#if _WIN64 +#if _DEBUG +#pragma comment(lib, "..\\cppkore_libs\\DirectXTex\\DirectXTex_x64d.lib") +#else +#pragma comment(lib, "..\\cppkore_libs\\DirectXTex\\DirectXTex_x64r.lib") +#endif +#else +#error DirectXTex doesn't support non x64 builds yet +#endif + +namespace Assets +{ + DDSFormat::DDSFormat() + : MipLevels(1), CubeMap(false), Format(DXGI_FORMAT::DXGI_FORMAT_UNKNOWN), Flags(DDSFormatFlags::None) + { + } + + std::unique_ptr DDS::TranscodeRGBToRGBA(const uint8_t* Buffer, uint32_t BufferSize, uint64_t& ResultSize) + { + // Must be divisible by 3 + if (BufferSize % 3 != 0) + return nullptr; + + ResultSize = (uint64_t)BufferSize + (BufferSize / 3); + auto Result = std::make_unique(ResultSize); + + for (uint32_t i = 0; i < ResultSize; i += 4) + { + Result[i] = Buffer[i]; + Result[i + 1] = Buffer[i + 1]; + Result[i + 2] = Buffer[i + 2]; + Result[i + 3] = 0xFF; + } + + return std::move(Result); + } + + void DDS::WriteDDSHeader(const std::unique_ptr& Stream, uint32_t Width, uint32_t Height, const DDSFormat& Format) + { + WriteDDSHeader(Stream.get(), Width, Height, Format); + } + + void DDS::WriteDDSHeader(IO::Stream* Stream, uint32_t Width, uint32_t Height, const DDSFormat& Format) + { + // Temporary buffer + char Buffer[0x100]{}; + DirectX::TexMetadata MetaData{}; + + MetaData.width = Width; + MetaData.height = Height; + MetaData.depth = 1; + MetaData.arraySize = (Format.CubeMap) ? 6 : 1; + MetaData.mipLevels = Format.MipLevels; + MetaData.miscFlags = (Format.CubeMap) ? DirectX::TEX_MISC_FLAG::TEX_MISC_TEXTURECUBE : 0; + MetaData.dimension = DirectX::TEX_DIMENSION::TEX_DIMENSION_TEXTURE2D; + MetaData.format = Format.Format; + + size_t ResultSize = 0; + DirectX::EncodeDDSHeader(MetaData, 0, Buffer, sizeof(Buffer), ResultSize); + + Stream->Write((uint8_t*)Buffer, 0, (uint64_t)ResultSize); + } + + void DDS::WriteDDSHeader(uint8_t* Buffer, uint32_t Width, uint32_t Height, const DDSFormat& Format, uint32_t& ResultSize) + { + DirectX::TexMetadata MetaData{}; + + MetaData.width = Width; + MetaData.height = Height; + MetaData.depth = 1; + MetaData.arraySize = (Format.CubeMap) ? 6 : 1; + MetaData.mipLevels = Format.MipLevels; + MetaData.miscFlags = (Format.CubeMap) ? DirectX::TEX_MISC_FLAG::TEX_MISC_TEXTURECUBE : 0; + MetaData.dimension = DirectX::TEX_DIMENSION::TEX_DIMENSION_TEXTURE2D; + MetaData.format = Format.Format; + + size_t Result = 0; + DirectX::EncodeDDSHeader(MetaData, 0, Buffer, sizeof(Buffer), Result); + + ResultSize = (uint32_t)Result; + } + + const uint32_t DDS::CalculateBlockSize(uint32_t Width, uint32_t Height, const DDSFormat& Format) + { + return (uint32_t)(DirectX::BitsPerPixel(Format.Format) * Width * Height) / 8; + } + + const uint32_t DDS::CountMipLevels(uint32_t Width, uint32_t Height) + { + uint32_t Result = 1; + + while (Height > 1 || Width > 1) + { + if (Height > 1) + Height >>= 1; + + if (Width > 1) + Width >>= 1; + + ++Result; + } + + return Result; + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/DDS.h b/r5dev/thirdparty/cppnet/cppkore/DDS.h new file mode 100644 index 00000000..201f4556 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/DDS.h @@ -0,0 +1,55 @@ +#pragma once + +#include +#include +#include +#include "Stream.h" + +namespace Assets +{ + // Flags used to extend the DDS texture format. + enum class DDSFormatFlags + { + None = 0 + }; + + // Contains information about the DDS texture format. + struct DDSFormat + { + // The count of mip levels in this texture (Default: 1) (>= 1) + uint32_t MipLevels; + // Whether or not this is a cubemapped texture. (Default: false) + bool CubeMap; + // The block compression format for the texture. (Default: DXGI_FORMAT_UNKNOWN) + DXGI_FORMAT Format; + // Flags which extend the format for the texture. (Default: None) + DDSFormatFlags Flags; + + DDSFormat(); + }; + + // A utility class for building DDS assets. + class DDS + { + // Don't initialize this class + DDS() = delete; + ~DDS() = delete; + + public: + // Transcodes a buffer of (legacy) RGB8 data to a DXGI compatible RGBA buffer + static std::unique_ptr TranscodeRGBToRGBA(const uint8_t* Buffer, uint32_t BufferSize, uint64_t& ResultSize); + + // Serializes a DDS header to the given stream. + static void WriteDDSHeader(const std::unique_ptr& Stream, uint32_t Width, uint32_t Height, const DDSFormat& Format); + // Serializes a DDS header to the given stream. + static void WriteDDSHeader(IO::Stream* Stream, uint32_t Width, uint32_t Height, const DDSFormat& Format); + + // Serializes a DDS header to the buffer. + static void WriteDDSHeader(uint8_t* Buffer, uint32_t Width, uint32_t Height, const DDSFormat& Format, uint32_t& ResultSize); + + // Calculate a block size for the given format. + static const uint32_t CalculateBlockSize(uint32_t Width, uint32_t Height, const DDSFormat& Format); + // Calculate the maximum level of mips. + static const uint32_t CountMipLevels(uint32_t Width, uint32_t Height); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/DeflateCodec.cpp b/r5dev/thirdparty/cppnet/cppkore/DeflateCodec.cpp new file mode 100644 index 00000000..3200744a --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/DeflateCodec.cpp @@ -0,0 +1,113 @@ +#include "stdafx.h" +#include "DeflateCodec.h" + +#include "..\cppkore_incl\ZLib\miniz.h" + +#if _DEBUG +#pragma comment(lib, "..\\cppkore_libs\\ZLib\\cppkorezlibx64d.lib") +#else +#pragma comment(lib, "..\\cppkore_libs\\ZLib\\cppkorezlibx64r.lib") +#endif + +namespace Compression +{ + uint64_t DeflateCodec::Compress(uint8_t* Input, uint64_t InputOffset, uint64_t InputLength, uint8_t* Output, uint64_t OutputOffset, uint64_t OutputLength) + { + z_stream DeflateStream{}; + + if (deflateInit2(&DeflateStream, MZ_DEFAULT_LEVEL, MZ_DEFLATED, -MZ_DEFAULT_WINDOW_BITS, 9, MZ_DEFAULT_STRATEGY) != MZ_OK) + return 0; + + DeflateStream.avail_in = (uint32_t)InputLength; + DeflateStream.avail_out = (uint32_t)OutputLength; + DeflateStream.next_in = (const uint8_t*)(Input + InputOffset); + DeflateStream.next_out = (uint8_t*)(Output + OutputOffset); + + auto Result = deflate(&DeflateStream, MZ_SYNC_FLUSH); + + deflateEnd(&DeflateStream); + + if (Result == MZ_OK) + return (uint64_t)DeflateStream.total_out; + + return 0; + } + + std::unique_ptr DeflateCodec::Compress(uint8_t* Input, uint64_t InputOffset, uint64_t InputLength, uint64_t& OutputLength) + { + auto ResultBounds = compressBound((mz_ulong)InputLength); + auto Result = std::make_unique(ResultBounds); + + OutputLength = 0; + + z_stream DeflateStream{}; + + if (deflateInit2(&DeflateStream, MZ_DEFAULT_LEVEL, MZ_DEFLATED, -MZ_DEFAULT_WINDOW_BITS, 9, MZ_DEFAULT_STRATEGY) != MZ_OK) + return nullptr; + + DeflateStream.avail_in = (uint32_t)InputLength; + DeflateStream.avail_out = (uint32_t)ResultBounds; + DeflateStream.next_in = (const uint8_t*)(Input + InputOffset); + DeflateStream.next_out = (uint8_t*)Result.get(); + + auto ResultCode = deflate(&DeflateStream, MZ_SYNC_FLUSH); + + deflateEnd(&DeflateStream); + + if (ResultCode != MZ_OK) + return nullptr; + + OutputLength = (uint64_t)DeflateStream.total_out; + + return Result; + } + + uint64_t DeflateCodec::Decompress(uint8_t* Input, uint64_t InputOffset, uint64_t InputLength, uint8_t* Output, uint64_t OutputOffset, uint64_t OutputLength) + { + z_stream DeflateStream{}; + + if (inflateInit2(&DeflateStream, -MZ_DEFAULT_WINDOW_BITS) != MZ_OK) + return 0; + + DeflateStream.avail_in = (uint32_t)InputLength; + DeflateStream.avail_out = (uint32_t)OutputLength; + DeflateStream.next_in = (const uint8_t*)(Input + InputOffset); + DeflateStream.next_out = (uint8_t*)(Output + OutputOffset); + + auto Result = inflate(&DeflateStream, MZ_SYNC_FLUSH); + + inflateEnd(&DeflateStream); + + if (Result == MZ_OK || (DeflateStream.total_out == OutputLength)) + return (uint64_t)DeflateStream.total_out; + + return 0; + } + + std::unique_ptr DeflateCodec::Decompress(uint8_t* Input, uint64_t InputOffset, uint64_t InputLength, uint64_t KnownOutputLength) + { + if (InputLength == 0) + return nullptr; + + auto Result = std::make_unique(KnownOutputLength); + + z_stream DeflateStream{}; + + if (inflateInit2(&DeflateStream, -MZ_DEFAULT_WINDOW_BITS) != MZ_OK) + return 0; + + DeflateStream.avail_in = (uint32_t)InputLength; + DeflateStream.avail_out = (uint32_t)KnownOutputLength; + DeflateStream.next_in = (const uint8_t*)(Input + InputOffset); + DeflateStream.next_out = (uint8_t*)Result.get(); + + auto ResultCode = inflate(&DeflateStream, MZ_SYNC_FLUSH); + + inflateEnd(&DeflateStream); + + if (ResultCode == MZ_OK || (DeflateStream.total_out == KnownOutputLength)) + return Result; + + return nullptr; + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/DeflateCodec.h b/r5dev/thirdparty/cppnet/cppkore/DeflateCodec.h new file mode 100644 index 00000000..30db397b --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/DeflateCodec.h @@ -0,0 +1,23 @@ +#pragma once + +#include +#include + +namespace Compression +{ + // A compression codec that implements the Deflate algo. + class DeflateCodec + { + public: + + // Compress the input buffer using the Deflate codec + static uint64_t Compress(uint8_t* Input, uint64_t InputOffset, uint64_t InputLength, uint8_t* Output, uint64_t OutputOffset, uint64_t OutputLength); + // Compress the input buffer using the Deflate codec + static std::unique_ptr Compress(uint8_t* Input, uint64_t InputOffset, uint64_t InputLength, uint64_t& OutputLength); + + // Decompress the input buffer using the Deflate codec + static uint64_t Decompress(uint8_t* Input, uint64_t InputOffset, uint64_t InputLength, uint8_t* Output, uint64_t OutputOffset, uint64_t OutputLength); + // Decompress the input buffer using the Deflate codec (With known output length) + static std::unique_ptr Decompress(uint8_t* Input, uint64_t InputOffset, uint64_t InputLength, uint64_t KnownOutputLength); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/DeflateStream.cpp b/r5dev/thirdparty/cppnet/cppkore/DeflateStream.cpp new file mode 100644 index 00000000..c14c1d07 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/DeflateStream.cpp @@ -0,0 +1,219 @@ +#include "stdafx.h" +#include "DeflateStream.h" + +#include "..\cppkore_incl\ZLib\miniz.h" + +#if _DEBUG +#pragma comment(lib, "..\\cppkore_libs\\ZLib\\cppkorezlibx64d.lib") +#else +#pragma comment(lib, "..\\cppkore_libs\\ZLib\\cppkorezlibx64r.lib") +#endif + +namespace Compression +{ + DeflateStream::DeflateStream(std::unique_ptr Stream, CompressionMode Mode, bool LeaveOpen) + : BaseStream(std::move(Stream)), _Mode(Mode), _LeaveOpen(LeaveOpen), _BufferLength(DeflateStream::DefaultBufferSize), _BufferOffset(0) + { + this->_Buffer = std::make_unique(DeflateStream::DefaultBufferSize); + this->CreateInflatorDeflator(); + } + + DeflateStream::DeflateStream(IO::Stream* Stream, CompressionMode Mode, bool LeaveOpen) + : BaseStream(Stream), _Mode(Mode), _LeaveOpen(LeaveOpen), _BufferLength(DeflateStream::DefaultBufferSize), _BufferOffset(0) + { + this->_Buffer = std::make_unique(DeflateStream::DefaultBufferSize); + this->CreateInflatorDeflator(); + } + + DeflateStream::~DeflateStream() + { + this->Close(); + } + + bool DeflateStream::CanRead() + { + return (this->_Mode == CompressionMode::Decompress); + } + + bool DeflateStream::CanWrite() + { + return (this->_Mode == CompressionMode::Compress); + } + + bool DeflateStream::CanSeek() + { + return (_Mode == CompressionMode::Decompress); + } + + bool DeflateStream::GetIsEndOfFile() + { + return this->BaseStream->GetIsEndOfFile(); + } + + uint64_t DeflateStream::GetLength() + { + return this->BaseStream->GetLength(); + } + + uint64_t DeflateStream::GetPosition() + { + return this->BaseStream->GetPosition(); + } + + void DeflateStream::SetLength(uint64_t Length) + { + IO::IOError::StreamSetLengthSupport(); + } + + void DeflateStream::SetPosition(uint64_t Position) + { + if (_Mode == CompressionMode::Decompress) + { + this->BaseStream->SetPosition(Position); + mz_inflateReset((mz_streamp)this->_DeflateState); + } + else + IO::IOError::StreamNoSeekSupport(); + } + + void DeflateStream::Close() + { + if (this->_Mode == CompressionMode::Compress) + this->WriteDeflaterOutput(); // Ensure that all data has been written to the stream... + + if (this->_LeaveOpen) + this->BaseStream.release(); + else + this->BaseStream.reset(); + + this->_Buffer.reset(); + + if (this->_Mode == CompressionMode::Compress) + deflateEnd((mz_streamp)this->_DeflateState); + else + inflateEnd((mz_streamp)this->_DeflateState); + + delete (mz_streamp)this->_DeflateState; + } + + void DeflateStream::Flush() + { + if (this->CanWrite()) + this->BaseStream->Flush(); + } + + void DeflateStream::Seek(uint64_t Offset, IO::SeekOrigin Origin) + { + if (_Mode == CompressionMode::Decompress) + { + this->BaseStream->Seek(Offset, Origin); + mz_inflateReset((mz_streamp)this->_DeflateState); + } + else + IO::IOError::StreamNoSeekSupport(); + } + + uint64_t DeflateStream::Read(uint8_t* Buffer, uint64_t Offset, uint64_t Count) + { + uint64_t TotalRead = 0; + uint64_t TotalOutNow = 0; + + mz_streamp StreamState = (mz_streamp)this->_DeflateState; + + TotalOutNow = StreamState->total_out; + + while (true) + { + StreamState->avail_out = (unsigned int)(Count - TotalRead); + StreamState->next_out = (unsigned char*)(Buffer + Offset + TotalRead); + + auto Result = inflate(StreamState, MZ_SYNC_FLUSH); + TotalRead = StreamState->total_out - TotalOutNow; + + if (TotalRead == Count) + break; + + if (Result == MZ_STREAM_END) + break; + + auto RequiredRead = (StreamState->avail_in > 0) ? (DeflateStream::DefaultBufferSize - StreamState->avail_in) : DeflateStream::DefaultBufferSize; + + // + // We must move the z_stream expected block to the front, and then read expected input after... + // + + std::memmove(this->_Buffer.get(), this->_Buffer.get() + RequiredRead, StreamState->avail_in); + + auto Bytes = this->BaseStream->Read(this->_Buffer.get(), StreamState->avail_in, RequiredRead); + + if (Bytes == 0) + break; + + StreamState->next_in = (const unsigned char*)this->_Buffer.get(); + StreamState->avail_in = (unsigned int)DeflateStream::DefaultBufferSize; + } + + return TotalRead; + } + + uint64_t DeflateStream::Read(uint8_t* Buffer, uint64_t Offset, uint64_t Count, uint64_t Position) + { + return 0; + } + + void DeflateStream::Write(uint8_t* Buffer, uint64_t Offset, uint64_t Count) + { + // Continue to write if need be + this->WriteDeflaterOutput(); + + // Set the new input and size to us + mz_streamp StreamState = (mz_streamp)this->_DeflateState; + + StreamState->avail_in = (unsigned int)Count; + StreamState->next_in = (const unsigned char*)(Buffer + Offset); + + // Write the last output + this->WriteDeflaterOutput(); + } + + void DeflateStream::Write(uint8_t* Buffer, uint64_t Offset, uint64_t Count, uint64_t Position) + { + } + + void DeflateStream::CreateInflatorDeflator() + { + this->_DeflateState = new z_stream(); + + if (_Mode == CompressionMode::Compress) + deflateInit2((mz_streamp)this->_DeflateState, MZ_DEFAULT_LEVEL, MZ_DEFLATED, -MZ_DEFAULT_WINDOW_BITS, 9, MZ_DEFAULT_STRATEGY); + else if (_Mode == CompressionMode::Decompress) + inflateInit2((mz_streamp)this->_DeflateState, -MZ_DEFAULT_WINDOW_BITS); + + mz_streamp StreamState = (mz_streamp)this->_DeflateState; + + // Setup default state values... + StreamState->avail_in = 0; + StreamState->avail_out = 0; + StreamState->next_in = nullptr; + StreamState->next_out = nullptr; + } + + void DeflateStream::WriteDeflaterOutput() + { + mz_streamp StreamState = (mz_streamp)this->_DeflateState; + + // Loop until we need data again... + while (StreamState->avail_in > 0) + { + // Reset the buffers + StreamState->next_out = (unsigned char*)this->_Buffer.get(); + StreamState->avail_out = (unsigned int)DeflateStream::DefaultBufferSize; + + // Prepare to deflate the data + auto Result = deflate(StreamState, MZ_SYNC_FLUSH); + + // Write the data if any + this->BaseStream->Write(this->_Buffer.get(), 0, (DeflateStream::DefaultBufferSize - StreamState->avail_out)); + } + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/DeflateStream.h b/r5dev/thirdparty/cppnet/cppkore/DeflateStream.h new file mode 100644 index 00000000..4173fa95 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/DeflateStream.h @@ -0,0 +1,61 @@ +#pragma once + +#include +#include +#include "Stream.h" +#include "CompressionMode.h" + +namespace Compression +{ + // DeflateStream supports decompressing and compressing Deflate encoded data + class DeflateStream : public IO::Stream + { + public: + DeflateStream(std::unique_ptr Stream, CompressionMode Mode, bool LeaveOpen = false); + DeflateStream(IO::Stream* Stream, CompressionMode Mode, bool LeaveOpen = false); + virtual ~DeflateStream(); + + // Implement Getters and Setters + virtual bool CanRead(); + virtual bool CanWrite(); + virtual bool CanSeek(); + virtual bool GetIsEndOfFile(); + virtual uint64_t GetLength(); + virtual uint64_t GetPosition(); + virtual void SetLength(uint64_t Length); + virtual void SetPosition(uint64_t Position); + + // Implement functions + virtual void Close(); + virtual void Flush(); + virtual void Seek(uint64_t Offset, IO::SeekOrigin Origin); + virtual uint64_t Read(uint8_t* Buffer, uint64_t Offset, uint64_t Count); + virtual uint64_t Read(uint8_t* Buffer, uint64_t Offset, uint64_t Count, uint64_t Position); + virtual void Write(uint8_t* Buffer, uint64_t Offset, uint64_t Count); + virtual void Write(uint8_t* Buffer, uint64_t Offset, uint64_t Count, uint64_t Position); + + private: + // Internal cached flags + std::unique_ptr BaseStream; + bool _LeaveOpen; + + // Internal state + void* _DeflateState; + + // Internal buffer + std::unique_ptr _Buffer; + uint32_t _BufferLength; + uint32_t _BufferOffset; + + // Mode to use on the data + CompressionMode _Mode; + + // An internal routine to setup the deflate state + void CreateInflatorDeflator(); + // An internal routine to write deflater output + void WriteDeflaterOutput(); + + // The default buffer size for deflate streams + constexpr static uint32_t DefaultBufferSize = 8192; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/DialogResult.h b/r5dev/thirdparty/cppnet/cppkore/DialogResult.h new file mode 100644 index 00000000..65a73ece --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/DialogResult.h @@ -0,0 +1,35 @@ +#pragma once + +#include + +namespace Forms +{ + // Specifies identifiers to indicate the return value of a dialog box. + enum class DialogResult + { + // Nothing is returned from the dialog box. This + // means that the modal dialog continues running. + None = 0, + // The dialog box return value is + // OK (usually sent from a button labeled OK). + OK = 1, + // The dialog box return value is Cancel (usually sent + // from a button labeled Cancel). + Cancel = 2, + // The dialog box return value is + // Abort (usually sent from a button labeled Abort). + Abort = 3, + // The dialog box return value is + // Retry (usually sent from a button labeled Retry). + Retry = 4, + // The dialog box return value is Ignore (usually sent + // from a button labeled Ignore). + Ignore = 5, + // The dialog box return value is + // Yes (usually sent from a button labeled Yes). + Yes = 6, + // The dialog box return value is + // No (usually sent from a button labeled No). + No = 7, + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/DictionaryBase.h b/r5dev/thirdparty/cppnet/cppkore/DictionaryBase.h new file mode 100644 index 00000000..f1598b35 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/DictionaryBase.h @@ -0,0 +1,573 @@ +#pragma once + +#include +#include +#include +#include "HashHelpers.h" +#include "HashComparer.h" + +// A KeyValuePair holds a key and a value from a dictionary. +template +struct KeyValuePair : std::pair +{ + constexpr TKey& Key() + { + return this->first; + } + + constexpr TValue& Value() + { + return this->second; + } + + constexpr TKey& Key() const + { + return this->first; + } + + constexpr TValue& Value() const + { + return this->second; + } +}; + +// A container class that holds keys and values. +template> +class Dictionary +{ +private: + typedef KeyValuePair PairType; + + struct Entry + { + uint64_t HashCode; // Lower 63 bits of hash code, -1 if unused + uint32_t Next; // Index of next entry, -1 if last + + PairType Kvp; + + Entry() + : HashCode(-1), Next(-1) + { + } + }; + +public: + Dictionary(); + Dictionary(uint32_t Capacity); + + constexpr Dictionary(const Dictionary& Value); + constexpr Dictionary(Dictionary&& Value); + + // Assignment operator + constexpr Dictionary& operator=(const Dictionary& Rhs); + + ~Dictionary() = default; + + // Adds the specified key and value to the dictionary (Returns: true if added) + constexpr bool Add(TKey Key, TValue Value); + // Adds the specified key value pair to the dictionary (Returns: true if added) + constexpr bool Add(PairType Kvp); + + // Removes a key and value from the dictionary if exists + constexpr bool Remove(TKey Key); + + // Clears the entries in the dictionary + constexpr void Clear(); + + // Checks whether or not the dictionary contains the key + constexpr bool ContainsKey(TKey Key); + // Checks whether or not the dictionary contains the key + constexpr bool ContainsKey(TKey Key) const; + // Checks whether or not the dictionary contains the value + constexpr bool ContainsValue(TValue Value); + + // Attempts to get the value from the specified key + constexpr bool TryGetValue(TKey Key, TValue& Value); + + // TODO: Keys collection + // TODO: Values collection + + // Array index operator + constexpr TValue& operator[](TKey& Key); + constexpr TValue& operator[](const TKey& Key); + constexpr TValue& operator[](TKey& Key) const; + constexpr TValue& operator[](const TKey& Key) const; + + // Define custom iterator for loops + class DictionaryIterator : public std::iterator> + { + public: + DictionaryIterator(const Dictionary* Dict, uint32_t Index = -1); + ~DictionaryIterator() = default; + + // Increment operator + DictionaryIterator& operator++() + { + MoveNext(); + return *this; + } + + // Dereference operator + KeyValuePair& operator*(); + // Const dereference operator + const KeyValuePair& operator*() const; + // Pointer access operator + KeyValuePair* operator->(); + + // Inequality operator + bool operator!=(const DictionaryIterator& Rhs) const; + + protected: + // Internal cached flags + const Dictionary* Dict; + KeyValuePair* Kvp; + uint32_t Index; + + private: + // Move the iterator to the next postion + void MoveNext(); + }; + + // Iterator definitions, for for(& :) loop + DictionaryIterator begin() + { + return DictionaryIterator(this); + } + + DictionaryIterator end() + { + return DictionaryIterator(this, this->_Count); + } + + // Const iterator definitions, for for(& :) loop + DictionaryIterator begin() const + { + return DictionaryIterator(this); + } + + DictionaryIterator end() const + { + return DictionaryIterator(this, this->_Count); + } + + // Returns the count of items in the dictionary + constexpr uint32_t Count() const; + +private: + // Internal buffers + std::unique_ptr _Buckets; + std::unique_ptr _Entries; + + // Internal routine to add to the dictionary + bool Insert(TKey& Key, TValue& Value, bool Add); + // Internal routine to setup the dictionary + void Initialize(uint32_t Capacity); + // Internal routine to resize the dictionary + void Resize(); + // Internal routine to resize the dictionary + void Resize(uint32_t NewSize, bool ForceNewHashCodes); + + // Internal routine to find an entry in the dictionary + uint32_t FindEntry(const TKey& Key) const; + + // Internal cached counts + uint32_t _Count; + uint32_t _FreeList; + uint32_t _FreeCount; + uint32_t _BucketLength; +}; + +template +inline Dictionary::Dictionary() + : Dictionary(0) +{ +} + +template +inline Dictionary::Dictionary(uint32_t Capacity) + : _Count(0), _FreeList(-1), _FreeCount(0), _BucketLength(0) +{ + if (Capacity > 0) + Initialize(Capacity); +} + +template +inline constexpr Dictionary::Dictionary(const Dictionary& Value) +{ + this->_Buckets.reset(new uint32_t[Value._BucketLength]); + std::memcpy(this->_Buckets.get(), Value._Buckets.get(), Value._BucketLength * sizeof(uint32_t)); + + this->_Entries.reset(new Entry[Value._BucketLength]); + std::copy(Value._Entries.get(), Value._Entries.get() + Value._BucketLength, this->_Entries); + + this->_Count = Value._Count; + this->_FreeList = Value._FreeList; + this->_FreeCount = Value._FreeCount; + this->_BucketLength = Value._BucketLength; +} + +template +inline constexpr Dictionary::Dictionary(Dictionary&& Value) +{ + this->_Buckets.reset(Value._Buckets.release()); + this->_Entries.reset(Value._Entries.release()); + + this->_Count = Value._Count; + this->_FreeList = Value._FreeList; + this->_FreeCount = Value._FreeCount; + this->_BucketLength = Value._BucketLength; + + Value._Count = 0; + Value._FreeList = -1; + Value._FreeCount = 0; + Value._BucketLength = 0; +} + +template +inline constexpr Dictionary& Dictionary::operator=(const Dictionary& Rhs) +{ + if (Rhs._BucketLength != 0) + { + this->_Buckets.reset(new uint32_t[Rhs._BucketLength]()); + std::memcpy(this->_Buckets.get(), Rhs._Buckets.get(), Rhs._BucketLength * sizeof(uint32_t)); + + this->_Entries.reset(new Entry[Rhs._BucketLength]); + std::copy(Rhs._Entries.get(), Rhs._Entries.get() + Rhs._BucketLength, this->_Entries.get()); + } + else + { + this->_Buckets.reset(); + this->_Entries.reset(); + } + + this->_Count = Rhs._Count; + this->_FreeList = Rhs._FreeList; + this->_FreeCount = Rhs._FreeCount; + this->_BucketLength = Rhs._BucketLength; + + return *this; +} + +template +inline constexpr bool Dictionary::Add(TKey Key, TValue Value) +{ + return Insert(Key, Value, true); +} + +template +inline constexpr bool Dictionary::Add(PairType Kvp) +{ + return Insert(Kvp.Key(), Kvp.Value(), true); +} + +template +inline constexpr bool Dictionary::Remove(TKey Key) +{ + if (this->_Buckets == nullptr) + return false; + + auto HashCode = THasher::GetHashCode(Key) & INT64_MAX; + auto Bucket = HashCode % this->_BucketLength; + uint32_t Last = -1; + + for (uint32_t i = this->_Buckets[Bucket]; i != -1; Last = i, i = this->_Entries[i].Next) + { + if (this->_Entries[i].HashCode == HashCode && THasher::Equals(this->_Entries[i].Kvp.Key(), Key)) + { + if (Last == -1) + this->_Buckets[Bucket] = this->_Entries[i].Next; + else + this->_Entries[Last].Next = this->_Entries[i].Next; + + this->_Entries[i].HashCode = -1; + this->_Entries[i].Next = this->_FreeList; + this->_Entries[i].Kvp.Key() = {}; + this->_Entries[i].Kvp.Value() = {}; + + this->_FreeList = i; + this->_FreeCount++; + + return true; + } + } + + return true; +} + +template +inline constexpr void Dictionary::Clear() +{ + if (this->_Count > 0) + { + this->_Buckets.reset(); + this->_Entries.reset(); + + this->_FreeList = -1; + this->_Count = 0; + this->_FreeCount = 0; + } +} + +template +inline constexpr bool Dictionary::ContainsKey(TKey Key) +{ + return (FindEntry(Key) != -1); +} + +template +inline constexpr bool Dictionary::ContainsKey(TKey Key) const +{ + return (FindEntry(Key) != -1); +} + +template +inline constexpr bool Dictionary::ContainsValue(TValue Value) +{ + for (uint32_t i = 0; i < this->_Count; i++) + if (this->_Entries[i].HashCode != -1 && this->_Entries[i].Value == Value) + return true; + + return false; +} + +template +inline constexpr bool Dictionary::TryGetValue(TKey Key, TValue& Value) +{ + auto Index = FindEntry(Key); + + if (Index != -1) + { + Value = this->_Entries[Index].Kvp.Value(); + return true; + } + + Value = {}; + return false; +} + +template +inline constexpr TValue& Dictionary::operator[](TKey& Key) +{ + auto Index = FindEntry(Key); + + if (Index == -1) + throw std::exception(); + + return this->_Entries[Index].Kvp.Value(); +} + +template +inline constexpr TValue& Dictionary::operator[](const TKey& Key) +{ + auto Index = FindEntry(Key); + + if (Index == -1) + throw std::exception(); + + return this->_Entries[Index].Kvp.Value(); +} + +template +inline constexpr TValue& Dictionary::operator[](TKey& Key) const +{ + auto Index = FindEntry(Key); + + if (Index == -1) + throw std::exception(); + + return this->_Entries[Index].Kvp.Value(); +} + +template +inline constexpr TValue& Dictionary::operator[](const TKey& Key) const +{ + auto Index = FindEntry(Key); + + if (Index == -1) + throw std::exception(); + + return this->_Entries[Index].Kvp.Value(); +} + +template +inline constexpr uint32_t Dictionary::Count() const +{ + return (this->_Count - this->_FreeCount); +} + +template +inline bool Dictionary::Insert(TKey& Key, TValue& Value, bool Add) +{ + if (this->_Buckets == nullptr) + Initialize(0); + + auto HashCode = THasher::GetHashCode(Key) & INT64_MAX; + auto TargetBucket = HashCode % this->_BucketLength; + + for (uint32_t i = this->_Buckets[TargetBucket]; i != -1; i = this->_Entries[i].Next) + { + if (this->_Entries[i].HashCode == HashCode && THasher::Equals(this->_Entries[i].Kvp.Key(), Key)) + { + if (Add) + return false; + + this->_Entries[i].Kvp.Value() = Value; + return false; + } + } + + uint32_t Index = 0; + + if (this->_FreeCount > 0) + { + Index = this->_FreeList; + this->_FreeList = this->_Entries[Index].Next; + this->_FreeCount--; + } + else + { + if (this->_Count == this->_BucketLength) + { + Resize(); + TargetBucket = HashCode % this->_BucketLength; + } + + Index = this->_Count; + this->_Count++; + } + + this->_Entries[Index].HashCode = HashCode; + this->_Entries[Index].Next = this->_Buckets[TargetBucket]; + this->_Entries[Index].Kvp.Key() = Key; + this->_Entries[Index].Kvp.Value() = Value; + + this->_Buckets[TargetBucket] = Index; + + return true; +} + +template +inline void Dictionary::Initialize(uint32_t Capacity) +{ + auto Size = HashHelpers::GetPrime(Capacity); + + this->_Buckets.reset(new uint32_t[Size]); + std::memset(this->_Buckets.get(), 0xFF, sizeof(uint32_t) * Size); + + this->_Entries.reset(new Entry[Size]); + this->_FreeList = -1; + this->_BucketLength = Size; +} + +template +inline void Dictionary::Resize() +{ + Resize(HashHelpers::ExpandPrime(this->_Count), false); +} + +template +inline void Dictionary::Resize(uint32_t NewSize, bool ForceNewHashCodes) +{ + auto NewBuckets = new uint32_t[NewSize]; + std::memset(NewBuckets, 0xFF, NewSize * sizeof(uint32_t)); + + auto NewEntries = new Entry[NewSize]{}; + std::copy(this->_Entries.get(), this->_Entries.get() + this->_Count, NewEntries); + + if (ForceNewHashCodes) + { + for (uint32_t i = 0; i < this->_Count; i++) + { + if (NewEntries[i].HashCode != -1) + NewEntries[i].HashCode = (THasher::GetHashCode(NewEntries[i].Kvp.Key()) & INT64_MAX); + } + } + + for (uint32_t i = 0; i < this->_Count; i++) + { + if (NewEntries[i].HashCode != -1) + { + auto Bucket = NewEntries[i].HashCode % NewSize; + NewEntries[i].Next = NewBuckets[Bucket]; + NewBuckets[Bucket] = i; + } + } + + this->_Buckets.reset(NewBuckets); + this->_Entries.reset(NewEntries); + + this->_BucketLength = NewSize; +} + +template +inline uint32_t Dictionary::FindEntry(const TKey& Key) const +{ + // Strip const modifiers + TKey& KeyUse = *((TKey*)(&Key)); + + if (this->_Buckets == nullptr) + return -1; + + auto HashCode = THasher::GetHashCode(KeyUse) & INT64_MAX; + for (uint32_t i = this->_Buckets[HashCode % this->_BucketLength]; i != -1; i = this->_Entries[i].Next) + { + if (this->_Entries[i].HashCode == HashCode && THasher::Equals(this->_Entries[i].Kvp.Key(), KeyUse)) + return i; + } + + return -1; +} + +template +inline Dictionary::DictionaryIterator::DictionaryIterator(const Dictionary* Dict, uint32_t Index) + : Dict(Dict), Kvp(nullptr), Index(Index) +{ + if (Index == -1) + MoveNext(); // Assigns first kvp +} + +template +inline KeyValuePair& Dictionary::DictionaryIterator::operator*() +{ + return *Kvp; +} + +template +inline const KeyValuePair& Dictionary::DictionaryIterator::operator*() const +{ + return *Kvp; +} + +template +inline KeyValuePair* Dictionary::DictionaryIterator::operator->() +{ + return Kvp; +} + +template +inline bool Dictionary::DictionaryIterator::operator!=(const DictionaryIterator& Rhs) const +{ + if (this->Index != Rhs.Index) + return true; + + return false; +} + +template +inline void Dictionary::DictionaryIterator::MoveNext() +{ + Index++; + + while (Index < this->Dict->_Count) + { + if (this->Dict->_Entries[Index].HashCode != -1) + { + Kvp = &this->Dict->_Entries[Index].Kvp; + return; + } + + Index++; + } + + Index = this->Dict->_Count; +} diff --git a/r5dev/thirdparty/cppnet/cppkore/Directory.cpp b/r5dev/thirdparty/cppnet/cppkore/Directory.cpp new file mode 100644 index 00000000..da81a85f --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Directory.cpp @@ -0,0 +1,299 @@ +#include "stdafx.h" +#include "Directory.h" + +namespace IO +{ + void Directory::CreateDirectory(const string& Path) + { + if (Path.Length() == 0) + return; + if (Directory::Exists(Path)) + return; + + int32_t fLength = Path.Length(); + int32_t rLength = (fLength > 2 && Path[1] == Path::VolumeSeparatorChar && (Path[2] == Path::DirectorySeparatorChar || Path[2] == Path::AltDirectorySeparatorChar)) ? 3 : 0; + + // We need to trim the trailing slash or the code will try to create 2 directories of the same name + if (fLength >= 2 && (Path[fLength - 1] == Path::DirectorySeparatorChar || Path[fLength - 1] == Path::AltDirectorySeparatorChar)) + fLength--; + + // A list of directories to make + auto DirectoryStack = List(); + + if (fLength > rLength) + { + int32_t i = fLength - 1; + while (i >= rLength) + { + DirectoryStack.EmplaceBack(std::move(Path.Substring(0, i + 1))); + + while (i > rLength && Path[i] != Path::DirectorySeparatorChar && Path[1] != Path::AltDirectorySeparatorChar) + i--; + + i--; + } + } + + // Iteration in stack-based order FILO + for (int32_t i = DirectoryStack.Count() - 1; i >= 0; --i) + CreateDirectoryA((const char*)DirectoryStack[i], NULL); + } + + bool Directory::Exists(const string& Path) + { + if (Path.Length() == 0) + return false; + + WIN32_FILE_ATTRIBUTE_DATA Data{}; + auto Result = GetFileAttributesExA((const char*)Path, GET_FILEEX_INFO_LEVELS::GetFileExInfoStandard, &Data); + if (Result) + { + return (Data.dwFileAttributes != -1) && ((Data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0); + } + + return false; + } + + List Directory::GetFiles(const string& Path) + { + return Directory::GetFiles(Path, "*"); + } + + List Directory::GetFiles(const string& Path, const string& SearchPattern) + { + auto Result = List(); + + auto sQuery = (Path[Path.Length() - 1] == Path::DirectorySeparatorChar || Path[Path.Length() - 1] == Path::AltDirectorySeparatorChar) ? Path + SearchPattern : Path + Path::DirectorySeparatorChar + SearchPattern; + + WIN32_FIND_DATAA fInfo; + auto ResultHandle = FindFirstFileA((const char*)sQuery, &fInfo); + + if (ResultHandle == INVALID_HANDLE_VALUE) + return Result; + + if (_strnicmp(fInfo.cFileName, ".", 1) != 0 && _strnicmp(fInfo.cFileName, "..", 2) != 0) + { + auto isDir = (0 != (fInfo.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)); + if (!isDir) + Result.EmplaceBack(std::move(Path::Combine(Path, fInfo.cFileName))); + } + + while (FindNextFileA(ResultHandle, &fInfo)) + { + if (_strnicmp(fInfo.cFileName, ".", 1) != 0 && _strnicmp(fInfo.cFileName, "..", 2) != 0) + { + auto isDir = (0 != (fInfo.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)); + if (!isDir) + Result.EmplaceBack(std::move(Path::Combine(Path, fInfo.cFileName))); + } + } + + FindClose(ResultHandle); + + return Result; + } + + List Directory::GetDirectories(const string& Path) + { + auto Result = List(); + + auto sQuery = (Path[Path.Length() - 1] == Path::DirectorySeparatorChar || Path[Path.Length() - 1] == Path::AltDirectorySeparatorChar) ? Path + "*" : Path + Path::DirectorySeparatorChar + "*"; + + WIN32_FIND_DATAA fInfo; + auto ResultHandle = FindFirstFileA((const char*)sQuery, &fInfo); + + if (ResultHandle == INVALID_HANDLE_VALUE) + return Result; + + if (_strnicmp(fInfo.cFileName, ".", 1) != 0 && _strnicmp(fInfo.cFileName, "..", 2) != 0) + { + auto isDir = (0 != (fInfo.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)); + if (isDir) + Result.EmplaceBack(std::move(Path::Combine(Path, fInfo.cFileName))); + } + + while (FindNextFileA(ResultHandle, &fInfo)) + { + if (_strnicmp(fInfo.cFileName, ".", 1) != 0 && _strnicmp(fInfo.cFileName, "..", 2) != 0) + { + auto isDir = (0 != (fInfo.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)); + if (isDir) + Result.EmplaceBack(std::move(Path::Combine(Path, fInfo.cFileName))); + } + } + + FindClose(ResultHandle); + + return Result; + } + + List Directory::GetLogicalDrives() + { + auto Result = List(); + + auto dCount = ::GetLogicalDrives(); + if (dCount == 0) + IOError::StreamAccessDenied(); + + uint32_t d = (uint32_t)dCount; + char Root[] = { 'A', ':', '\\' }; + + while (d != 0) + { + if ((d & 1) != 0) + Result.EmplaceBack(std::move(string(Root, 3))); + + d >>= 1; + Root[0]++; + } + + return Result; + } + + string Directory::GetCurrentDirectory() + { + char Buffer[MAX_PATH + 1]{}; + if (!GetCurrentDirectoryA(MAX_PATH, (char*)Buffer)) + { + auto Error = GetLastError(); + switch (Error) + { + case ERROR_ACCESS_DENIED: + IOError::StreamAccessDenied(); + break; + default: + IOError::StreamUnknown(); + break; + } + } + + return Buffer; + } + + void Directory::SetCurrentDirectory(const string& Path) + { + auto Result = SetCurrentDirectoryA((const char*)Path); + if (!Result) + { + auto Error = GetLastError(); + switch (Error) + { + case ERROR_ACCESS_DENIED: + IOError::StreamAccessDenied(); + break; + case ERROR_FILE_NOT_FOUND: + case ERROR_PATH_NOT_FOUND: + IOError::StreamFileNotFound(); + break; + default: + IOError::StreamUnknown(); + break; + } + } + } + + void Directory::Move(const string& SourcePath, const string& DestinationPath) + { + // Ensure that the roots are the same + if (Path::GetPathRoot(SourcePath).ToLower() != Path::GetPathRoot(DestinationPath).ToLower()) + IOError::StreamRootMismatch(); + + auto Result = MoveFileA((const char*)SourcePath, (const char*)DestinationPath); + if (!Result) + { + auto Error = GetLastError(); + switch (Error) + { + case ERROR_ACCESS_DENIED: + IOError::StreamAccessDenied(); + break; + case ERROR_FILE_NOT_FOUND: + case ERROR_PATH_NOT_FOUND: + IOError::StreamFileNotFound(); + break; + default: + IOError::StreamUnknown(); + break; + } + } + } + + void Directory::Copy(const string& SourcePath, const string& DestinationPath, bool OverWrite) + { + auto Result = CopyFileA((const char*)SourcePath, (const char*)DestinationPath, !OverWrite); + if (!Result) + { + auto Error = GetLastError(); + switch (Error) + { + case ERROR_ACCESS_DENIED: + IOError::StreamAccessDenied(); + break; + case ERROR_FILE_NOT_FOUND: + case ERROR_PATH_NOT_FOUND: + IOError::StreamFileNotFound(); + break; + case ERROR_FILE_EXISTS: + IOError::StreamFileExists(); + break; + default: + IOError::StreamUnknown(); + break; + } + } + } + + bool Directory::Delete(const string& Path, bool Recursive) + { + if (Path.Length() == 0) + return false; + if (!Directory::Exists(Path)) + return false; + + if (!Recursive) + return (RemoveDirectoryA((const char*)Path) != 0); + + // + // We must recursively delete each file and folder in the path, because RemoveDirectory doesn't handle non-empty file paths + // If one of the operations fails, the entire delete operation fails + // + + auto sQuery = (Path[Path.Length() - 1] == Path::DirectorySeparatorChar || Path[Path.Length() - 1] == Path::AltDirectorySeparatorChar) ? Path + "*" : Path + Path::DirectorySeparatorChar + "*"; + + WIN32_FIND_DATAA fInfo; + auto ResultHandle = FindFirstFileA((const char*)sQuery, &fInfo); + + if (ResultHandle == INVALID_HANDLE_VALUE) + return false; + + do + { + auto bDir = (0 != (fInfo.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)); + if (bDir) + { + auto bReparse = (0 != (fInfo.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)); + if (!bReparse) + { + return Directory::Delete(Path::Combine(Path, fInfo.cFileName), true); + } + else if (bReparse && fInfo.dwReserved0 == IO_REPARSE_TAG_MOUNT_POINT) + { + if (!DeleteVolumeMountPointA((const char*)Path::Combine(Path, string(fInfo.cFileName) + Path::DirectorySeparatorChar))) + return false; + } + } + else + { + if (!DeleteFileA((const char*)Path::Combine(Path, fInfo.cFileName))) + return false; + } + } while (FindNextFileA(ResultHandle, &fInfo)); + + FindClose(ResultHandle); + + if (RemoveDirectoryA((const char*)Path)) + return true; + + return false; + } +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Directory.h b/r5dev/thirdparty/cppnet/cppkore/Directory.h new file mode 100644 index 00000000..570e73e9 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Directory.h @@ -0,0 +1,45 @@ +#pragma once + +#include "Path.h" +#include "IOError.h" +#include "ListBase.h" +#include "StringBase.h" + +// +// Remove Win32 macros +// + +#undef CreateDirectory +#undef GetCurrentDirectory +#undef SetCurrentDirectory + +namespace IO +{ + class Directory + { + public: + // Checks whether or not the specified path exists + static bool Exists(const string& Path); + // Creates a new directory at the given path + static void CreateDirectory(const string& Path); + // Returns the current directory set + static string GetCurrentDirectory(); + // Sets the current directory + static void SetCurrentDirectory(const string& Path); + // Moves the source path to the destination path + static void Move(const string& SourcePath, const string& DestinationPath); + // Copies the source path to the destination path + static void Copy(const string& SourcePath, const string& DestinationPath, bool OverWrite = false); + // Deletes a directory, optionally recursive if it's not empty + static bool Delete(const string& Path, bool Recursive = true); + + // Returns an array of files in the current path + static List GetFiles(const string& Path); + // Returns an array of files in the current path matching the search pattern + static List GetFiles(const string& Path, const string& SearchPattern); + // Returns an array of folders in the current path + static List GetDirectories(const string& Path); + // Returns an array of logical drives + static List GetLogicalDrives(); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/DragDropEffects.h b/r5dev/thirdparty/cppnet/cppkore/DragDropEffects.h new file mode 100644 index 00000000..ef64949c --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/DragDropEffects.h @@ -0,0 +1,26 @@ +#pragma once + +#include +#include + +namespace Forms +{ + // Specifies the effects of a drag-and-drop operation. + enum class DragDropEffects + { + None = 0x0, + Copy = 0x1, + Move = 0x2, + Link = 0x4, + Scroll = (int)0x80000000, + All = Copy | Move | Scroll + }; + + // + // Allow bitwise operations on this enumeration + // + constexpr DragDropEffects operator|(DragDropEffects Lhs, DragDropEffects Rhs) + { + return static_cast(static_cast::type>(Lhs) | static_cast::type>(Rhs)); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/DragEventArgs.cpp b/r5dev/thirdparty/cppnet/cppkore/DragEventArgs.cpp new file mode 100644 index 00000000..b5dec186 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/DragEventArgs.cpp @@ -0,0 +1,10 @@ +#include "stdafx.h" +#include "DragEventArgs.h" + +namespace Forms +{ + DragEventArgs::DragEventArgs(IDataObject* Data, const int32_t KeyState, const int32_t X, const int32_t Y, const DragDropEffects AllowedEffect, DragDropEffects Effect) + : Data(Data), KeyState(KeyState), X(X), Y(Y), AllowedEffect(AllowedEffect), Effect(Effect) + { + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/DragEventArgs.h b/r5dev/thirdparty/cppnet/cppkore/DragEventArgs.h new file mode 100644 index 00000000..68e85003 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/DragEventArgs.h @@ -0,0 +1,31 @@ +#pragma once + +#include +#include "DragDropEffects.h" + +namespace Forms +{ + // Provides data for the DragDrop events. + class DragEventArgs + { + public: + DragEventArgs(IDataObject* Data, const int32_t KeyState, const int32_t X, const int32_t Y, const DragDropEffects AllowedEffect, DragDropEffects Effect);; + ~DragEventArgs() = default; + + // The data associated with this event. + IDataObject* Data; + // The current statie of the shift, ctrl, and alt keys. + const int32_t KeyState; + + // The mouse X location. + const int32_t X; + // The mouse Y location. + const int32_t Y; + + // The effect that should be applied to the mouse cursor. + const DragDropEffects AllowedEffect; + + // Gets or sets which drag-and-drop operations are allowed by the target of the drag event. + DragDropEffects Effect; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/DrawListViewColumnHeaderEventArgs.cpp b/r5dev/thirdparty/cppnet/cppkore/DrawListViewColumnHeaderEventArgs.cpp new file mode 100644 index 00000000..350b21d7 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/DrawListViewColumnHeaderEventArgs.cpp @@ -0,0 +1,10 @@ +#include "stdafx.h" +#include "DrawListViewColumnHeaderEventArgs.h" + +namespace Forms +{ + DrawListViewColumnHeaderEventArgs::DrawListViewColumnHeaderEventArgs(HDC Dc, const ColumnHeader* Header, int32_t ColumnIndex, Drawing::Rectangle Bounds, ListViewItemStates State) + : Header(Header), ColumnIndex(ColumnIndex), Bounds(Bounds), State(State), DrawDefault(false), Graphics(std::make_unique(Dc)) + { + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/DrawListViewColumnHeaderEventArgs.h b/r5dev/thirdparty/cppnet/cppkore/DrawListViewColumnHeaderEventArgs.h new file mode 100644 index 00000000..fe73045a --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/DrawListViewColumnHeaderEventArgs.h @@ -0,0 +1,33 @@ +#pragma once + +#include +#include +#include "DrawingBase.h" +#include "ColumnHeader.h" +#include "ListViewItemStates.h" + +namespace Forms +{ + // This class contains the information a user needs to paint ListView headers. + class DrawListViewColumnHeaderEventArgs + { + public: + DrawListViewColumnHeaderEventArgs(HDC Dc, const ColumnHeader* Header, int32_t ColumnIndex, Drawing::Rectangle Bounds, ListViewItemStates State); + ~DrawListViewColumnHeaderEventArgs() = default; + + // The header object. + const ColumnHeader* Header; + // Gets the state of the header to draw. + const ListViewItemStates State; + // Gets the bounds of the header to draw. + const Drawing::Rectangle Bounds; + // The index of the header to draw. + const int32_t ColumnIndex; + + // Whether or not the system draws the header. + bool DrawDefault; + + // The graphics instance used to paint this header. + std::unique_ptr Graphics; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/DrawListViewItemEventArgs.cpp b/r5dev/thirdparty/cppnet/cppkore/DrawListViewItemEventArgs.cpp new file mode 100644 index 00000000..f951ba79 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/DrawListViewItemEventArgs.cpp @@ -0,0 +1,10 @@ +#include "stdafx.h" +#include "DrawListViewItemEventArgs.h" + +namespace Forms +{ + DrawListViewItemEventArgs::DrawListViewItemEventArgs(HDC Dc, const string& Text, const ListViewItemStyle Style, Drawing::Rectangle Bounds, int32_t ItemIndex, ListViewItemStates State) + : Text(Text), Style(Style), Bounds(Bounds), ItemIndex(ItemIndex), DrawDefault(false), Graphics(std::make_unique(Dc)), State(State) + { + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/DrawListViewItemEventArgs.h b/r5dev/thirdparty/cppnet/cppkore/DrawListViewItemEventArgs.h new file mode 100644 index 00000000..ff908a34 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/DrawListViewItemEventArgs.h @@ -0,0 +1,36 @@ +#pragma once + +#include +#include +#include "StringBase.h" +#include "DrawingBase.h" +#include "ListViewItem.h" +#include "ListViewItemStates.h" + +namespace Forms +{ + // This class contains the information a user needs to paint ListView items. + class DrawListViewItemEventArgs + { + public: + DrawListViewItemEventArgs(HDC Dc, const string& Text, const ListViewItemStyle Style, Drawing::Rectangle Bounds, int32_t ItemIndex, ListViewItemStates State); + ~DrawListViewItemEventArgs() = default; + + // Gets the text of the item to draw. + const string Text; + // Gets the style of the item to draw. + const ListViewItemStyle Style; + // Gets the state of the item to draw. + const ListViewItemStates State; + // Gets the bounds of the item to draw. + const Drawing::Rectangle Bounds; + // The index of the item to draw. + const int32_t ItemIndex; + + // Whether or not the system draws the item. + bool DrawDefault; + + // The graphics instance used to paint this item. + std::unique_ptr Graphics; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/DrawListViewSubItemEventArgs.cpp b/r5dev/thirdparty/cppnet/cppkore/DrawListViewSubItemEventArgs.cpp new file mode 100644 index 00000000..cee5dbc0 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/DrawListViewSubItemEventArgs.cpp @@ -0,0 +1,10 @@ +#include "stdafx.h" +#include "DrawListViewSubItemEventArgs.h" + +namespace Forms +{ + DrawListViewSubItemEventArgs::DrawListViewSubItemEventArgs(HDC Dc, const string& Text, const ListViewItemStyle Style, Drawing::Rectangle Bounds, int32_t ItemIndex, int32_t SubItemIndex, ListViewItemStates State) + : Text(Text), Style(Style), Bounds(Bounds), ItemIndex(ItemIndex), SubItemIndex(SubItemIndex), DrawDefault(false), Graphics(std::make_unique(Dc)), State(State) + { + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/DrawListViewSubItemEventArgs.h b/r5dev/thirdparty/cppnet/cppkore/DrawListViewSubItemEventArgs.h new file mode 100644 index 00000000..3601810c --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/DrawListViewSubItemEventArgs.h @@ -0,0 +1,38 @@ +#pragma once + +#include +#include +#include "StringBase.h" +#include "DrawingBase.h" +#include "ListViewItem.h" +#include "ListViewItemStates.h" + +namespace Forms +{ + // This class contains the information a user needs to paint ListView sub items. + class DrawListViewSubItemEventArgs + { + public: + DrawListViewSubItemEventArgs(HDC Dc, const string& Text, const ListViewItemStyle Style, Drawing::Rectangle Bounds, int32_t ItemIndex, int32_t SubItemIndex, ListViewItemStates State); + ~DrawListViewSubItemEventArgs() = default; + + // Gets the text of the item to draw. + const string Text; + // Gets the style of the item to draw. + const ListViewItemStyle Style; + // Gets the state of the item to draw. + const ListViewItemStates State; + // Gets the bounds of the item to draw. + const Drawing::Rectangle Bounds; + // The index of the item to draw. + const int32_t ItemIndex; + // The sub item index to draw. + const int32_t SubItemIndex; + + // Whether or not the system draws the item. + bool DrawDefault; + + // The graphics instance used to paint this item. + std::unique_ptr Graphics; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/DrawMode.h b/r5dev/thirdparty/cppnet/cppkore/DrawMode.h new file mode 100644 index 00000000..39c1ecd5 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/DrawMode.h @@ -0,0 +1,17 @@ +#pragma once + +#include + +namespace Forms +{ + // Specifies responsibility for drawing a control or portion of a control. + enum class DrawMode + { + // The operating system paints the items in the control, and the items are each the same height. + Normal = 0, + // The programmer explicitly paints the items in the control, and the items are the same height. + OwnerDrawFixed = 1, + // The programmer explicitly paints the items in the control manually, and they may be different heights. + OwnerDrawVariable = 2 + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/DrawToolTipEventArgs.cpp b/r5dev/thirdparty/cppnet/cppkore/DrawToolTipEventArgs.cpp new file mode 100644 index 00000000..1ce7cc41 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/DrawToolTipEventArgs.cpp @@ -0,0 +1,45 @@ +#include "stdafx.h" +#include "DrawToolTipEventArgs.h" + +namespace Forms +{ + DrawToolTipEventArgs::DrawToolTipEventArgs(HDC Dc, Control* Window, Control* Ctrl, Drawing::Rectangle Bounds, const string& Text, Drawing::Color BackColor, Drawing::Color ForeColor, Drawing::Font* Font) + : _Dc(Dc), AssociatedWindow(Window), AssociatedControl(Ctrl), Bounds(Bounds), ToolTipText(Text), BackColor(BackColor), ForeColor(ForeColor), Font(Font) + { + this->Graphics = std::make_unique(Dc); + this->Graphics->SetPageUnit(Gdiplus::Unit::UnitPixel); + } + + void DrawToolTipEventArgs::DrawBackground() + { + Drawing::SolidBrush Brush(BackColor); + Graphics->FillRectangle(&Brush, Bounds); + } + + void DrawToolTipEventArgs::DrawText() + { + Drawing::SolidBrush Brush(ForeColor); + Gdiplus::RectF BoundsF((float)Bounds.X, (float)Bounds.Y, (float)Bounds.Width, (float)Bounds.Height); + Gdiplus::Font Fnt(_Dc, Font->GetFontHandle()); + Gdiplus::StringFormat Fmt; + + Fmt.SetAlignment(Gdiplus::StringAlignment::StringAlignmentCenter); + Fmt.SetLineAlignment(Gdiplus::StringAlignment::StringAlignmentCenter); + + auto WideString = ToolTipText.ToWString(); + + Graphics->DrawString((wchar_t*)WideString, WideString.Length(), &Fnt, BoundsF, &Fmt, &Brush); + } + + void DrawToolTipEventArgs::DrawBorder() + { + Drawing::SolidBrush Brush(Drawing::GetSystemColor(Drawing::SystemColors::WindowFrame)); + Drawing::Pen Pen(&Brush); + + Drawing::Rectangle BoundsOne(Bounds); + BoundsOne.Width--; + BoundsOne.Height--; + + Graphics->DrawRectangle(&Pen, BoundsOne); + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/DrawToolTipEventArgs.h b/r5dev/thirdparty/cppnet/cppkore/DrawToolTipEventArgs.h new file mode 100644 index 00000000..b89b0d59 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/DrawToolTipEventArgs.h @@ -0,0 +1,48 @@ +#pragma once + +#include +#include "Control.h" +#include "StringBase.h" +#include "DrawingBase.h" +#include "Font.h" + +namespace Forms +{ + // Provides data for the OnDraw event. + class DrawToolTipEventArgs + { + public: + DrawToolTipEventArgs() = default; + DrawToolTipEventArgs(HDC Dc, Control* Window, Control* Ctrl, Drawing::Rectangle Bounds, const string& Text, Drawing::Color BackColor, Drawing::Color ForeColor, Drawing::Font* Font); + ~DrawToolTipEventArgs() = default; + + // The graphics object used to paint during this event + std::unique_ptr Graphics; + // The bounds used for painting during this event + Drawing::Rectangle Bounds; + // The text that should be drawn + string ToolTipText; + // The font used to draw tooltip text + Drawing::Font* Font; + + // The control for which the tooltip is being painted. + Control* AssociatedControl; + // The window for which the tooltip is being painted. + Control* AssociatedWindow; + + // Draws the background of the tooltip. + void DrawBackground(); + // Draws the text of the tooltip. + void DrawText(); + // Draws the border of the tooltip. + void DrawBorder(); + + private: + // Internal color states + Drawing::Color BackColor; + Drawing::Color ForeColor; + + // Internal DC + HDC _Dc; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/DrawingBase.h b/r5dev/thirdparty/cppnet/cppkore/DrawingBase.h new file mode 100644 index 00000000..6ecef368 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/DrawingBase.h @@ -0,0 +1,269 @@ +#pragma once + +#include +#include +#include + + + +namespace Drawing +{ + // + // Contains a list of remapped GDI+ objects to natural objects following our naming conventions + // + + // Represents a image + using Image = Gdiplus::Image; + // Represents a bitmap surface + using Bitmap = Gdiplus::Bitmap; + // Represents a rectangle from a point and a size + using Rectangle = Gdiplus::Rect; + // Represents a 2D point + using Point = Gdiplus::Point; + // Represents a 2D floating point + using PointF = Gdiplus::PointF; + // Represents a 2D size + using Size = Gdiplus::Size; + // Represents a 2D size floating point + using SizeF = Gdiplus::SizeF; + // Represents a color + using Color = Gdiplus::Color; + // Represents a generic brush + using Brush = Gdiplus::Brush; + // Represents a solid color brush + using SolidBrush = Gdiplus::SolidBrush; + // Represents a gradient color brush + using LinearGradientBrush = Gdiplus::LinearGradientBrush; + // Represents a graphics object in GDI+ + using Graphics = Gdiplus::Graphics; + // Represents a saved state in GDI+ + using GraphicsState = Gdiplus::GraphicsState; + // Represents a pen in GDI+ + using Pen = Gdiplus::Pen; + // Represents a brush in GDI+ + using Brush = Gdiplus::Brush; + + // Represents a list of system defined colors + enum class SystemColors + { + ActiveBorder = 0x0A, + ActiveCaption = 0x02, + ActiveCaptionText = 0x09, + AppWorkspace = 0x0C, + ButtonFace = 0x0F, + ButtonHighlight = 0x14, + ButtonShadow = 0x10, + Control = 0x0F, + ControlDark = 0x10, + ControlDarkDark = 0x15, + ControlLight = 0x16, + ControlLightLight = 0x14, + ControlText = 0x12, + Desktop = 0x01, + GradientActiveCaption = 0x1B, + GradientInactiveCaption = 0x1C, + GrayText = 0x11, + Highlight = 0x0D, + HighlightText = 0x0E, + HotTrack = 0x1A, + InactiveBorder = 0x0B, + InactiveCaption = 0x03, + InactiveCaptionText = 0x13, + Info = 0x18, + InfoText = 0x17, + Menu = 0x04, + MenuBar = 0x1E, + MenuHighlight = 0x1D, + MenuText = 0x07, + ScrollBar = 0x00, + Window = 0x05, + WindowFrame = 0x06, + WindowText = 0x08 + }; + +#pragma region Internal + namespace __Internal + { + constexpr int AlphaShift = 24; + constexpr int RedShift = 16; + constexpr int GreenShift = 8; + constexpr int BlueShift = 0; + + constexpr int Win32RedShift = 0; + constexpr int Win32GreenShift = 8; + constexpr int Win32BlueShift = 16; + + constexpr int Encode(int alpha, int red, int green, int blue) + { + return red << RedShift | green << GreenShift | blue << BlueShift | alpha << AlphaShift; + } + + constexpr int FromWin32Value(int value) + { + return Encode(255, (value >> Win32RedShift) & 0xFF, (value >> Win32GreenShift) & 0xFF, (value >> Win32BlueShift) & 0xFF); + } + + constexpr int ToWin32(uint8_t R, uint8_t G, uint8_t B) + { + return R << Win32RedShift | G << Win32GreenShift | B << Win32BlueShift; + } + } +#pragma endregion + + inline Drawing::Size UnionSizes(Drawing::Size S1, Drawing::Size S2) + { + return Drawing::Size(max(S1.Width, S2.Width), max(S1.Height, S2.Height)); + } + + inline Drawing::Size IntersectSizes(Drawing::Size S1, Drawing::Size S2) + { + return Drawing::Size(min(S1.Width, S2.Width), min(S1.Height, S2.Height)); + } + + inline Drawing::Size ConvertZeroToUnbounded(Drawing::Size S) + { + Drawing::Size Result = S; + + if (Result.Width == 0) Result.Width = INT_MAX; + if (Result.Height == 0) Result.Height = INT_MAX; + + return Result; + } + + // Gets a system color from the specified index + inline Color GetSystemColor(SystemColors Index) + { + return Color(__Internal::FromWin32Value(GetSysColor((int)Index))); + } + + // Converts a drawing color to a native windows color + inline int ColorToWin32(Color Value) + { + return __Internal::ToWin32(Value.GetR(), Value.GetG(), Value.GetB()); + } + + inline void FillRoundRectangle(Drawing::Graphics* G, Drawing::Brush* Brush, Gdiplus::RectF& Rect, float Radius) + { + Gdiplus::GraphicsPath Path; + + Path.AddLine((float)Rect.X + Radius, (float)Rect.Y, (float)Rect.X + Rect.Width - (Radius * 2), (float)Rect.Y); + Path.AddArc((float)Rect.X + Rect.Width - (Radius * 2), (float)Rect.Y, (float)Radius * 2, (float)Radius * 2, 270, 90); + Path.AddLine((float)Rect.X + Rect.Width, (float)Rect.Y + Radius, (float)Rect.X + Rect.Width, (float)Rect.Y + Rect.Height - (Radius * 2)); + Path.AddArc(Rect.X + Rect.Width - (Radius * 2), Rect.Y + Rect.Height - (Radius * 2), Radius * 2, Radius * 2, 0, 90); + Path.AddLine((float)Rect.X + Rect.Width - (Radius * 2), (float)Rect.Y + Rect.Height, (float)Rect.X + Radius, (float)Rect.Y + Rect.Height); + Path.AddArc((float)Rect.X, (float)Rect.Y + Rect.Height - (Radius * 2), (float)Radius * 2, (float)Radius * 2, 90, 90); + Path.AddLine((float)Rect.X, (float)Rect.Y + Rect.Height - (Radius * 2), (float)Rect.X, (float)Rect.Y + Radius); + Path.AddArc((float)Rect.X, (float)Rect.Y, (float)Radius * 2, (float)Radius * 2, 180, 90); + Path.CloseFigure(); + + G->FillPath(Brush, &Path); + } + + inline void FillRoundRectangle(Drawing::Graphics* G, Drawing::Brush* Brush, Drawing::Rectangle& Rect, float Radius) + { + Gdiplus::GraphicsPath Path; + + Path.AddLine((float)Rect.X + Radius, (float)Rect.Y, (float)Rect.X + Rect.Width - (Radius * 2), (float)Rect.Y); + Path.AddArc((float)Rect.X + Rect.Width - (Radius * 2), (float)Rect.Y, (float)Radius * 2, (float)Radius * 2, 270, 90); + Path.AddLine((float)Rect.X + Rect.Width, (float)Rect.Y + Radius, (float)Rect.X + Rect.Width, (float)Rect.Y + Rect.Height - (Radius * 2)); + Path.AddArc(Rect.X + Rect.Width - (Radius * 2), Rect.Y + Rect.Height - (Radius * 2), Radius * 2, Radius * 2, 0, 90); + Path.AddLine((float)Rect.X + Rect.Width - (Radius * 2), (float)Rect.Y + Rect.Height, (float)Rect.X + Radius, (float)Rect.Y + Rect.Height); + Path.AddArc((float)Rect.X, (float)Rect.Y + Rect.Height - (Radius * 2), (float)Radius * 2, (float)Radius * 2, 90, 90); + Path.AddLine((float)Rect.X, (float)Rect.Y + Rect.Height - (Radius * 2), (float)Rect.X, (float)Rect.Y + Radius); + Path.AddArc((float)Rect.X, (float)Rect.Y, (float)Radius * 2, (float)Radius * 2, 180, 90); + Path.CloseFigure(); + + G->FillPath(Brush, &Path); + } + + inline void DrawRoundRectangle(Drawing::Graphics* G, Drawing::Pen* Pen, Drawing::Rectangle& Rect, float Radius) + { + Gdiplus::GraphicsPath Path; + + Path.AddLine((float)Rect.X + Radius, (float)Rect.Y, (float)Rect.X + Rect.Width - (Radius * 2), (float)Rect.Y); + Path.AddArc((float)Rect.X + Rect.Width - (Radius * 2), (float)Rect.Y, (float)Radius * 2, (float)Radius * 2, 270, 90); + Path.AddLine((float)Rect.X + Rect.Width, (float)Rect.Y + Radius, (float)Rect.X + Rect.Width, (float)Rect.Y + Rect.Height - (Radius * 2)); + Path.AddArc(Rect.X + Rect.Width - (Radius * 2), Rect.Y + Rect.Height - (Radius * 2), Radius * 2, Radius * 2, 0, 90); + Path.AddLine((float)Rect.X + Rect.Width - (Radius * 2), (float)Rect.Y + Rect.Height, (float)Rect.X + Radius, (float)Rect.Y + Rect.Height); + Path.AddArc((float)Rect.X, (float)Rect.Y + Rect.Height - (Radius * 2), (float)Radius * 2, (float)Radius * 2, 90, 90); + Path.AddLine((float)Rect.X, (float)Rect.Y + Rect.Height - (Radius * 2), (float)Rect.X, (float)Rect.Y + Radius); + Path.AddArc((float)Rect.X, (float)Rect.Y, (float)Radius * 2, (float)Radius * 2, 180, 90); + Path.CloseFigure(); + + G->DrawPath(Pen, &Path); + } + + inline Drawing::Image* ImageFromTgaData(const uint8_t* TgaData, const uint32_t TgaDataSize) + { +#pragma pack(push, 1) + struct TgaHeader + { + uint8_t idlength; + uint8_t colourmaptype; + uint8_t datatypecode; + uint16_t colourmaporigin; + uint16_t colourmaplength; + uint8_t colourmapdepth; + uint16_t x_origin; + uint16_t y_origin; + uint16_t width; + uint16_t height; + uint8_t bitsperpixel; + uint8_t imagedescriptor; + }; +#pragma pack(pop) + + auto Header = (TgaHeader*)TgaData; + auto Stride = (Header->bitsperpixel / 8) * Header->width; + auto Format = (Header->bitsperpixel == 32) ? PixelFormat32bppARGB : PixelFormat24bppRGB; + auto Result = new Drawing::Bitmap(Header->width, Header->height, Stride, Format, (BYTE*)(TgaData + sizeof(TgaHeader))); + + // TGAs are TOP->BOTTOM, BMPs are BOTTOM->TOP... + Result->RotateFlip(Gdiplus::RotateFlipType::RotateNoneFlipY); + + return Result; + } + + inline Drawing::Image* ImageFromPngResource(const uint32_t ResourceId) + { + auto hInst = ::GetModuleHandleA(NULL); + auto hResource = ::FindResourceA(hInst, MAKEINTRESOURCEA(ResourceId), "PNG"); + + if (hResource != nullptr) + { + auto ImageSize = ::SizeofResource(hInst, hResource); + auto hLoadResource = ::LoadResource(hInst, hResource); + + if (hLoadResource != nullptr) + { + const void* pResourceData = ::LockResource(hLoadResource); + + auto hBuffer = ::GlobalAlloc(GMEM_MOVEABLE, ImageSize); + + if (hBuffer) + { + void* pBuffer = ::GlobalLock(hBuffer); + if (pBuffer) + { + CopyMemory(pBuffer, pResourceData, ImageSize); + + IStream* pStream = NULL; + if (::CreateStreamOnHGlobal(hBuffer, FALSE, &pStream) == S_OK) + { + auto m_pBitmap = Gdiplus::Bitmap::FromStream(pStream); + pStream->Release(); + return m_pBitmap; + } + ::GlobalUnlock(hBuffer); + } + ::GlobalFree(hBuffer); + } + + ::FreeResource(hLoadResource); + } + } + + // Failed during load + return nullptr; + } +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/DropTarget.cpp b/r5dev/thirdparty/cppnet/cppkore/DropTarget.cpp new file mode 100644 index 00000000..b78307c7 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/DropTarget.cpp @@ -0,0 +1,82 @@ +#include "stdafx.h" +#include "Control.h" +#include "DropTarget.h" +#include "DragEventArgs.h" + +namespace Forms +{ + DropTarget::DropTarget(Control* Target) + : IDropTarget(), _Target(Target), _LastObject(nullptr), _LastEffect(DragDropEffects::None) + { + } + + HRESULT STDMETHODCALLTYPE DropTarget::DragEnter(IDataObject* pDataObj, DWORD grfKeyState, POINTL pt, DWORD* pdwEffect) + { + auto EventArgs = std::make_unique(pDataObj, grfKeyState, pt.x, pt.y, (DragDropEffects)*pdwEffect, this->_LastEffect); + + if (this->_Target != nullptr) + { + this->_Target->OnDragEnter(EventArgs); + *pdwEffect = (DWORD)EventArgs->Effect; + } + + this->_LastObject = pDataObj; + this->_LastEffect = (DragDropEffects)*pdwEffect; + + return S_OK; + } + + HRESULT STDMETHODCALLTYPE DropTarget::DragOver(DWORD grfKeyState, POINTL pt, DWORD* pdwEffect) + { + auto EventArgs = std::make_unique(this->_LastObject, grfKeyState, pt.x, pt.y, (DragDropEffects)*pdwEffect, this->_LastEffect); + + if (this->_Target != nullptr) + { + this->_Target->OnDragOver(EventArgs); + *pdwEffect = (DWORD)EventArgs->Effect; + } + + this->_LastEffect = (DragDropEffects)*pdwEffect; + + return S_OK; + } + + HRESULT STDMETHODCALLTYPE DropTarget::DragLeave() + { + if (this->_Target != nullptr) + this->_Target->OnDragLeave(); + + return S_OK; + } + + HRESULT STDMETHODCALLTYPE DropTarget::Drop(IDataObject* pDataObj, DWORD grfKeyState, POINTL pt, DWORD* pdwEffect) + { + auto EventArgs = std::make_unique(pDataObj, grfKeyState, pt.x, pt.y, (DragDropEffects)*pdwEffect, this->_LastEffect); + + if (this->_Target != nullptr) + { + this->_Target->OnDragDrop(EventArgs); + *pdwEffect = (DWORD)EventArgs->Effect; + } + + this->_LastObject = nullptr; + this->_LastEffect = DragDropEffects::None; + + return S_OK; + } + + HRESULT STDMETHODCALLTYPE DropTarget::QueryInterface(REFIID riid, void** ppvObject) + { + return S_OK; + } + + ULONG STDMETHODCALLTYPE DropTarget::AddRef(void) + { + return NULL; + } + + ULONG STDMETHODCALLTYPE DropTarget::Release(void) + { + return NULL; + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/DropTarget.h b/r5dev/thirdparty/cppnet/cppkore/DropTarget.h new file mode 100644 index 00000000..8415373a --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/DropTarget.h @@ -0,0 +1,52 @@ +#pragma once + +#include +#include +#include "DragDropEffects.h" + +namespace Forms +{ + // Defined elsewhere + class Control; + + // Handles drag and drop events for a target control. + class DropTarget : public IDropTarget + { + public: + DropTarget(Control* Target); + ~DropTarget() = default; + + virtual HRESULT STDMETHODCALLTYPE DragEnter( + /* [unique][in] */ __RPC__in_opt IDataObject *pDataObj, + /* [in] */ DWORD grfKeyState, + /* [in] */ POINTL pt, + /* [out][in] */ __RPC__inout DWORD *pdwEffect); + + virtual HRESULT STDMETHODCALLTYPE DragOver( + /* [in] */ DWORD grfKeyState, + /* [in] */ POINTL pt, + /* [out][in] */ __RPC__inout DWORD *pdwEffect); + + virtual HRESULT STDMETHODCALLTYPE DragLeave(); + + virtual HRESULT STDMETHODCALLTYPE Drop( + /* [unique][in] */ __RPC__in_opt IDataObject *pDataObj, + /* [in] */ DWORD grfKeyState, + /* [in] */ POINTL pt, + /* [out][in] */ __RPC__inout DWORD *pdwEffect); + + virtual HRESULT STDMETHODCALLTYPE QueryInterface( + /* [in] */ REFIID riid, + /* [iid_is][out] */ _COM_Outptr_ void __RPC_FAR *__RPC_FAR *ppvObject); + + virtual ULONG STDMETHODCALLTYPE AddRef(void); + + virtual ULONG STDMETHODCALLTYPE Release(void); + + private: + // Internal cached control + Control* _Target; + DragDropEffects _LastEffect; + IDataObject* _LastObject; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Environment.cpp b/r5dev/thirdparty/cppnet/cppkore/Environment.cpp new file mode 100644 index 00000000..3d50a432 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Environment.cpp @@ -0,0 +1,122 @@ +#include "stdafx.h" +#include "Environment.h" +#include "Path.h" +#include + +namespace System +{ + const string Environment::NewLine = "\r\n"; + + void Environment::Exit(int32_t ExitCode) + { + std::exit(ExitCode); + } + + string Environment::GetFolderPath(SpecialFolder Folder) + { + char Buffer[MAX_PATH + 1]{}; + auto Result = SHGetFolderPathA(NULL, (int)Folder, NULL, SHGFP_TYPE_CURRENT, Buffer); + + if (Result < 0) + return ""; + + return string(Buffer); + } + + string Environment::GetApplicationPath() + { + char Buffer[MAX_PATH + 1]{}; + auto mResult = GetModuleFileNameA(NULL, Buffer, MAX_PATH); + + if (mResult != 0) + return IO::Path::GetDirectoryName(Buffer); + + return ""; + } + + string Environment::GetApplication() + { + char Buffer[MAX_PATH + 1]{}; + auto mResult = GetModuleFileNameA(NULL, Buffer, MAX_PATH); + + if (mResult != 0) + return Buffer; + + return ""; + } + + string Environment::GetCommandLine() + { + return string(GetCommandLineA()); + } + + List Environment::GetCommandLineArgs() + { + auto Result = List(); + + int nArgs = 0; + auto szArgList = CommandLineToArgvW(GetCommandLineW(), &nArgs); + if (szArgList == nullptr) + return Result; + + for (int i = 0; i < nArgs; i++) + Result.EmplaceBack(std::move(wstring(szArgList[i]).ToString())); + + LocalFree(szArgList); + return Result; + } + + string Environment::GetUserName() + { + char Buffer[1024]{}; + DWORD BufferSize = 1024; + GetUserNameA(Buffer, &BufferSize); + + return string(Buffer); + } + + string Environment::GetComputerName() + { + char Buffer[MAX_COMPUTERNAME_LENGTH + 1]{}; + DWORD BufferSize = MAX_COMPUTERNAME_LENGTH; + GetComputerNameA(Buffer, &BufferSize); + + return string(Buffer); + } + + uint64_t Environment::GetTickCount() + { + return GetTickCount64(); + } + + void Environment::SetEnvironmentVariable(const string& Key, const string& Value) + { + if (Key.Length() == 0 || Value.Length() == 0) + return; + + SetEnvironmentVariableA((const char*)Key, (const char*)Value); + } + + string Environment::GetEnvironmentVariable(const string& Key) + { + char Buffer[1024]{}; + GetEnvironmentVariableA((const char*)Key, Buffer, 1024); + + return string(Buffer); + } + + string Environment::ExpandEnvironmentVariables(const string& Path) + { + char Buffer[4096]{}; + ExpandEnvironmentStringsA((const char*)Path, Buffer, 4096); + + // In theory, this should be ok, since, most paths will be used for actual file paths, < 260 chars anyways... + + return string(Buffer); + } + + constexpr bool Environment::Is64BitProcess() + { + return (sizeof(uintptr_t) == 8); + } +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Environment.h b/r5dev/thirdparty/cppnet/cppkore/Environment.h new file mode 100644 index 00000000..8ea5a4dd --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Environment.h @@ -0,0 +1,52 @@ +#pragma once + +#include "ListBase.h" +#include "StringBase.h" +#include "SpecialFolder.h" +#include + +#undef GetCommandLine +#undef SetEnvironmentVariable +#undef GetEnvironmentVariable +#undef GetComputerName +#undef GetUserName + +namespace System +{ + class Environment + { + public: + // Terminates the process with the given code + static void Exit(int32_t ExitCode); + + // Gets the path to the specific system file folder + static string GetFolderPath(SpecialFolder Folder); + // Returns the application path + static string GetApplicationPath(); + // Returns the application + static string GetApplication(); + // Rethrns the full command line string + static string GetCommandLine(); + // Returns a list of command line arguments + static List GetCommandLineArgs(); + // Returns the current users account name + static string GetUserName(); + // Returns the current computer name + static string GetComputerName(); + // Returns the total tick count since startup + static uint64_t GetTickCount(); + + // Sets an environment variable to the specified value + static void SetEnvironmentVariable(const string& Key, const string& Value); + // Gets an environment variable from the specified key + static string GetEnvironmentVariable(const string& Key); + // Expands environment variables in the given path + static string ExpandEnvironmentVariables(const string& Path); + + // Returns whether or not we are a 64bit process + constexpr static bool Is64BitProcess(); + + // Returns a newline string for the environment + const static string NewLine; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/EventBase.h b/r5dev/thirdparty/cppnet/cppkore/EventBase.h new file mode 100644 index 00000000..4cf4dd8e --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/EventBase.h @@ -0,0 +1,110 @@ +#pragma once + +#include + +template +class EventBase +{ +public: + EventBase(); + ~EventBase(); + + template + void RaiseEvent(TArgs&&... Args); + + EventBase& operator+=(const Tevent& Rhs); + EventBase& operator-=(const Tevent& Rhs); + +private: + // List of event pointers + Tevent* EventStack; + // Count of event pointers + uint8_t StackSize; +}; + +template +inline EventBase::EventBase() + : EventStack(nullptr), StackSize(0) +{ +} + +template +inline EventBase::~EventBase() +{ + if (EventStack) + delete[] EventStack; + EventStack = nullptr; + StackSize = 0; +} + +template +inline EventBase& EventBase::operator+=(const Tevent& Rhs) +{ + auto NewBuffer = new Tevent[StackSize + 1]; + + if (EventStack != nullptr) + { + std::memcpy(NewBuffer, EventStack, sizeof(void*) * StackSize); + delete[] EventStack; + } + + NewBuffer[StackSize] = Rhs; + + EventStack = NewBuffer; + StackSize++; + + return *this; +} + +template +inline EventBase& EventBase::operator-=(const Tevent& Rhs) +{ + if (EventStack == nullptr) + return *this; + + int32_t Index = -1; + for (uint32_t i = 0; i < StackSize; i++) + { + if (EventStack[i] == Rhs) + { + Index = i; + break; + } + } + + if (Index < 0) + return *this; + else if (StackSize == 1) + { + delete[] EventStack; + EventStack = nullptr; + StackSize--; + return *this; + } + + auto NewBuffer = new Tevent[StackSize - 1]; + + std::memcpy(NewBuffer, EventStack, sizeof(void*) * Index); + std::memcpy(NewBuffer + Index, EventStack + Index + 1, sizeof(void*) * (StackSize - Index - 1)); + + delete[] EventStack; + + EventStack = NewBuffer; + StackSize--; + + return *this; +} + +// Define normal types here +using BasicEvent = EventBase; + +template +template +inline void EventBase::RaiseEvent(TArgs&&... Args) +{ + if (EventStack == nullptr) + return; + + for (uint32_t i = 0; i < StackSize; i++) + EventStack[i](std::forward(Args)...); +} diff --git a/r5dev/thirdparty/cppnet/cppkore/Exporter.h b/r5dev/thirdparty/cppnet/cppkore/Exporter.h new file mode 100644 index 00000000..a4adb456 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Exporter.h @@ -0,0 +1,43 @@ +#pragma once + +#include +#include "Model.h" +#include "Animation.h" +#include "StringBase.h" + +namespace Assets::Exporters +{ + // This enumeration represents the possible exporter scale constants. + enum class ExporterScale + { + // This exporter requires no scale modifications. + Default, + // This exporter requires conversion to inches. + Inch, + // This exporter requires conversion to centimeters. + CM + }; + + // The interface for all asset exporter types. + class Exporter + { + public: + // Exports the given animation to the provided path. + virtual bool ExportAnimation(const Animation& Animation, const string& Path) = 0; + // Exports the given model to the provided path. + virtual bool ExportModel(const Model& Model, const string& Path) = 0; + + // Gets the file extension for this exporters model format. + virtual imstring ModelExtension() = 0; + // Gets the file extension for this exporters animation format. + virtual imstring AnimationExtension() = 0; + + // Gets the required scaling constant for this exporter. + virtual ExporterScale ExportScale() = 0; + + // Gets whether or not the exporter supports animation exporting. + virtual bool SupportsAnimations() = 0; + // Gets whether or not the exporter supports model exporting. + virtual bool SupportsModels() = 0; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Face.cpp b/r5dev/thirdparty/cppnet/cppkore/Face.cpp new file mode 100644 index 00000000..da0ff6c8 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Face.cpp @@ -0,0 +1,25 @@ +#include "stdafx.h" +#include "Face.h" + +namespace Assets +{ + Face::Face() + : Face(0, 0, 0) + { + } + + Face::Face(uint32_t Index1, uint32_t Index2, uint32_t Index3) + : Indices{ Index1, Index2, Index3 } + { + } + + uint32_t& Face::operator[](uint32_t Index) + { + return this->Indices[Index]; + } + + const uint32_t& Face::operator[](uint32_t Index) const + { + return this->Indices[Index]; + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/Face.h b/r5dev/thirdparty/cppnet/cppkore/Face.h new file mode 100644 index 00000000..d7113be5 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Face.h @@ -0,0 +1,27 @@ +#pragma once + +#include + +namespace Assets +{ + // A container class that holds 3D face data. + class Face + { + public: + // Initialize a blank 3D face. + Face(); + // Initialize a 3D face with the given vertices. + Face(uint32_t Index1, uint32_t Index2, uint32_t Index3); + // Destroys all 3D face data. + ~Face() = default; + + // Array index operator + uint32_t& operator[](uint32_t Index); + // Const array index operator + const uint32_t& operator[](uint32_t Index) const; + + private: + // Internal index buffer + uint32_t Indices[3]; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/File.cpp b/r5dev/thirdparty/cppnet/cppkore/File.cpp new file mode 100644 index 00000000..52264c34 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/File.cpp @@ -0,0 +1,205 @@ +#include "stdafx.h" +#include "File.h" + +namespace IO +{ + void File::Copy(const string& SourceFileName, const string& DestinationFileName, bool OverWrite) + { + auto Result = CopyFileA((const char*)SourceFileName, (const char*)DestinationFileName, !OverWrite); + if (!Result) + { + auto Error = GetLastError(); + switch (Error) + { + case ERROR_FILE_EXISTS: + IOError::StreamFileExists(); + break; + case ERROR_ACCESS_DENIED: + IOError::StreamAccessDenied(); + break; + } + } + } + + void File::Delete(const string& FilePath) + { + auto Result = DeleteFileA((const char*)FilePath); + if (!Result) + { + auto Error = GetLastError(); + switch (Error) + { + case ERROR_FILE_NOT_FOUND: + IOError::StreamFileNotFound(); + break; + case ERROR_ACCESS_DENIED: + IOError::StreamAccessDenied(); + break; + } + } + } + + void File::Decrypt(const string& FilePath) + { + auto Result = DecryptFileA((const char*)FilePath, 0); + if (!Result) + { + auto Error = GetLastError(); + switch (Error) + { + case ERROR_FILE_NOT_FOUND: + IOError::StreamFileNotFound(); + break; + case ERROR_ACCESS_DENIED: + IOError::StreamAccessDenied(); + break; + } + } + } + + void File::Encrypt(const string& FilePath) + { + auto Result = EncryptFileA((const char*)FilePath); + if (!Result) + { + auto Error = GetLastError(); + switch (Error) + { + case ERROR_FILE_NOT_FOUND: + IOError::StreamFileNotFound(); + break; + case ERROR_ACCESS_DENIED: + IOError::StreamAccessDenied(); + break; + } + } + } + + bool File::Exists(const string& FilePath) + { + if (FilePath.Length() == 0) + return false; + + WIN32_FILE_ATTRIBUTE_DATA Data{}; + auto Result = GetFileAttributesExA((const char*)FilePath, GET_FILEEX_INFO_LEVELS::GetFileExInfoStandard, &Data); + if (Result) + { + return (Data.dwFileAttributes != -1) && ((Data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0); + } + + return false; + } + + void File::Move(const string& SourceFileName, const string& DestinationFileName, bool OverWrite) + { + if (File::Exists(DestinationFileName)) + { + if (OverWrite) + File::Delete(DestinationFileName); + else + IOError::StreamFileExists(); + } + + auto Result = MoveFileA((const char*)SourceFileName, (const char*)DestinationFileName); + if (!Result) + { + auto Error = GetLastError(); + switch (Error) + { + case ERROR_FILE_NOT_FOUND: + IOError::StreamFileNotFound(); + break; + case ERROR_ACCESS_DENIED: + IOError::StreamAccessDenied(); + break; + } + } + } + + std::unique_ptr File::Create(const string& FilePath) + { + return std::make_unique(FilePath, FileMode::Create, FileAccess::ReadWrite, FileShare::None); + } + + std::unique_ptr File::Open(const string& FilePath, FileMode Mode) + { + return File::Open(FilePath, Mode, (Mode == FileMode::Append ? FileAccess::Write : FileAccess::ReadWrite), FileShare::None); + } + + std::unique_ptr File::Open(const string& FilePath, FileMode Mode, FileAccess Access) + { + return File::Open(FilePath, Mode, Access, FileShare::None); + } + + std::unique_ptr File::Open(const string& FilePath, FileMode Mode, FileAccess Access, FileShare Share) + { + return std::make_unique(FilePath, Mode, Access, Share); + } + + std::unique_ptr File::OpenRead(const string& FilePath) + { + return std::make_unique(FilePath, FileMode::Open, FileAccess::Read, FileShare::Read); + } + + std::unique_ptr File::OpenWrite(const string& FilePath) + { + return std::make_unique(FilePath, FileMode::OpenOrCreate, FileAccess::Write, FileShare::None); + } + + std::unique_ptr File::OpenAppend(const string & FilePath) + { + return std::make_unique(FilePath, FileMode::Append, FileAccess::Write, FileShare::None); + } + + string File::ReadAllText(const string& FilePath) + { + return StreamReader(File::OpenRead(FilePath)).ReadToEnd(); + } + + List File::ReadAllBytes(const string& FilePath) + { + auto FileReader = BinaryReader(File::OpenRead(FilePath)); + auto FileLength = FileReader.GetBaseStream()->GetLength(); + + auto Result = List((uint32_t)FileLength, true); + + FileReader.Read((uint8_t*)Result, 0, FileLength); + + return Result; + } + + List File::ReadAllLines(const string& FilePath) + { + auto Result = List(); + auto FileReader = StreamReader(File::OpenRead(FilePath)); + auto BaseStream = FileReader.GetBaseStream(); + + while (!BaseStream->GetIsEndOfFile()) + Result.EmplaceBack(std::move(FileReader.ReadLine())); + + return Result; + } + + void File::WriteAllText(const string& FilePath, const string& Text) + { + StreamWriter(File::Create(FilePath)).Write(Text); + } + + void File::WriteAllBytes(const string& FilePath, const List& Bytes) + { + BinaryWriter(File::Create(FilePath)).Write((uint8_t*)Bytes, 0, Bytes.Count()); + } + + void File::WriteAllBytes(const string& FilePath, const uint8_t* Bytes, uint64_t Count) + { + BinaryWriter(File::Create(FilePath)).Write((uint8_t*)Bytes, 0, Count); + } + + void File::WriteAllLines(const string& FilePath, const List& Lines) + { + auto Writer = StreamWriter(File::Create(FilePath)); + + for (auto& Line : Lines) + Writer.WriteLine(Line); + } +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/File.h b/r5dev/thirdparty/cppnet/cppkore/File.h new file mode 100644 index 00000000..16b65d4c --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/File.h @@ -0,0 +1,66 @@ +#pragma once + +#include +#include "IOError.h" +#include "ListBase.h" +#include "StringBase.h" +#include "FileStream.h" +#include "StreamReader.h" +#include "StreamWriter.h" +#include "BinaryReader.h" +#include "BinaryWriter.h" + +// +// Remove Win32 macros +// + +namespace IO +{ + class File + { + public: + // Copies an existing file to a new file, overwriting if specified + static void Copy(const string& SourceFileName, const string& DestinationFileName, bool OverWrite = false); + // Deletes a file permanently + static void Delete(const string& FilePath); + // Decrypts a file from a NTFS volume + static void Decrypt(const string& FilePath); + // Encrypts a file from a NTFS volume + static void Encrypt(const string& FilePath); + // Whether or not the file exists + static bool Exists(const string& FilePath); + // Moves an existing file to a new location, overwriting if specified + static void Move(const string& SourceFileName, const string& DestinationFileName, bool OverWrite = false); + + // Creates a file in a particular path with ReadWrite access + static std::unique_ptr Create(const string& FilePath); + // Opens a file in a particular path with the given mode + static std::unique_ptr Open(const string& FilePath, FileMode Mode); + // Opens a file in a particular path with the given mode + static std::unique_ptr Open(const string& FilePath, FileMode Mode, FileAccess Access); + // Opens a file in a particular path with the given mode + static std::unique_ptr Open(const string& FilePath, FileMode Mode, FileAccess Access, FileShare Share); + // Opens a file in a particular path for reading + static std::unique_ptr OpenRead(const string& FilePath); + // Opens a file in a particular path for writing + static std::unique_ptr OpenWrite(const string& FilePath); + // Opens or creates a file in a particular path for appending + static std::unique_ptr OpenAppend(const string& FilePath); + + // Reads the entire specified file as a text + static string ReadAllText(const string& FilePath); + // Reads the entire specified file as bytes + static List ReadAllBytes(const string& FilePath); + // Reads all the lines in the specified text file + static List ReadAllLines(const string& FilePath); + + // Writes the specified text to the a file + static void WriteAllText(const string& FilePath, const string& Text); + // Writes the specified bytes to the file + static void WriteAllBytes(const string& FilePath, const List& Bytes); + // Writes the specified bytes to the file + static void WriteAllBytes(const string& FilePath, const uint8_t* Bytes, uint64_t Count); + // Writes the specified lines to the file + static void WriteAllLines(const string& FilePath, const List& Lines); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/FileAccess.h b/r5dev/thirdparty/cppnet/cppkore/FileAccess.h new file mode 100644 index 00000000..e9189657 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/FileAccess.h @@ -0,0 +1,18 @@ +#pragma once + +namespace IO +{ + enum class FileAccess + { + // Specifies read access to the file. Data can be read from the file and + // the file pointer can be moved. Combine with WRITE for read-write access. + Read = 1, + // Specifies write access to the file. Data can be written to the file and + // the file pointer can be moved. Combine with READ for read-write access. + Write = 2, + // Specifies read and write access to the file. Data can be written to the + // file and the file pointer can be moved. Data can also be read from the + // file. + ReadWrite = 3 + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/FileMode.h b/r5dev/thirdparty/cppnet/cppkore/FileMode.h new file mode 100644 index 00000000..7e198173 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/FileMode.h @@ -0,0 +1,23 @@ +#pragma once + +namespace IO +{ + enum class FileMode + { + // Creates a new file. An exception is raised if the file already exists. + CreateNew = 1, + // Creates a new file. If the file already exists, it is overwritten. + Create = 2, + // Opens an existing file. An exception is raised if the file does not exist. + Open = 3, + // Opens the file if it exists. Otherwise, creates a new file. + OpenOrCreate = 4, + // Opens an existing file. Once opened, the file is truncated so that its + // size is zero bytes. The calling process must open the file with at least + // WRITE access. An exception is raised if the file does not exist. + Truncate = 5, + // Opens the file if it exists and seeks to the end. Otherwise, + // creates a new file. + Append = 6 + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/FileShare.h b/r5dev/thirdparty/cppnet/cppkore/FileShare.h new file mode 100644 index 00000000..1ba1521d --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/FileShare.h @@ -0,0 +1,25 @@ +#pragma once + +namespace IO +{ + enum class FileShare + { + // No sharing. Any request to open the file (by this process or another + // process) will fail until the file is closed. + None = 0, + // Allows subsequent opening of the file for reading. If this flag is not + // specified, any request to open the file for reading (by this process or + // another process) will fail until the file is closed. + Read = 1, + // Allows subsequent opening of the file for writing. If this flag is not + // specified, any request to open the file for writing (by this process or + // another process) will fail until the file is closed. + Write = 2, + // Allows subsequent opening of the file for writing or reading. If this flag + // is not specified, any request to open the file for writing or reading (by + // this process or another process) will fail until the file is closed. + ReadWrite = 3, + // Open the file, but allow someone else to delete the file. + Delete = 4, + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/FileStream.cpp b/r5dev/thirdparty/cppnet/cppkore/FileStream.cpp new file mode 100644 index 00000000..7663014a --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/FileStream.cpp @@ -0,0 +1,540 @@ +#include "stdafx.h" +#include "FileStream.h" + +namespace IO +{ + FileStream::FileStream(const string& Path, FileMode Mode) + : FileStream(Path, Mode, (Mode == FileMode::Append ? FileAccess::Write : FileAccess::ReadWrite), FileShare::Read) + { + } + + FileStream::FileStream(const string& Path, FileMode Mode, FileAccess Access) + : FileStream(Path, Mode, Access, FileShare::Read) + { + } + + FileStream::FileStream(const string& Path, FileMode Mode, FileAccess Access, FileShare Share) + : FileStream(Path, Mode, Access, Share, FileStream::DefaultBufferSize) + { + } + + FileStream::FileStream(const string & Path, FileMode Mode, FileAccess Access, FileShare Share, uint32_t BufferSize) + { + this->SetupStream(Path, Mode, Access, Share, BufferSize); + } + + FileStream::~FileStream() + { + this->Close(); + } + + bool FileStream::CanRead() + { + return _CanRead; + } + + bool FileStream::CanWrite() + { + return _CanWrite; + } + + bool FileStream::CanSeek() + { + return _CanSeek; + } + + bool FileStream::GetIsEndOfFile() + { + if (_CanRead) + { + if (this->GetLength() == this->GetPosition()) + return true; + else + return false; + } + + return false; + } + + uint64_t FileStream::GetLength() + { + if (!this->_Handle) + IOError::StreamNotOpen(); + + int64_t Result = 0; + GetFileSizeEx(this->_Handle, (PLARGE_INTEGER)&Result); + + if (this->_WritePosition > 0 && (this->_Position + this->_WritePosition) > Result) + Result = (this->_WritePosition + this->_Position); + + return Result; + } + + uint64_t FileStream::GetPosition() + { + if (!this->_Handle) + IOError::StreamNotOpen(); + + VerifyOSHandlePosition(); + + return (uint64_t)(this->_Position + (this->_ReadPosition - this->_ReadLength + this->_WritePosition)); + } + + void FileStream::SetLength(uint64_t Length) + { + IOError::StreamSetLengthSupport(); + } + + void FileStream::SetPosition(uint64_t Position) + { + if (!this->_Handle) + IOError::StreamNotOpen(); + + if (!_CanSeek) + IOError::StreamNoSeekSupport(); + + if (this->_WritePosition > 0) + this->FlushWrite(); + this->_ReadPosition = 0; + this->_ReadLength = 0; + + LARGE_INTEGER Move{}; + Move.QuadPart = Position; + + SetFilePointerEx(this->_Handle, Move, NULL, FILE_BEGIN); + } + + void FileStream::Close() + { + if (this->_WritePosition > 0) + this->FlushWrite(); + + if (this->_Handle) + CloseHandle(this->_Handle); + + this->_Handle = nullptr; + this->_CanRead = false; + this->_CanSeek = false; + this->_CanWrite = false; + + this->_Buffer.reset(); + } + + void FileStream::Flush() + { + if (!this->_Handle) + IOError::StreamNotOpen(); + + if (this->_WritePosition > 0) + this->FlushWrite(); + if (this->_ReadPosition < this->_ReadLength) + this->FlushRead(); + } + + void FileStream::Seek(uint64_t Offset, SeekOrigin Origin) + { + if (!this->_Handle) + IOError::StreamNotOpen(); + + if (!_CanSeek) + IOError::StreamNoSeekSupport(); + + // Handle simulated seeking when our buffer already covers the segment + if (this->_WritePosition > 0) + this->FlushWrite(); + else if (Origin == SeekOrigin::Current) + Offset -= (this->_ReadLength - this->_ReadPosition); + + // Validate that our internal position matches the handle position + VerifyOSHandlePosition(); + + auto OldPosition = this->_Position + (this->_ReadPosition - this->_ReadLength); + + LARGE_INTEGER Distance{}; + LARGE_INTEGER Position{}; + Distance.QuadPart = Offset; + + // Perform the seek + switch (Origin) + { + case SeekOrigin::Begin: + SetFilePointerEx(this->_Handle, Distance, &Position, FILE_BEGIN); + break; + case SeekOrigin::Current: + SetFilePointerEx(this->_Handle, Distance, &Position, FILE_CURRENT); + break; + case SeekOrigin::End: + SetFilePointerEx(this->_Handle, Distance, &Position, FILE_END); + break; + } + this->_Position = Position.QuadPart; + + // Emulated seek in our buffer + if (this->_ReadLength > 0) + { + if (OldPosition == Position.QuadPart) + { + if (this->_ReadPosition > 0) + { + std::memcpy(this->_Buffer.get(), this->_Buffer.get() + this->_ReadPosition, (this->_ReadLength - this->_ReadPosition)); + this->_ReadLength -= this->_ReadPosition; + this->_ReadPosition = 0; + } + + if (this->_ReadLength > 0) + { + Distance.QuadPart = this->_ReadLength; + SetFilePointerEx(this->_Handle, Distance, &Position, FILE_CURRENT); + this->_Position = Position.QuadPart; + } + } + else if (OldPosition - this->_ReadPosition < this->_Position && this->_Position < OldPosition + this->_ReadLength - this->_ReadPosition) + { + auto Difference = (this->_Position - OldPosition); + std::memcpy(this->_Buffer.get(), this->_Buffer.get() + (this->_ReadPosition + Difference), this->_ReadLength - (this->_ReadPosition + Difference)); + + this->_ReadLength -= (uint32_t)(this->_ReadPosition + Difference); + this->_ReadPosition = 0; + + if (this->_ReadLength > 0) + { + Distance.QuadPart = this->_ReadLength; + SetFilePointerEx(this->_Handle, Distance, &Position, FILE_CURRENT); + this->_Position = Position.QuadPart; + } + } + else + { + this->_ReadPosition = 0; + this->_ReadLength = 0; + } + } + } + + uint64_t FileStream::Read(uint8_t* Buffer, uint64_t Offset, uint64_t Count) + { + if (!this->_Handle) + IOError::StreamNotOpen(); + + if (!this->_CanRead) + IOError::StreamNoReadSupport(); + + bool isBlocked = false; + uint64_t BufferRemaining = this->_ReadLength - this->_ReadPosition; + if (BufferRemaining == 0) + { + if (this->_WritePosition > 0) + this->FlushWrite(); + + if (!this->_CanSeek || (Count >= this->_BufferSize)) + { + auto ResultRead = this->ReadCore(Buffer, Offset, Count); + + this->_ReadPosition = 0; + this->_ReadLength = 0; + + return ResultRead; + } + + BufferRemaining = this->ReadCore(this->_Buffer.get(), 0, this->_BufferSize); + + if (BufferRemaining == 0) + return 0; + isBlocked = (BufferRemaining < this->_BufferSize); + + this->_ReadPosition = 0; + this->_ReadLength = (uint32_t)BufferRemaining; + } + + if (BufferRemaining > Count) + BufferRemaining = Count; + + std::memcpy(Buffer + Offset, this->_Buffer.get() + this->_ReadPosition, BufferRemaining); + this->_ReadPosition += (uint32_t)BufferRemaining; + + if (BufferRemaining < Count && !isBlocked) + { + auto MoreFill = this->ReadCore(Buffer, Offset + BufferRemaining, Count - BufferRemaining); + + BufferRemaining += MoreFill; + + this->_ReadPosition = 0; + this->_ReadLength = 0; + } + + return BufferRemaining; + } + + uint64_t FileStream::Read(uint8_t* Buffer, uint64_t Offset, uint64_t Count, uint64_t Position) + { + this->SetPosition(Position); + return this->Read(Buffer, Offset, Count); + } + + void FileStream::Write(uint8_t* Buffer, uint64_t Offset, uint64_t Count) + { + if (!this->_Handle) + IOError::StreamNotOpen(); + + if (!this->_CanWrite) + IOError::StreamNoWriteSupport(); + + if (this->_WritePosition == 0) + { + if (this->_ReadPosition < this->_ReadLength) + this->FlushRead(); + + this->_ReadPosition = 0; + this->_ReadLength = 0; + } + + if (this->_WritePosition > 0) + { + auto BufferLeft = (this->_BufferSize - this->_WritePosition); + if (BufferLeft > 0) + { + if (BufferLeft > Count) + BufferLeft = (uint32_t)Count; + + std::memcpy(this->_Buffer.get() + this->_WritePosition, Buffer + Offset, BufferLeft); + + this->_WritePosition += BufferLeft; + + if (Count == BufferLeft) + return; + + Offset += BufferLeft; + Count -= BufferLeft; + } + + // Flush the write buffer + this->WriteCore(this->_Buffer.get(), 0, this->_WritePosition); + this->_WritePosition = 0; + } + + if (Count >= this->_BufferSize) + { + this->WriteCore(Buffer, Offset, Count); + return; + } + + std::memcpy(this->_Buffer.get() + this->_WritePosition, Buffer + Offset, Count); + this->_WritePosition = (uint32_t)Count; + } + + void FileStream::Write(uint8_t* Buffer, uint64_t Offset, uint64_t Count, uint64_t Position) + { + this->SetPosition(Position); + this->Write(Buffer, Offset, Count); + } + + void FileStream::FlushWrite() + { + this->WriteCore(this->_Buffer.get(), 0, this->_WritePosition); + this->_WritePosition = 0; + } + + void FileStream::FlushRead() + { + if ((this->_ReadPosition - this->_ReadLength) != 0) + { + LARGE_INTEGER Distance{}; + Distance.QuadPart = (this->_ReadPosition - this->_ReadLength); + + LARGE_INTEGER Position{}; + SetFilePointerEx(this->_Handle, Distance, &Position, FILE_CURRENT); + + this->_Position = Position.QuadPart; + } + + this->_ReadPosition = 0; + this->_ReadLength = 0; + } + + void FileStream::VerifyOSHandlePosition() + { + LARGE_INTEGER Distance{}; + LARGE_INTEGER Result{}; + + // Save the old position, and grab the file position + auto OldPosition = this->_Position; + SetFilePointerEx(this->_Handle, Distance, &Result, FILE_CURRENT); + this->_Position = Result.QuadPart; + + // Check for out of sync file position + if (Result.QuadPart != OldPosition) + { + this->_ReadPosition = 0; + this->_ReadLength = 0; + } + } + + void FileStream::WriteCore(uint8_t* Buffer, uint64_t Offset, uint64_t Count) + { + auto WritePtr = (Buffer + Offset); + uint64_t TotalWrite = 0; + + VerifyOSHandlePosition(); + + DWORD nWrite = 0; + while (Count > 0 && this->_Handle) + { + // Calculate based on DWORD MAX value due to API limitations + auto Want = (Count > UINT32_MAX) ? UINT32_MAX : Count; + + // Write the buffer + WriteFile(this->_Handle, WritePtr, (DWORD)Want, &nWrite, NULL); + + // Adjust counts + TotalWrite += nWrite; + Count -= Want; + WritePtr += Want; + } + + this->_Position += TotalWrite; + } + + uint64_t FileStream::ReadCore(uint8_t* Buffer, uint64_t Offset, uint64_t Count) + { + auto ReadPtr = (Buffer + Offset); + uint64_t TotalRead = 0; + + VerifyOSHandlePosition(); + + DWORD nRead = 0; + while (Count > 0 && this->_Handle) + { + // Calculate based on DWORD MAX value due to API limitations + auto Want = (Count > UINT32_MAX) ? UINT32_MAX : Count; + + // Read the buffer + ReadFile(this->_Handle, ReadPtr, (DWORD)Want, &nRead, NULL); + + // Adjust counts + TotalRead += nRead; + Count -= Want; + ReadPtr += Want; + } + + this->_Position += TotalRead; + + return TotalRead; + } + + void FileStream::SetupStream(const string& Path, FileMode Mode, FileAccess Access, FileShare Share, uint32_t BufferSize) + { + // Easy way to make sure we have a fresh stream + this->Close(); + + // Prepare CreateFileA flags against our options + auto fAccess = GENERIC_READ; + switch (Access) + { + case FileAccess::Write: + fAccess = GENERIC_WRITE; + break; + case FileAccess::ReadWrite: + fAccess |= GENERIC_WRITE; + break; + } + + auto fShare = NULL; + switch (Share) + { + case FileShare::Read: + fShare = FILE_SHARE_READ; + break; + case FileShare::Write: + fShare = FILE_SHARE_WRITE; + break; + case FileShare::ReadWrite: + fShare = (FILE_SHARE_READ | FILE_SHARE_WRITE); + break; + case FileShare::Delete: + fShare = FILE_SHARE_DELETE; + break; + } + + auto fMode = CREATE_NEW; + switch (Mode) + { + case FileMode::Create: + fMode = CREATE_ALWAYS; + break; + case FileMode::OpenOrCreate: + fMode = OPEN_ALWAYS; + break; + case FileMode::Open: + fMode = OPEN_EXISTING; + break; + case FileMode::Truncate: + fMode = TRUNCATE_EXISTING; + break; + case FileMode::Append: + fMode = OPEN_EXISTING; + break; + } + + // Open a native file handle + auto hFile = CreateFileA(Path.begin(), fAccess, fShare, NULL, fMode, FILE_ATTRIBUTE_NORMAL, NULL); + if (hFile == INVALID_HANDLE_VALUE) + { + switch (GetLastError()) + { + case ERROR_FILE_EXISTS: + IOError::StreamFileExists(); + break; + case ERROR_PATH_NOT_FOUND: + IOError::StreamPathInvalid(); + break; + case ERROR_FILE_NOT_FOUND: + IOError::StreamFileNotFound(); + break; + case ERROR_SHARING_VIOLATION: + IOError::StreamInUse(); + break; + default: + IOError::StreamUnknown(); + break; + } + } + + // Set the handle + this->_Handle = hFile; + + // Set flags once we are sure it's open + switch (Access) + { + case FileAccess::Read: + this->_CanRead = true; + break; + case FileAccess::Write: + this->_CanWrite = true; + break; + case FileAccess::ReadWrite: + this->_CanRead = true; + this->_CanWrite = true; + break; + } + + // We can seek if we aren't in append mode, otherwise, move to end for appending... + LARGE_INTEGER Position{}; + if (Mode != FileMode::Append) + this->_CanSeek = true; + else + { + LARGE_INTEGER Move{}; + SetFilePointerEx(this->_Handle, Move, &Position, FILE_END); + } + + // Setup the buffer + this->_Buffer = std::make_unique(BufferSize); + this->_BufferSize = BufferSize; + + // Initialize structures + this->_ReadLength = 0; + this->_ReadPosition = 0; + this->_WritePosition = 0; + this->_Position = Position.QuadPart; + } +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/FileStream.h b/r5dev/thirdparty/cppnet/cppkore/FileStream.h new file mode 100644 index 00000000..c88f196a --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/FileStream.h @@ -0,0 +1,79 @@ +#pragma once + +#include +#include + +#include "Stream.h" +#include "StringBase.h" +#include "FileMode.h" +#include "FileAccess.h" +#include "FileShare.h" + +namespace IO +{ + // FileStream supports reading and writing files to the disk + class FileStream : public Stream + { + public: + FileStream(const string& Path, FileMode Mode); + FileStream(const string& Path, FileMode Mode, FileAccess Access); + FileStream(const string& Path, FileMode Mode, FileAccess Access, FileShare Share); + FileStream(const string& Path, FileMode Mode, FileAccess Access, FileShare Share, uint32_t BufferSize); + virtual ~FileStream(); + + // Implement Getters and Setters + virtual bool CanRead(); + virtual bool CanWrite(); + virtual bool CanSeek(); + virtual bool GetIsEndOfFile(); + virtual uint64_t GetLength(); + virtual uint64_t GetPosition(); + virtual void SetLength(uint64_t Length); + virtual void SetPosition(uint64_t Position); + + // Implement functions + virtual void Close(); + virtual void Flush(); + virtual void Seek(uint64_t Offset, SeekOrigin Origin); + virtual uint64_t Read(uint8_t* Buffer, uint64_t Offset, uint64_t Count); + virtual uint64_t Read(uint8_t* Buffer, uint64_t Offset, uint64_t Count, uint64_t Position); + virtual void Write(uint8_t* Buffer, uint64_t Offset, uint64_t Count); + virtual void Write(uint8_t* Buffer, uint64_t Offset, uint64_t Count, uint64_t Position); + + private: + // FileMode flags cached + bool _CanRead; + bool _CanWrite; + bool _CanSeek; + + // Internal buffer + std::unique_ptr _Buffer; + uint32_t _BufferSize; + + // Internal cached positions + int32_t _ReadLength; + int32_t _ReadPosition; + int32_t _WritePosition; + int64_t _Position; + + // The file handle + HANDLE _Handle; + + // Internal routines to flush the buffers + void FlushWrite(); + void FlushRead(); + + // Internal routine to verify the handle position + void VerifyOSHandlePosition(); + + // Internal routines for reading and writing + void WriteCore(uint8_t* Buffer, uint64_t Offset, uint64_t Count); + uint64_t ReadCore(uint8_t* Buffer, uint64_t Offset, uint64_t Count); + + // Sets up the FileStream + void SetupStream(const string& Path, FileMode Mode, FileAccess Access, FileShare Share, uint32_t BufferSize); + + // Internal buffer size default 4k + constexpr static uint32_t DefaultBufferSize = 4096; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/FlatStyle.h b/r5dev/thirdparty/cppnet/cppkore/FlatStyle.h new file mode 100644 index 00000000..ff87df37 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/FlatStyle.h @@ -0,0 +1,21 @@ +#pragma once + +#include + +namespace Forms +{ + // Specifies the style of control to display. + enum class FlatStyle + { + // The control appears flat. + Flat, + // A control appears flat until the mouse pointer + // moves over + // it, at which point it appears three-dimensional. + Popup, + // The control appears three-dimensional. + Standard, + // The control appears three-dimensional. + System, + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Font.cpp b/r5dev/thirdparty/cppnet/cppkore/Font.cpp new file mode 100644 index 00000000..c3739fb7 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Font.cpp @@ -0,0 +1,49 @@ +#include "stdafx.h" +#include "Font.h" + +namespace Drawing +{ + Font::Font(HWND Handle, const HFONT hFont) + : _Handle(Handle), _NativeFont(hFont), _OwnsFont(false) + { + } + + Font::Font(HWND Handle, const Gdiplus::Font& FontObject) + : _Handle(Handle), _NativeFont(nullptr), _OwnsFont(true) + { + LOGFONTA FontParams{}; + auto hDC = GetDC(Handle); + auto Gfx = Graphics::FromHDC(hDC); + + FontObject.GetLogFontA(Gfx, &FontParams); + + _NativeFont = CreateFontIndirectA(&FontParams); + + delete Gfx; + ReleaseDC(Handle, hDC); + } + + Font::~Font() + { + if (_OwnsFont && _NativeFont != nullptr) + DeleteObject(_NativeFont); + + _NativeFont = nullptr; + _Handle = nullptr; + } + + HFONT Font::GetFontHandle() + { + return _NativeFont; + } + + std::unique_ptr Font::GetFont() + { + auto hDC = GetDC(this->_Handle); + + auto Result = std::make_unique(hDC, this->_NativeFont); + ReleaseDC(this->_Handle, hDC); + + return std::move(Result); + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/Font.h b/r5dev/thirdparty/cppnet/cppkore/Font.h new file mode 100644 index 00000000..c8fdaf23 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Font.h @@ -0,0 +1,31 @@ +#pragma once + +#include +#include "DrawingBase.h" + +namespace Drawing +{ + // Represents a font used for text rendering + class Font + { + public: + Font() = default; + Font(HWND Handle, const HFONT hFont); + Font(HWND Handle, const Gdiplus::Font& FontObject); + + virtual ~Font(); + + // Gets a handle to the native font + HFONT GetFontHandle(); + // Returns a GDI+ font + std::unique_ptr GetFont(); + + private: + // Internal handle + HWND _Handle; + // Internal native handle + HFONT _NativeFont; + // Internal cached state + bool _OwnsFont; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/FontArial.h b/r5dev/thirdparty/cppnet/cppkore/FontArial.h new file mode 100644 index 00000000..bb5583af --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/FontArial.h @@ -0,0 +1,557 @@ +#pragma once + +#include + +constexpr unsigned char FontArial_PTRF[6594] = +{ + 0xE2, 0x50, 0x54, 0x52, 0x46, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x20, 0x00, 0x04, 0x00, 0x3F, 0x08, 0x20, 0x0E, 0x01, 0x00, 0x0C, + 0xF5, 0x02, 0x05, 0x06, 0x06, 0x0A, 0x0A, 0x10, 0x0C, 0x03, 0x06, 0x06, + 0x07, 0x0B, 0x05, 0x06, 0x05, 0x05, 0x0A, 0x01, 0x00, 0xF0, 0x25, 0x05, + 0x05, 0x0B, 0x0B, 0x0B, 0x0A, 0x12, 0x0B, 0x0C, 0x0D, 0x0D, 0x0C, 0x0B, + 0x0E, 0x0D, 0x04, 0x09, 0x0C, 0x0A, 0x0F, 0x0D, 0x0E, 0x0C, 0x0E, 0x0D, + 0x0C, 0x0C, 0x0D, 0x0B, 0x11, 0x0B, 0x0C, 0x0B, 0x05, 0x05, 0x05, 0x07, + 0x0A, 0x06, 0x0A, 0x0A, 0x09, 0x0A, 0x0A, 0x05, 0x0A, 0x0A, 0x04, 0x04, + 0x09, 0x04, 0x0E, 0x38, 0x00, 0xF1, 0x21, 0x06, 0x09, 0x05, 0x0A, 0x09, + 0x0D, 0x08, 0x09, 0x08, 0x06, 0x06, 0x06, 0x0B, 0x0E, 0x0A, 0x0E, 0x04, + 0x0A, 0x07, 0x12, 0x0A, 0x0A, 0x06, 0x11, 0x0C, 0x06, 0x12, 0x0E, 0x0B, + 0x0E, 0x0E, 0x04, 0x04, 0x07, 0x07, 0x06, 0x0A, 0x12, 0x05, 0x12, 0x09, + 0x06, 0x11, 0x0E, 0x08, 0x0C, 0x05, 0x06, 0x34, 0x00, 0xC0, 0x0A, 0x06, + 0x0D, 0x06, 0x0A, 0x0B, 0x06, 0x0D, 0x0A, 0x07, 0x0A, 0x06, 0x92, 0x00, + 0xA1, 0x06, 0x06, 0x06, 0x07, 0x0A, 0x0F, 0x0F, 0x0F, 0x0B, 0x0C, 0x01, + 0x00, 0x20, 0x12, 0x0D, 0x06, 0x00, 0x61, 0x05, 0x05, 0x05, 0x05, 0x0D, + 0x0D, 0xB7, 0x00, 0x92, 0x0B, 0x0E, 0x0D, 0x0D, 0x0D, 0x0D, 0x0C, 0x0C, + 0x0B, 0xAC, 0x00, 0x22, 0x10, 0x09, 0xB2, 0x00, 0x08, 0xC0, 0x00, 0x10, + 0x0A, 0x9A, 0x00, 0x2F, 0x09, 0x00, 0x01, 0x00, 0xFF, 0xFF, 0xFF, 0x74, + 0x1F, 0xFE, 0x9D, 0x00, 0x8A, 0x1F, 0xFE, 0x1F, 0x00, 0x0D, 0x0F, 0x22, + 0x00, 0x0C, 0x31, 0x67, 0xFE, 0xEF, 0x04, 0x00, 0x0F, 0x01, 0x00, 0x04, + 0x7F, 0x99, 0xE0, 0xFE, 0xFE, 0xFE, 0xD9, 0x8B, 0x3F, 0x00, 0x06, 0x6F, + 0xCF, 0xFE, 0xF8, 0xC7, 0x00, 0x00, 0x42, 0x00, 0x09, 0x4F, 0xC7, 0xF8, + 0xFE, 0xCF, 0xBE, 0x00, 0x24, 0x0F, 0x00, 0x01, 0x51, 0x7F, 0x99, 0xFE, + 0xD9, 0x00, 0xA7, 0xFE, 0xD9, 0x1E, 0x00, 0x04, 0x22, 0xA7, 0xFE, 0x01, + 0x00, 0x1F, 0x99, 0xDD, 0x00, 0x05, 0x50, 0xFE, 0xA7, 0xB1, 0xFE, 0xC7, + 0x07, 0x01, 0x1F, 0xA7, 0x21, 0x01, 0x06, 0x00, 0x41, 0x01, 0x0F, 0x00, + 0x01, 0x87, 0x31, 0xC7, 0xFE, 0xB1, 0x04, 0x00, 0x0F, 0x01, 0x00, 0x03, + 0x7E, 0xF8, 0xFE, 0xB1, 0x00, 0xFE, 0x00, 0xB1, 0xDE, 0x01, 0x05, 0x20, + 0x00, 0x4E, 0x00, 0x00, 0xFE, 0xF8, 0xFF, 0x01, 0x08, 0x82, 0x00, 0x4F, + 0x7C, 0x7C, 0xFE, 0xFE, 0x00, 0x01, 0x65, 0x20, 0xE0, 0xE0, 0x03, 0x00, + 0x0F, 0x3E, 0x00, 0x08, 0x05, 0x01, 0x00, 0x0F, 0x5F, 0x00, 0x07, 0x1F, + 0xFE, 0x7F, 0x00, 0x0B, 0x00, 0x04, 0x00, 0x1E, 0xCF, 0x41, 0x01, 0x09, + 0x22, 0x01, 0x1F, 0xEF, 0x9F, 0x00, 0x07, 0x0F, 0x00, 0x01, 0x4B, 0x20, + 0xCF, 0xCF, 0x03, 0x00, 0x0F, 0x00, 0x01, 0x27, 0x4E, 0xE0, 0xFE, 0xE8, + 0x99, 0x62, 0x00, 0x0D, 0x00, 0x02, 0x2F, 0xF8, 0xF8, 0x21, 0x04, 0x08, + 0x4F, 0xB1, 0xE8, 0xF8, 0x7C, 0x9F, 0x00, 0x07, 0x0F, 0x00, 0x01, 0x4B, + 0x0F, 0x01, 0x00, 0x0E, 0x31, 0x8B, 0xFE, 0xE0, 0x04, 0x00, 0x0F, 0x41, + 0x02, 0x05, 0x00, 0xFF, 0x04, 0x2F, 0xC7, 0x99, 0x3E, 0x03, 0x09, 0x6F, + 0xA7, 0xFE, 0xBC, 0xBC, 0xFE, 0xBC, 0x22, 0x00, 0x06, 0x5F, 0xB1, 0xFE, + 0xFE, 0xCF, 0x67, 0x00, 0x06, 0x66, 0x0F, 0x01, 0x00, 0x0E, 0x00, 0xBB, + 0x00, 0x0E, 0xBF, 0x00, 0x08, 0x21, 0x01, 0x5F, 0xD9, 0xFE, 0xFE, 0xFE, + 0xE8, 0x01, 0x01, 0x07, 0x00, 0x00, 0x06, 0x33, 0xF8, 0xF8, 0x67, 0x08, + 0x06, 0x1E, 0x00, 0x20, 0x00, 0x1E, 0xEF, 0xFF, 0x05, 0x0F, 0x00, 0x01, + 0x78, 0x31, 0xE0, 0xFE, 0x8B, 0x04, 0x00, 0x0F, 0x63, 0x00, 0x09, 0x2E, + 0xC7, 0xFE, 0xC3, 0x00, 0x0A, 0xE3, 0x01, 0x14, 0xCF, 0x08, 0x06, 0x0E, + 0x5F, 0x01, 0x10, 0xCF, 0x1C, 0x06, 0x3F, 0x67, 0xF8, 0xD9, 0x00, 0x01, + 0x82, 0x0F, 0x00, 0x04, 0x0E, 0x02, 0x00, 0x09, 0x1F, 0x7C, 0x66, 0x00, + 0x0B, 0x33, 0xEF, 0xFE, 0x67, 0x08, 0x04, 0x0E, 0x1B, 0x00, 0x00, 0x39, + 0x00, 0x4F, 0xE8, 0xFE, 0xCF, 0xFE, 0x00, 0x01, 0xA4, 0x5E, 0xF8, 0xFE, + 0x67, 0x00, 0xFE, 0x66, 0x00, 0x0B, 0x24, 0x08, 0x14, 0xCF, 0x08, 0x06, + 0x1E, 0x00, 0x61, 0x00, 0x8F, 0x67, 0x00, 0x00, 0x67, 0xF8, 0xFE, 0xFE, + 0x8B, 0x3F, 0x0A, 0x83, 0x00, 0xB5, 0x02, 0x0E, 0xB9, 0x02, 0x06, 0x01, + 0x00, 0x7E, 0xD9, 0xFE, 0xE0, 0x67, 0xFE, 0x67, 0xD9, 0xBF, 0x01, 0x0A, + 0xFF, 0x01, 0x1F, 0x00, 0x00, 0x02, 0x05, 0x10, 0xE8, 0x3B, 0x04, 0x5F, + 0x7C, 0xE0, 0xFE, 0xFE, 0x7C, 0x00, 0x04, 0x83, 0x5F, 0xD9, 0xFE, 0xA7, + 0x00, 0xD9, 0xDE, 0x09, 0x06, 0x01, 0xBB, 0x01, 0x00, 0x01, 0x00, 0x0E, + 0xC1, 0x06, 0x08, 0x41, 0x0A, 0x14, 0xE0, 0x08, 0x06, 0x0F, 0x5F, 0x06, + 0x01, 0x01, 0x01, 0x00, 0x4F, 0xBC, 0xE8, 0xF8, 0x99, 0x00, 0x01, 0x82, + 0x00, 0xBC, 0x01, 0x2F, 0xEF, 0xFE, 0xA0, 0x06, 0x08, 0x7F, 0x7C, 0xCF, + 0xF8, 0xFE, 0xFE, 0xD9, 0x7C, 0x42, 0x05, 0x0C, 0x03, 0x08, 0x06, 0x0F, + 0x40, 0x00, 0x01, 0x9F, 0xD9, 0xFE, 0xFE, 0xE8, 0x99, 0x00, 0x00, 0xD9, + 0xCF, 0x00, 0x0E, 0xFE, 0x0F, 0x00, 0x01, 0xFE, 0x0F, 0x01, 0x00, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x14, 0x2F, 0xA7, 0xD9, 0xBF, 0x14, 0x08, 0x1F, + 0xA7, 0xBE, 0x11, 0xAE, 0x0E, 0x3B, 0x1E, 0x0B, 0x5F, 0x15, 0x1F, 0xF8, + 0x1E, 0x00, 0x09, 0x0F, 0x57, 0x15, 0x0D, 0x5F, 0xE0, 0xCF, 0xEF, 0xCF, + 0xE0, 0x00, 0x01, 0x8A, 0x0E, 0x7E, 0x17, 0x0B, 0xE2, 0x00, 0x1F, 0xBC, + 0xBF, 0x1B, 0x0A, 0x1F, 0xF8, 0x5E, 0x01, 0x0C, 0x4F, 0xCF, 0xFE, 0xCF, + 0x7C, 0x43, 0x1B, 0x4C, 0x0F, 0x01, 0x00, 0x2B, 0x1F, 0xE8, 0x1B, 0x19, + 0x0B, 0x1F, 0xCF, 0xE1, 0x00, 0x0C, 0x2F, 0xF8, 0xCF, 0x5F, 0x00, 0x0C, + 0x3F, 0xCF, 0xE8, 0x00, 0x00, 0x01, 0x8A, 0x0E, 0x36, 0x19, 0x0A, 0x1E, + 0x03, 0x0F, 0xE0, 0x00, 0x0C, 0x1E, 0xCF, 0xBD, 0x17, 0x09, 0x40, 0x00, + 0x4F, 0xD9, 0x00, 0xE0, 0x67, 0x00, 0x01, 0x89, 0x1E, 0xA7, 0xE1, 0x00, + 0x0B, 0x60, 0x23, 0x0F, 0x40, 0x00, 0x0D, 0x1F, 0xC7, 0x43, 0x1E, 0x6D, + 0x0F, 0x81, 0x1A, 0x2C, 0x1F, 0x99, 0x9F, 0x1E, 0x0B, 0x0F, 0xBE, 0x03, + 0x0C, 0x3F, 0x7C, 0xFE, 0xE0, 0x01, 0x1D, 0x33, 0x0F, 0xFF, 0x02, 0x82, + 0x0F, 0x9C, 0x01, 0x10, 0x2F, 0xFE, 0xFE, 0x00, 0x01, 0x68, 0x0F, 0x3A, + 0x01, 0x2E, 0x00, 0x7E, 0x26, 0x0F, 0x00, 0x01, 0x69, 0x0E, 0x42, 0x00, + 0x0F, 0x00, 0x01, 0x5B, 0x0E, 0x38, 0x27, 0x0F, 0x00, 0x01, 0x9A, 0x0F, + 0x01, 0x00, 0x2E, 0x00, 0x38, 0x1F, 0x0F, 0x00, 0x04, 0x69, 0x0F, 0x00, + 0x01, 0x6C, 0x1E, 0x7C, 0x18, 0x22, 0x0F, 0x00, 0x06, 0x7C, 0x2F, 0xFE, + 0xFE, 0x5D, 0x01, 0x49, 0x0E, 0xDF, 0x00, 0x0F, 0x00, 0x08, 0x3C, 0x0F, + 0x60, 0x25, 0x6E, 0x0F, 0x3A, 0x24, 0x0D, 0x0F, 0x21, 0x04, 0x0F, 0x0F, + 0x60, 0x00, 0x0C, 0x1F, 0xCF, 0xA2, 0x02, 0x4C, 0x1F, 0xF8, 0x20, 0x0C, + 0x6C, 0x0F, 0x00, 0x0C, 0x2B, 0x0F, 0x01, 0x00, 0x2E, 0x2F, 0xEF, 0x99, + 0x00, 0x01, 0x6C, 0x0F, 0x00, 0x0E, 0x2B, 0x0F, 0x00, 0x10, 0xEE, 0x0F, + 0x01, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBC, 0x6F, 0x99, 0xE8, 0xFE, 0xFE, 0xE0, + 0x99, 0x23, 0x13, 0x27, 0x04, 0x80, 0x33, 0x0F, 0x7F, 0x1E, 0x06, 0x4F, + 0xEF, 0xFE, 0xEF, 0xBC, 0xA2, 0x1D, 0x0D, 0x0F, 0x41, 0x19, 0x0E, 0x0F, + 0xA2, 0x12, 0x09, 0x0F, 0x61, 0x00, 0x0A, 0x0F, 0x7E, 0x19, 0x0D, 0x12, + 0x67, 0x1F, 0x00, 0x0E, 0x23, 0x1E, 0x09, 0x61, 0x3F, 0x0F, 0x61, 0x16, + 0x09, 0x0E, 0xBF, 0x3F, 0x0B, 0x9E, 0x3B, 0x00, 0x9F, 0x35, 0x0F, 0x22, + 0x3B, 0x0B, 0x0E, 0x60, 0x00, 0x0C, 0xE0, 0x35, 0x0F, 0xE0, 0x1B, 0x09, + 0x0E, 0x61, 0x00, 0x0E, 0x00, 0x01, 0x0E, 0xE4, 0x12, 0x07, 0x40, 0x3A, + 0x2F, 0x00, 0xD9, 0xE4, 0x16, 0x09, 0x1F, 0xD9, 0x7F, 0x00, 0x0C, 0x10, + 0xCF, 0x22, 0x01, 0x1F, 0xEF, 0x81, 0x15, 0x07, 0x3E, 0x99, 0x00, 0xA7, + 0x84, 0x1B, 0x0B, 0xE2, 0x00, 0x0F, 0xBF, 0x1D, 0x25, 0x00, 0x3E, 0x00, + 0x2E, 0xE8, 0x67, 0x3F, 0x40, 0x0D, 0x45, 0x00, 0x1F, 0xB1, 0x5D, 0x36, + 0x0A, 0x0F, 0xA0, 0x3D, 0x09, 0x3E, 0xF8, 0xF8, 0x99, 0xA0, 0x00, 0x0C, + 0x60, 0x19, 0x2F, 0xFE, 0xFE, 0xA4, 0x16, 0x27, 0x2F, 0xEF, 0xF8, 0x1F, + 0x00, 0x09, 0x1E, 0xBC, 0xBB, 0x00, 0x0C, 0xFE, 0x3E, 0x0F, 0xE3, 0x15, + 0x10, 0x1F, 0xEF, 0xC0, 0x00, 0x27, 0x1F, 0xCF, 0x24, 0x1B, 0x12, 0x1F, + 0xEF, 0x83, 0x1F, 0x25, 0x00, 0xD9, 0x38, 0x0F, 0x60, 0x02, 0x0B, 0x5F, + 0xA7, 0xE0, 0xFE, 0xEF, 0x8B, 0x3C, 0x04, 0x08, 0x1F, 0x7C, 0x04, 0x1C, + 0x2A, 0x1E, 0xFE, 0xC0, 0x01, 0x0F, 0xA3, 0x18, 0x1F, 0x0E, 0x9A, 0x39, + 0x0A, 0x63, 0x02, 0x1F, 0xE0, 0x1F, 0x40, 0x0B, 0x0E, 0x60, 0x00, 0x0A, + 0x1F, 0x40, 0x1E, 0xFE, 0xDE, 0x3A, 0x08, 0x9C, 0x00, 0x4F, 0xE0, 0xFE, + 0xEF, 0xA7, 0x01, 0x25, 0x26, 0x0F, 0x00, 0x01, 0x31, 0x3F, 0x7C, 0xF8, + 0xE8, 0x7F, 0x01, 0x0A, 0x1F, 0xEF, 0x5F, 0x03, 0x0A, 0x2F, 0x67, 0x00, + 0x1C, 0x3E, 0x0A, 0x00, 0xBC, 0x01, 0x1E, 0xBC, 0xC6, 0x1B, 0x06, 0x20, + 0x00, 0x1E, 0xE8, 0x80, 0x05, 0x0E, 0x81, 0x44, 0x0F, 0x00, 0x01, 0x49, + 0x0F, 0xFF, 0x00, 0x0C, 0x02, 0xC0, 0x3F, 0x0F, 0x1F, 0x3C, 0x08, 0x0F, + 0x84, 0x1E, 0x2A, 0x01, 0x3A, 0x40, 0x3F, 0xBC, 0xFE, 0xE8, 0x03, 0x1E, + 0x25, 0x03, 0x00, 0x01, 0x1F, 0xF8, 0x00, 0x01, 0x27, 0x3F, 0x8B, 0xF8, + 0xE8, 0xA5, 0x1B, 0x27, 0x0F, 0x1E, 0x21, 0x14, 0x2F, 0xFE, 0xFE, 0x80, + 0x05, 0x27, 0x1F, 0x8B, 0x1D, 0x01, 0x0A, 0x1E, 0xEF, 0x00, 0x06, 0x0F, + 0x00, 0x01, 0x1B, 0x1E, 0xB1, 0x3C, 0x00, 0x0C, 0xE0, 0x3F, 0x0F, 0x00, + 0x01, 0x29, 0x2F, 0xF8, 0xFE, 0x60, 0x05, 0x0B, 0x1F, 0xE0, 0x00, 0x01, + 0x0E, 0x0E, 0x7D, 0x43, 0x0A, 0x1C, 0x05, 0x10, 0xD9, 0x86, 0x02, 0x1F, + 0xBC, 0x00, 0x01, 0x25, 0x1E, 0x99, 0x5E, 0x01, 0x0B, 0x60, 0x00, 0x1E, + 0xC7, 0xC0, 0x03, 0x0F, 0x60, 0x00, 0x18, 0x01, 0x9B, 0x00, 0x0E, 0xC3, + 0x00, 0x0A, 0x5B, 0x03, 0x0E, 0x60, 0x00, 0x0D, 0x3F, 0x3E, 0x0F, 0x60, + 0x09, 0x0C, 0x1F, 0x67, 0xA0, 0x00, 0x25, 0x1F, 0xE8, 0x60, 0x0A, 0x0D, + 0x1E, 0xF8, 0xDF, 0x3F, 0x0F, 0x60, 0x00, 0x19, 0x11, 0x7C, 0x40, 0x00, + 0x1F, 0xEF, 0x81, 0x00, 0x0D, 0x1F, 0x7C, 0x82, 0x3F, 0x0B, 0x0F, 0x00, + 0x0C, 0x0C, 0x2F, 0xE8, 0x99, 0xBF, 0x08, 0x26, 0x0E, 0xC0, 0x03, 0x0E, + 0x20, 0x0C, 0x0E, 0xDF, 0x3F, 0x0F, 0x60, 0x03, 0x18, 0x2E, 0x7C, 0xE0, + 0xE0, 0x46, 0x0B, 0xC1, 0x29, 0x3F, 0xFE, 0xE8, 0x8B, 0x7E, 0x29, 0x85, + 0x0F, 0x01, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xA1, 0x0F, 0x00, + 0x14, 0x0D, 0x6F, 0x8B, 0xE8, 0xFE, 0xF8, 0xCF, 0x67, 0xE0, 0x00, 0xA7, + 0x0F, 0xA0, 0x20, 0x0C, 0x03, 0x80, 0x5F, 0x1F, 0xA7, 0x20, 0x16, 0x0B, + 0x2F, 0xF8, 0x7C, 0xFF, 0x00, 0xA6, 0x1E, 0xF8, 0xA0, 0x20, 0x0C, 0xA0, + 0x1F, 0x2E, 0x00, 0x99, 0x61, 0x16, 0x0B, 0x80, 0x17, 0x1F, 0xCF, 0x84, + 0x32, 0x4D, 0x1F, 0xE0, 0x5F, 0x5B, 0x25, 0x0E, 0xA1, 0x32, 0x0E, 0xE0, + 0x18, 0x0E, 0xA0, 0x20, 0x0F, 0x00, 0x1C, 0x16, 0x03, 0x20, 0x00, 0x0F, + 0xE5, 0x18, 0x07, 0x0F, 0xBB, 0x1A, 0x27, 0x09, 0x24, 0x23, 0x0F, 0x21, + 0x1A, 0x25, 0x4F, 0xFE, 0xFE, 0xEF, 0xB1, 0x80, 0x1A, 0x28, 0x22, 0x00, + 0xE0, 0x00, 0x02, 0x1F, 0xE0, 0x20, 0x1D, 0x26, 0x0F, 0x00, 0x01, 0x2E, + 0x7F, 0x67, 0xC7, 0xF8, 0xFE, 0xEF, 0xC7, 0x7C, 0x00, 0x01, 0x24, 0x7F, + 0x7C, 0xC7, 0xEF, 0xFE, 0xF8, 0xC7, 0x67, 0x06, 0x3A, 0x0D, 0x1F, 0xEF, + 0xDE, 0x23, 0x09, 0x0F, 0x7E, 0x5D, 0x09, 0x10, 0xE8, 0x00, 0x03, 0x1F, + 0xCF, 0x44, 0x18, 0x47, 0x6F, 0x8B, 0xCF, 0xFE, 0xF8, 0xCF, 0x8B, 0x43, + 0x00, 0x2C, 0x2E, 0xF8, 0xFE, 0x43, 0x00, 0x09, 0xA2, 0x1D, 0x0E, 0x03, + 0x1B, 0x0A, 0x61, 0x20, 0x1F, 0xE0, 0xE0, 0x1B, 0x08, 0x11, 0xFE, 0x63, + 0x1F, 0x0F, 0xFF, 0x39, 0x47, 0x0F, 0x5B, 0x04, 0x31, 0x1F, 0xCF, 0x01, + 0x1D, 0x0B, 0x1F, 0xF8, 0x5F, 0x66, 0x09, 0x0F, 0xE0, 0x04, 0x0C, 0x20, + 0xA7, 0xEF, 0xA2, 0x5C, 0x0F, 0x00, 0x02, 0x66, 0x0E, 0x21, 0x1F, 0x0F, + 0x00, 0x02, 0x1D, 0x10, 0xB1, 0x22, 0x25, 0x0F, 0x00, 0x20, 0x29, 0x00, + 0x40, 0x03, 0x1F, 0xE8, 0xA0, 0x47, 0x48, 0x0F, 0x00, 0x04, 0x4C, 0x01, + 0xE2, 0x1F, 0x0F, 0x00, 0x22, 0x2A, 0x2F, 0x00, 0x99, 0x00, 0x07, 0x4C, + 0x2F, 0xB1, 0xEF, 0x61, 0x02, 0x26, 0x0E, 0x00, 0x06, 0x0F, 0x81, 0x05, + 0x1B, 0x3E, 0xE0, 0xFE, 0xB1, 0x40, 0x22, 0x09, 0x3E, 0x01, 0x3E, 0xA7, + 0x00, 0x67, 0xC0, 0x62, 0x0F, 0x00, 0x08, 0x96, 0x0F, 0x9F, 0x65, 0x0F, + 0x0E, 0x00, 0x2A, 0x0B, 0x9D, 0x29, 0x0E, 0x20, 0x06, 0x0F, 0x00, 0x08, + 0x3D, 0x0F, 0x61, 0x3F, 0x69, 0x6F, 0x8B, 0xE0, 0xFE, 0xFE, 0xE0, 0x8B, + 0x5F, 0x2B, 0x25, 0x0F, 0x00, 0x01, 0xAF, 0x0F, 0x81, 0x0B, 0x4F, 0x0F, + 0x60, 0x0E, 0xEB, 0x2F, 0xEF, 0x99, 0x04, 0x20, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xA0, 0x8F, 0xA7, 0xD9, 0xF8, 0xFE, 0xFE, 0xF8, 0xE0, 0xB1, 0x83, + 0x17, 0x06, 0x0F, 0xA0, 0x18, 0x0E, 0x2F, 0xD9, 0x99, 0x42, 0x14, 0x08, + 0x00, 0x62, 0x20, 0x1F, 0xB1, 0x40, 0x00, 0x0A, 0x3F, 0xF8, 0xCF, 0x7C, + 0x40, 0x59, 0x24, 0x0F, 0x20, 0x19, 0x10, 0x5E, 0xB1, 0xE0, 0xFE, 0xFE, + 0xF8, 0xA1, 0x00, 0x07, 0x01, 0x52, 0x04, 0x44, 0x00, 0x0E, 0xED, 0x51, + 0x03, 0x22, 0x20, 0x1F, 0xA7, 0xA0, 0x19, 0x0F, 0x1F, 0xA7, 0x81, 0x1F, + 0x0B, 0x2F, 0xFE, 0xE8, 0x40, 0x00, 0x23, 0x0F, 0x00, 0x01, 0x2F, 0x04, + 0xA2, 0x36, 0x1F, 0xCF, 0x02, 0x21, 0x07, 0x20, 0xEF, 0xA7, 0x45, 0x78, + 0x2E, 0xA7, 0xEF, 0x86, 0x00, 0x02, 0xA2, 0x77, 0x0E, 0x5F, 0x37, 0x0C, + 0x5E, 0x15, 0x1F, 0xC7, 0xC1, 0x7F, 0x08, 0x00, 0xFE, 0x35, 0x2E, 0xA7, + 0xF8, 0xC3, 0x37, 0x06, 0x40, 0x00, 0x00, 0xA5, 0x21, 0x2F, 0xF8, 0x67, + 0x5F, 0x16, 0x43, 0x11, 0xE8, 0xFE, 0x21, 0x2E, 0x67, 0xB1, 0x04, 0x1D, + 0x05, 0x01, 0x18, 0x10, 0xB1, 0x81, 0x19, 0x5E, 0xC7, 0x67, 0xFE, 0xEF, + 0xCF, 0x86, 0x00, 0x01, 0x62, 0x79, 0x0F, 0xFF, 0x1E, 0x10, 0x0E, 0x23, + 0x00, 0x0A, 0x1F, 0x3A, 0x0E, 0x04, 0x41, 0x0A, 0x38, 0x00, 0x0E, 0x83, + 0x41, 0x0F, 0x00, 0x01, 0x33, 0x14, 0xA7, 0x99, 0x01, 0x0E, 0x83, 0x82, + 0x04, 0xE1, 0x19, 0x12, 0xB1, 0xE5, 0x18, 0x32, 0xE0, 0xFE, 0xC7, 0xCE, + 0x41, 0x0C, 0x41, 0x00, 0x12, 0xD9, 0xA6, 0x3C, 0x0F, 0x00, 0x02, 0x0C, + 0x1F, 0xCF, 0x60, 0x20, 0x08, 0x01, 0x68, 0x01, 0x0F, 0xC0, 0x00, 0x0B, + 0x0E, 0xA6, 0x3B, 0x0F, 0x00, 0x01, 0x33, 0x06, 0xBB, 0x00, 0x1F, 0x67, + 0xDB, 0x1B, 0x04, 0x10, 0xEF, 0x04, 0x44, 0x10, 0xA7, 0x43, 0x1E, 0x1E, + 0x99, 0x29, 0x20, 0x02, 0x41, 0x00, 0x0E, 0xBF, 0x83, 0x0D, 0x80, 0x03, + 0x1F, 0xD9, 0x1F, 0x19, 0x2D, 0x2F, 0xFE, 0xFE, 0x00, 0x22, 0x24, 0x0F, + 0x40, 0x3C, 0x11, 0x0F, 0x1C, 0x41, 0x0B, 0x34, 0xC7, 0xFE, 0xC7, 0x81, + 0x00, 0x0E, 0x49, 0x00, 0x0F, 0x17, 0x00, 0x04, 0x0C, 0x80, 0x00, 0x1F, + 0xE0, 0x00, 0x01, 0x84, 0x2E, 0xFE, 0xFE, 0x45, 0x46, 0x0E, 0xA0, 0x7A, + 0x10, 0x7C, 0x24, 0x00, 0x1E, 0xE0, 0x86, 0x00, 0x06, 0xA0, 0x85, 0x1F, + 0xA7, 0xC0, 0x00, 0x0B, 0x0E, 0xE2, 0x3F, 0x0F, 0x00, 0x01, 0x36, 0x0F, + 0x00, 0x03, 0x2B, 0x0F, 0x00, 0x01, 0x0D, 0x05, 0x58, 0x7E, 0x10, 0x7C, + 0xA1, 0x05, 0x0E, 0xE9, 0x02, 0x1F, 0xD9, 0xE0, 0x02, 0x14, 0x0E, 0x42, + 0x20, 0x0B, 0x00, 0x04, 0x2F, 0x00, 0x99, 0x40, 0x00, 0x0A, 0x0E, 0x83, + 0x24, 0x0F, 0x00, 0x01, 0x33, 0x15, 0xE0, 0xBA, 0x01, 0x0F, 0x00, 0x01, + 0x0C, 0x30, 0xCF, 0xFE, 0x7C, 0x2E, 0x03, 0x1E, 0x99, 0x40, 0x25, 0x01, + 0x43, 0x43, 0x1F, 0xF8, 0x00, 0x06, 0x2C, 0x1E, 0x99, 0xA1, 0x81, 0x09, + 0x38, 0x00, 0x3F, 0xE0, 0xFE, 0xBC, 0x00, 0x06, 0x4B, 0x0F, 0x2A, 0x00, + 0x04, 0x00, 0xFC, 0x02, 0x11, 0xE8, 0xA4, 0x7F, 0x3E, 0xFE, 0x00, 0x8B, + 0x4A, 0x83, 0x04, 0x3F, 0x62, 0x0E, 0x46, 0x64, 0x09, 0x56, 0x00, 0x2E, + 0x67, 0xCF, 0x01, 0x04, 0x0C, 0x00, 0x08, 0x1F, 0x8B, 0x00, 0x08, 0x0C, + 0x1F, 0x00, 0x00, 0x08, 0x45, 0x21, 0xEF, 0xA7, 0x61, 0x20, 0x0E, 0x2A, + 0x00, 0x04, 0xE0, 0x28, 0x10, 0xA7, 0xFB, 0x09, 0x0E, 0x24, 0x09, 0x02, + 0x1F, 0x05, 0x1E, 0x99, 0xC3, 0x46, 0x0E, 0xA0, 0x04, 0x0F, 0x42, 0x20, + 0x08, 0x2F, 0x7C, 0xEF, 0x7F, 0x09, 0x0A, 0x05, 0x40, 0x00, 0x1F, 0x99, + 0x00, 0x0A, 0x25, 0x0F, 0x00, 0x69, 0x0F, 0x0E, 0xDD, 0x0A, 0x07, 0xE1, + 0x01, 0x00, 0xF3, 0x08, 0x5F, 0xC7, 0xFE, 0xE0, 0x7C, 0xBC, 0x07, 0x4C, + 0x02, 0x05, 0x78, 0x87, 0x0E, 0x81, 0x87, 0x09, 0xC0, 0x0B, 0x0E, 0xC1, + 0x8B, 0x0A, 0x5E, 0x0C, 0x0F, 0x00, 0x0C, 0x0C, 0x1E, 0xEF, 0x62, 0x2C, + 0x0F, 0x00, 0x01, 0x36, 0x02, 0xDE, 0x0C, 0x0E, 0xDD, 0x0C, 0x06, 0x81, + 0x88, 0x17, 0x7C, 0x2B, 0x46, 0x1F, 0xE0, 0xFD, 0x0D, 0xDD, 0x00, 0x20, + 0x02, 0x30, 0xCF, 0x99, 0x67, 0x83, 0x09, 0x4F, 0xB1, 0xEF, 0xFE, 0xE8, + 0xFE, 0x0E, 0xE0, 0x16, 0xD9, 0x64, 0x02, 0x1F, 0xC7, 0xFF, 0x0F, 0xE2, + 0x40, 0x7C, 0xC7, 0xE0, 0xF8, 0xC3, 0x09, 0x2F, 0xC7, 0x67, 0xFB, 0x1F, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xED, 0x0F, 0x80, 0x18, 0x2E, 0x1F, 0x00, 0x1F, 0x3C, + 0x13, 0x1E, 0xE8, 0x42, 0x19, 0x0F, 0x60, 0x00, 0x13, 0x42, 0xF8, 0xE0, + 0xBC, 0x7C, 0xA5, 0x10, 0x3F, 0xBC, 0xE0, 0xF8, 0x40, 0x00, 0x02, 0x1F, + 0xB1, 0x49, 0x00, 0x0D, 0x10, 0xB1, 0x80, 0x20, 0x1F, 0xBC, 0x00, 0x01, + 0x6A, 0x0E, 0xFF, 0x00, 0x0F, 0xE0, 0x16, 0x17, 0x2F, 0xFE, 0xD9, 0x87, + 0x5F, 0x09, 0x05, 0x9C, 0x40, 0x0E, 0x49, 0x00, 0x0A, 0x00, 0x16, 0x2F, + 0xEF, 0x7C, 0x00, 0x01, 0x67, 0x1E, 0xE8, 0x41, 0x41, 0x0F, 0x00, 0x01, + 0x17, 0x23, 0xEF, 0xF8, 0xC4, 0x5E, 0x0F, 0x00, 0x01, 0x04, 0x2E, 0xFE, + 0xE8, 0x49, 0x00, 0x0D, 0x00, 0x20, 0x11, 0x99, 0x28, 0x98, 0x0F, 0x00, + 0x01, 0x64, 0x0E, 0xFF, 0x00, 0x0F, 0x00, 0x01, 0x19, 0x11, 0xC7, 0x1B, + 0x18, 0x10, 0x99, 0x25, 0x9C, 0x0F, 0x20, 0x00, 0x04, 0x1E, 0xBC, 0x49, + 0x00, 0x07, 0x00, 0x1A, 0x14, 0xE8, 0x08, 0x01, 0x1F, 0xA7, 0x00, 0x01, + 0x64, 0x0E, 0x7B, 0x01, 0x0F, 0x00, 0x01, 0x1A, 0x31, 0x99, 0xFE, 0xC7, + 0x9A, 0x17, 0x1F, 0x99, 0x00, 0x01, 0x04, 0x04, 0xBF, 0x1D, 0x1F, 0xFE, + 0x80, 0x1C, 0x0B, 0x3F, 0xA7, 0xFE, 0xE0, 0xA1, 0x9B, 0x21, 0x0F, 0x00, + 0x01, 0x2F, 0x15, 0xF8, 0xA3, 0x04, 0x0F, 0xE0, 0x1A, 0x24, 0x22, 0xF8, + 0xEF, 0xC9, 0x78, 0x0F, 0x00, 0x01, 0x05, 0x02, 0x9E, 0x3D, 0x0F, 0xC0, + 0x00, 0x0E, 0x2F, 0xFE, 0xFE, 0x00, 0x01, 0x63, 0x00, 0x01, 0x01, 0x1F, + 0x7C, 0x00, 0x01, 0x29, 0x31, 0xD9, 0xFE, 0x7C, 0xC8, 0x7B, 0x0F, 0x00, + 0x01, 0x05, 0x02, 0x1F, 0x5C, 0x0F, 0x00, 0x01, 0x26, 0x0F, 0x00, 0x03, + 0x4D, 0x10, 0xCF, 0x83, 0x1C, 0x0F, 0x00, 0x01, 0x29, 0x11, 0xA7, 0x42, + 0xA1, 0x1F, 0xB1, 0x00, 0x01, 0x07, 0x01, 0x05, 0x63, 0x0F, 0x00, 0x01, + 0x86, 0x01, 0x03, 0x27, 0x1F, 0xD9, 0x00, 0x01, 0x28, 0x7F, 0x67, 0xFE, + 0xE8, 0x00, 0xE8, 0xFE, 0x67, 0x00, 0x01, 0x08, 0x00, 0xB7, 0x23, 0x0F, + 0x00, 0x04, 0x0D, 0x0E, 0x61, 0x20, 0x0F, 0x00, 0x01, 0x32, 0x2F, 0xE8, + 0xFE, 0x00, 0x07, 0x10, 0x1E, 0x99, 0x03, 0x04, 0x0F, 0xE0, 0x1E, 0x19, + 0x20, 0xE8, 0xFE, 0x03, 0x01, 0x0F, 0x00, 0x01, 0x08, 0x2E, 0x00, 0xBC, + 0x1E, 0x06, 0x0E, 0x00, 0x06, 0x1F, 0xB1, 0x00, 0x01, 0x41, 0x02, 0x3F, + 0x26, 0x0F, 0x1F, 0x47, 0x0D, 0x1E, 0xBC, 0x03, 0x04, 0x0F, 0x00, 0x01, + 0x18, 0x11, 0xBC, 0x9C, 0x26, 0x0E, 0x00, 0x01, 0x0A, 0x60, 0x0A, 0x0F, + 0x00, 0x08, 0x0D, 0x1F, 0xEF, 0x00, 0x08, 0x42, 0x1E, 0xBC, 0xE0, 0x69, + 0x0E, 0x40, 0x00, 0x00, 0xBE, 0x09, 0x1F, 0xE8, 0xC0, 0x24, 0x27, 0x12, + 0x7C, 0x5F, 0x20, 0x0F, 0x00, 0x01, 0x09, 0x1E, 0x7C, 0x45, 0x68, 0x0B, + 0x80, 0x20, 0x0F, 0x00, 0x0A, 0x45, 0x2E, 0xBC, 0xF8, 0x20, 0x40, 0x0E, + 0x40, 0x00, 0x00, 0xA3, 0xA3, 0x0F, 0xC0, 0x25, 0x27, 0x3E, 0xF8, 0xFE, + 0xF8, 0x8B, 0x00, 0x0A, 0x60, 0x00, 0x0E, 0x45, 0x68, 0x0A, 0x80, 0x2C, + 0x1F, 0xBC, 0xFF, 0x5F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x17, + 0x04, 0xDF, 0x37, 0x0E, 0x02, 0x54, 0x0F, 0x40, 0x13, 0x13, 0x05, 0x00, + 0x3A, 0x1F, 0x99, 0xDF, 0x57, 0x05, 0x3E, 0xBC, 0xE0, 0xF8, 0x7F, 0x13, + 0x0F, 0xE0, 0x33, 0x1F, 0x0F, 0xBF, 0x18, 0x04, 0x17, 0xEF, 0xC8, 0x36, + 0x0F, 0xFD, 0x74, 0x06, 0x13, 0x7C, 0x22, 0x75, 0x0E, 0x0A, 0x7B, 0x0F, + 0xC0, 0x35, 0x17, 0x1F, 0xF8, 0x40, 0x15, 0x05, 0x0E, 0xC1, 0x35, 0x0B, + 0x7C, 0x5B, 0x02, 0x3F, 0x00, 0x1F, 0x67, 0x00, 0x01, 0x42, 0x04, 0xFF, + 0x7C, 0x0E, 0xA2, 0x59, 0x08, 0xFF, 0x3C, 0x00, 0x85, 0x80, 0x1E, 0xB1, + 0x04, 0x3E, 0x07, 0x57, 0x00, 0x1F, 0xCF, 0xC3, 0x17, 0x06, 0x14, 0xEF, + 0x40, 0x17, 0x0F, 0xC0, 0x3E, 0x0A, 0x1E, 0x67, 0x63, 0x5F, 0x04, 0x3F, + 0x00, 0x6F, 0xD9, 0x67, 0x00, 0x00, 0x7C, 0xE8, 0x43, 0x57, 0x25, 0x0E, + 0x00, 0x01, 0x0E, 0xDD, 0xA0, 0x0E, 0xE4, 0x7B, 0x0B, 0x20, 0x00, 0x22, + 0xCF, 0xFE, 0xA0, 0x3E, 0x0E, 0x26, 0x00, 0x0F, 0xC0, 0x39, 0x0E, 0x07, + 0x40, 0x19, 0x1F, 0xBC, 0x40, 0x17, 0x28, 0x0E, 0x42, 0x5C, 0x0F, 0x00, + 0x01, 0x33, 0x04, 0xD2, 0x02, 0x0E, 0xE5, 0x77, 0x08, 0x57, 0x3F, 0x12, + 0xEF, 0x41, 0x1A, 0x0E, 0x0B, 0xA1, 0x0F, 0x00, 0x01, 0x0F, 0x07, 0x40, + 0x1F, 0x1F, 0xE8, 0x00, 0x02, 0x21, 0x06, 0x80, 0x3B, 0x0F, 0x00, 0x01, + 0x42, 0x03, 0xC0, 0x9A, 0x0E, 0xA1, 0x5C, 0x0A, 0xBF, 0x3E, 0x3E, 0xEF, + 0x00, 0xEF, 0xA8, 0x1B, 0x08, 0xC0, 0x3A, 0x0E, 0x81, 0xBA, 0x0F, 0x40, + 0x1F, 0x1E, 0x1F, 0x99, 0xFF, 0x43, 0x05, 0x4F, 0xEF, 0xCF, 0xB1, 0x7C, + 0x00, 0x01, 0x46, 0x02, 0x9F, 0x9A, 0x0E, 0xE3, 0x7E, 0x08, 0xFE, 0x7A, + 0x11, 0x8B, 0xC3, 0x41, 0x1E, 0x8B, 0xE7, 0x7C, 0x08, 0xC0, 0x00, 0x1F, + 0x7C, 0x00, 0x01, 0x2B, 0x0E, 0x41, 0x06, 0x05, 0xDF, 0x5D, 0x10, 0xEF, + 0x7E, 0x1A, 0x1F, 0x99, 0x00, 0x01, 0x44, 0x02, 0x02, 0x06, 0x0F, 0xE4, + 0x7A, 0x07, 0x13, 0xC7, 0x3D, 0x1F, 0x11, 0xB1, 0x08, 0x00, 0x1F, 0xC7, + 0xC0, 0x3A, 0x1E, 0x2E, 0xFE, 0xFE, 0xE4, 0x82, 0x0D, 0x20, 0x00, 0x0E, + 0x1C, 0x03, 0x0B, 0xA1, 0x5F, 0x1E, 0xD9, 0x7E, 0x1D, 0x0F, 0x00, 0x01, + 0x35, 0x02, 0x1E, 0x21, 0x1F, 0xE0, 0x00, 0xA0, 0x09, 0x06, 0x04, 0x02, + 0x1F, 0xA7, 0x40, 0x3F, 0x20, 0x1E, 0x99, 0x04, 0x5F, 0x0D, 0x40, 0x00, + 0x0E, 0x3F, 0x06, 0x0E, 0x87, 0xA1, 0x0F, 0x00, 0x01, 0x44, 0x00, 0x01, + 0x03, 0x0F, 0xE6, 0x9C, 0x08, 0x00, 0xBA, 0x3F, 0x01, 0x04, 0x43, 0x01, + 0x08, 0x00, 0x1F, 0x67, 0x00, 0x01, 0x1E, 0x12, 0xB1, 0x39, 0x05, 0x3E, + 0xE0, 0x7C, 0xE8, 0x63, 0x02, 0x07, 0x40, 0x00, 0x1F, 0xEF, 0x3B, 0x3A, + 0x05, 0x04, 0x5B, 0x7E, 0x0F, 0x00, 0x06, 0x25, 0x04, 0xB7, 0x25, 0x0F, + 0x63, 0x02, 0x07, 0x04, 0xDD, 0x04, 0x0F, 0xFF, 0x60, 0x07, 0x22, 0xFE, + 0xE8, 0x09, 0x04, 0x2F, 0xFE, 0xF8, 0xE0, 0x1D, 0x20, 0x01, 0x00, 0x08, + 0x2E, 0x7C, 0xEF, 0xC2, 0x20, 0x09, 0x40, 0x00, 0x1F, 0x8B, 0x41, 0x09, + 0x05, 0x12, 0xCF, 0x7F, 0x47, 0x1F, 0xCF, 0x59, 0x3D, 0x09, 0x0F, 0xBD, + 0x63, 0x0C, 0x2E, 0xA7, 0x00, 0x40, 0x48, 0x0A, 0xE3, 0x08, 0x0E, 0xFF, + 0x7F, 0x0A, 0xBF, 0x48, 0x02, 0x23, 0x05, 0x0E, 0xE4, 0x05, 0x0F, 0x00, + 0x01, 0x11, 0x14, 0x7C, 0x1E, 0x4A, 0x0F, 0xC0, 0x42, 0x0B, 0x0F, 0x01, + 0x49, 0x06, 0x0E, 0x3F, 0x0A, 0x0F, 0x84, 0x00, 0x1B, 0x2E, 0xE8, 0xFE, + 0x40, 0x4A, 0x0F, 0xA0, 0x4A, 0x18, 0x01, 0xFC, 0x09, 0x13, 0xA7, 0x27, + 0x00, 0x1F, 0xBC, 0xE0, 0x23, 0x21, 0x00, 0x02, 0x60, 0x3E, 0xFE, 0xE8, + 0xA7, 0x22, 0x07, 0x0A, 0x40, 0x00, 0x0E, 0x02, 0x03, 0x07, 0x3F, 0x0C, + 0x0E, 0x42, 0x6C, 0x0F, 0x84, 0x00, 0x17, 0x00, 0xBF, 0x4B, 0x0E, 0xBF, + 0x3F, 0x09, 0x62, 0x42, 0x1F, 0xFE, 0xE1, 0x61, 0x0C, 0x02, 0xFC, 0x0B, + 0x0F, 0x24, 0xC3, 0x2C, 0x2F, 0x67, 0x8B, 0x00, 0x20, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xD3, 0x11, 0xD9, 0x99, 0x15, 0x1F, 0xE8, 0x42, 0x15, + 0x05, 0x14, 0xD9, 0xB8, 0x15, 0x0E, 0x04, 0x5E, 0x0A, 0x00, 0x1A, 0x1F, + 0xEF, 0xE0, 0x1F, 0x08, 0x1F, 0x00, 0x9D, 0x94, 0x26, 0x0E, 0x3F, 0x00, + 0x0E, 0xE0, 0x13, 0x0F, 0xD6, 0x13, 0x2C, 0x00, 0x99, 0x56, 0x1E, 0xBC, + 0x9F, 0x1F, 0x08, 0xA0, 0xDE, 0x01, 0x46, 0x15, 0x1F, 0xF8, 0xC0, 0x1F, + 0x0B, 0x1F, 0xC7, 0xC1, 0x00, 0x23, 0x0E, 0x9C, 0x9A, 0x0F, 0x00, 0x01, + 0x1D, 0x1F, 0xCF, 0x9C, 0x78, 0x2B, 0x00, 0x5D, 0x37, 0x1E, 0x67, 0x5D, + 0x17, 0x0A, 0x20, 0x56, 0x2E, 0x00, 0x67, 0x19, 0x59, 0x0A, 0x45, 0x01, + 0x1F, 0xF8, 0x7E, 0x76, 0x25, 0x0F, 0x39, 0x1A, 0x0F, 0x0F, 0x5E, 0xE2, + 0x0D, 0x1F, 0xE0, 0xA1, 0xB6, 0x2B, 0x00, 0xFC, 0x02, 0x0E, 0x60, 0x97, + 0x0B, 0x02, 0x03, 0x0E, 0x02, 0x61, 0x0F, 0x63, 0xC0, 0x15, 0x0F, 0xE0, + 0x42, 0x0E, 0x1F, 0xFE, 0x00, 0x01, 0x2B, 0x5F, 0xBC, 0xFE, 0x67, 0xFE, + 0xBC, 0x02, 0x79, 0x2E, 0x1F, 0x8B, 0xA2, 0x00, 0x0A, 0x1E, 0x8B, 0x3A, + 0x1A, 0x0D, 0x64, 0x1D, 0x0F, 0x00, 0x01, 0x25, 0x0E, 0xA0, 0xBB, 0x0F, + 0x41, 0x00, 0x1B, 0x4F, 0xF8, 0xE0, 0x00, 0xE0, 0x62, 0x77, 0x2C, 0x0E, + 0x7D, 0xDA, 0x0C, 0x7F, 0xD9, 0x1F, 0xE0, 0xFE, 0x02, 0x0A, 0x1F, 0x99, + 0xDC, 0x1A, 0x25, 0x0E, 0xA0, 0xBD, 0x0F, 0x41, 0x00, 0x1E, 0x11, 0xA7, + 0xDB, 0x1E, 0x1F, 0xA7, 0x23, 0xBC, 0x2C, 0x1F, 0xF8, 0x20, 0x57, 0x0D, + 0x1F, 0xD9, 0xFD, 0x03, 0x23, 0x0F, 0x60, 0x1A, 0x11, 0x1F, 0xF8, 0xE1, + 0x5B, 0x2A, 0x00, 0x96, 0x1D, 0x02, 0xDC, 0x22, 0x0F, 0x3C, 0x80, 0x28, + 0x3F, 0xE0, 0xFE, 0xCF, 0x83, 0x00, 0x2A, 0x0F, 0x7E, 0x9A, 0x2A, 0x0E, + 0xA0, 0xC1, 0x0F, 0xBF, 0x7A, 0x5A, 0x00, 0xFF, 0x03, 0x1F, 0xA7, 0x1A, + 0x1B, 0x0C, 0x0F, 0xC2, 0x06, 0x0C, 0x1F, 0xBC, 0x3C, 0xA3, 0x2C, 0x1F, + 0xCF, 0x00, 0x01, 0x6A, 0x11, 0xEF, 0x19, 0x21, 0x1F, 0xE8, 0x00, 0x9F, + 0x27, 0x1F, 0xE0, 0x60, 0xC0, 0x2D, 0x1F, 0xF8, 0x00, 0x01, 0x69, 0x01, + 0xFB, 0x08, 0x0E, 0x01, 0x08, 0x0E, 0x83, 0x00, 0x0F, 0xFD, 0x03, 0x21, + 0x0F, 0xBF, 0x00, 0x12, 0x00, 0xC1, 0x22, 0x0F, 0x00, 0x01, 0x66, 0x12, + 0x67, 0xE0, 0x09, 0x1E, 0xB1, 0x01, 0x0A, 0x0F, 0x83, 0x00, 0x13, 0x1F, + 0xC7, 0xA0, 0x64, 0x0F, 0x0F, 0xA1, 0xC6, 0x0F, 0x1F, 0xC7, 0x00, 0x01, + 0x67, 0x04, 0xFA, 0x02, 0x0E, 0x01, 0x0C, 0x0F, 0x83, 0x00, 0x13, 0x1F, + 0xEF, 0x00, 0x01, 0x2F, 0x0E, 0x3D, 0xA8, 0x0F, 0xBF, 0x9F, 0xB9, 0x0F, + 0xBF, 0x00, 0x2E, 0x0F, 0x00, 0x01, 0xFF, 0xAF, 0x2F, 0xFE, 0xFE, 0x3F, + 0x00, 0x67, 0x0E, 0x7F, 0xC9, 0x0F, 0x00, 0x01, 0xFE, 0x0F, 0x01, 0x00, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFA, 0x3F, 0xCF, 0xFE, 0x8B, 0x9F, 0x11, 0x70, 0x0F, 0x46, + 0x00, 0x27, 0x2E, 0x7C, 0xE8, 0x1E, 0xB5, 0x0F, 0x01, 0x01, 0x1B, 0x1F, + 0xE0, 0x00, 0x01, 0xAA, 0x1F, 0xF8, 0xDC, 0x10, 0x6C, 0x0F, 0x00, 0x01, + 0x6D, 0x0F, 0xFD, 0x00, 0x4E, 0x20, 0x99, 0xE0, 0xBF, 0x36, 0x0F, 0x80, + 0x00, 0x09, 0x09, 0x42, 0x76, 0x0F, 0xC0, 0xB6, 0x01, 0x0E, 0x43, 0xE0, + 0x0A, 0xC1, 0x02, 0x1F, 0xE0, 0x62, 0x19, 0x0A, 0x00, 0x7F, 0x1D, 0x1F, + 0x67, 0x20, 0xDB, 0x27, 0x10, 0x7C, 0x01, 0x79, 0x0F, 0x26, 0x01, 0x27, + 0x1E, 0xA7, 0x3D, 0x82, 0x0B, 0x81, 0x00, 0x1E, 0xE0, 0xDE, 0x42, 0x0D, + 0x00, 0xB9, 0x1F, 0xE0, 0x00, 0xF9, 0x0B, 0x0E, 0x9C, 0x79, 0x0B, 0xE1, + 0x02, 0x1F, 0xEF, 0x00, 0x01, 0x26, 0x2F, 0x67, 0xF8, 0xFF, 0x13, 0x2B, + 0x00, 0xE0, 0x5A, 0x00, 0x24, 0x1D, 0x0F, 0x80, 0xBE, 0x08, 0x1E, 0x67, + 0xDD, 0x58, 0x0A, 0x80, 0xA2, 0x0F, 0x41, 0xC2, 0x09, 0x00, 0x3A, 0x3D, + 0x1F, 0x67, 0x60, 0x9F, 0x08, 0x12, 0xC7, 0x60, 0xC3, 0x1F, 0xBC, 0x00, + 0x03, 0x25, 0x1E, 0xC7, 0x60, 0x00, 0x0F, 0x62, 0x05, 0x1D, 0x3F, 0xA7, + 0xC7, 0xE8, 0x00, 0x01, 0x09, 0x1E, 0x7C, 0x60, 0xA1, 0x0F, 0xE1, 0x25, + 0x18, 0x01, 0xB8, 0x45, 0x0E, 0xFF, 0xFD, 0x0B, 0xC1, 0xD9, 0x0F, 0xA0, + 0xA2, 0x0D, 0x0F, 0x60, 0x00, 0x27, 0x0F, 0x1F, 0x79, 0x11, 0x0F, 0x60, + 0x80, 0x11, 0x0F, 0xA0, 0x7F, 0x2D, 0x0F, 0x60, 0xBB, 0x25, 0x0F, 0x60, + 0x00, 0x2D, 0x0F, 0x21, 0x1C, 0x0F, 0x4F, 0xEF, 0xBC, 0xA7, 0x7C, 0x00, + 0x01, 0xE7, 0x01, 0x3A, 0x00, 0x1F, 0x67, 0x00, 0x03, 0x6D, 0x2F, 0x00, + 0x00, 0x00, 0x03, 0x65, 0x00, 0xF8, 0x3E, 0x1F, 0x67, 0x00, 0x04, 0x0A, + 0x01, 0x60, 0x04, 0x1F, 0xC7, 0x9F, 0x28, 0x09, 0x1F, 0x8B, 0x41, 0x1F, + 0x0A, 0x01, 0x40, 0x05, 0x1F, 0xFE, 0xDF, 0x28, 0x0A, 0x02, 0x85, 0x41, + 0x0F, 0x60, 0x26, 0x24, 0x11, 0xE8, 0xC4, 0x03, 0x0F, 0x5A, 0xA4, 0x28, + 0x0E, 0x80, 0x02, 0x0F, 0x00, 0x07, 0x18, 0x0E, 0xC0, 0xBF, 0x0F, 0x00, + 0x07, 0x1B, 0x03, 0xC0, 0x06, 0x0F, 0x60, 0x28, 0x26, 0x0F, 0x00, 0x07, + 0x2D, 0x11, 0x00, 0x3F, 0xAB, 0x0F, 0x80, 0x03, 0x09, 0x00, 0xE0, 0xC6, + 0x1F, 0x7C, 0x40, 0xAC, 0x0A, 0x0E, 0x00, 0xC0, 0x0A, 0x20, 0x09, 0x0E, + 0x00, 0x09, 0x0E, 0xC0, 0xAB, 0x0F, 0x00, 0x0A, 0x26, 0x00, 0x00, 0x09, + 0x1F, 0xB1, 0xFF, 0x1B, 0xED, 0x2F, 0xFE, 0xF8, 0xE0, 0x4E, 0xE7, 0x13, + 0x99, 0x05, 0xAC, 0x0F, 0xE0, 0x0F, 0xE5, 0x0E, 0x20, 0xC4, 0x0F, 0x01, + 0x00, 0xDA, 0x2E, 0xBC, 0xEF, 0x80, 0xC4, 0x0F, 0x00, 0x80, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0x10, 0x0F, 0x20, 0x00, 0x84, 0x0F, 0x00, 0x01, 0xFE, 0x0F, 0x1E, + 0xB5, 0x9C, 0x0F, 0x00, 0x01, 0x90, 0x00, 0x82, 0xBB, 0x0F, 0xE0, 0x01, + 0x4B, 0x0E, 0xE5, 0x3E, 0x0F, 0x40, 0x00, 0x19, 0x00, 0x21, 0x17, 0x10, + 0x7C, 0x86, 0xBC, 0x0F, 0x80, 0x1A, 0x04, 0x0E, 0x61, 0x20, 0x0F, 0x80, + 0xD7, 0x18, 0x02, 0xC0, 0x18, 0x2F, 0xFE, 0xCF, 0x00, 0x01, 0x49, 0x2F, + 0xCF, 0xFE, 0x60, 0x01, 0x29, 0x10, 0xE0, 0xBD, 0x62, 0x1E, 0xEF, 0x83, + 0x9C, 0x07, 0x60, 0x7F, 0x0E, 0xC0, 0x00, 0x0C, 0x80, 0xD9, 0x1F, 0x67, + 0xC0, 0x1F, 0x0A, 0x3F, 0xC7, 0xFE, 0xF8, 0x00, 0x01, 0x48, 0x01, 0x03, + 0xDB, 0x0F, 0x40, 0x00, 0x27, 0x10, 0xD9, 0xC3, 0x59, 0x1E, 0xCF, 0xE1, + 0x78, 0x07, 0xC0, 0x00, 0x1E, 0xBC, 0xC0, 0x00, 0x0B, 0x00, 0x1B, 0x0F, + 0xE0, 0x01, 0x08, 0x0E, 0x3D, 0x81, 0x0F, 0x00, 0x01, 0x3B, 0x0E, 0xE2, + 0x41, 0x0F, 0x40, 0x00, 0x1B, 0x13, 0x7C, 0x45, 0x5D, 0x2F, 0xFE, 0xFE, + 0xC0, 0x00, 0x21, 0x1E, 0xEF, 0xA0, 0x1D, 0x0F, 0xC0, 0x1E, 0x40, 0x0F, + 0x81, 0x36, 0x0B, 0x0F, 0x3F, 0xBB, 0x2E, 0x0E, 0x84, 0xA1, 0x0F, 0xC0, + 0xC4, 0x1D, 0x1F, 0xFE, 0x00, 0x01, 0x67, 0x4F, 0xC7, 0xF8, 0xFE, 0x7C, + 0x00, 0x01, 0xE9, 0x0E, 0x22, 0xE0, 0x0F, 0x00, 0x01, 0x59, 0x0F, 0x00, + 0x03, 0x6F, 0x0E, 0x7B, 0x80, 0x0F, 0x00, 0x01, 0x59, 0x0E, 0x00, 0x05, + 0x0F, 0x00, 0x01, 0x5F, 0x1E, 0x8B, 0x80, 0x06, 0x0F, 0x00, 0x01, 0x56, + 0x0E, 0x00, 0x07, 0x0F, 0x00, 0x01, 0x5F, 0x00, 0x7C, 0x61, 0x0F, 0x00, + 0x01, 0x65, 0x0E, 0x80, 0xE0, 0x0F, 0x5E, 0xC0, 0xBA, 0x0F, 0x3B, 0x9E, + 0x6E, 0x0F, 0x00, 0x01, 0xEC, 0x1F, 0xFE, 0x5A, 0x20, 0xE7, 0x03, 0xBC, + 0x43, 0x0F, 0x5B, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x16, 0x0F, 0x01, 0x00, 0xFF, + 0x13, 0x2F, 0xBC, 0xF8, 0x80, 0x21, 0xFE, 0x0F, 0x00, 0x01, 0xFF, 0x5B, + 0x0F, 0xC0, 0x3F, 0x0E, 0x1E, 0x8B, 0xA0, 0x3F, 0x0A, 0x40, 0x00, 0x0F, + 0x00, 0xFB, 0x0C, 0x1E, 0xC7, 0x20, 0x97, 0x0E, 0xE0, 0x52, 0x0F, 0xC0, + 0x3A, 0x26, 0x05, 0xFF, 0x7F, 0x0F, 0x5F, 0xBF, 0x05, 0x11, 0xD9, 0xA4, + 0x5A, 0x1E, 0xA7, 0x8A, 0x7F, 0x06, 0xC1, 0x14, 0x0F, 0xC0, 0x3F, 0x0F, + 0x1F, 0xCF, 0x00, 0x3A, 0x0A, 0x0E, 0x03, 0x15, 0x0D, 0x80, 0x34, 0x1F, + 0xBC, 0x00, 0x01, 0x45, 0x04, 0xFF, 0x7F, 0x1F, 0xEF, 0xF9, 0x36, 0x09, + 0x02, 0x80, 0x20, 0x2F, 0xFE, 0xFE, 0xC0, 0x3F, 0x23, 0x0E, 0x40, 0x3F, + 0x0F, 0xC0, 0xDE, 0x19, 0x00, 0xA0, 0x1E, 0x1E, 0x99, 0x7F, 0x37, 0x0F, + 0xC0, 0x3C, 0x35, 0x02, 0x3E, 0x5D, 0x0F, 0x63, 0x1F, 0x07, 0x00, 0xF7, + 0x7F, 0x02, 0xE1, 0x5F, 0x1F, 0x8B, 0x40, 0x21, 0x05, 0x1F, 0x8B, 0xC0, + 0x3C, 0x0C, 0x1F, 0x7C, 0x00, 0x41, 0x0C, 0x0E, 0x01, 0x16, 0x0B, 0xFF, + 0xBB, 0x0E, 0x9E, 0x60, 0x0F, 0xC0, 0x3D, 0x38, 0x2E, 0xEF, 0xF8, 0x9D, + 0xBA, 0x0B, 0x5D, 0x5B, 0x20, 0x99, 0xFE, 0xC6, 0xBB, 0x3F, 0xBC, 0xFE, + 0xA7, 0x20, 0x1E, 0x61, 0x2E, 0xA7, 0xF8, 0x7B, 0x9B, 0x0F, 0x00, 0x01, + 0x39, 0x5F, 0xBC, 0xFE, 0x99, 0x00, 0x99, 0x61, 0x22, 0x07, 0x00, 0xBA, + 0xE4, 0x53, 0xCF, 0xFE, 0x67, 0xFE, 0xCF, 0x29, 0xFE, 0x0F, 0x00, 0x01, + 0x5E, 0x10, 0x00, 0x56, 0xBE, 0x2F, 0xF8, 0x99, 0x00, 0x01, 0x46, 0x30, + 0x67, 0xFE, 0xD9, 0xE1, 0x00, 0x0F, 0xBF, 0x3C, 0x08, 0x12, 0x67, 0x23, + 0x64, 0x0E, 0x60, 0xC0, 0x08, 0xC0, 0x3F, 0x1F, 0xE8, 0x40, 0x3F, 0x25, + 0x0F, 0xC0, 0x06, 0x11, 0x1F, 0xBC, 0x3F, 0xE5, 0x2D, 0x0E, 0x66, 0x1B, + 0x09, 0x3F, 0x5F, 0x0E, 0x60, 0x20, 0x09, 0x01, 0x03, 0x01, 0x23, 0x64, + 0x3F, 0xCF, 0xFE, 0xB1, 0xC0, 0x3F, 0x22, 0x0E, 0xA0, 0x3F, 0x0F, 0xE0, + 0x66, 0x1D, 0x3F, 0x99, 0x00, 0x8B, 0x00, 0x05, 0x28, 0x00, 0xA0, 0x5F, + 0x0E, 0xC0, 0x44, 0x0B, 0xA1, 0xE4, 0x0F, 0x5D, 0x84, 0x0A, 0x00, 0xE2, + 0x01, 0x1F, 0x67, 0xE3, 0xFF, 0x06, 0x01, 0xDD, 0xE4, 0x0E, 0x1F, 0x3D, + 0x0A, 0x80, 0x46, 0x0F, 0x00, 0x01, 0x28, 0x1E, 0xCF, 0x58, 0xBC, 0x0C, + 0xC0, 0x26, 0x0F, 0x40, 0x00, 0x0F, 0x0E, 0xDD, 0xA1, 0x09, 0xA2, 0x02, + 0x1F, 0xEF, 0xC1, 0x43, 0x0C, 0x02, 0xC6, 0x81, 0x0F, 0xC0, 0x05, 0x06, + 0x1F, 0xE8, 0xA0, 0x3F, 0x0D, 0x1F, 0xE8, 0x00, 0x03, 0x28, 0x00, 0x9F, + 0xFF, 0x2F, 0xF8, 0xC7, 0x80, 0x62, 0x0A, 0x0F, 0x40, 0x00, 0x0E, 0x1F, + 0xC7, 0x22, 0x82, 0x0C, 0x1F, 0xB1, 0x60, 0x64, 0x0F, 0x0E, 0x68, 0x6B, + 0x0E, 0x80, 0x0A, 0x0F, 0xA6, 0x0B, 0xE2, 0x0F, 0x00, 0x01, 0xFF, 0xFF, + 0xEE, 0x0F, 0xDF, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x0F, 0x22, 0x32, 0x6B, 0x0E, + 0xDD, 0x5B, 0x0F, 0x5B, 0x10, 0x17, 0x00, 0xFF, 0x3B, 0x0F, 0x61, 0x30, + 0x2A, 0x01, 0x39, 0x34, 0x0F, 0x00, 0xF3, 0x6B, 0x1F, 0xFE, 0x00, 0x01, + 0x2B, 0x2F, 0xFE, 0xE0, 0x00, 0x01, 0xAB, 0x0E, 0x76, 0x95, 0x0E, 0x5B, + 0x12, 0x0F, 0x61, 0x34, 0x47, 0x0E, 0x00, 0x01, 0x0E, 0x1F, 0x9D, 0x0E, + 0x85, 0x80, 0x0C, 0x60, 0x1F, 0x0E, 0x38, 0xA2, 0x0E, 0x9F, 0x5A, 0x0F, + 0x21, 0x42, 0x83, 0x0E, 0x00, 0x01, 0x0E, 0x40, 0xA0, 0x0E, 0xC2, 0x7C, + 0x0C, 0x9F, 0x7F, 0x04, 0x66, 0xA1, 0x0F, 0x00, 0x01, 0xBF, 0x00, 0x3B, + 0x9C, 0x0E, 0xBC, 0xDD, 0x0C, 0xA0, 0x82, 0x0E, 0x00, 0x80, 0x0C, 0x63, + 0xBA, 0x0F, 0x00, 0x01, 0x66, 0x13, 0xCF, 0x5E, 0x22, 0x1F, 0xA7, 0x00, + 0x04, 0x25, 0x2E, 0xF8, 0xF8, 0xC3, 0x7B, 0x0C, 0x21, 0x03, 0x2F, 0xFE, + 0xF8, 0xFF, 0x00, 0x26, 0x1F, 0xCF, 0xE0, 0x80, 0x2B, 0x1E, 0x00, 0x93, + 0xE2, 0x0B, 0x9F, 0x00, 0x00, 0x5E, 0x5B, 0x4F, 0x8B, 0x00, 0xB1, 0xFE, + 0x00, 0x01, 0x25, 0x1F, 0xB1, 0x9F, 0xC1, 0x0A, 0x01, 0x34, 0xA1, 0x0F, + 0x60, 0x9C, 0x0A, 0x1F, 0x67, 0xFE, 0x01, 0x0C, 0x1F, 0xCF, 0x5B, 0x17, + 0x2D, 0x1F, 0xCF, 0x5E, 0x03, 0x0A, 0x11, 0xA7, 0x61, 0x5B, 0x0E, 0x87, + 0x38, 0x0F, 0x00, 0x01, 0x35, 0x00, 0x01, 0x1F, 0x0F, 0xC2, 0x41, 0x09, + 0x0E, 0xDC, 0xBF, 0x0C, 0xFF, 0x3F, 0x0F, 0x00, 0x01, 0x4A, 0x13, 0xA7, + 0x3F, 0xFF, 0x2F, 0xCF, 0x00, 0x00, 0x03, 0x26, 0x3F, 0xEF, 0xEF, 0xF8, + 0x40, 0x1C, 0x0C, 0x0E, 0xA3, 0x82, 0x08, 0xFF, 0x00, 0x0F, 0xE1, 0x01, + 0x0B, 0x0E, 0xFD, 0x43, 0x0F, 0x41, 0x1E, 0x1E, 0x1F, 0xCF, 0x00, 0x05, + 0x4C, 0x0E, 0x81, 0x7E, 0x0C, 0xC1, 0x08, 0x0F, 0xE1, 0x02, 0x07, 0x0E, + 0xFF, 0x00, 0x0E, 0xA1, 0xA6, 0x0F, 0x00, 0x05, 0x2D, 0x1F, 0x67, 0x00, + 0x07, 0x4D, 0x0F, 0xA4, 0x61, 0x0B, 0x1E, 0xA7, 0x21, 0x03, 0x0F, 0x00, + 0x07, 0x98, 0x0E, 0x00, 0x0C, 0x0E, 0x00, 0x09, 0x0E, 0x18, 0xA6, 0x0E, + 0xE3, 0x25, 0x0F, 0x00, 0x01, 0xA4, 0x0F, 0x01, 0x6A, 0x31, 0x0F, 0x60, + 0x6C, 0x2B, 0x0F, 0x00, 0x01, 0xAE, 0x0E, 0x39, 0xCA, 0x0F, 0x00, 0x0C, + 0x59, 0x2F, 0x99, 0xFE, 0xBF, 0x0C, 0x6D, 0x0F, 0x14, 0xE1, 0x2C, 0x1F, + 0xD9, 0x00, 0x0E, 0x6A, 0x0F, 0x01, 0x00, 0x2E, 0x1F, 0xF8, 0x80, 0x00, + 0x2E, 0x1F, 0xD9, 0x00, 0x01, 0x2B, 0x1F, 0xD9, 0x24, 0x20, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0x5D, 0x2E, 0xC7, 0xEF, 0x9F, 0xB9, 0x0F, 0x03, 0x20, 0x3B, 0x10, + 0xEF, 0xA3, 0x19, 0x0F, 0x63, 0x5E, 0x84, 0x03, 0xE0, 0xB5, 0x1F, 0x7C, + 0x61, 0xF2, 0x4C, 0x1F, 0x7C, 0x00, 0x01, 0x85, 0x11, 0xEF, 0xFE, 0x35, + 0x0F, 0xFB, 0xF1, 0x4A, 0x0E, 0xC3, 0x17, 0x0F, 0x00, 0x01, 0x77, 0x1F, + 0xB1, 0x60, 0x13, 0x4E, 0x01, 0x9F, 0x1B, 0x0F, 0x00, 0x01, 0x65, 0x0E, + 0x00, 0x93, 0x0E, 0xA0, 0xFB, 0x0F, 0x83, 0x24, 0x50, 0x0F, 0x57, 0xF6, + 0x46, 0x0E, 0x3F, 0xC3, 0x0F, 0x20, 0x00, 0x1B, 0x04, 0x1D, 0xD9, 0x0F, + 0x63, 0x9B, 0x4B, 0x1F, 0xC7, 0xBF, 0xC5, 0x4D, 0x0F, 0x82, 0x19, 0x27, + 0x0F, 0x5F, 0x17, 0x50, 0x0E, 0x7B, 0x3C, 0x0F, 0x00, 0x04, 0x77, 0x0F, + 0x00, 0x02, 0x51, 0x01, 0x64, 0x1B, 0x0F, 0x00, 0x05, 0x85, 0x0E, 0x7F, + 0xA0, 0x0F, 0x63, 0x66, 0xDB, 0x1F, 0xA7, 0x00, 0x06, 0x4E, 0x1E, 0x67, + 0x7D, 0x7B, 0x0F, 0x00, 0x08, 0x7F, 0x0F, 0x1F, 0xDD, 0x48, 0x0E, 0x5E, + 0x1E, 0x0F, 0x00, 0x0A, 0x81, 0x0F, 0xDD, 0x02, 0x47, 0x0E, 0x3D, 0x27, + 0x0B, 0x40, 0x00, 0x0F, 0x20, 0x1B, 0x11, 0x0E, 0x07, 0x43, 0x0F, 0x00, + 0x08, 0x34, 0x00, 0x9C, 0xC1, 0x1E, 0xF8, 0x00, 0x0C, 0x0F, 0x00, 0x01, + 0x38, 0x0E, 0x21, 0xA4, 0x0F, 0x00, 0x01, 0x7B, 0x0F, 0xDC, 0x0C, 0x2C, + 0x1F, 0xF8, 0xFF, 0x05, 0x2B, 0x2E, 0x7C, 0xF8, 0x43, 0x00, 0x0F, 0x63, + 0x6B, 0x99, 0x2F, 0xEF, 0x99, 0xFE, 0x0B, 0x2B, 0x2E, 0xEF, 0x99, 0x43, + 0x00, 0x0F, 0x63, 0x6C, 0xB8, 0x1F, 0xA7, 0x5D, 0x08, 0x4D, 0x0F, 0x00, + 0x01, 0x8D, 0x1F, 0xF8, 0x22, 0x60, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDA, 0x6F, 0xE8, 0xF8, 0x99, 0x99, + 0xF8, 0xE8, 0x80, 0x00, 0xE7, 0x2E, 0x00, 0xCF, 0xE5, 0x36, 0x0F, 0x80, + 0x00, 0xDA, 0x0F, 0x21, 0x90, 0xAE, 0x1F, 0xCF, 0xBD, 0x16, 0x08, 0x00, + 0x7D, 0x7C, 0x0E, 0x60, 0xD7, 0x0E, 0xE0, 0xDF, 0x0F, 0xA1, 0x8F, 0x2A, + 0x3F, 0xF8, 0xBC, 0x00, 0xA7, 0x13, 0x25, 0x0E, 0x80, 0xC0, 0x0F, 0x3E, + 0x03, 0x3A, 0x20, 0xD9, 0xFE, 0x38, 0x5B, 0x0E, 0x85, 0x97, 0x0F, 0xE0, + 0xDF, 0x16, 0x0F, 0x7E, 0x21, 0x0F, 0x02, 0x21, 0x56, 0x0F, 0x00, 0x01, + 0x2D, 0x1F, 0xC7, 0x5C, 0x12, 0x45, 0x00, 0xFF, 0x35, 0x0E, 0x85, 0x31, + 0x0F, 0xE0, 0xDF, 0x1A, 0x0F, 0xE0, 0x3F, 0x0C, 0x12, 0xBC, 0x46, 0xF7, + 0x0F, 0xC6, 0xB7, 0x2A, 0x2F, 0xF8, 0x00, 0x00, 0x01, 0x48, 0x0E, 0x61, + 0xBD, 0x0F, 0xE0, 0xDF, 0x1B, 0x0F, 0xDF, 0x39, 0x10, 0x1F, 0xCF, 0x00, + 0x01, 0x2A, 0x1F, 0xE8, 0x62, 0x1C, 0x45, 0x00, 0x9E, 0xBD, 0x3E, 0xFE, + 0xF8, 0xE8, 0x9C, 0x00, 0x0E, 0xE0, 0xDF, 0x0F, 0xE0, 0xBB, 0x24, 0x03, + 0xBB, 0x00, 0x0F, 0xE7, 0x41, 0x2A, 0x0E, 0x83, 0xBC, 0x0F, 0xBB, 0x23, + 0x37, 0x00, 0x3E, 0xDB, 0x0E, 0xC1, 0x1A, 0x0F, 0xE0, 0xDF, 0x17, 0x3F, + 0x7C, 0xF8, 0xE8, 0x9D, 0x15, 0x12, 0x0F, 0xA7, 0x18, 0x28, 0x1F, 0x99, + 0x61, 0x1B, 0x48, 0x00, 0x7D, 0x82, 0x31, 0xC7, 0xFE, 0xC7, 0x06, 0x06, + 0x02, 0x0C, 0x06, 0x0F, 0xE0, 0xDF, 0x1C, 0x3F, 0xE8, 0xF8, 0x7C, 0x00, + 0x01, 0x4C, 0x0F, 0xFD, 0x03, 0x47, 0x06, 0xE0, 0x40, 0x01, 0x06, 0x06, + 0x02, 0x0C, 0x06, 0x0F, 0xE0, 0xDF, 0x1B, 0x0F, 0xDF, 0xC2, 0x16, 0x2F, + 0xFE, 0xFE, 0xFD, 0x03, 0x7F, 0x05, 0x43, 0x60, 0x02, 0xA5, 0x1B, 0x0E, + 0xAB, 0x1B, 0x0E, 0x62, 0x9A, 0x0F, 0x00, 0x01, 0x1E, 0x03, 0xBE, 0x00, + 0x0E, 0x23, 0x9E, 0x0F, 0xFD, 0x03, 0x70, 0x05, 0x63, 0xC3, 0x0E, 0x00, + 0x01, 0x0F, 0xE0, 0xDF, 0x16, 0x0E, 0x00, 0x03, 0x0F, 0x00, 0x06, 0x3B, + 0x0F, 0xFD, 0x03, 0x4A, 0x04, 0x61, 0x60, 0x01, 0x06, 0x06, 0x02, 0x0C, + 0x06, 0x0F, 0xE0, 0xDF, 0x1D, 0x0E, 0x00, 0x05, 0x0F, 0x00, 0x08, 0x3A, + 0x0F, 0xFD, 0x03, 0x4E, 0x01, 0x03, 0x48, 0x1E, 0xD9, 0x00, 0x04, 0x0E, + 0xE0, 0xDF, 0x0F, 0xE0, 0xC2, 0x24, 0x12, 0xC7, 0x21, 0x67, 0x0F, 0x00, + 0x05, 0x24, 0x1F, 0xC7, 0xE0, 0xBA, 0x4E, 0x01, 0x1E, 0x42, 0x10, 0xE0, + 0x06, 0x62, 0x2E, 0x00, 0xE0, 0xCC, 0x1B, 0x0E, 0xE0, 0xDF, 0x0F, 0x61, + 0x00, 0x1F, 0x1F, 0xE8, 0x00, 0x0C, 0x28, 0x0E, 0x80, 0xC0, 0x0F, 0x01, + 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x4F, 0x1F, 0x99, 0xBF, + 0x55, 0x2C, 0x2E, 0x99, 0xEF, 0x43, 0x00, 0x0E, 0x00, 0x34, 0x0F, 0x01, + 0x00, 0x87, 0x0E, 0xBF, 0x17, 0x0F, 0xC0, 0x76, 0x1C, 0x1E, 0x7C, 0x43, + 0x00, 0x0F, 0x00, 0x01, 0x99, 0x2F, 0xFE, 0xFE, 0x00, 0x35, 0x2B, 0x0E, + 0xE0, 0x00, 0x0F, 0x00, 0x35, 0x3E, 0x0F, 0x00, 0x01, 0x6A, 0x2F, 0xEF, + 0x99, 0x00, 0x01, 0x2B, 0x0E, 0x00, 0x35, 0x0F, 0x01, 0x00, 0xFF, 0xFC, + 0x4F, 0xA7, 0xF8, 0xF8, 0xA7, 0x00, 0x01, 0xE9, 0x1E, 0xF8, 0x21, 0x7B, + 0x0F, 0x00, 0x01, 0xF9, 0x0F, 0x00, 0x43, 0x17, 0x0E, 0x28, 0x1B, 0x0F, + 0x00, 0x03, 0xB1, 0x0F, 0x00, 0x01, 0xCD, 0x0F, 0x01, 0x00, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x44, 0x2E, 0xFE, 0xFE, 0xC0, 0x8D, + 0x0F, 0x00, 0x01, 0xFE, 0x0F, 0xDF, 0x1F, 0xE6, 0x00, 0x5D, 0x93, 0x0F, + 0x42, 0x74, 0x10, 0x03, 0x45, 0x94, 0x0F, 0xFF, 0x42, 0x9E, 0x14, 0xD9, + 0x98, 0x36, 0x0E, 0xC2, 0xFD, 0x05, 0x9D, 0x5D, 0x0F, 0x82, 0xFE, 0x0E, + 0x02, 0xE8, 0xB0, 0x00, 0xC7, 0x60, 0x0F, 0xFF, 0x42, 0x9F, 0x02, 0xE0, + 0xF6, 0x00, 0xE1, 0xF6, 0x0F, 0xDC, 0x00, 0x03, 0x1F, 0x67, 0xA2, 0x39, + 0x0E, 0x02, 0x00, 0x01, 0x6F, 0xC7, 0xC7, 0x00, 0xC7, 0xC7, 0xFE, 0xE1, + 0x02, 0xA1, 0x21, 0xF8, 0x67, 0xC6, 0x9E, 0x1F, 0x99, 0x44, 0x78, 0x2B, + 0x6F, 0x7C, 0xEF, 0x00, 0xEF, 0x7C, 0xFE, 0xE0, 0x9F, 0x1E, 0x0F, 0xC0, + 0x01, 0x11, 0x02, 0x7F, 0x57, 0x2F, 0x99, 0xEF, 0x48, 0x00, 0x21, 0x0F, + 0xD6, 0x1A, 0x0F, 0x01, 0x02, 0x03, 0x0E, 0xFE, 0x02, 0x0F, 0x44, 0x79, + 0x1E, 0x5F, 0xEF, 0x8B, 0xEF, 0x00, 0xFE, 0xE0, 0x9F, 0x1E, 0x0F, 0x01, + 0x3C, 0x11, 0x10, 0xFE, 0xE1, 0xBF, 0x02, 0x68, 0xE0, 0x1F, 0xE0, 0x00, + 0x01, 0x3E, 0x00, 0x02, 0x03, 0x1E, 0x8B, 0x81, 0x9A, 0x0F, 0x00, 0x01, + 0x1F, 0x2E, 0xC7, 0xEF, 0x2A, 0x05, 0x0E, 0xE0, 0x9F, 0x0F, 0x01, 0x3C, + 0x1E, 0x10, 0xBC, 0x1B, 0x65, 0x30, 0x8B, 0xE8, 0xF8, 0x61, 0x39, 0x1F, + 0x67, 0x6B, 0x77, 0x24, 0x0E, 0x82, 0x7E, 0x0B, 0x22, 0x3C, 0x0F, 0xE5, + 0x61, 0x2B, 0x02, 0x00, 0x01, 0x5F, 0x7C, 0xFE, 0x7C, 0x00, 0xFE, 0xE0, + 0x9F, 0x1F, 0x0E, 0x01, 0x3C, 0x0C, 0xBC, 0x00, 0x12, 0x99, 0xE6, 0x77, + 0x11, 0x67, 0x46, 0x43, 0x1F, 0xE0, 0xFF, 0x00, 0x3E, 0x01, 0x7F, 0x65, + 0x0F, 0x45, 0x76, 0x47, 0x0E, 0xE0, 0x9F, 0x0E, 0x41, 0x3B, 0x0F, 0x21, + 0x7F, 0x0B, 0x09, 0xC8, 0x02, 0x0F, 0xA8, 0x02, 0x1F, 0x0E, 0x80, 0x80, + 0x0F, 0x01, 0x58, 0x5C, 0x0E, 0xE0, 0x9F, 0x0F, 0xE0, 0xFC, 0x19, 0x0B, + 0x00, 0x01, 0x0F, 0xAA, 0x00, 0x1E, 0x0E, 0x80, 0x80, 0x0F, 0x01, 0x59, + 0x5F, 0x0E, 0xE0, 0x9F, 0x0F, 0x00, 0x03, 0x17, 0x02, 0xBA, 0xA5, 0x04, + 0xE6, 0x7A, 0x1F, 0x8B, 0xFF, 0x00, 0x20, 0x1F, 0xCF, 0x81, 0x61, 0x6A, + 0x0E, 0xE0, 0x9F, 0x0F, 0x00, 0x05, 0x1A, 0x00, 0x60, 0xA0, 0x51, 0x8B, + 0x00, 0x8B, 0xF8, 0xF8, 0x84, 0xA7, 0x1F, 0xCF, 0xC7, 0x49, 0x1E, 0x0E, + 0xFF, 0x00, 0x0F, 0x00, 0x01, 0x5C, 0x0E, 0xE0, 0x9F, 0x0F, 0x00, 0x07, + 0x22, 0x13, 0xA7, 0x01, 0x40, 0x1F, 0x8B, 0x00, 0x07, 0x3F, 0x0F, 0x00, + 0x03, 0x4C, 0x0E, 0xE0, 0x9F, 0x0F, 0x00, 0x09, 0x24, 0x00, 0x28, 0xE0, + 0x2F, 0x8B, 0x00, 0x00, 0x01, 0x9E, 0x0F, 0x01, 0x00, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xB4, + 0x50, 0x00, 0x00, 0x00, 0x00, 0x00 +}; \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Form.cpp b/r5dev/thirdparty/cppnet/cppkore/Form.cpp new file mode 100644 index 00000000..dc90a6a6 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Form.cpp @@ -0,0 +1,1182 @@ +#include "stdafx.h" +#include "Form.h" +#include "Application.h" +#include "Button.h" + +namespace Forms +{ + Form::Form() + : ContainerControl(), _Owner(nullptr), _FormBorderStyle(FormBorderStyle::Sizable), _FormWindowState(FormWindowState::Normal), _FormStartPosition(FormStartPosition::WindowsDefaultLocation), _DialogResult(DialogResult::None), _CloseReason(CloseReason::None), _Opacity(255), _Icon(nullptr), _FormStateFlags(0x1f), _DefaultButton(nullptr) + { + // Default form styles + SetStyle(ControlStyles::ContainerControl, true); + SetState(ControlStates::StateVisible, false); + SetState(ControlStates::StateTopLevel, true); + +#if 0 + // This is used to debug the form state flags, we use the magic number 0x1f right now... + _FormStateFlags.set(0, true); // ControlBox + _FormStateFlags.set(1, true); // MaximizeBox + _FormStateFlags.set(2, true); // MinimizeBox + _FormStateFlags.set(3, true); // ShowInTaskbar + _FormStateFlags.set(4, true); // ShowIcon + _FormStateFlags.set(5, false); // TopMost + _FormStateFlags.set(6, false); // CalledClosing + _FormStateFlags.set(7, false); // CalledCreateControl + _FormStateFlags.set(8, false); // CalledMakeVisible + _FormStateFlags.set(9, false); // CalledOnLoad + _FormStateFlags.set(10, false); // IsClosing + _FormStateFlags.set(11, false); // ShowWindowOnCreate + _FormStateFlags.set(12, false); // UseCustomFrame +#endif + + // Setup the container + this->_Controls = std::make_unique(); + + // Default form background + this->SetBackColor(Drawing::GetSystemColor(Drawing::SystemColors::Control)); + + // We are a form control + this->_RTTI = ControlTypes::Form; + } + + FormBorderStyle Form::GetFormBorderStyle() + { + return this->_FormBorderStyle; + } + + void Form::SetFormBorderStyle(FormBorderStyle Value) + { + this->_FormBorderStyle = Value; + UpdateStyles(); + } + + bool Form::ControlBox() + { + return this->_FormStateFlags[0]; + } + + void Form::SetControlBox(bool Value) + { + this->_FormStateFlags[0] = Value; + UpdateStyles(); + } + + DialogResult Form::GetDialogResult() + { + return this->_DialogResult; + } + + void Form::SetDialogResult(DialogResult Value) + { + this->_DialogResult = Value; + } + + bool Form::MaximizeBox() + { + return this->_FormStateFlags[1]; + } + + void Form::SetMaximizeBox(bool Value) + { + this->_FormStateFlags[1] = Value; + UpdateStyles(); + } + + bool Form::MinimizeBox() + { + return this->_FormStateFlags[2]; + } + + void Form::SetMinimizeBox(bool Value) + { + this->_FormStateFlags[2] = Value; + UpdateStyles(); + } + + bool Form::ShowInTaskbar() + { + return this->_FormStateFlags[3]; + } + + void Form::SetShowInTaskbar(bool Value) + { + this->_FormStateFlags[3] = Value; + UpdateStyles(); + } + + bool Form::ShowIcon() + { + return this->_FormStateFlags[4]; + } + + void Form::SetShowIcon(bool Value) + { + this->_FormStateFlags[4] = Value; + UpdateStyles(); + } + + std::unique_ptr& Form::Icon() + { + return this->_Icon; + } + + void Form::SetIcon(std::unique_ptr&& Value) + { + this->_Icon = std::move(Value); + + if (GetState(ControlStates::StateCreated)) + { + if (this->_Icon != nullptr) + { + SendMessageA(this->_Handle, WM_SETICON, ICON_SMALL, (LPARAM)this->_Icon->SmallHandle()); + SendMessageA(this->_Handle, WM_SETICON, ICON_BIG, (LPARAM)this->_Icon->LargeHandle()); + } + else + { + SendMessageA(this->_Handle, WM_SETICON, ICON_SMALL, NULL); + SendMessageA(this->_Handle, WM_SETICON, ICON_BIG, NULL); + } + } + } + + FormStartPosition Form::StartPosition() + { + return this->_FormStartPosition; + } + + void Form::SetStartPosition(FormStartPosition Value) + { + this->_FormStartPosition = Value; + } + + bool Form::TopMost() + { + return this->_FormStateFlags[5]; + } + + void Form::SetTopMost(bool Value) + { + if (GetState(ControlStates::StateCreated)) + { + auto Key = (Value) ? HWND_TOPMOST : HWND_NOTOPMOST; + SetWindowPos(this->_Handle, Key, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); + } + + this->_FormStateFlags[5] = Value; + } + + FormWindowState Form::WindowState() + { + return this->_FormWindowState; + } + + void Form::SetWindowState(FormWindowState Value) + { + switch (Value) + { + case FormWindowState::Normal: + SetState(ControlStates::StateSizeLockedByOS, false); + break; + case FormWindowState::Maximized: + case FormWindowState::Minimized: + SetState(ControlStates::StateSizeLockedByOS, true); + break; + } + + if (GetState(ControlStates::StateCreated) && Visible()) + { + switch (Value) + { + case FormWindowState::Normal: + ShowWindow(this->_Handle, SW_NORMAL); + break; + case FormWindowState::Maximized: + ShowWindow(this->_Handle, SW_MAXIMIZE); + break; + case FormWindowState::Minimized: + ShowWindow(this->_Handle, SW_MINIMIZE); + break; + } + } + + this->_FormWindowState = Value; + } + + void Form::Activate() + { + if (Visible() && GetState(ControlStates::StateCreated)) + SetActive(true); + } + + bool Form::CheckCloseDialog(bool ClosingOnly) + { + if (_DialogResult == DialogResult::None && Visible()) + return false; + + if (!CalledClosing()) + { + auto EventArgs = std::make_unique(_CloseReason, false); + + OnClosing(EventArgs); + OnFormClosing(EventArgs); + + if (EventArgs->Cancel) + _DialogResult = DialogResult::None; + else + SetCalledClosing(true); + } + + if (!ClosingOnly && _DialogResult != DialogResult::None) + { + auto EventArgs = std::make_unique(_CloseReason); + + OnClosed(EventArgs); + OnFormClosed(EventArgs); + + SetCalledClosing(false); + } + + if (_DialogResult != DialogResult::None) + return true; + + return !Visible(); + } + + void Form::Close() + { + if (GetState(ControlStates::StateCreated)) + { + _CloseReason = CloseReason::UserClosing; + SendMessageA(this->_Handle, WM_CLOSE, NULL, NULL); + } + } + + DialogResult Form::ShowDialog() + { + return this->ShowDialog(nullptr); + } + + DialogResult Form::ShowDialog(Form* Owner) + { + SetCalledOnLoad(false); + SetCalledMakeVisible(false); + + this->_CloseReason = CloseReason::None; + + auto HwndCapture = GetCapture(); + if (HwndCapture != NULL) + { + SendMessageA(HwndCapture, WM_CANCELMODE, NULL, NULL); + ReleaseCapture(); + } + + // Workaround so we always have an owner + auto HwndActive = GetActiveWindow(); + auto HwndOwner = (Owner == nullptr) ? HwndActive : Owner->GetHandle(); + auto OldOwner = this->_Owner; + + // Set result and create the control + this->_DialogResult = DialogResult::None; + this->CreateControl(nullptr); + + // If we don't have an owner, set one + if (Owner == nullptr) + SetWindowLongPtr(this->_Handle, GWLP_HWNDPARENT, (LONG_PTR)HwndOwner); + else + SetOwner(Owner); + + SetState(ControlStates::StateModal, true); + + // Run dialog, then make sure we're invisible + Application::RunDialog(this); + + if (!IsWindow(HwndActive)) + HwndActive = HwndOwner; + if (IsWindow(HwndActive) && IsWindowVisible(HwndActive)) + SetActiveWindow(HwndActive); + else if (IsWindow(HwndOwner) && IsWindowVisible(HwndOwner)) + SetActiveWindow(HwndOwner); + + SetVisibleCore(false); + + if (GetState(ControlStates::StateCreated)) + { + DestroyHandle(); + SetState(ControlStates::StateModal, false); + } + + SetOwner(OldOwner); + + // Return our result + return GetDialogResult(); + } + + Form* Form::Owner() + { + return this->_Owner; + } + + void Form::SetOwner(Form* Value) + { + HWND HwndOwner = (Value != nullptr) ? Value->GetHandle() : NULL; + + SetWindowLongPtr(this->_Handle, GWLP_HWNDPARENT, (LONG_PTR)HwndOwner); + + this->_Owner = Value; + } + + bool Form::UseCustomFrame() + { + return this->_FormStateFlags[12]; + } + + void Form::SetUseCustomFrame(bool Value) + { + this->_FormStateFlags[12] = Value; + this->Invalidate(true); + } + + bool Form::Active() + { + auto ParentForm = (Form*)this->ParentFormInternal(); + if (ParentForm == nullptr) + return this->_FormStateFlags[13]; + + return (ParentForm->ActiveControl() == this && ParentForm->Active()); + } + + void Form::SetActive(bool Value) + { + if (this->_FormStateFlags[13] != Value) + { + this->_FormStateFlags[13] = Value; + + if (Value) + { + if (ActiveControl() == nullptr) + SelectNextControl(nullptr, true, true, true, false); + + OnActivated(); + } + else + { + OnDeactivate(); + } + } + } + + uint8_t Form::Opacity() + { + return this->_Opacity; + } + + void Form::SetOpacity(uint8_t Value) + { + if (_Opacity != Value) + { + _Opacity = Value; + + if (GetState(ControlStates::StateCreated)) + { + UpdateStyles(); + SetLayeredWindowAttributes(this->_Handle, 0, (BYTE)_Opacity, LWA_ALPHA); + } + } + } + + void Form::UpdateDefaultButton() + { + if (this->ActiveControl() != nullptr && this->ActiveControl()->GetType() == ControlTypes::Button) + { + SetDefaultButton(this->ActiveControl()); + } + else + { + SetDefaultButton(nullptr); + // TODO: SetDefaultButton(AcceptButton); + } + } + + void Form::OnLoad() + { + // If we are a model window, we can set the position + if (GetState(ControlStates::StateModal)) + { + if (this->_FormStartPosition == FormStartPosition::CenterParent) + CenterToParent(); + else if (this->_FormStartPosition == FormStartPosition::CenterScreen) + CenterToScreen(); + } + + // If we have no icon set, set the exe one... + // this logic matches WPF windows... + if (this->_Icon == nullptr) + this->SetIcon(Drawing::Icon::ApplicationIcon()); + + Load.RaiseEvent(this); + } + + void Form::OnHandleCreated() + { + // Change opacity if need be + SetLayeredWindowAttributes(this->_Handle, NULL, (BYTE)_Opacity, LWA_ALPHA); + + // Ensure the icon is set + if (this->_Icon != nullptr) + { + SendMessageA(this->_Handle, WM_SETICON, ICON_SMALL, (LPARAM)this->_Icon->SmallHandle()); + SendMessageA(this->_Handle, WM_SETICON, ICON_BIG, (LPARAM)this->_Icon->LargeHandle()); + } + + // We must call the base event last + ContainerControl::OnHandleCreated(); + } + + void Form::OnStyleChanged() + { + ContainerControl::OnStyleChanged(); + AdjustSystemMenu(); + } + + void Form::OnEnabledChanged() + { + ContainerControl::OnEnabledChanged(); + + if (Enabled() && Active()) + { + if (ActiveControl() == nullptr) + SelectNextControl(this, true, true, true, true); + else + FocusActiveControlInternal(); + } + } + + void Form::OnActivated() + { + Activated.RaiseEvent(this); + } + + void Form::OnDeactivate() + { + Deactivate.RaiseEvent(this); + } + + void Form::OnClosing(const std::unique_ptr& EventArgs) + { + Closing.RaiseEvent(EventArgs, this); + } + + void Form::OnFormClosing(const std::unique_ptr& EventArgs) + { + FormClosing.RaiseEvent(EventArgs, this); + } + + void Form::OnClosed(const std::unique_ptr& EventArgs) + { + Closed.RaiseEvent(EventArgs, this); + } + + void Form::OnFormClosed(const std::unique_ptr& EventArgs) + { + FormClosed.RaiseEvent(EventArgs, this); + } + + void Form::OnPaintFrame(const std::unique_ptr& EventArgs) + { + PaintFrame.RaiseEvent(EventArgs, this); + } + + void Form::AddControl(Control* Ctrl) + { + ContainerControl::AddControl(Ctrl); + } + + void Form::Dispose() + { + // Forcefully set to cancel if we don't have a proper result... + if (_DialogResult == DialogResult::None) + _DialogResult = DialogResult::Cancel; + + // Call the base event last... + ContainerControl::Dispose(); + } + + void Form::WndProc(Message& Msg) + { + switch (Msg.Msg) + { + case WM_CREATE: + WmCreate(Msg); + break; + case WM_CLOSE: + if (_CloseReason == CloseReason::None) + _CloseReason = CloseReason::TaskManagerClosing; + WmClose(Msg); + break; + case WM_QUERYENDSESSION: + case WM_ENDSESSION: + _CloseReason = CloseReason::WindowsShutDown; + WmClose(Msg); + break; + case WM_SYSCOMMAND: + WmSysCommand(Msg); + break; + case WM_GETMINMAXINFO: + WmGetMinMaxInfo(Msg); + break; + case WM_ERASEBKGND: + WmEraseBkgnd(Msg); + break; + case WM_WINDOWPOSCHANGED: + WmWindowPosChanged(Msg); + break; + case WM_NCPAINT: + if (UseCustomFrame()) + WmNcPaint(Msg); + else + ContainerControl::WndProc(Msg); + break; + case WM_NCACTIVATE: + if (UseCustomFrame()) + WmNcActivate(Msg); + else + ContainerControl::WndProc(Msg); + break; + case WM_ACTIVATE: + WmActivate(Msg); + break; + default: + ContainerControl::WndProc(Msg); + break; + } + } + + CreateParams Form::GetCreateParams() + { + auto Cp = ContainerControl::GetCreateParams(); + + Cp.ClassName = "APPWINDOW"; + + if (this->_Opacity < 255) + Cp.ExStyle |= WS_EX_LAYERED; + + // Fill in properties + FillInCreateParamsBorderStyles(Cp); + FillInCreateParamsWindowState(Cp); + FillInCreateParamsBorderIcons(Cp); + + if (ShowInTaskbar()) + Cp.ExStyle |= WS_EX_APPWINDOW; + + auto BorderStyle = GetFormBorderStyle(); + if (!ShowIcon() && + (BorderStyle == FormBorderStyle::Sizable || + BorderStyle == FormBorderStyle::Fixed3D || + BorderStyle == FormBorderStyle::FixedSingle)) + { + Cp.ExStyle |= WS_EX_DLGMODALFRAME; + } + + if (BorderStyle == FormBorderStyle::None) + Cp.Style |= WS_POPUP; + + if (GetState(ControlStates::StateTopLevel)) + { + FillInCreateParamsStartPosition(Cp); + + if ((Cp.Style & WS_VISIBLE) != 0) + { + SetShowWindowOnCreate(true); + Cp.Style &= (~WS_VISIBLE); + } + else + { + SetShowWindowOnCreate(false); + } + } + + return Cp; + } + + bool Form::CalledClosing() + { + return this->_FormStateFlags[6]; + } + + void Form::SetCalledClosing(bool Value) + { + this->_FormStateFlags[6] = Value; + } + + bool Form::CalledCreateControl() + { + return this->_FormStateFlags[7]; + } + + void Form::SetCalledCreateControl(bool Value) + { + this->_FormStateFlags[7] = Value; + } + + bool Form::CalledMakeVisible() + { + return this->_FormStateFlags[8]; + } + + void Form::SetCalledMakeVisible(bool Value) + { + this->_FormStateFlags[8] = Value; + } + + bool Form::CalledOnLoad() + { + return this->_FormStateFlags[9]; + } + + void Form::SetCalledOnLoad(bool Value) + { + this->_FormStateFlags[9] = Value; + } + + bool Form::IsClosing() + { + return this->_FormStateFlags[10]; + } + + void Form::SetIsClosing(bool Value) + { + this->_FormStateFlags[10] = Value; + } + + bool Form::ShowWindowOnCreate() + { + return this->_FormStateFlags[11]; + } + + void Form::SetShowWindowOnCreate(bool Value) + { + this->_FormStateFlags[11] = Value; + } + + void Form::SetVisibleCore(bool Value) + { + if (GetVisibleCore() == Value && _DialogResult == DialogResult::OK) + return; + + if (GetVisibleCore() == Value && (!Value || CalledMakeVisible())) + { + ContainerControl::SetVisible(Value); + return; + } + + if (Value) + { + SetCalledMakeVisible(true); + + if (!CalledCreateControl()) + { + this->CreateControl(_Parent); + this->SetCalledCreateControl(true); + } + + if (!CalledOnLoad()) + { + SetCalledOnLoad(true); + OnLoad(); + if (_DialogResult != DialogResult::None) + Value = false; + } + } + + // If not mdi child: + ContainerControl::SetVisibleCore(Value); + + if (Value && (WindowState() == FormWindowState::Maximized || TopMost())) + { + if (ActiveControl() == nullptr) + SelectNextControl(nullptr, true, true, true, false); + FocusActiveControlInternal(); + } + } + + void Form::WmClose(Message& Msg) + { + auto EventArgs = std::make_unique(_CloseReason, false); + + if (Msg.Msg != WM_ENDSESSION) + { + if (GetState(ControlStates::StateModal)) + { + if (_DialogResult == DialogResult::None) + _DialogResult = DialogResult::Cancel; + + SetCalledClosing(false); + EventArgs->Cancel = !CheckCloseDialog(true); + } + else + { + OnClosing(EventArgs); + OnFormClosing(EventArgs); + } + + if (Msg.Msg == WM_QUERYENDSESSION) + Msg.Result = (uintptr_t)(EventArgs->Cancel ? 0 : 1); + + if (GetState(ControlStates::StateModal)) + return; + } + else + { + EventArgs->Cancel = (Msg.WParam == (uintptr_t)0); + } + + if (Msg.Msg != WM_QUERYENDSESSION) + { + if (!EventArgs->Cancel) + { + auto FcEventArgs = std::make_unique(CloseReason::FormOwnerClosing); + + SetIsClosing(true); + + FcEventArgs->Reason = _CloseReason; + OnClosed(FcEventArgs); + OnFormClosed(FcEventArgs); + + this->Dispose(); // Forcefully dispose of the control + } + } + } + + void Form::WmSysCommand(Message& Msg) + { + bool CallDefault = true; + + auto Sc = (uint16_t)(LOWORD(Msg.WParam) & 0xFFF0); + + switch (Sc) + { + case SC_CLOSE: + _CloseReason = CloseReason::UserClosing; + break; + } + + if (CallDefault) + ContainerControl::WndProc(Msg); + } + + void Form::WmEraseBkgnd(Message& Msg) + { + UpdateWindowState(); + ContainerControl::WndProc(Msg); + } + + void Form::WmGetMinMaxInfo(Message& Msg) + { + auto MinTrack = this->MinimumSize(); + auto MaxTrack = this->MaximumSize(); + + auto MinMaxInfo = (MINMAXINFO*)Msg.LParam; + + if (!MinTrack.Empty()) + { + MinMaxInfo->ptMinTrackSize.x = MinTrack.Width; + MinMaxInfo->ptMinTrackSize.y = MinTrack.Height; + + if (MaxTrack.Empty()) + { + // Make sure we aren't bigger than our total screen size + Drawing::Size VirtualScreenSize(0, 0); + Drawing::Rectangle(GetSystemMetrics(SM_XVIRTUALSCREEN), GetSystemMetrics(SM_YVIRTUALSCREEN), GetSystemMetrics(SM_CXVIRTUALSCREEN), GetSystemMetrics(SM_CYVIRTUALSCREEN)).GetSize(&VirtualScreenSize); + + if (MinTrack.Height > VirtualScreenSize.Height) + MinMaxInfo->ptMaxTrackSize.y = INT_MAX; + if (MinTrack.Width > VirtualScreenSize.Width) + MinMaxInfo->ptMaxTrackSize.x = INT_MAX; + } + } + + if (!MaxTrack.Empty()) + { + MinMaxInfo->ptMaxTrackSize.x = MaxTrack.Width; + MinMaxInfo->ptMaxTrackSize.y = MaxTrack.Height; + } + + Msg.Result = (uintptr_t)0; + } + + void Form::WmWindowPosChanged(Message& Msg) + { + UpdateWindowState(); + ContainerControl::WndProc(Msg); + } + + void Form::WmNcPaint(Message& Msg) + { + auto InRgn = (HRGN)Msg.WParam; + HDC DC = nullptr; + + if (InRgn != (HRGN)1) + DC = GetDCEx((HWND)Msg.HWnd, InRgn, DCX_WINDOW | DCX_USESTYLE | DCX_LOCKWINDOWUPDATE | DCX_INTERSECTRGN | DCX_NODELETERGN); + else + DC = GetDCEx((HWND)Msg.HWnd, InRgn, DCX_WINDOW | DCX_USESTYLE | DCX_LOCKWINDOWUPDATE); + + OnPaintFrame(std::make_unique(DC, Drawing::Rectangle(0, 0, this->_Width, this->_Height), this->Active())); + + ReleaseDC((HWND)Msg.HWnd, DC); + + Msg.Result = (uintptr_t)0; + } + + void Form::WmNcActivate(Message& Msg) + { + HRGN InRgn = nullptr; + HDC DC = nullptr; + auto Flags = DCX_WINDOW | DCX_USESTYLE | DCX_LOCKWINDOWUPDATE; + + InRgn = ContainerControl::CreateCopyOfRgn((HRGN)Msg.LParam); + + if (InRgn) + Flags |= DCX_INTERSECTRGN; + + if ((DC = GetDCEx((HWND)Msg.HWnd, InRgn, Flags)) == NULL) + { + DeleteObject(InRgn); + return; + } + + RECT Rc; + RECT RcWnd; + GetWindowRect((HWND)Msg.HWnd, &RcWnd); + GetClientRect((HWND)Msg.HWnd, &Rc); + + MapWindowPoints((HWND)Msg.HWnd, NULL, (LPPOINT)&Rc, 1); + + Rc.left -= RcWnd.left; + Rc.top -= RcWnd.top; + Rc.right += Rc.left; + Rc.bottom += Rc.top; + + ExcludeClipRect(DC, Rc.left, Rc.top, Rc.right, Rc.bottom); + + OnPaintFrame(std::make_unique(DC, Drawing::Rectangle(0, 0, this->_Width, this->_Height), (bool)Msg.WParam)); + + if (InRgn) + DeleteObject(InRgn); + ReleaseDC((HWND)Msg.HWnd, DC); + + Msg.Result = (uintptr_t)1; // Resume normal processing + } + + void Form::WmActivate(Message& Msg) + { + this->SetActive((bool)((int16_t)LOWORD(Msg.WParam) != WA_INACTIVE)); + // TODO: Application.FormActivated(this.Modal, Value); + } + + void Form::WmCreate(Message& Msg) + { + ContainerControl::WndProc(Msg); + + STARTUPINFOA Si{}; + GetStartupInfoA(&Si); + + if (GetState(ControlStates::StateTopLevel) && (Si.dwFlags & STARTF_USESHOWWINDOW) != 0) + { + switch (Si.wShowWindow) + { + case SW_MAXIMIZE: + this->SetWindowState(FormWindowState::Maximized); + break; + case SW_MINIMIZE: + this->SetWindowState(FormWindowState::Minimized); + break; + } + } + } + + void Form::FillInCreateParamsBorderStyles(CreateParams& Cp) + { + switch (_FormBorderStyle) + { + case FormBorderStyle::FixedSingle: + Cp.Style |= WS_BORDER; + break; + case FormBorderStyle::Sizable: + Cp.Style |= WS_BORDER | WS_THICKFRAME; + break; + case FormBorderStyle::Fixed3D: + Cp.Style |= WS_BORDER; + Cp.ExStyle |= WS_EX_CLIENTEDGE; + break; + case FormBorderStyle::FixedDialog: + Cp.Style |= WS_BORDER; + Cp.ExStyle |= WS_EX_DLGMODALFRAME; + break; + case FormBorderStyle::FixedToolWindow: + Cp.Style |= WS_BORDER; + Cp.ExStyle |= WS_EX_TOOLWINDOW; + break; + case FormBorderStyle::SizeableToolWindow: + Cp.Style |= WS_BORDER | WS_THICKFRAME; + Cp.ExStyle |= WS_EX_TOOLWINDOW; + break; + } + } + + void Form::FillInCreateParamsWindowState(CreateParams& Cp) + { + switch (_FormWindowState) + { + case FormWindowState::Maximized: + Cp.Style |= WS_MAXIMIZE; + break; + case FormWindowState::Minimized: + Cp.Style |= WS_MINIMIZE; + break; + } + } + + void Form::FillInCreateParamsBorderIcons(CreateParams& Cp) + { + if (_FormBorderStyle == FormBorderStyle::None) + return; + + if (Text().Length() != 0) + Cp.Style |= WS_CAPTION; + + if (ControlBox()) + Cp.Style |= WS_SYSMENU | WS_CAPTION; + else + Cp.Style &= (~WS_SYSMENU); + + if (MaximizeBox()) + Cp.Style |= WS_MAXIMIZEBOX; + else + Cp.Style &= (~WS_MAXIMIZEBOX); + + if (MinimizeBox()) + Cp.Style |= WS_MINIMIZEBOX; + else + Cp.Style &= (~WS_MINIMIZEBOX); + + Cp.ExStyle &= (~WS_EX_CONTEXTHELP); + } + + void Form::FillInCreateParamsStartPosition(CreateParams& Cp) + { + switch (_FormStartPosition) + { + case FormStartPosition::WindowsDefaultBounds: + Cp.Width = CW_USEDEFAULT; + Cp.Height = CW_USEDEFAULT; + Cp.X = CW_USEDEFAULT; + Cp.Y = CW_USEDEFAULT; + break; + case FormStartPosition::WindowsDefaultLocation: + case FormStartPosition::CenterParent: + Cp.X = CW_USEDEFAULT; + Cp.Y = CW_USEDEFAULT; + break; + case FormStartPosition::CenterScreen: + if (_FormWindowState != FormWindowState::Maximized) + { + // Calculate X / Y based on our width/height + HMONITOR MonHandle = nullptr; + + if (_Parent != nullptr) + MonHandle = MonitorFromWindow(_Parent->GetHandle(), MONITOR_DEFAULTTONEAREST); + else + { + auto CursorPos = ContainerControl::GetMousePosition(); + MonHandle = MonitorFromPoint({ CursorPos.X, CursorPos.Y }, MONITOR_DEFAULTTONEAREST); + } + + if (MonHandle != nullptr) + { + MONITORINFO Info; + Info.cbSize = sizeof(Info); + GetMonitorInfo(MonHandle, &Info); + + Cp.X = max((uint32_t)Info.rcWork.left, (Info.rcWork.left + Info.rcWork.right) / 2 - Cp.Width / 2); + Cp.Y = max((uint32_t)Info.rcWork.top, (Info.rcWork.top + Info.rcWork.bottom) / 2 - Cp.Height / 2); + } + } + break; + } + } + + void Form::UpdateWindowState() + { + if (!GetState(ControlStates::StateCreated)) + return; + + auto OldState = WindowState(); + + WINDOWPLACEMENT Wp{}; + Wp.length = sizeof(WINDOWPLACEMENT); + GetWindowPlacement(this->_Handle, &Wp); + + switch (Wp.showCmd) + { + case SW_NORMAL: + case SW_RESTORE: + case SW_SHOW: + case SW_SHOWNA: + case SW_SHOWNOACTIVATE: + _FormWindowState = FormWindowState::Normal; + break; + case SW_SHOWMAXIMIZED: + _FormWindowState = FormWindowState::Maximized; + break; + case SW_SHOWMINIMIZED: + case SW_MINIMIZE: + case SW_SHOWMINNOACTIVE: + _FormWindowState = FormWindowState::Minimized; + break; + } + + switch (WindowState()) + { + case FormWindowState::Normal: + SetState(ControlStates::StateSizeLockedByOS, false); + break; + case FormWindowState::Maximized: + case FormWindowState::Minimized: + SetState(ControlStates::StateSizeLockedByOS, true); + break; + } + + if (OldState != WindowState()) + AdjustSystemMenu(); + } + + void Form::AdjustSystemMenu() + { + if (GetState(ControlStates::StateCreated)) + { + auto hMenu = GetSystemMenu(this->_Handle, false); + AdjustSystemMenu(hMenu); + } + } + + void Form::AdjustSystemMenu(HMENU Menu) + { + UpdateWindowState(); + + auto WinState = WindowState(); + auto BorderStyle = GetFormBorderStyle(); + bool SizableBorder = (BorderStyle == FormBorderStyle::SizeableToolWindow || BorderStyle == FormBorderStyle::Sizable); + + bool ShowMin = MinimizeBox() && WinState != FormWindowState::Minimized; + bool ShowMax = MaximizeBox() && WinState != FormWindowState::Maximized; + bool ShowClose = ControlBox(); + bool ShowRestore = WinState != FormWindowState::Normal; + bool ShowSize = SizableBorder && WinState != FormWindowState::Minimized && WinState != FormWindowState::Maximized; + + if (!ShowMin) + EnableMenuItem(Menu, SC_MINIMIZE, MF_BYCOMMAND | MF_GRAYED); + else + EnableMenuItem(Menu, SC_MINIMIZE, MF_BYCOMMAND | MF_ENABLED); + if (!ShowMax) + EnableMenuItem(Menu, SC_MAXIMIZE, MF_BYCOMMAND | MF_GRAYED); + else + EnableMenuItem(Menu, SC_MAXIMIZE, MF_BYCOMMAND | MF_ENABLED); + if (!ShowClose) + EnableMenuItem(Menu, SC_CLOSE, MF_BYCOMMAND | MF_GRAYED); + else + EnableMenuItem(Menu, SC_CLOSE, MF_BYCOMMAND | MF_ENABLED); + if (!ShowRestore) + EnableMenuItem(Menu, SC_RESTORE, MF_BYCOMMAND | MF_GRAYED); + else + EnableMenuItem(Menu, SC_RESTORE, MF_BYCOMMAND | MF_ENABLED); + if (!ShowSize) + EnableMenuItem(Menu, SC_SIZE, MF_BYCOMMAND | MF_GRAYED); + else + EnableMenuItem(Menu, SC_SIZE, MF_BYCOMMAND | MF_ENABLED); + } + + void Form::SetDefaultButton(Control* Btn) + { + if (_DefaultButton != Btn) + { + if (_DefaultButton != nullptr) + ((Button*)_DefaultButton)->NotifyDefault(false); + + _DefaultButton = Btn; + + if (Btn != nullptr) + ((Button*)Btn)->NotifyDefault(true); + } + } + + void Form::CenterToParent() + { + auto HwndOwner = (HWND)GetWindowLongPtr(this->_Handle, GWLP_HWNDPARENT); + + if (HwndOwner != NULL) + { + auto Screen = MonitorFromWindow(HwndOwner, MONITOR_DEFAULTTONEAREST); + + MONITORINFO Mi; + Mi.cbSize = sizeof(Mi); + GetMonitorInfo(Screen, &Mi); + + RECT OwnerRect{}; + GetWindowRect(HwndOwner, &OwnerRect); + + auto SizeCache = this->Size(); + Drawing::Point Point(0, 0); + + Point.X = (OwnerRect.left + OwnerRect.right - SizeCache.Width) / 2; + if (Point.X < Mi.rcWork.left) + Point.X = Mi.rcWork.left; + else if (Point.X + SizeCache.Width > Mi.rcWork.right) + Point.X = Mi.rcWork.right - SizeCache.Width; + + Point.Y = (OwnerRect.top + OwnerRect.bottom - SizeCache.Height) / 2; + if (Point.Y < Mi.rcWork.top) + Point.Y = Mi.rcWork.top; + else if (Point.Y + SizeCache.Height > Mi.rcWork.bottom) + Point.Y = Mi.rcWork.bottom - SizeCache.Height; + + this->SetLocation(Point); + } + else + { + CenterToScreen(); + } + } + + void Form::CenterToScreen() + { + Drawing::Point Point(0, 0); + HMONITOR Desktop = nullptr; + + if (_Owner != nullptr) + { + Desktop = MonitorFromWindow(_Owner->GetHandle(), MONITOR_DEFAULTTONEAREST); + } + else + { + auto HwndOwner = (HWND)GetWindowLongPtr(this->_Handle, GWLP_HWNDPARENT); + + if (HwndOwner != NULL) + Desktop = MonitorFromWindow(HwndOwner, MONITOR_DEFAULTTONEAREST); + else + { + auto Cursor = ContainerControl::GetMousePosition(); + Desktop = MonitorFromPoint({ Cursor.X, Cursor.Y }, MONITOR_DEFAULTTONEAREST); + } + } + + MONITORINFO Info; + Info.cbSize = sizeof(Info); + GetMonitorInfo(Desktop, &Info); + + Point.X = max((uint32_t)Info.rcWork.left, (Info.rcWork.left + Info.rcWork.right) / 2 - this->_Width / 2); + Point.Y = max((uint32_t)Info.rcWork.top, (Info.rcWork.top + Info.rcWork.bottom) / 2 - this->_Height / 2); + + this->SetLocation(Point); + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/Form.h b/r5dev/thirdparty/cppnet/cppkore/Form.h new file mode 100644 index 00000000..32d6f267 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Form.h @@ -0,0 +1,251 @@ +#pragma once + +#include +#include +#include +#include "Icon.h" +#include "Control.h" +#include "ContainerControl.h" +#include "DialogResult.h" +#include "CloseReason.h" +#include "FormBorderStyle.h" +#include "FormWindowState.h" +#include "FormStartPosition.h" +#include "FormClosedEventArgs.h" +#include "FormClosingEventArgs.h" +#include "PaintFrameEventArgs.h" + +namespace Forms +{ + class Form : public ContainerControl + { + public: + Form(); + virtual ~Form() = default; + + // Gets the border style of the form. + FormBorderStyle GetFormBorderStyle(); + // Sets the border style of the form. + void SetFormBorderStyle(FormBorderStyle Value); + + // Gets a value indicating whether a control box is displayed in the + // caption bar of the form. + bool ControlBox(); + // Sets a value indicating whether a control box is displayed in the + // caption bar of the form. + void SetControlBox(bool Value); + + // Gets the dialog result for the form. + DialogResult GetDialogResult(); + // Sets the dialog result for the form. + void SetDialogResult(DialogResult Value); + + // Gets a value indicating whether the maximize button is + // displayed in the caption bar of the form. + bool MaximizeBox(); + // Sets a value indicating whether the maximize button is + // displayed in the caption bar of the form. + void SetMaximizeBox(bool Value); + + // Gets a value indicating whether the minimize button is displayed in the caption bar of the form. + bool MinimizeBox(); + // Sets a value indicating whether the minimize button is displayed in the caption bar of the form. + void SetMinimizeBox(bool Value); + + // If ShowInTaskbar is true then the form will be displayed + // in the Windows Taskbar. + bool ShowInTaskbar(); + // If ShowInTaskbar is true then the form will be displayed + // in the Windows Taskbar. + void SetShowInTaskbar(bool Value); + + // Gets a value indicating whether an icon is displayed in the + // caption bar of the form. + bool ShowIcon(); + // Sets a value indicating whether an icon is displayed in the + // caption bar of the form. + void SetShowIcon(bool Value); + + // Gets the icon displayed on this form. + std::unique_ptr& Icon(); + // Sets the icon displayed on this form. + void SetIcon(std::unique_ptr&& Value); + + // Gets the starting position of the form at run time. + FormStartPosition StartPosition(); + // Sets the starting position of the form at run time. + void SetStartPosition(FormStartPosition Value); + + // Gets a value indicating whether the form should be displayed as the top-most + // form of your application. + bool TopMost(); + // Sets a value indicating whether the form should be displayed as the top-most + // form of your application. + void SetTopMost(bool Value); + + // Gets the form's window state. + FormWindowState WindowState(); + // Sets the form's window state. + void SetWindowState(FormWindowState Value); + + // Activates the form and gives it focus. + void Activate(); + + // Checks whether a modal dialog is ready to close. + bool CheckCloseDialog(bool ClosingOnly); + + // Closes the form. + void Close(); + + // Displays this form as a model dialog box with no owner window. (You MUST clean up the dialog) + DialogResult ShowDialog(); + // Displays this form as a model dialog with the specified owner. (You MUST clean up the dialog) + DialogResult ShowDialog(Form* Owner); + + // Gets the form that owns this form. + Form* Owner(); + // Sets the form that owns this form. + void SetOwner(Form* Value); + + // Gets whether or not to render a custom form frame. (OnPaintFrame) + bool UseCustomFrame(); + // Sets whether or not to render a custom form frame. (OnPaintFrame) + void SetUseCustomFrame(bool Value); + + // Gets whether or not the form is active. + bool Active(); + // Sets whether or not the form is active. + void SetActive(bool Value); + + // Gets the opacity value for this form. + uint8_t Opacity(); + // Sets the opacity value for this form (0-255). + void SetOpacity(uint8_t Value); + + // Updates the default button based on current selection + void UpdateDefaultButton(); + + // We must define control event bases here + virtual void OnLoad(); + virtual void OnHandleCreated(); + virtual void OnStyleChanged(); + virtual void OnEnabledChanged(); + virtual void OnActivated(); + virtual void OnDeactivate(); + virtual void OnClosing(const std::unique_ptr& EventArgs); + virtual void OnFormClosing(const std::unique_ptr& EventArgs); + virtual void OnClosed(const std::unique_ptr& EventArgs); + virtual void OnFormClosed(const std::unique_ptr& EventArgs); + virtual void OnPaintFrame(const std::unique_ptr& EventArgs); + + // We must define event handlers here + EventBase Load; + EventBase Activated; + EventBase Deactivate; + EventBase&, Control*)> Closing; + EventBase&, Control*)> FormClosing; + EventBase&, Control*)> Closed; + EventBase&, Control*)> FormClosed; + EventBase&, Control*)> PaintFrame; + + // Add a control to this form. + virtual void AddControl(Control* Ctrl); + // Used to properly clean up the control. + virtual void Dispose(); + // Override WndProc for specific form messages. + virtual void WndProc(Message& Msg); + + protected: + // Get custom control creation parameters for this instance. + virtual CreateParams GetCreateParams(); + + // The owner form, if any + Form* _Owner; + + // Gets whether or not closing has been called. + bool CalledClosing(); + // Sets whether or not closing has been called. + void SetCalledClosing(bool Value); + + // Gets whether or not create control has been called. + bool CalledCreateControl(); + // Sets whether or not create control has been called. + void SetCalledCreateControl(bool Value); + + // Gets whether or not make visible has been called. + bool CalledMakeVisible(); + // Sets whether or not make visible has been called. + void SetCalledMakeVisible(bool Value); + + // Gets whether or not on load has been called. + bool CalledOnLoad(); + // Sets whether or not on load has been called. + void SetCalledOnLoad(bool Value); + + // Gets a value that determines whether the window is closing. + bool IsClosing(); + // Sets a value that determines whether the window is closing. + void SetIsClosing(bool Value); + + // Gets a value that determine whether we show the window on create. + bool ShowWindowOnCreate(); + // Sets a value that determine whether we show the window on create. + void SetShowWindowOnCreate(bool Value); + + // Internal routine to change control visibility. + virtual void SetVisibleCore(bool Value); + + private: + // Internal cached flags + FormBorderStyle _FormBorderStyle; + FormWindowState _FormWindowState; + FormStartPosition _FormStartPosition; + DialogResult _DialogResult; + CloseReason _CloseReason; + uint8_t _Opacity; + + // The default button for this form, if any + Control* _DefaultButton; + + // Internal shared form flags + std::bitset<14> _FormStateFlags; + + // Internal icon handle + std::unique_ptr _Icon; + + // We must define each window message handler here... + void WmClose(Message& Msg); + void WmSysCommand(Message& Msg); + void WmEraseBkgnd(Message& Msg); + void WmGetMinMaxInfo(Message& Msg); + void WmWindowPosChanged(Message& Msg); + void WmNcPaint(Message& Msg); + void WmNcActivate(Message& Msg); + void WmActivate(Message& Msg); + void WmCreate(Message& Msg); + + // Internal routine to setup the border styles + void FillInCreateParamsBorderStyles(CreateParams& Cp); + // Internal routine to setup the window state + void FillInCreateParamsWindowState(CreateParams& Cp); + // Internal routine to setup the border icons + void FillInCreateParamsBorderIcons(CreateParams& Cp); + // Internal routine to setup the start position + void FillInCreateParamsStartPosition(CreateParams& Cp); + + // Updates the internal window state + void UpdateWindowState(); + // This forces the SystemMenu to look like we want + void AdjustSystemMenu(); + // This forces the SystemMenu to look like we want + void AdjustSystemMenu(HMENU Menu); + + // Sets up the default button + void SetDefaultButton(Control* Btn); + + // Centers the form to the parent + void CenterToParent(); + // Centers the form to the screen + void CenterToScreen(); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/FormBorderStyle.h b/r5dev/thirdparty/cppnet/cppkore/FormBorderStyle.h new file mode 100644 index 00000000..7cd76196 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/FormBorderStyle.h @@ -0,0 +1,25 @@ +#pragma once + +#include + +namespace Forms +{ + // Specifies the border styles for a form. + enum class FormBorderStyle + { + // No border. + None = 0, + // A fixed, single line border. + FixedSingle = 1, + // A fixed, three-dimensional border. + Fixed3D = 2, + // A thick, fixed dialog-style border. + FixedDialog = 3, + // A resizable border. + Sizable = 4, + // A tool window border that is not resizable. + FixedToolWindow = 5, + // A resizable tool window border. + SizeableToolWindow = 6 + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/FormClosedEventArgs.cpp b/r5dev/thirdparty/cppnet/cppkore/FormClosedEventArgs.cpp new file mode 100644 index 00000000..fb7a43f7 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/FormClosedEventArgs.cpp @@ -0,0 +1,10 @@ +#include "stdafx.h" +#include "FormClosedEventArgs.h" + +namespace Forms +{ + FormClosedEventArgs::FormClosedEventArgs(CloseReason Reason) + : Reason(Reason) + { + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/FormClosedEventArgs.h b/r5dev/thirdparty/cppnet/cppkore/FormClosedEventArgs.h new file mode 100644 index 00000000..42cab840 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/FormClosedEventArgs.h @@ -0,0 +1,18 @@ +#pragma once + +#include +#include "CloseReason.h" + +namespace Forms +{ + // Provides data for the on closed event. + class FormClosedEventArgs + { + public: + FormClosedEventArgs(CloseReason Reason); + ~FormClosedEventArgs() = default; + + // Provides the reason for the form close. + CloseReason Reason; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/FormClosingEventArgs.cpp b/r5dev/thirdparty/cppnet/cppkore/FormClosingEventArgs.cpp new file mode 100644 index 00000000..742ac27e --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/FormClosingEventArgs.cpp @@ -0,0 +1,10 @@ +#include "stdafx.h" +#include "FormClosingEventArgs.h" + +namespace Forms +{ + FormClosingEventArgs::FormClosingEventArgs(CloseReason Reason, bool Cancel) + : CancelEventArgs(Cancel), Reason(Reason) + { + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/FormClosingEventArgs.h b/r5dev/thirdparty/cppnet/cppkore/FormClosingEventArgs.h new file mode 100644 index 00000000..321d422c --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/FormClosingEventArgs.h @@ -0,0 +1,19 @@ +#pragma once + +#include +#include "CancelEventArgs.h" +#include "CloseReason.h" + +namespace Forms +{ + // Provides data for the on closing event. + class FormClosingEventArgs : public CancelEventArgs + { + public: + FormClosingEventArgs(CloseReason Reason, bool Cancel); + ~FormClosingEventArgs() = default; + + // Provides the reason for the form close. + CloseReason Reason; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/FormStartPosition.h b/r5dev/thirdparty/cppnet/cppkore/FormStartPosition.h new file mode 100644 index 00000000..9c288a77 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/FormStartPosition.h @@ -0,0 +1,25 @@ +#pragma once + +#include + +namespace Forms +{ + // Specifies the initial position of a form. + enum class FormStartPosition + { + // The location and size of the form will determine its + // starting position. + Manual = 0, + // The form is centered on the current display, + // and has the dimensions specified in the form's size. + CenterScreen = 1, + // The form is positioned at the Windows default + // location and has the dimensions specified in the form's size. + WindowsDefaultLocation = 2, + // The form is positioned at the Windows default + // location and has the bounds determined by Windows default. + WindowsDefaultBounds = 3, + // The form is centered within the bounds of its parent form. + CenterParent = 4 + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/FormWindowState.h b/r5dev/thirdparty/cppnet/cppkore/FormWindowState.h new file mode 100644 index 00000000..13e30def --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/FormWindowState.h @@ -0,0 +1,17 @@ +#pragma once + +#include + +namespace Forms +{ + // Specifies how a form window is displayed. + enum class FormWindowState + { + // A default sized window. + Normal = 0, + // A minimized window. + Minimized = 1, + // A maximized window. + Maximized = 2 + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/GroupBox.cpp b/r5dev/thirdparty/cppnet/cppkore/GroupBox.cpp new file mode 100644 index 00000000..be0947f0 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/GroupBox.cpp @@ -0,0 +1,123 @@ +#include "stdafx.h" +#include "GroupBox.h" + +namespace Forms +{ + GroupBox::GroupBox() + : Control(), _OwnerDraw(false), _FlatStyle(FlatStyle::Standard) + { + SetStyle(ControlStyles::ContainerControl, true); + + SetStyle(ControlStyles::SupportsTransparentBackColor | + ControlStyles::UserPaint | + ControlStyles::ResizeRedraw, this->_OwnerDraw); + + SetStyle(ControlStyles::Selectable, false); + + // Setup the container + this->_Controls = std::make_unique(); + + // We are a group box control + this->_RTTI = ControlTypes::GroupBox; + } + + bool GroupBox::OwnerDraw() + { + return this->_OwnerDraw; + } + + void GroupBox::SetOwnerDraw(bool Value) + { + this->_OwnerDraw = Value; + + SetStyle(ControlStyles::SupportsTransparentBackColor | ControlStyles::UserPaint | ControlStyles::ResizeRedraw, this->_OwnerDraw); + + UpdateStyles(); + Invalidate(); + } + + FlatStyle GroupBox::GetFlatStyle() + { + return this->_FlatStyle; + } + + void GroupBox::SetFlatStyle(FlatStyle Value) + { + this->_FlatStyle = Value; + + Invalidate(); + + // Force update styles... + SetStyle(ControlStyles::SupportsTransparentBackColor | ControlStyles::UserPaint | ControlStyles::ResizeRedraw, this->_OwnerDraw); + UpdateStyles(); + } + + void GroupBox::AddControl(Control* Ctrl) + { + Control::AddControl(Ctrl); + } + + void GroupBox::WndProc(Message& Msg) + { + if (this->_OwnerDraw) + { + Control::WndProc(Msg); + return; + } + + switch (Msg.Msg) + { + case WM_ERASEBKGND: + case WM_PRINTCLIENT: + WmEraseBkgnd(Msg); + break; + case WM_GETOBJECT: + Control::WndProc(Msg); + + // This allows MSAA to traverse the children of this control when we use + // the button class + if ((int)Msg.LParam == OBJID_QUERYCLASSNAMEIDX) + Msg.Result = (uintptr_t)0; + break; + default: + Control::WndProc(Msg); + break; + } + } + + CreateParams GroupBox::GetCreateParams() + { + auto Cp = Control::GetCreateParams(); + + if (!this->_OwnerDraw) + { + Cp.ClassName = "BUTTON"; + Cp.Style |= BS_GROUPBOX; + } + else + { + Cp.ClassName = ""; + Cp.Style &= ~BS_GROUPBOX; + } + + return Cp; + } + + void GroupBox::WmEraseBkgnd(Message& Msg) + { + RECT Rc{}; + GetClientRect(this->_Handle, &Rc); + + auto Gfx = Drawing::Graphics::FromHDC((HDC)Msg.WParam); + auto Brush = Drawing::SolidBrush(this->BackColor()); + + if (Gfx) + { + Gfx->FillRectangle(&Brush, Drawing::Rectangle(Rc.left, Rc.top, Rc.right - Rc.left, Rc.bottom - Rc.top)); + delete Gfx; + } + + // Handled + Msg.Result = (uintptr_t)1; + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/GroupBox.h b/r5dev/thirdparty/cppnet/cppkore/GroupBox.h new file mode 100644 index 00000000..2f88550a --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/GroupBox.h @@ -0,0 +1,47 @@ +#pragma once + +#include +#include "Control.h" +#include "FlatStyle.h" +#include "BorderStyle.h" +#include "ContentAlignment.h" + +namespace Forms +{ + // Encapsulates a standard Windows group box. + class GroupBox : public Control + { + public: + GroupBox(); + virtual ~GroupBox() = default; + + // Gets the drawing mode of the group box control. + bool OwnerDraw(); + // Sets the drawing mode of the group box control. + void SetOwnerDraw(bool Value); + + // Gets the flat style appearance of the label control. + FlatStyle GetFlatStyle(); + // Sets the flat style appearance of the label control. + void SetFlatStyle(FlatStyle Value); + + // Add a control to this group box. + virtual void AddControl(Control* Ctrl); + + // Override WndProc for specific group box messages. + virtual void WndProc(Message& Msg); + + protected: + // Get custom control creation parameters for this instance. + virtual CreateParams GetCreateParams(); + + private: + // Whether or not the control will draw itself + bool _OwnerDraw; + // Controls the style of the control + FlatStyle _FlatStyle; + + // We must define each window message handler here... + void WmEraseBkgnd(Message& Msg); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Half.cpp b/r5dev/thirdparty/cppnet/cppkore/Half.cpp new file mode 100644 index 00000000..8ce4b39d --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Half.cpp @@ -0,0 +1,74 @@ +#include "stdafx.h" +#include "Half.h" + +namespace Math +{ + Half::Half() + : Half(0.0f) + { + } + + Half::Half(float Value) + { + FloatBits v, s; + v.f = Value; + + uint32_t sign = v.si & signN; + v.si ^= sign; + + sign >>= shiftSign; + s.si = mulN; + + s.si = (int32_t)(s.f * v.f); + v.si ^= (s.si ^ v.si) & -(minN > v.si); + v.si ^= (infN ^ v.si) & -((infN > v.si) & (v.si > maxN)); + v.si ^= (nanN ^ v.si) & -((nanN > v.si) & (v.si > infN)); + + v.ui >>= shift; + v.si ^= ((v.si - maxD) ^ v.si) & -(v.si > maxC); + v.si ^= ((v.si - minD) ^ v.si) & -(v.si > subC); + + this->Value = (v.ui | sign); + } + + Half::Half(uint16_t Value) + : Value(Value) + { + } + + float Half::ToFloat() + { + FloatBits v, s; + v.ui = this->Value; + + int32_t sign = v.si & signC; + v.si ^= sign; + sign <<= shiftSign; + v.si ^= ((v.si + minD) ^ v.si) & -(v.si > subC); + v.si ^= ((v.si + maxD) ^ v.si) & -(v.si > maxC); + + s.si = mulC; + s.f *= v.si; + int32_t mask = -(norC > v.si); + v.si <<= shift; + v.si ^= (s.si ^ v.si) & mask; + v.si |= sign; + + return v.f; + } + + uint16_t Half::ToHalf() + { + return this->Value; + } + + uint16_t Half::ToHalf(float Value) + { + return Half(Value).ToHalf(); + } + + float Half::ToFloat(uint16_t Value) + { + return Half(Value).ToFloat(); + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/Half.h b/r5dev/thirdparty/cppnet/cppkore/Half.h new file mode 100644 index 00000000..31eb9d3b --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Half.h @@ -0,0 +1,76 @@ +#pragma once + +#include + +namespace Math +{ + // Represents a 16bit floating point value. + class Half + { + public: + Half(); + Half(float Value); + Half(uint16_t Value); + ~Half() = default; + + // Converts the float 16bit value to a 32bit float. + float ToFloat(); + // Converts the float 32bit value to a 16bit float. + uint16_t ToHalf(); + + // Converts the float 32bit value to a 16bit float. + static uint16_t ToHalf(float Value); + // Convert the float 16bit value to a 32bit float. + static float ToFloat(uint16_t Value); + + private: + // Internal value + uint16_t Value; + + // Represents the different casts of a float + union FloatBits + { + float f; + int32_t si; + uint32_t ui; + }; + + // Shift value + static int constexpr shift = 13; + // Sign used to shift + static int constexpr shiftSign = 16; + + // Infinity of a float + static int32_t constexpr infN = 0x7F800000; + // Maximum value of a half float + static int32_t constexpr maxN = 0x477FE000; + // Minimum value of a half float + static int32_t constexpr minN = 0x38800000; + // Sign bit of a float + static int32_t constexpr signN = 0x80000000; + + // Precalculated properties of a half float + static int32_t constexpr infC = infN >> shift; + static int32_t constexpr nanN = (infC + 1) << shift; + static int32_t constexpr maxC = maxN >> shift; + static int32_t constexpr minC = minN >> shift; + static int32_t constexpr signC = signN >> shiftSign; + + // Precalculated (1 << 23) / minN + static int32_t constexpr mulN = 0x52000000; + // Precalculated minN / (1 << (23 - shift)) + static int32_t constexpr mulC = 0x33800000; + + // Max float subnormal down shifted + static int32_t constexpr subC = 0x003FF; + // Min float normal down shifted + static int32_t constexpr norC = 0x00400; + + // Precalculated min and max decimals + static int32_t constexpr maxD = infC - maxC - 1; + static int32_t constexpr minD = minC - subC - 1; + }; + + // A 16bit floating point value. + using half_t = Half; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/HandledMouseEventArgs.cpp b/r5dev/thirdparty/cppnet/cppkore/HandledMouseEventArgs.cpp new file mode 100644 index 00000000..eb94e17a --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/HandledMouseEventArgs.cpp @@ -0,0 +1,10 @@ +#include "stdafx.h" +#include "HandledMouseEventArgs.h" + +namespace Forms +{ + HandledMouseEventArgs::HandledMouseEventArgs(MouseButtons Button, uint32_t Clicks, int32_t X, int32_t Y, int32_t Delta) + : MouseEventArgs(Button, Clicks, X, Y, Delta), Handled(false) + { + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/HandledMouseEventArgs.h b/r5dev/thirdparty/cppnet/cppkore/HandledMouseEventArgs.h new file mode 100644 index 00000000..576a29a0 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/HandledMouseEventArgs.h @@ -0,0 +1,20 @@ +#pragma once + +#include +#include "MouseButtons.h" +#include "MouseEventArgs.h" + +namespace Forms +{ + // Provides data for all mouse events + class HandledMouseEventArgs : public MouseEventArgs + { + public: + HandledMouseEventArgs() = default; + HandledMouseEventArgs(MouseButtons Button, uint32_t Clicks, int32_t X, int32_t Y, int32_t Delta); + ~HandledMouseEventArgs() = default; + + // Whether or not the event was pre handled... + bool Handled; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/HashComparer.h b/r5dev/thirdparty/cppnet/cppkore/HashComparer.h new file mode 100644 index 00000000..4ba92ad6 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/HashComparer.h @@ -0,0 +1,23 @@ +#pragma once + +#include +#include "XXHash.h" + +template +struct HashComparer +{ + constexpr static uint64_t GetHashCode(TType& Value) + { + if constexpr (std::is_arithmetic::value) + return Hashing::XXHash::HashValue(Value); + else if constexpr (std::is_enum::value) + return Hashing::XXHash::HashValue((uint32_t)Value); + else if constexpr (std::is_same::value) + return Hashing::XXHash::HashString(Value); + } + + constexpr static bool Equals(TType& Lhs, TType& Rhs) + { + return (Lhs == Rhs); + } +}; \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/HashHelpers.h b/r5dev/thirdparty/cppnet/cppkore/HashHelpers.h new file mode 100644 index 00000000..721c4ad8 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/HashHelpers.h @@ -0,0 +1,78 @@ +#pragma once + +#include +#include +#include + +// Provides data for various hashtable implementations +class HashHelpers +{ +private: + + // Pre-calculated table of primes + constexpr static const int Primes[] = + { + 3, 7, 11, 17, 23, 29, 37, 47, 59, 71, 89, 107, 131, 163, 197, 239, 293, 353, 431, 521, 631, 761, 919, + 1103, 1327, 1597, 1931, 2333, 2801, 3371, 4049, 4861, 5839, 7013, 8419, 10103, 12143, 14591, + 17519, 21023, 25229, 30293, 36353, 43627, 52361, 62851, 75431, 90523, 108631, 130363, 156437, + 187751, 225307, 270371, 324449, 389357, 467237, 560689, 672827, 807403, 968897, 1162687, 1395263, + 1674319, 2009191, 2411033, 2893249, 3471899, 4166287, 4999559, 5999471, 7199369 + }; + + // A good hash prime value + constexpr static int HashPrime = 101; + // This is the maximum prime smaller than array length + constexpr static int MaxPrimeArrayLength = 0x7FEFFFFD; + +public: + + // Threshhold used when calculating hashes + constexpr static int HashCollisionThreshhold = 100; + + // Calculates whether or not the candidate is a prime number + constexpr static bool IsPrime(uint32_t Candidate) + { + if ((Candidate & 1) != 0) + { + auto Limit = (uint32_t)std::sqrt(Candidate); + for (uint32_t Divisor = 3; Divisor <= Limit; Divisor += 2) + { + if ((Candidate % Divisor) == 0) + return false; + } + + return true; + } + + return (Candidate == 2); + } + + // Gets the nearest prime number + constexpr static uint32_t GetPrime(uint32_t Min) + { + for (const auto& Prime : Primes) + { + if ((uint32_t)Prime >= Min) + return Prime; + } + + for (uint32_t i = (Min | 1); i < INT32_MAX; i += 2) + { + if (IsPrime(i) && ((i - 1) % HashPrime != 0)) + return i; + } + + return Min; + } + + // Returns the new prime size + constexpr static uint32_t ExpandPrime(uint32_t OldSize) + { + auto NewSize = 2 * OldSize; + + if (NewSize > MaxPrimeArrayLength && MaxPrimeArrayLength > OldSize) + return MaxPrimeArrayLength; + + return GetPrime(NewSize); + } +}; \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/HorizontalAlignment.h b/r5dev/thirdparty/cppnet/cppkore/HorizontalAlignment.h new file mode 100644 index 00000000..9e6a68a6 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/HorizontalAlignment.h @@ -0,0 +1,18 @@ +#pragma once + +#include + +namespace Forms +{ + // Specifies how an object or text in a control is + // horizontally aligned relative to an element of the control. + enum class HorizontalAlignment + { + // The object or text is aligned on the left of the control element. + Left = 0, + // The object or text is aligned on the right of the control element. + Right = 1, + // The object or text is aligned in the center of the control element. + Center = 2 + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/IOError.cpp b/r5dev/thirdparty/cppnet/cppkore/IOError.cpp new file mode 100644 index 00000000..b4807f54 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/IOError.cpp @@ -0,0 +1,70 @@ +#include "stdafx.h" +#include "IOError.h" + +namespace IO +{ + void IOError::StreamNotOpen() + { + throw std::exception("Stream not open"); + } + + void IOError::StreamNoReadSupport() + { + throw std::exception("Read not supported"); + } + + void IOError::StreamNoWriteSupport() + { + throw std::exception("Write not supported"); + } + + void IOError::StreamNoSeekSupport() + { + throw std::exception("Seek not supported"); + } + + void IOError::StreamSetLengthSupport() + { + throw std::exception("SetLength is not supported"); + } + + void IOError::StreamBaseStream() + { + throw std::exception("The underlying stream was closed"); + } + + void IOError::StreamFileNotFound() + { + throw std::exception("The file does not exist"); + } + + void IOError::StreamInUse() + { + throw std::exception("The file is in use by another process or thread"); + } + + void IOError::StreamFileExists() + { + throw std::exception("The file already exists"); + } + + void IOError::StreamPathInvalid() + { + throw std::exception("The file path was invalid"); + } + + void IOError::StreamAccessDenied() + { + throw std::exception("File access was denied"); + } + + void IOError::StreamRootMismatch() + { + throw std::exception("Source and destination path roots must match"); + } + + void IOError::StreamUnknown() + { + throw std::exception("An unknown IO error occured"); + } +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/IOError.h b/r5dev/thirdparty/cppnet/cppkore/IOError.h new file mode 100644 index 00000000..483b2806 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/IOError.h @@ -0,0 +1,35 @@ +#pragma once + +namespace IO +{ + class IOError + { + public: + // Occurs when the stream is closed + static void StreamNotOpen(); + // Occurs when reading is not supported + static void StreamNoReadSupport(); + // Occurs when writing is not supported + static void StreamNoWriteSupport(); + // Occurs when seek is not supported + static void StreamNoSeekSupport(); + // Occurs when setlength is not supported + static void StreamSetLengthSupport(); + // Occurs when the basestream was closed + static void StreamBaseStream(); + // Occurs when the file doesn't exist + static void StreamFileNotFound(); + // Occurs when the file is in use by another process + static void StreamInUse(); + // Occurs when a file already exists + static void StreamFileExists(); + // Occurs when the input path is invalid + static void StreamPathInvalid(); + // Occurs when we don't have enouch permissions + static void StreamAccessDenied(); + // Occurs when the roots of a move operation don't match + static void StreamRootMismatch(); + // Occurs during an unknown stream error + static void StreamUnknown(); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Icon.cpp b/r5dev/thirdparty/cppnet/cppkore/Icon.cpp new file mode 100644 index 00000000..b8bcbe59 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Icon.cpp @@ -0,0 +1,70 @@ +#include "stdafx.h" +#include "Icon.h" +#include "Path.h" +#include "Environment.h" +#include + +namespace Drawing +{ + Icon::Icon() + : _IconHandleSm(nullptr) ,_IconHandleLg(nullptr) + { + } + + Icon::Icon(HICON Icon) + : _IconHandleSm(Icon), _IconHandleLg(Icon) + { + } + + Icon::~Icon() + { + if (_IconHandleSm != nullptr) + DestroyIcon(_IconHandleSm); + if (_IconHandleLg != nullptr) + DestroyIcon(_IconHandleLg); + + _IconHandleLg = nullptr; + _IconHandleLg = nullptr; + } + + HICON Icon::LargeHandle() + { + return this->_IconHandleLg; + } + + HICON Icon::SmallHandle() + { + return this->_IconHandleSm; + } + + std::unique_ptr Icon::FromFile(const string& File) + { + auto Result = std::make_unique(); + + Result->_IconHandleLg = (HICON)LoadImageA(NULL, (char*)File, IMAGE_ICON, GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON), LR_LOADFROMFILE); + Result->_IconHandleSm = (HICON)LoadImageA(NULL, (char*)File, IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_LOADFROMFILE); + + return Result; + } + + std::unique_ptr Icon::FromResource(const int32_t ID) + { + auto Result = std::make_unique(); + + Result->_IconHandleLg = (HICON)LoadImageA(GetModuleHandle(NULL), MAKEINTRESOURCEA(ID), IMAGE_ICON, GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON), NULL); + Result->_IconHandleSm = (HICON)LoadImageA(GetModuleHandle(NULL), MAKEINTRESOURCEA(ID), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), NULL); + + return Result; + } + + std::unique_ptr Icon::ApplicationIcon() + { + auto Result = std::make_unique(); + auto Exe = System::Environment::GetApplication(); + + Result->_IconHandleLg = ExtractIconA(GetModuleHandle(NULL), (const char*)Exe, 0); + Result->_IconHandleSm = Result->_IconHandleLg; + + return Result; + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/Icon.h b/r5dev/thirdparty/cppnet/cppkore/Icon.h new file mode 100644 index 00000000..1be7c8d7 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Icon.h @@ -0,0 +1,35 @@ +#pragma once + +#include +#include +#include "StringBase.h" +#include "DrawingBase.h" + +namespace Drawing +{ + // Represents a drawable windows icon. + class Icon + { + public: + Icon(); + Icon(HICON Icon); + ~Icon(); + + // Gets a handle to the large rendition of this icon. + HICON LargeHandle(); + // Gets a handle to the small rendition of this icon. + HICON SmallHandle(); + + // Loads an icon resouce from a file. + static std::unique_ptr FromFile(const string& File); + // Loads an icon resource from a resource. + static std::unique_ptr FromResource(const int32_t ID); + // Loads the application defined icon. + static std::unique_ptr ApplicationIcon(); + + private: + // The internal icon handles + HICON _IconHandleSm; + HICON _IconHandleLg; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/ImmutableStringBase.h b/r5dev/thirdparty/cppnet/cppkore/ImmutableStringBase.h new file mode 100644 index 00000000..8f8300e6 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ImmutableStringBase.h @@ -0,0 +1,103 @@ +#pragma once + +#include + +template +class ImmutableStringBase +{ +public: + constexpr ImmutableStringBase(const Tchar* Value); + + // Returns a null-terminated string + constexpr const Tchar* ToCString() const; + // Returns the length of the string in characters + constexpr uint32_t Length() const; + + // Standard logical casts + constexpr operator Tchar*(void) const; + constexpr operator const Tchar*(void) const; + + // Iterator definitions, for for(& :) loop + constexpr Tchar* begin() const noexcept; + constexpr Tchar* end() const noexcept; + + // Array index operator + constexpr const Tchar& operator[](uint32_t Index) const; + +private: + uint32_t _StoreSize; + const Tchar* _Buffer; + + // Calculates the length of the string, including the null-terminator + constexpr uint32_t ExpressionLength(const Tchar* Value); +}; + +template +inline constexpr ImmutableStringBase::ImmutableStringBase(const Tchar* Value) + : _StoreSize(ExpressionLength(Value)), _Buffer(Value) +{ +} + +template +inline constexpr const Tchar* ImmutableStringBase::ToCString() const +{ + return (const Tchar*)&this->_Buffer[0]; +} + +template +inline constexpr uint32_t ImmutableStringBase::Length() const +{ + return this->_StoreSize; +} + +template +inline constexpr ImmutableStringBase::operator Tchar*(void) const +{ + return (Tchar*)&this->_Buffer[0]; +} + +template +inline constexpr ImmutableStringBase::operator const Tchar*(void) const +{ + return (const Tchar*)&this->_Buffer[0]; +} + +template +inline constexpr Tchar* ImmutableStringBase::begin() const noexcept +{ + return (Tchar*)&this->_Buffer[0]; +} + +template +inline constexpr Tchar* ImmutableStringBase::end() const noexcept +{ + return (Tchar*)&this->_Buffer[this->_StoreSize]; +} + +template +inline constexpr const Tchar& ImmutableStringBase::operator[](uint32_t Index) const +{ + return this->_Buffer[Index]; +} + +template +inline constexpr uint32_t ImmutableStringBase::ExpressionLength(const Tchar* Value) +{ + if constexpr (sizeof(Tchar) == sizeof(char)) + return (uint32_t)strlen(Value); + else + return (uint32_t)wcslen(Value); +} + +// +// Predefined immutable string types +// + +// An immutable string +using imstring = ImmutableStringBase; +// An immutable string +using ImString = ImmutableStringBase; +// An immutable wide string +using wimstring = ImmutableStringBase; +// An immutable wide string +using WImString = ImmutableStringBase; \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/InternetPortType.h b/r5dev/thirdparty/cppnet/cppkore/InternetPortType.h new file mode 100644 index 00000000..f3900630 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/InternetPortType.h @@ -0,0 +1,14 @@ +#pragma once + +#include + +namespace Net +{ + // Specifies the internet protocol port to use in a Uri request + enum class InternetPortType + { + Default = 0, + Http = 1, + Https = 2 + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/InvalidateEventArgs.cpp b/r5dev/thirdparty/cppnet/cppkore/InvalidateEventArgs.cpp new file mode 100644 index 00000000..8dcd9719 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/InvalidateEventArgs.cpp @@ -0,0 +1,10 @@ +#include "stdafx.h" +#include "InvalidateEventArgs.h" + +namespace Forms +{ + InvalidateEventArgs::InvalidateEventArgs(Drawing::Rectangle InvalidRect) + : InvalidRectangle(InvalidRect) + { + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/InvalidateEventArgs.h b/r5dev/thirdparty/cppnet/cppkore/InvalidateEventArgs.h new file mode 100644 index 00000000..e5a07697 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/InvalidateEventArgs.h @@ -0,0 +1,19 @@ +#pragma once + +#include +#include "DrawingBase.h" + +namespace Forms +{ + // Provides data for the OnInvalidate event + class InvalidateEventArgs + { + public: + InvalidateEventArgs() = default; + InvalidateEventArgs(Drawing::Rectangle InvalidRect); + ~InvalidateEventArgs() = default; + + // The area that was invalidated + Drawing::Rectangle InvalidRectangle; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/ItemActivation.h b/r5dev/thirdparty/cppnet/cppkore/ItemActivation.h new file mode 100644 index 00000000..bbe177a7 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ItemActivation.h @@ -0,0 +1,21 @@ +#pragma once + +#include + +namespace Forms +{ + // Specifies how the user activates items and the appearance + // of items as the mouse cursor moves over them. + enum class ItemActivation + { + // Activate items with a double-click. + // Items do not change appearance. + Standard = 0, + // Activate items with a single click. The cursor changes shape and the item + // text changes color. + OneClick = 1, + // Activate items with a + // double click. The item text changes color. + TwoClick = 2 + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Job.cpp b/r5dev/thirdparty/cppnet/cppkore/Job.cpp new file mode 100644 index 00000000..2ec51a6e --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Job.cpp @@ -0,0 +1,40 @@ +#include "stdafx.h" +#include "Job.h" + +namespace Jobs +{ + Job::Job() + : Job(nullptr, nullptr, true) + { + } + + Job::Job(std::function Task, std::function OnFinished, bool IsAwaiter) + : _Task(std::move(Task)), _Finished(std::move(OnFinished)), _IsFinished(false), _IsAwaiter(IsAwaiter) + { + } + + void Job::Execute() + { + if (_Task != nullptr) + _Task(); + if (_Finished != nullptr) + _Finished(); + + this->_IsFinished = true; + } + + void Job::SetIsFinished() + { + this->_IsFinished = true; + } + + bool Job::IsFinished() + { + return (this->_IsFinished == true); + } + + bool Job::IsAwaiter() + { + return (this->_IsAwaiter == true); + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/Job.h b/r5dev/thirdparty/cppnet/cppkore/Job.h new file mode 100644 index 00000000..67c7f931 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Job.h @@ -0,0 +1,35 @@ +#pragma once + +#include +#include +#include +#include +#include + +namespace Jobs +{ + // Represents a single task to complete on any thread, with optionally a task to complete when finished. + class Job + { + public: + Job(); + Job(std::function Task, std::function OnFinished, bool IsAwaiter); + ~Job() = default; + + // Executes the job, sets the state to finished, and calls the finalizer. + void Execute(); + // Forcefully sets the job state to finished. + void SetIsFinished(); + // Returns whether or not the job is completed. + bool IsFinished(); + // Returns whether or not the job is being used as an awaitable object. + bool IsAwaiter(); + + private: + // Internal cached states for the job + std::function _Task; + std::function _Finished; + std::atomic_bool _IsFinished; + std::atomic_bool _IsAwaiter; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/JobManager.cpp b/r5dev/thirdparty/cppnet/cppkore/JobManager.cpp new file mode 100644 index 00000000..16ae5664 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/JobManager.cpp @@ -0,0 +1,222 @@ +#include "stdafx.h" +#include "JobManager.h" + +namespace Jobs +{ + JobManager::JobManager(const uint32_t Workers, uint32_t DefaultWorkerId) + : _IsActive(true), _OwnerThreadId(std::this_thread::get_id()) + { + for (uint32_t i = 0; i < Workers; i++) + { + _Workers.EmplaceBack(new JobWorker(this, DefaultWorkerId)); + _Threads.Emplace([this, i]() + { + _Workers[i]->Run(); + }).Start(); + } + } + + JobManager::~JobManager() + { + this->HaltAllJobs(); + } + + Job* JobManager::ScheduleJob(std::function Task, std::function OnFinished) + { + if (!this->_IsActive) + return nullptr; + + auto NewJob = new Job(Task, OnFinished, true); + _JobPool.Enqueue(NewJob); + + if (!this->_IsActive) + { + delete NewJob; + return nullptr; + } + + return NewJob; + } + + void JobManager::ScheduleJobNoWait(std::function Task, std::function OnFinished) + { + if (!this->_IsActive) + return; + + auto NewJob = new Job(Task, OnFinished, false); + _JobPool.Enqueue(NewJob); + + if (!this->_IsActive) + { + delete NewJob; + } + } + + void JobManager::WaitForSingleJob(Job* Job) + { + while (!Job->IsFinished()) + std::this_thread::yield(); + + delete Job; + } + + void JobManager::WaitForAllJobs(Job** Jobs, const uint32_t Count) + { + bool AllFinished = false; + while (!AllFinished) + { + AllFinished = true; + for (uint32_t i = 0; i < Count; i++) + { + if (Jobs[i] != nullptr && !Jobs[i]->IsFinished()) + { + AllFinished = false; + break; + } + } + + if (AllFinished) + break; + + std::this_thread::yield(); + } + + for (uint32_t i = 0; i < Count; i++) + delete Jobs[i]; + } + + void JobManager::WaitForAllJobs(List& Jobs) + { + this->WaitForAllJobs(&Jobs[0], Jobs.Count()); + } + + void JobManager::WaitAll(std::function ProgressCallback, std::function CancelCallback) + { + // Must be called by owner thread + if (std::this_thread::get_id() != _OwnerThreadId) + throw std::exception("Must be called by thread that owns JobManager!"); + + // We can store this here, just for dependency tracking... + uint32_t StorageLeft = this->_JobPool.Count(); + std::atomic LastProgress = 0; + + // Flags brought to stack for easy read information... + auto isPoolEmpty = this->_JobPool.IsEmpty(); + auto isWorkersIdle = this->AreWorkersIdle(); + + while (!isPoolEmpty || !isWorkersIdle) + { + std::this_thread::yield(); + + isPoolEmpty = this->_JobPool.IsEmpty(); + isWorkersIdle = this->AreWorkersIdle(); + + if (ProgressCallback != nullptr) + { + auto TempStorage = this->_JobPool.Count(); + + if (TempStorage > StorageLeft) + { + // We got more jobs in the process of processing other jobs + // so the progress is shifted + StorageLeft = TempStorage; + + if (LastProgress != 0) + { + LastProgress = 0; + ProgressCallback(0); + } + } + else + { + // We can convert our progress range here, then abs the value + int32_t ProgressRange = (TempStorage - StorageLeft); + uint32_t Progress = std::abs((int32_t)(((float)ProgressRange / (float)StorageLeft) * 100.0f)); + + if (LastProgress != Progress) + { + LastProgress = Progress; + ProgressCallback(Progress); + } + } + } + + // Break out of the loop if the setup was canceled + if (!this->_IsActive) + break; + + // Check if a cancel callback was provided, and if cancel is confirmed + if (CancelCallback != nullptr && CancelCallback()) + { + this->Cancel(); + break; + } + } + } + + void JobManager::HaltAllJobs() + { + // Must be called by owner thread + if (std::this_thread::get_id() != _OwnerThreadId) + throw std::exception("Must be called by thread that owns JobManager!"); + + // Prevents the scheduler from scheduling more jobs + this->_IsActive = false; + + // Prevent execution of threads... + for (auto& Worker : _Workers) + Worker->Stop(); + + // Wait for the last jobs to comlete, then destroy the workers + for (auto& Thread : _Threads) + Thread.Join(); + for (auto& Worker : _Workers) + delete Worker; + + // Iterate, and delete all jobs being non-waited, and mark all jobs awaited as finished. + Job* Item = nullptr; + while (_JobPool.Dequeue(Item)) + { + if (!Item->IsAwaiter()) + { + // It's not being awaited on so we must free it here... + delete Item; + } + else + { + // Forceable mark as finished, so the awaiter elsewhere can stop and clean up. + Item->IsFinished(); + } + } + + // Make sure the buffers are clear for subsequent calls + _Workers.Clear(); + _Threads.Clear(); + } + + void JobManager::Cancel() + { + this->_IsActive = false; + + for (auto& Worker : _Workers) + Worker->Stop(); + } + + bool JobManager::AreWorkersIdle() + { + for (auto& Worker : _Workers) + { + if (Worker->IsExecuting()) + return false; + } + + return true; + } + + Job* JobWorker::GetJob() + { + Job* Item = nullptr; + auto Result = _Manager->_JobPool.Dequeue(Item); + return (Result) ? Item : nullptr; + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/JobManager.h b/r5dev/thirdparty/cppnet/cppkore/JobManager.h new file mode 100644 index 00000000..799dd339 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/JobManager.h @@ -0,0 +1,72 @@ +#pragma once + +#include +#include +#include +#include +#include "ListBase.h" +#include "Job.h" +#include "JobWorker.h" +#include "Thread.h" +#include "AtomicListBase.h" + +namespace Jobs +{ + // Remove built-in windows function +#undef GetJob + + // The job manager is the base class for all async operations. + // It handles scheduling jobs, waiting on jobs, and allocating jobs. + class JobManager + { + public: + // Initialize a new job manager, with the specified amount of 'workers' (threads) + JobManager(const uint32_t Workers, uint32_t DefaultWorkerId = 0); + ~JobManager(); + + // Schedules a job for execution, this returns a Job task for use with waiting for it's execution to finish. + // you must dispose of the resource after you're done with it + [[nodiscard]] Job* ScheduleJob(std::function Task, std::function OnFinished = nullptr); + + // Schedules a job for execution, this automatically cleans up the job after it's done with. + void ScheduleJobNoWait(std::function Task, std::function OnFinished = nullptr); + + // Waits for a single job to continue it's execution, yielding the thread until it's completed. + // After, the job is cleanly disposed. + void WaitForSingleJob(Job* Job); + + // Waits for multiple jobs to continue their execution, yielding the thread until all of them have completed. + // After, all jobs are disposed. + void WaitForAllJobs(Job** Jobs, const uint32_t Count); + // Waits for multiple jobs to continue their execution, yielding the thread until all of them have completed. + // After, all jobs are disposed. + void WaitForAllJobs(List& Jobs); + + // Waits for the entire queue to finish execution + // When this ends, all scheduled jobs are complete. + // (Must be called by owning thread) + void WaitAll(std::function ProgressCallback = nullptr, std::function CancelCallback = nullptr); + + // Stops all threads, waits for the final execution, and frees up all resources required. + // (Must be called by owning thread) + void HaltAllJobs(); + + // Cancels all current jobs, and addition of new jobs. + void Cancel(); + + // Allow the job worker to access private members of the manager + friend class JobWorker; + private: + // Workers will use our manager to get jobs + List _Workers; + List _Threads; + + // Internal routine to check if all workers are idle and not executing. + bool AreWorkersIdle(); + + // Fixed size atomoc job queue + AtomicListBase _JobPool; + std::thread::id _OwnerThreadId; + std::atomic_bool _IsActive; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/JobWorker.cpp b/r5dev/thirdparty/cppnet/cppkore/JobWorker.cpp new file mode 100644 index 00000000..e839dc41 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/JobWorker.cpp @@ -0,0 +1,51 @@ +#include "stdafx.h" +#include "JobWorker.h" +#include + +namespace Jobs +{ + JobWorker::JobWorker() + : JobWorker(nullptr, 0) + { + } + + JobWorker::JobWorker(JobManager* Manager, uint32_t WorkerId) + : _Running(false), _Manager(Manager), _WorkerId(WorkerId), _Executing(false) + { + } + + void JobWorker::Run() + { + _Running = true; + while (_Running) + this->TryRunTask(); + } + + void JobWorker::Stop() + { + _Running = false; + } + + bool JobWorker::IsExecuting() + { + return (this->_Executing == true); + } + + void JobWorker::TryRunTask() + { + auto Job = GetJob(); + if (Job != nullptr) + { + this->_Executing = true; + Job->Execute(); + + if (!Job->IsAwaiter()) + delete Job; + this->_Executing = false; + } + else + { + std::this_thread::yield(); + } + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/JobWorker.h b/r5dev/thirdparty/cppnet/cppkore/JobWorker.h new file mode 100644 index 00000000..5d5dda2b --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/JobWorker.h @@ -0,0 +1,38 @@ +#pragma once + +#include +#include +#include "Job.h" + +namespace Jobs +{ + // Forward declared because c++ + class JobManager; + + class JobWorker + { + public: + JobWorker(); + JobWorker(JobManager* Manager, uint32_t WorkerId = 0); + ~JobWorker() = default; + + // The main thread look for this worker. + void Run(); + // Halt this threads execution. + void Stop(); + + // Whether or not the worker is executing a job or is looking for one. + bool IsExecuting(); + + private: + // Try and execute a task if we can + void TryRunTask(); + // Fetch a job to run on this worker + Job* GetJob(); + + JobManager* _Manager; + uint32_t _WorkerId; + std::atomic_bool _Running; + std::atomic_bool _Executing; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/KaydaraFBX.cpp b/r5dev/thirdparty/cppnet/cppkore/KaydaraFBX.cpp new file mode 100644 index 00000000..7b7dcc6e --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/KaydaraFBX.cpp @@ -0,0 +1,602 @@ +#include "stdafx.h" +#include "KaydaraFBX.h" +#include "KaydaraFBXContainer.h" + +#include "File.h" +#include "Matrix.h" +#include "Path.h" +#include "BinaryWriter.h" + +namespace Assets::Exporters +{ + void AddObjectConnection(KaydaraFBXNode& ConnectionsNode, uint64_t From, uint64_t To) + { + auto& Connection = ConnectionsNode.Children.Emplace("C"); + + Connection.AddPropertyString("OO"); + Connection.AddPropertyInteger64(From); + Connection.AddPropertyInteger64(To); + } + + void AddObjectPropertyConnection(KaydaraFBXNode& ConnectionsNode, uint64_t From, uint64_t To, const char* PropertyName) + { + auto& Connection = ConnectionsNode.Children.Emplace("C"); + + Connection.AddPropertyString("OP"); + Connection.AddPropertyInteger64(From); + Connection.AddPropertyInteger64(To); + Connection.AddPropertyString(PropertyName); + } + + void InitializeRootNode(KaydaraFBXNode& RootNode) + { + RootNode.Children.Emplace("Version").AddPropertyInteger32(232); + auto& Properties = RootNode.Children.Emplace("Properties70"); + + { + auto& Prop = Properties.Children.Emplace("P"); + + Prop.AddPropertyString("Lcl Rotation"); + Prop.AddPropertyString("Lcl Rotation"); + Prop.AddPropertyString(""); + Prop.AddPropertyString("A"); + Prop.AddPropertyFloat64(-90); // To match default Maya axis + Prop.AddPropertyFloat64(0); + Prop.AddPropertyFloat64(0); + } + } + + void InitializeMaterialTexture(KaydaraFBXNode& ObjectsNode, Material& Material, uint64_t TextureId) + { + auto& Texture = ObjectsNode.Children.Emplace("Texture"); + + auto TextureName = Material.Name + "_c" + string("\u0000\u0001Texture", 9); + + Texture.AddPropertyInteger64(TextureId); + Texture.AddPropertyString(TextureName); + Texture.AddPropertyString(""); + + Texture.Children.Emplace("Type").AddPropertyString("TextureVideoClip"); + Texture.Children.Emplace("Version").AddPropertyInteger32(202); + Texture.Children.Emplace("TextureName").AddPropertyString(TextureName); + + auto& Properties = Texture.Children.Emplace("Properties70"); + + { + auto& Prop = Properties.Children.Emplace("P"); + + Prop.AddPropertyString("CurrentTextureBlendMode"); + Prop.AddPropertyString("enum"); + Prop.AddPropertyString(""); + Prop.AddPropertyString(""); + Prop.AddPropertyInteger32(0); + } + + { + auto& Prop = Properties.Children.Emplace("P"); + + Prop.AddPropertyString("UVSet"); + Prop.AddPropertyString("KString"); + Prop.AddPropertyString(""); + Prop.AddPropertyString(""); + Prop.AddPropertyString("map1"); + } + + { + auto& Prop = Properties.Children.Emplace("P"); + + Prop.AddPropertyString("UseMaterial"); + Prop.AddPropertyString("bool"); + Prop.AddPropertyString(""); + Prop.AddPropertyString(""); + Prop.AddPropertyInteger32(1); + } + + Texture.Children.Emplace("Media").AddPropertyString(Material.Name + "_c" + string("\u0000\u0001Video", 7)); + + string DiffuseMap = ""; + if (Material.Slots.ContainsKey(MaterialSlotType::Albedo)) + DiffuseMap = Material.Slots[MaterialSlotType::Albedo].first; + else if (Material.Slots.ContainsKey(MaterialSlotType::Diffuse)) + DiffuseMap = Material.Slots[MaterialSlotType::Diffuse].first; + + Texture.Children.Emplace("FileName").AddPropertyString(DiffuseMap.Replace("\\", "/")); + Texture.Children.Emplace("RelativeFilename").AddPropertyString(DiffuseMap); + } + + void InitializeMeshSkinCluster(KaydaraFBXNode& ObjectsNode, KaydaraFBXNode& ConnectionsNode, uint64_t SubmeshIndex, uint64_t GeometryId, uint64_t DeformerId) + { + auto& SkinDeformer = ObjectsNode.Children.Emplace("Deformer"); + + SkinDeformer.AddPropertyInteger64(DeformerId); + SkinDeformer.AddPropertyString(string::Format("KoreLibMesh%02d", SubmeshIndex) + string("\u0000\u0001Deformer", 10)); + SkinDeformer.AddPropertyString("Skin"); + + SkinDeformer.Children.Emplace("Version").AddPropertyInteger32(101); + SkinDeformer.Children.Emplace("Link_DeformAcuracy").AddPropertyFloat64(50); + + AddObjectConnection(ConnectionsNode, DeformerId, GeometryId); + } + + void InitializeMeshSubDeformer(KaydaraFBXNode& ObjectsNode, Bone& Bone, uint64_t SubmeshIndex, uint64_t BoneIndex, uint64_t DeformerId) + { + auto& SubDeformer = ObjectsNode.Children.Emplace("Deformer"); + + SubDeformer.AddPropertyInteger64(DeformerId); + SubDeformer.AddPropertyString(string::Format("KoreLibMesh%02d_Bone%02d", SubmeshIndex, BoneIndex) + string("\u0000\u0001SubDeformer", 13)); + SubDeformer.AddPropertyString("Cluster"); + + SubDeformer.Children.Emplace("Version").AddPropertyInteger32(100); + + auto GlobalMatrix = Math::Matrix::CreateFromQuaternion(Bone.GlobalRotation()); + GlobalMatrix.SetPosition(Bone.GlobalPosition()); + + auto InverseGlobalMatrix = GlobalMatrix.Inverse(); + + SubDeformer.Children.Emplace("Indexes").Properties.EmplaceBack('i', nullptr, 0); + SubDeformer.Children.Emplace("Weights").Properties.EmplaceBack('d', nullptr, 0); + + auto& Transform = SubDeformer.Children.Emplace("Transform").Properties.Emplace('d', nullptr, 0); + auto& TransformLink = SubDeformer.Children.Emplace("TransformLink").Properties.Emplace('d', nullptr, 0); + + for (uint32_t i = 0; i < 16; i++) + { + Transform.AddValueFloat64(InverseGlobalMatrix.GetMatrix()[i]); + TransformLink.AddValueFloat64(GlobalMatrix.GetMatrix()[i]); + } + } + + bool KaydaraFBX::ExportAnimation(const Animation& Animation, const string& Path) + { + return false; + } + + bool KaydaraFBX::ExportModel(const Model& Model, const string& Path) + { + auto Writer = IO::BinaryWriter(IO::File::Create(Path)); + auto FileName = IO::Path::GetFileNameWithoutExtension(Path); + + KaydaraFBXDocument Document; + + auto& ObjectsNode = Document.GetRootNode("Objects"); + auto& ConnectionsNode = Document.GetRootNode("Connections"); + + uint32_t SubmeshIndex = 0; + uint32_t BoneIndex = 0; + uint32_t MatIndex = 0; + + uint64_t UniqueId = 0xDEADC0DE; + uint64_t ModelId = 0x10000001; + uint64_t DeformerId = 0x80000008; + uint64_t RootModelId = 0xC0DEDEAD; + uint64_t RootJointsId = 0xC0DEBEAD; + + auto& RootModelNode = ObjectsNode.Children.Emplace("Model"); + auto& RootJointsNode = ObjectsNode.Children.Emplace("Model"); + + RootModelNode.AddPropertyInteger64(RootModelId); + RootModelNode.AddPropertyString(FileName + string("\u0000\u0001Model", 7)); + RootModelNode.AddPropertyString("Null"); + + RootJointsNode.AddPropertyInteger64(RootJointsId); + RootJointsNode.AddPropertyString("Joints\u0000\u0001Model", 13); + RootJointsNode.AddPropertyString("Null"); + + InitializeRootNode(RootModelNode); + InitializeRootNode(RootJointsNode); + + Dictionary BoneIdMap; + + for (auto& Bone : Model.Bones) + { + auto& SkeletonNode = ObjectsNode.Children.Emplace("NodeAttribute"); + + SkeletonNode.AddPropertyInteger64(ModelId); + SkeletonNode.AddPropertyString("\u0000\u0001NodeAttribute", 15); + SkeletonNode.AddPropertyString("LimbNode"); + + auto& SkeletonNodeProps = SkeletonNode.Children.Emplace("Properties70"); + + { + auto& Prop = SkeletonNodeProps.Children.Emplace("P"); + + Prop.AddPropertyString("Size"); + Prop.AddPropertyString("double"); + Prop.AddPropertyString("Number"); + Prop.AddPropertyString(""); + Prop.AddPropertyFloat64(16.5); + } + + SkeletonNode.Children.Emplace("TypeFlags").AddPropertyString("Skeleton"); + + auto& JointModelNode = ObjectsNode.Children.Emplace("Model"); + + auto& Position = Bone.LocalPosition(); + auto Rotation = Bone.LocalRotation().ToEulerAngles(); + + JointModelNode.AddPropertyInteger64(UniqueId); + JointModelNode.AddPropertyString(Bone.Name() + string("\u0000\u0001Model", 7)); + JointModelNode.AddPropertyString("LimbNode"); + + JointModelNode.Children.Emplace("Version").AddPropertyInteger32(232); + auto & JointNodeProps = JointModelNode.Children.Emplace("Properties70"); + + { + auto& Prop = JointNodeProps.Children.Emplace("P"); + + Prop.AddPropertyString("PreRotation"); + Prop.AddPropertyString("Vector3D"); + Prop.AddPropertyString("Vector"); + Prop.AddPropertyString(""); + Prop.AddPropertyFloat64(Rotation.X); + Prop.AddPropertyFloat64(Rotation.Y); + Prop.AddPropertyFloat64(Rotation.Z); + } + + { + auto& Prop = JointNodeProps.Children.Emplace("P"); + + Prop.AddPropertyString("RotationActive"); + Prop.AddPropertyString("bool"); + Prop.AddPropertyString(""); + Prop.AddPropertyString(""); + Prop.AddPropertyInteger32(1); + } + + { + auto& Prop = JointNodeProps.Children.Emplace("P"); + + Prop.AddPropertyString("InheritType"); + Prop.AddPropertyString("enum"); + Prop.AddPropertyString(""); + Prop.AddPropertyString(""); + Prop.AddPropertyInteger32(2); + } + + { + auto& Prop = JointNodeProps.Children.Emplace("P"); + + Prop.AddPropertyString("ScalingMax"); + Prop.AddPropertyString("Vector3D"); + Prop.AddPropertyString("Vector"); + Prop.AddPropertyString(""); + Prop.AddPropertyFloat64(0); + Prop.AddPropertyFloat64(0); + Prop.AddPropertyFloat64(0); + } + + { + auto& Prop = JointNodeProps.Children.Emplace("P"); + + Prop.AddPropertyString("DefaultAttributeIndex"); + Prop.AddPropertyString("int"); + Prop.AddPropertyString("Integer"); + Prop.AddPropertyString(""); + Prop.AddPropertyInteger32(0); + } + + { + auto& Prop = JointNodeProps.Children.Emplace("P"); + + Prop.AddPropertyString("Lcl Translation"); + Prop.AddPropertyString("Lcl Translation"); + Prop.AddPropertyString(""); + Prop.AddPropertyString("A"); + Prop.AddPropertyFloat64(Position.X); + Prop.AddPropertyFloat64(Position.Y); + Prop.AddPropertyFloat64(Position.Z); + } + + AddObjectConnection(ConnectionsNode, ModelId, UniqueId); + + auto ParentIndex = Bone.Parent(); + + if (ParentIndex >= 0) + { + AddObjectConnection(ConnectionsNode, UniqueId, BoneIdMap[ParentIndex]); + } + else + { + AddObjectConnection(ConnectionsNode, UniqueId, RootJointsId); + } + + BoneIdMap.Add(BoneIndex, UniqueId); + + UniqueId++; + ModelId++; + BoneIndex++; + } + + Dictionary MatIdMap; + + for (auto& Mat : Model.Materials) + { + auto& MaterialNode = ObjectsNode.Children.Emplace("Material"); + + MaterialNode.AddPropertyInteger64(UniqueId); + MaterialNode.AddPropertyString(Mat.Name + string("\u0000\u0001Material", 10)); + MaterialNode.AddPropertyString(""); + + MaterialNode.Children.Emplace("Version").AddPropertyInteger32(102); + MaterialNode.Children.Emplace("ShadingModel").AddPropertyString("Lambert"); + MaterialNode.Children.Emplace("MultiLayer").AddPropertyInteger32(0); + + MatIdMap.Add(MatIndex, UniqueId); + + UniqueId++; + MatIndex++; + + string DiffuseMap = ""; + if (Mat.Slots.ContainsKey(MaterialSlotType::Albedo)) + DiffuseMap = Mat.Slots[MaterialSlotType::Albedo].first; + else if (Mat.Slots.ContainsKey(MaterialSlotType::Diffuse)) + DiffuseMap = Mat.Slots[MaterialSlotType::Diffuse].first; + + if (!string::IsNullOrWhiteSpace(DiffuseMap)) + { + InitializeMaterialTexture(ObjectsNode, Mat, UniqueId); + AddObjectPropertyConnection(ConnectionsNode, UniqueId, UniqueId - 1, "DiffuseColor"); + + UniqueId++; + } + } + + for (auto& Mesh : Model.Meshes) + { + auto& MeshModelNode = ObjectsNode.Children.Emplace("Model"); + + MeshModelNode.AddPropertyInteger64(ModelId); + MeshModelNode.AddPropertyString(string::Format("KoreLibMesh%02d", SubmeshIndex) + string("\u0000\u0001Model", 7)); + MeshModelNode.AddPropertyString("Mesh"); + + MeshModelNode.Children.Emplace("Version").AddPropertyInteger32(232); + auto& MeshNodeProps = MeshModelNode.Children.Emplace("Properties70"); + + { + auto& MeshProp = MeshNodeProps.Children.Emplace("P"); + MeshProp.AddPropertyString("Lcl Rotation"); + MeshProp.AddPropertyString("Lcl Rotation"); + MeshProp.AddPropertyString(""); + MeshProp.AddPropertyString("A"); + MeshProp.AddPropertyFloat64(0); + MeshProp.AddPropertyFloat64(0); + MeshProp.AddPropertyFloat64(0); + } + + { + auto& MeshProp = MeshNodeProps.Children.Emplace("P"); + MeshProp.AddPropertyString("DefaultAttributeIndex"); + MeshProp.AddPropertyString("int"); + MeshProp.AddPropertyString("Integer"); + MeshProp.AddPropertyString(""); + MeshProp.AddPropertyInteger32(0); + } + + { + auto& MeshProp = MeshNodeProps.Children.Emplace("P"); + MeshProp.AddPropertyString("InheritType"); + MeshProp.AddPropertyString("enum"); + MeshProp.AddPropertyString(""); + MeshProp.AddPropertyString(""); + MeshProp.AddPropertyInteger32(0); + } + + MeshModelNode.Children.Emplace("MultiLayer").AddPropertyInteger32(0); + MeshModelNode.Children.Emplace("MultiTake").AddPropertyInteger32(0); + MeshModelNode.Children.Emplace("Shading").AddPropertyBoolean(true); + MeshModelNode.Children.Emplace("Culling").AddPropertyString("CullingOff"); + + auto& MeshNode = ObjectsNode.Children.Emplace("Geometry"); + + MeshNode.AddPropertyInteger64(UniqueId); + MeshNode.AddPropertyString(string::Format("KoreLibMesh%02d", SubmeshIndex) + string("\u0000\u0001Geometry", 10)); + MeshNode.AddPropertyString("Mesh"); + + MeshNode.Children.EmplaceBack("Properties70"); + MeshNode.Children.Emplace("GeometryVersion").AddPropertyInteger32(124); + + auto& VertexBuffer = MeshNode.Children.Emplace("Vertices").Properties.Emplace('d', nullptr, 0); + + for (auto& Vertex : Mesh.Vertices) + { + auto& Position = Vertex.Position(); + + VertexBuffer.AddValueFloat64(Position.X); + VertexBuffer.AddValueFloat64(Position.Y); + VertexBuffer.AddValueFloat64(Position.Z); + } + + auto& FaceBuffer = MeshNode.Children.Emplace("PolygonVertexIndex").Properties.Emplace('i', nullptr, 0); + + for (auto& Face : Mesh.Faces) + { + FaceBuffer.AddValueInteger32(Face[2]); + FaceBuffer.AddValueInteger32(Face[1]); + FaceBuffer.AddValueInteger32(0xffffffff ^ Face[0]); + } + + auto& LayerNormals = MeshNode.Children.Emplace("LayerElementNormal"); + + LayerNormals.AddPropertyInteger32(0); + + LayerNormals.Children.Emplace("Version").AddPropertyInteger32(101); + LayerNormals.Children.Emplace("Name").AddPropertyString(""); + LayerNormals.Children.Emplace("MappingInformationType").AddPropertyString("ByVertice"); + LayerNormals.Children.Emplace("ReferenceInformationType").AddPropertyString("Direct"); + + auto& NormalsBuffer = LayerNormals.Children.Emplace("Normals").Properties.Emplace('d', nullptr, 0); + + for (auto& Vertex : Mesh.Vertices) + { + auto& Normal = Vertex.Normal(); + + NormalsBuffer.AddValueFloat64(Normal.X); + NormalsBuffer.AddValueFloat64(Normal.Y); + NormalsBuffer.AddValueFloat64(Normal.Z); + } + + for (uint8_t i = 0; i < Mesh.Vertices.UVLayerCount(); i++) + { + auto& LayerUVs = MeshNode.Children.Emplace("LayerElementUV"); + + LayerUVs.AddPropertyInteger32(i); + + LayerUVs.Children.Emplace("Version").AddPropertyInteger32(101); + LayerUVs.Children.Emplace("Name").AddPropertyString(string::Format("map%d", i + 1)); + LayerUVs.Children.Emplace("MappingInformationType").AddPropertyString("ByVertice"); + LayerUVs.Children.Emplace("ReferenceInformationType").AddPropertyString("Direct"); + + auto& UVsBuffer = LayerUVs.Children.Emplace("UV").Properties.Emplace('d', nullptr, 0); + + for (auto& Vertex : Mesh.Vertices) + { + auto& UVLayer = Vertex.UVLayers(i); + + UVsBuffer.AddValueFloat64(UVLayer.U); + UVsBuffer.AddValueFloat64((1.0l - UVLayer.V)); + } + } + + { + auto& LayerMats = MeshNode.Children.Emplace("LayerElementMaterial"); + + LayerMats.AddPropertyInteger32(0); + + LayerMats.Children.Emplace("Version").AddPropertyInteger32(101); + LayerMats.Children.Emplace("Name").AddPropertyString(""); + LayerMats.Children.Emplace("MappingInformationType").AddPropertyString("AllSame"); + LayerMats.Children.Emplace("ReferenceInformationType").AddPropertyString("IndexToDirect"); + + auto& IndicesBuffer = LayerMats.Children.Emplace("Materials").Properties.Emplace('i', nullptr, 0); + IndicesBuffer.AddValueInteger32(0); + } + + auto& LayerInfo = MeshNode.Children.Emplace("Layer"); + + LayerInfo.AddPropertyInteger32(0); + + LayerInfo.Children.Emplace("Version").AddPropertyInteger32(100); + + { + auto& LayerElement = LayerInfo.Children.Emplace("LayerElement"); + LayerElement.Children.Emplace("Type").AddPropertyString("LayerElementNormal"); + LayerElement.Children.Emplace("TypedIndex").AddPropertyInteger32(0); + } + + { + auto& LayerElement = LayerInfo.Children.Emplace("LayerElement"); + LayerElement.Children.Emplace("Type").AddPropertyString("LayerElementMaterial"); + LayerElement.Children.Emplace("TypedIndex").AddPropertyInteger32(0); + } + + { + auto& LayerElement = LayerInfo.Children.Emplace("LayerElement"); + LayerElement.Children.Emplace("Type").AddPropertyString("LayerElementUV"); + LayerElement.Children.Emplace("TypedIndex").AddPropertyInteger32(0); + } + + for (uint8_t i = 1; i < Mesh.Vertices.UVLayerCount(); i++) + { + auto& LayerInfo = MeshNode.Children.Emplace("Layer"); + + LayerInfo.AddPropertyInteger32(i); + + auto& LayerElement = LayerInfo.Children.Emplace("LayerElement"); + LayerElement.Children.Emplace("Type").AddPropertyString("LayerElementUV"); + LayerElement.Children.Emplace("TypedIndex").AddPropertyInteger32(i); + } + + AddObjectConnection(ConnectionsNode, ModelId, RootModelId); + AddObjectConnection(ConnectionsNode, UniqueId, ModelId); + + if (Mesh.MaterialIndices[0] >= 0) + AddObjectConnection(ConnectionsNode, MatIdMap[Mesh.MaterialIndices[0]], ModelId); + + InitializeMeshSkinCluster(ObjectsNode, ConnectionsNode, SubmeshIndex, UniqueId, DeformerId); + + uint64_t RootDeformer = DeformerId++; + + Dictionary SubDeformers; + Dictionary SubDeformerNodes; + + for (auto& Vertex : Mesh.Vertices) + { + for (uint8_t i = 0; i < Vertex.WeightCount(); i++) + { + auto& Weight = Vertex.Weights(i); + int32_t BoneId = Weight.Bone; + + if (!SubDeformers.ContainsKey(BoneId)) + { + // Make new subdeformer, connect to root, and add it + InitializeMeshSubDeformer(ObjectsNode, Model.Bones[BoneId], SubmeshIndex, BoneId, DeformerId); + + // Add a connection + AddObjectConnection(ConnectionsNode, DeformerId, RootDeformer); + AddObjectConnection(ConnectionsNode, BoneIdMap[BoneId], DeformerId); + + // Add it + SubDeformers.Add(BoneId, DeformerId++); + } + } + } + + for (auto& SubDef : SubDeformers) + SubDeformerNodes.Add(SubDef.Key(), ObjectsNode.FindByUID(SubDef.Value())); + + uint32_t VertexIndex = 0; + + for (auto& Vertex : Mesh.Vertices) + { + for (uint8_t i = 0; i < Vertex.WeightCount(); i++) + { + auto& Weight = Vertex.Weights(i); + int32_t BoneId = Weight.Bone; + + auto& DeformerNode = SubDeformerNodes[BoneId]; + + DeformerNode->Children[1].Properties[0].AddValueInteger32(VertexIndex); + DeformerNode->Children[2].Properties[0].AddValueFloat64(Weight.Value); + } + + VertexIndex++; + } + + UniqueId++; + SubmeshIndex++; + ModelId++; + } + + AddObjectConnection(ConnectionsNode, RootModelId, 0); + AddObjectConnection(ConnectionsNode, RootJointsId, 0); + + Document.Serialize(Writer); + + return true; + } + + imstring KaydaraFBX::ModelExtension() + { + return ".fbx"; + } + + imstring KaydaraFBX::AnimationExtension() + { + return ".fbx"; + } + + ExporterScale KaydaraFBX::ExportScale() + { + return ExporterScale::Default; + } + + bool KaydaraFBX::SupportsAnimations() + { + return false; + } + + bool KaydaraFBX::SupportsModels() + { + return true; + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/KaydaraFBX.h b/r5dev/thirdparty/cppnet/cppkore/KaydaraFBX.h new file mode 100644 index 00000000..aab9744e --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/KaydaraFBX.h @@ -0,0 +1,33 @@ +#pragma once + +#include +#include "Exporter.h" + +namespace Assets::Exporters +{ + // The Kaydara FBX exporter + class KaydaraFBX : public Exporter + { + public: + KaydaraFBX() = default; + ~KaydaraFBX() = default; + + // Exports the given animation to the provided path. + virtual bool ExportAnimation(const Animation& Animation, const string& Path); + // Exports the given model to the provided path. + virtual bool ExportModel(const Model& Model, const string& Path); + + // Gets the file extension for this exporters model format. + virtual imstring ModelExtension(); + // Gets the file extension for this exporters animation format. + virtual imstring AnimationExtension(); + + // Gets the required scaling constant for this exporter. + virtual ExporterScale ExportScale(); + + // Gets whether or not the exporter supports animation exporting. + virtual bool SupportsAnimations(); + // Gets whether or not the exporter supports model exporting. + virtual bool SupportsModels(); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/KaydaraFBXContainer.cpp b/r5dev/thirdparty/cppnet/cppkore/KaydaraFBXContainer.cpp new file mode 100644 index 00000000..ab351dab --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/KaydaraFBXContainer.cpp @@ -0,0 +1,538 @@ +#include "stdafx.h" +#include "KaydaraFBXContainer.h" + +namespace Assets::Exporters +{ + constexpr std::tuple HeaderExtensionProperties[] = + { + {"FBXHeaderVersion", 1003}, + {"FBXVersion", 7400}, + {"EncryptionType", 0} + }; + + constexpr std::tuple HeaderExtensionTimeProperties[] = + { + {"Version", 1000}, + {"Year", 2019}, + {"Month", 4}, + {"Day", 26}, + {"Hour", 10}, + {"Minute", 39}, + {"Second", 36}, + {"Millisecond", 240} + }; + + constexpr std::pair HeaderExtensionCreatorProperty = + { + "Creator", "KoreLib by DTZxPorter" + }; + + constexpr std::pair HeaderFileIdNode = + { + "FileId", "\x28\xb3\x2a\xeb\xb6\x24\xcc\xc2\xbf\xc8\xb0\x2a\xa9\x2b\xfc\xf1" + }; + + constexpr std::pair HeaderCreationTimeNode = + { + "CreationTime", "1970-01-01 10:00:00:000" + }; + + constexpr std::tuple HeaderDefinitionsNode[] = + { + {"ObjectType", "GlobalSettings", ""}, + {"ObjectType", "NodeAttribute", ""}, + {"ObjectType", "Geometry", "FbxMesh"}, + {"ObjectType", "Model", "FbxNode"}, + {"ObjectType", "Pose", ""}, + {"ObjectType", "Deformer", ""}, + {"ObjectType", "Material", "FbxSurfacePhong"}, + {"ObjectType", "Texture", "FbxFileTexture"} + }; + + constexpr uint8_t FooterData[] = + { + 0xFA, 0xBC, 0xAB, 0x09, 0xD0, 0xC8, 0xD4, 0x66, 0xB1, 0x76, 0xFB, 0x83, + 0x1C, 0xF7, 0x26, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xE8, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x5A, 0x8C, 0x6A, 0xDE, 0xF5, + 0xD9, 0x7E, 0xEC, 0xE9, 0x0C, 0xE3, 0x75, 0x8F, 0x29, 0x0B + }; + +#pragma pack(push, 1) + struct KaydaraFBXHeader + { + char Magic[0x15]; + + uint16_t VersionMinor; + uint32_t VersionMajor; + }; +#pragma pack(pop) + + KaydaraFBXDocument::KaydaraFBXDocument() + { + this->InitializeFBXHeaderExtension(); + this->InitializeGenerics(); + this->InitializeGlobalSettings(); + this->InitializeDocuments(); + this->InitializeReferences(); + this->InitializeDefinitions(); + this->InitializeDynamics(); + } + + void KaydaraFBXDocument::Serialize(IO::BinaryWriter& Writer) + { + Writer.Write({ "Kaydara FBX Binary ", 26, 7400 }); + + for (auto& Child : this->Nodes) + Child.Prepare(); + for (auto& Child : this->Nodes) + Child.Serialize(Writer); + + uint8_t EmptyNode[13]{}; + Writer.Write(EmptyNode, 0, sizeof(EmptyNode)); + + Writer.Write((uint8_t*)&FooterData[0], 0, sizeof(FooterData)); + } + + KaydaraFBXNode& KaydaraFBXDocument::GetRootNode(const char* Name) + { + for (auto& Node : this->Nodes) + if (Node.Name == Name) + return Node; + + throw std::exception("No FBX node was found"); + } + + void KaydaraFBXDocument::InitializeFBXHeaderExtension() + { + auto& Node = this->Nodes.Emplace("FBXHeaderExtension"); + + for (auto& Property : HeaderExtensionProperties) + Node.Children.Emplace(std::get<0>(Property)).Properties.EmplaceBack('I', &std::get<1>(Property)); + + auto& CreationTime = Node.Children.Emplace("CreationTimeStamp"); + + for (auto& Property : HeaderExtensionTimeProperties) + CreationTime.Children.Emplace(std::get<0>(Property)).Properties.EmplaceBack('I', &std::get<1>(Property)); + } + + void KaydaraFBXDocument::InitializeGenerics() + { + string s1(HeaderFileIdNode.second); + string s2(HeaderCreationTimeNode.second); + string s3(HeaderExtensionCreatorProperty.second); + this->Nodes.Emplace(HeaderFileIdNode.first).Properties.EmplaceBack('R', &s1); + this->Nodes.Emplace(HeaderCreationTimeNode.first).Properties.EmplaceBack('S', &s2); + this->Nodes.Emplace(HeaderExtensionCreatorProperty.first).Properties.EmplaceBack('S', &s3); + } + + void KaydaraFBXDocument::InitializeGlobalSettings() + { + auto& Node = this->Nodes.Emplace("GlobalSettings"); + + Node.Children.Emplace("Version").AddPropertyInteger32(1000); + + auto& Properties = Node.Children.Emplace("Properties70"); + + { + auto& Prop = Properties.Children.Emplace("P"); + + Prop.AddPropertyString("UpAxis"); + Prop.AddPropertyString("int"); + Prop.AddPropertyString("Integer"); + Prop.AddPropertyString(""); + Prop.AddPropertyInteger32(1); + } + + { + auto& Prop = Properties.Children.Emplace("P"); + + Prop.AddPropertyString("FrontAxis"); + Prop.AddPropertyString("int"); + Prop.AddPropertyString("Integer"); + Prop.AddPropertyString(""); + Prop.AddPropertyInteger32(2); + } + } + + void KaydaraFBXDocument::InitializeDocuments() + { + auto& Node = this->Nodes.Emplace("Documents"); + + Node.Children.Emplace("Count").AddPropertyInteger32(1); + + auto& Document = Node.Children.Emplace("Document"); + + Document.AddPropertyInteger64(318825901); + Document.AddPropertyString("Scene"); + Document.AddPropertyString("Scene"); + + Document.Children.Emplace("RootNode").AddPropertyInteger64(0); + } + + void KaydaraFBXDocument::InitializeReferences() + { + this->Nodes.EmplaceBack("References"); + } + + void KaydaraFBXDocument::InitializeDefinitions() + { + auto& Node = this->Nodes.Emplace("Definitions"); + + Node.Children.Emplace("Version").AddPropertyInteger32(100); + Node.Children.Emplace("Count").AddPropertyInteger32(ARRAYSIZE(HeaderDefinitionsNode)); + + for (auto& Type : HeaderDefinitionsNode) + { + auto& Definition = Node.Children.Emplace(std::get<0>(Type)); + + Definition.AddPropertyString(std::get<1>(Type)); + Definition.Children.Emplace("Count").AddPropertyInteger32(1); + + if (strlen(std::get<2>(Type))) + Definition.Children.Emplace("PropertyTemplate").AddPropertyString(std::get<2>(Type)); + } + } + + void KaydaraFBXDocument::InitializeDynamics() + { + // Create each dynamic node + auto& NodeObjects = this->Nodes.Emplace("Objects"); + auto& NodeConnections = this->Nodes.Emplace("Connections"); + auto& NodeTakes = this->Nodes.Emplace("Takes"); + + NodeTakes.Children.Emplace("Current").AddPropertyString(""); + } + + KaydaraFBXProperty::KaydaraFBXProperty() + : _Type(0), _IntegralValue{} + { + } + + KaydaraFBXProperty::KaydaraFBXProperty(const char Type, const void* Data) + : _Type(Type), _IntegralValue{} + { + switch (Type) + { + case 'Y': _IntegralValue.Integer16 = *(uint16_t*)Data; break; + case 'C': _IntegralValue.Boolean = *(bool*)Data; break; + case 'I': _IntegralValue.Integer32 = *(uint32_t*)Data; break; + case 'F': _IntegralValue.Float32 = *(float*)Data; break; + case 'D': _IntegralValue.Float64 = *(double*)Data; break; + case 'L': _IntegralValue.Integer64 = *(uint64_t*)Data; break; + + case 'R': + case 'S': + _StringValue = *(string*)Data; + break; + } + } + + KaydaraFBXProperty::KaydaraFBXProperty(const char Type, const void* Data, const uint32_t Count) + : _Type(Type), _IntegralValue{} + { + if (Data == nullptr || Count == 0) + return; + + for (uint32_t i = 0; i < Count; i++) + { + KaydaraFBXIntegralProperty Property; + + switch (Type) + { + case 'b': Property.Boolean = ((bool*)Data)[i]; break; + case 'i': Property.Integer32 = ((uint32_t*)Data)[i]; break; + case 'f': Property.Float32 = ((float*)Data)[i]; break; + case 'd': Property.Float64 = ((double*)Data)[i]; break; + case 'l': Property.Integer64 = ((uint64_t*)Data)[i]; break; + } + + this->_IntegralArrayValues.EmplaceBack(std::move(Property)); + } + } + + void KaydaraFBXProperty::AddValueBoolean(bool Value) + { + KaydaraFBXIntegralProperty Property; + Property.Boolean = Value; + + this->_IntegralArrayValues.EmplaceBack(std::move(Property)); + } + + void KaydaraFBXProperty::AddValueInteger32(uint32_t Value) + { + KaydaraFBXIntegralProperty Property; + Property.Integer32 = Value; + + this->_IntegralArrayValues.EmplaceBack(std::move(Property)); + } + + void KaydaraFBXProperty::AddValueInteger64(uint64_t Value) + { + KaydaraFBXIntegralProperty Property; + Property.Integer64 = Value; + + this->_IntegralArrayValues.EmplaceBack(std::move(Property)); + } + + void KaydaraFBXProperty::AddValueFloat32(float Value) + { + KaydaraFBXIntegralProperty Property; + Property.Float32 = Value; + + this->_IntegralArrayValues.EmplaceBack(std::move(Property)); + } + + void KaydaraFBXProperty::AddValueFloat64(double Value) + { + KaydaraFBXIntegralProperty Property; + Property.Float64 = Value; + + this->_IntegralArrayValues.EmplaceBack(std::move(Property)); + } + + void KaydaraFBXProperty::Serialize(IO::BinaryWriter& Writer) + { + Writer.Write(this->_Type); + + switch (this->_Type) + { + case 'Y': + Writer.Write(this->_IntegralValue.Integer16); + break; + case 'C': + Writer.Write(this->_IntegralValue.Boolean); + break; + case 'I': + Writer.Write(this->_IntegralValue.Integer32); + break; + case 'F': + Writer.Write(this->_IntegralValue.Float32); + break; + case 'D': + Writer.Write(this->_IntegralValue.Float64); + break; + case 'L': + Writer.Write(this->_IntegralValue.Integer64); + break; + case 'R': + case 'S': + Writer.Write(this->_StringValue.Length()); + Writer.Write((uint8_t*)&this->_StringValue[0], 0, this->_StringValue.Length()); + break; + + default: + Writer.Write(this->_IntegralArrayValues.Count()); + Writer.Write(0); + + { + uint32_t CompressedLength = this->_IntegralArrayValues.Count(); + + switch (this->_Type) + { + case 'f': CompressedLength *= sizeof(float); break; + case 'd': CompressedLength *= sizeof(double); break; + case 'l': CompressedLength *= sizeof(uint64_t); break; + case 'i': CompressedLength *= sizeof(uint32_t); break; + case 'b': CompressedLength *= sizeof(bool); break; + } + + Writer.Write(CompressedLength); + + for (auto& Value : this->_IntegralArrayValues) + { + switch (this->_Type) + { + case 'f': + Writer.Write(Value.Float32); + break; + case 'd': + Writer.Write(Value.Float64); + break; + case 'l': + Writer.Write(Value.Integer64); + break; + case 'i': + Writer.Write(Value.Integer32); + break; + case 'b': + Writer.Write(Value.Boolean); + break; + } + } + } + break; + } + } + + const uint32_t KaydaraFBXProperty::GetLength() const + { + switch (this->_Type) + { + case 'Y': return sizeof(uint16_t) + sizeof(char); + case 'C': return sizeof(bool) + sizeof(char); + case 'I': return sizeof(uint32_t) + sizeof(char); + case 'F': return sizeof(float) + sizeof(char); + case 'D': return sizeof(double) + sizeof(char); + case 'L': return sizeof(uint64_t) + sizeof(char); + case 'S': + case 'R': + return this->_StringValue.Length() + sizeof(uint32_t) + sizeof(char); + case 'f': return this->_IntegralArrayValues.Count() * sizeof(float) + 13; + case 'd': return this->_IntegralArrayValues.Count() * sizeof(double) + 13; + case 'l': return this->_IntegralArrayValues.Count() * sizeof(uint64_t) + 13; + case 'i': return this->_IntegralArrayValues.Count() * sizeof(uint32_t) + 13; + case 'b': return this->_IntegralArrayValues.Count() * sizeof(bool) + 13; + default: + return 0; + } + } + + KaydaraFBXIntegralProperty KaydaraFBXProperty::GetIntegralValue() const + { + return this->_IntegralValue; + } + + KaydaraFBXNode::KaydaraFBXNode(const string& Name) + : Name(Name) + { + } + + KaydaraFBXNode::KaydaraFBXNode(const char* Name) + : Name(Name) + { + } + + void KaydaraFBXNode::Prepare() + { + for (auto& Child : this->Children) + Child.Prepare(); + + if (this->Children.Count() > 0 || (this->Properties.Count() == 0 && this->Name.Length() > 0)) + this->Children.EmplaceBack(); + } + + void KaydaraFBXNode::Serialize(IO::BinaryWriter& Writer) + { + if (this->Name.Length() == 0 && this->Children.Count() == 0 && this->Properties.Count() == 0) + { + uint8_t EmptyNode[13]{}; + Writer.Write(EmptyNode, 0, sizeof(EmptyNode)); + + return; + } + + uint32_t PropertyListLength = 0; + uint32_t NodeLength = 13 + Name.Length(); + + for (auto& Property : this->Properties) + PropertyListLength += Property.GetLength(); + + NodeLength += PropertyListLength; + + for (auto& Child : this->Children) + NodeLength += Child.GetLength(); + + Writer.Write((uint32_t)Writer.GetBaseStream()->GetPosition() + NodeLength); + Writer.Write(this->Properties.Count()); + Writer.Write(PropertyListLength); + Writer.Write((uint8_t)Name.Length()); + Writer.Write((uint8_t*)&Name[0], 0, Name.Length()); + + for (auto& Property : this->Properties) + Property.Serialize(Writer); + for (auto& Child : this->Children) + Child.Serialize(Writer); + } + + void KaydaraFBXNode::AddPropertyBoolean(bool Value) + { + this->Properties.EmplaceBack('C', &Value); + } + + void KaydaraFBXNode::AddPropertyInteger16(uint16_t Value) + { + this->Properties.EmplaceBack('Y', &Value); + } + + void KaydaraFBXNode::AddPropertyInteger32(uint32_t Value) + { + this->Properties.EmplaceBack('I', &Value); + } + + void KaydaraFBXNode::AddPropertyInteger64(uint64_t Value) + { + this->Properties.EmplaceBack('L', &Value); + } + + void KaydaraFBXNode::AddPropertyFloat32(float Value) + { + this->Properties.EmplaceBack('F', &Value); + } + + void KaydaraFBXNode::AddPropertyFloat64(double Value) + { + this->Properties.EmplaceBack('D', &Value); + } + + void KaydaraFBXNode::AddPropertyString(const string& Value) + { + this->Properties.EmplaceBack('S', &Value); + } + + void KaydaraFBXNode::AddPropertyString(const char* Value) + { + string s(Value); + this->Properties.EmplaceBack('S', &s); + } + + void KaydaraFBXNode::AddPropertyString(const char* Value, const uint32_t Length) + { + string s(Value, Length); + this->Properties.EmplaceBack('S', &s); + } + + void KaydaraFBXNode::AddPropertyRaw(const char* Value) + { + string s(Value); + this->Properties.EmplaceBack('R', &s); + } + + void KaydaraFBXNode::AddPropertyRaw(const char* Value, const uint32_t Length) + { + string s(Value, Length); + this->Properties.EmplaceBack('R', &s); + } + + KaydaraFBXNode* KaydaraFBXNode::FindByUID(const uint64_t UID) + { + for (auto& Child : this->Children) + { + if (Child.Properties.Count() > 0 && Child.Properties[0].GetIntegralValue().Integer64 == UID) + return &Child; + } + + return nullptr; + } + + const uint32_t KaydaraFBXNode::GetLength() const + { + uint32_t Result = 13 + Name.Length(); + + for (auto& Child : this->Children) + Result += Child.GetLength(); + for (auto& Property : this->Properties) + Result += Property.GetLength(); + + return Result; + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/KaydaraFBXContainer.h b/r5dev/thirdparty/cppnet/cppkore/KaydaraFBXContainer.h new file mode 100644 index 00000000..53b03335 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/KaydaraFBXContainer.h @@ -0,0 +1,126 @@ +#pragma once + +#include +#include +#include "StringBase.h" +#include "ListBase.h" +#include "BinaryWriter.h" + +namespace Assets::Exporters +{ + // Represents any integral property of a node. + union KaydaraFBXIntegralProperty + { + bool Boolean; + uint16_t Integer16; + uint32_t Integer32; + uint64_t Integer64; + float Float32; + double Float64; + }; + + // Represents a property value of a node. + class KaydaraFBXProperty + { + public: + KaydaraFBXProperty(); + KaydaraFBXProperty(const char Type, const void* Data); + KaydaraFBXProperty(const char Type, const void* Data, const uint32_t Count); + + // Add value proxies for array types. + void AddValueBoolean(bool Value); + void AddValueInteger32(uint32_t Value); + void AddValueInteger64(uint64_t Value); + void AddValueFloat32(float Value); + void AddValueFloat64(double Value); + + // Serialize the property to the writer. + void Serialize(IO::BinaryWriter& Writer); + + // Returns the length, in bytes, of this property. + const uint32_t GetLength() const; + + // Returns the integral value, if any, of the property. + KaydaraFBXIntegralProperty GetIntegralValue() const; + + private: + // Internal property type + char _Type; + + // Internal value if it's integral + KaydaraFBXIntegralProperty _IntegralValue; + // Internal value for integral arrays + List _IntegralArrayValues; + + // Internal value for string and raw types + string _StringValue; + }; + + // Represents a node of an FBXDocument. + class KaydaraFBXNode + { + public: + KaydaraFBXNode() = default; + KaydaraFBXNode(const string& Name); + explicit KaydaraFBXNode(const char* Name); + + // Prepares a new node. + void Prepare(); + // Serialize the node to the writer. + void Serialize(IO::BinaryWriter& Writer); + + // Add property proxies + void AddPropertyBoolean(bool Value); + void AddPropertyInteger16(uint16_t Value); + void AddPropertyInteger32(uint32_t Value); + void AddPropertyInteger64(uint64_t Value); + void AddPropertyFloat32(float Value); + void AddPropertyFloat64(double Value); + void AddPropertyString(const string& Value); + void AddPropertyString(const char* Value); + void AddPropertyString(const char* Value, const uint32_t Length); + void AddPropertyRaw(const char* Value); + void AddPropertyRaw(const char* Value, const uint32_t Length); + + // Finds a child by it's UID. + KaydaraFBXNode* FindByUID(const uint64_t UID); + + // Returns the length, in bytes, of this node. + const uint32_t GetLength() const; + + // A list of properties attached to this node. + List Properties; + // A list of child nodes. + List Children; + // The name of this node. + string Name; + }; + + // Represents the root of an FBX container. + class KaydaraFBXDocument + { + public: + KaydaraFBXDocument(); + ~KaydaraFBXDocument() = default; + + // Serialize the document to the writer. + void Serialize(IO::BinaryWriter& Writer); + + // A list of document nodes. + List Nodes; + + // Returns a root document node by name + KaydaraFBXNode& GetRootNode(const char* Name); + + private: + + // Internal routines to setup a document + void InitializeFBXHeaderExtension(); + void InitializeGenerics(); + void InitializeGlobalSettings(); + void InitializeDocuments(); + void InitializeReferences(); + void InitializeDefinitions(); + void InitializeDynamics(); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/KeyEventArgs.cpp b/r5dev/thirdparty/cppnet/cppkore/KeyEventArgs.cpp new file mode 100644 index 00000000..5bffb994 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/KeyEventArgs.cpp @@ -0,0 +1,66 @@ +#include "stdafx.h" +#include "KeyEventArgs.h" + +namespace Forms +{ + KeyEventArgs::KeyEventArgs(Keys KeyData) + : _KeyData(KeyData), _SuppressKeyPress(false), _Handled(false) + { + } + + bool KeyEventArgs::Alt() + { + return ((int)_KeyData & (int)Keys::Alt) == (int)Keys::Alt; + } + + bool KeyEventArgs::Control() + { + return ((int)_KeyData & (int)Keys::Control) == (int)Keys::Control; + } + + bool KeyEventArgs::Shift() + { + return ((int)_KeyData & (int)Keys::Shift) == (int)Keys::Shift; + } + + bool KeyEventArgs::Handled() + { + return this->_Handled; + } + + void KeyEventArgs::SetHandled(bool Value) + { + this->_Handled = Value; + } + + bool KeyEventArgs::SuppressKeyPress() + { + return _SuppressKeyPress; + } + + void KeyEventArgs::SetSurpressKeyPress(bool Value) + { + _SuppressKeyPress = Value; + _Handled = Value; + } + + Keys KeyEventArgs::KeyCode() + { + return (Keys)((int)_KeyData & (int)Keys::KeyCode); + } + + uint32_t KeyEventArgs::KeyValue() + { + return (uint32_t)((int)_KeyData & (int)Keys::KeyCode); + } + + Keys KeyEventArgs::KeyData() + { + return _KeyData; + } + + Keys KeyEventArgs::Modifiers() + { + return (Keys)((int)_KeyData & (int)Keys::Modifiers); + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/KeyEventArgs.h b/r5dev/thirdparty/cppnet/cppkore/KeyEventArgs.h new file mode 100644 index 00000000..778dcead --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/KeyEventArgs.h @@ -0,0 +1,48 @@ +#pragma once + +#include +#include "Keys.h" + +namespace Forms +{ + // Provides data for the OnKey events. + class KeyEventArgs + { + public: + KeyEventArgs() = default; + KeyEventArgs(Keys KeyData); + ~KeyEventArgs() = default; + + // Gets a value indicating whether the ALT key was pressed. + bool Alt(); + // Gets a value indicating whether the CTRL key was pressed. + bool Control(); + // Gets a value indicating whether the SHIFT key was pressed. + bool Shift(); + + // Gets a value indicating whether the event was handled. + bool Handled(); + // Sets a value indicating whether the event was handled. + void SetHandled(bool Value); + + // Gets a value indicating whether the key press should be surpressed. + bool SuppressKeyPress(); + // Sets a value indicating whether the key press should be surpressed. + void SetSurpressKeyPress(bool Value); + + // Gets the keyboard code for a OnKeyDown or OnKeyUp event. + Keys KeyCode(); + // Gets the keyboard value for a OnKeyDown or OnKeyUp event. + uint32_t KeyValue(); + // Gets the key data for a OnKeyDown or OnKeyUp event. + Keys KeyData(); + // This returns which modifier keys (CTRL, SHIFT, and/or ALT) were pressed. + Keys Modifiers(); + + private: + // Internal key data from the event + Keys _KeyData; + bool _SuppressKeyPress; + bool _Handled; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/KeyPressEventArgs.cpp b/r5dev/thirdparty/cppnet/cppkore/KeyPressEventArgs.cpp new file mode 100644 index 00000000..8f0e4869 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/KeyPressEventArgs.cpp @@ -0,0 +1,20 @@ +#include "stdafx.h" +#include "KeyPressEventArgs.h" + +namespace Forms +{ + KeyPressEventArgs::KeyPressEventArgs(char KeyChar) + : KeyChar(KeyChar), _Handled(false) + { + } + + bool KeyPressEventArgs::Handled() + { + return _Handled; + } + + void KeyPressEventArgs::SetHandled(bool Value) + { + _Handled = Value; + } +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/KeyPressEventArgs.h b/r5dev/thirdparty/cppnet/cppkore/KeyPressEventArgs.h new file mode 100644 index 00000000..10e59f8e --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/KeyPressEventArgs.h @@ -0,0 +1,26 @@ +#pragma once + +#include + +namespace Forms +{ + class KeyPressEventArgs + { + public: + KeyPressEventArgs() = default; + KeyPressEventArgs(char KeyChar); + ~KeyPressEventArgs() = default; + + // Gets or sets the character corresponding to the key pressed. + char KeyChar; + + // Gets a value indicating whether the event was handled. + bool Handled(); + // Sets a value indicating whether the event was handled. + void SetHandled(bool Value); + + private: + // Internal key data from the event + bool _Handled; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Keys.h b/r5dev/thirdparty/cppnet/cppkore/Keys.h new file mode 100644 index 00000000..f4f1e584 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Keys.h @@ -0,0 +1,399 @@ +#pragma once + +#include + +namespace Forms +{ + // Specifies key codes and modifiers. + enum class Keys + { + // The bit mask to extract a key code from a key value. + KeyCode = 0x0000FFFF, + // The bit mask to extract modifiers from a key value. + Modifiers = (int)0xFFFF0000, + // No key pressed. + None = 0x00, + // The left mouse button. + LButton = 0x01, + // The right mouse button. + RButton = 0x02, + // The CANCEL key. + Cancel = 0x03, + // The middle mouse button (three-button mouse). + MButton = 0x04, + // The first x mouse button (five-button mouse). + XButton1 = 0x05, + // The second x mouse button (five-button mouse). + XButton2 = 0x06, + // The BACKSPACE key. + Back = 0x08, + // The TAB key. + Tab = 0x09, + // The CLEAR key. + LineFeed = 0x0A, + // The CLEAR key. + Clear = 0x0C, + // The RETURN key. + Return = 0x0D, + // The ENTER key. + Enter = Return, + // The SHIFT key. + ShiftKey = 0x10, + // The CTRL key. + ControlKey = 0x11, + // The ALT key. + Menu = 0x12, + // The PAUSE key. + Pause = 0x13, + // The CAPS LOCK key. + Capital = 0x14, + // The CAPS LOCK key. + CapsLock = 0x14, + // The IME Kana mode key. + KanaMode = 0x15, + // The IME Hanguel mode key. + HanguelMode = 0x15, + // The IME Hangul mode key. + HangulMode = 0x15, + // The IME Junja mode key. + JunjaMode = 0x17, + // The IME Final mode key. + FinalMode = 0x18, + // The IME Hanja mode key. + HanjaMode = 0x19, + // The IME Kanji mode key. + KanjiMode = 0x19, + // The ESC key. + Escape = 0x1B, + // The IME Convert key. + IMEConvert = 0x1C, + // The IME NonConvert key. + IMENonconvert = 0x1D, + // The IME Accept key. + IMEAccept = 0x1E, + // The IME Accept key. + IMEAceept = IMEAccept, + // The IME Mode change request. + IMEModeChange = 0x1F, + // The SPACEBAR key. + Space = 0x20, + // The PAGE UP key. + Prior = 0x21, + // The PAGE UP key. + PageUp = Prior, + // The PAGE DOWN key. + Next = 0x22, + // The PAGE DOWN key. + PageDown = Next, + // The END key. + End = 0x23, + // The HOME key. + Home = 0x24, + // The LEFT ARROW key. + Left = 0x25, + // The UP ARROW key. + Up = 0x26, + // The RIGHT ARROW key. + Right = 0x27, + // The DOWN ARROW key. + Down = 0x28, + // The SELECT key. + Select = 0x29, + // The PRINT key. + Print = 0x2A, + // The EXECUTE key. + Execute = 0x2B, + // The PRINT SCREEN key. + Snapshot = 0x2C, + // The PRINT SCREEN key. + PrintScreen = Snapshot, + // The INS key. + Insert = 0x2D, + // The DEL key. + Delete = 0x2E, + // The HELP key. + Help = 0x2F, + // The 0 key. + D0 = 0x30, + // The 1 key. + D1 = 0x31, + // The 2 key. + D2 = 0x32, + // The 3 key. + D3 = 0x33, + // The 4 key. + D4 = 0x34, + // The 5 key. + D5 = 0x35, + // The 6 key. + D6 = 0x36, + // The 7 key. + D7 = 0x37, + // The 8 key. + D8 = 0x38, + // The 9 key. + D9 = 0x39, + // The A key. + A = 0x41, + // The B key. + B = 0x42, + // The C key. + C = 0x43, + // The D key. + D = 0x44, + // The E key. + E = 0x45, + // The F key. + F = 0x46, + // The G key. + G = 0x47, + // The H key. + H = 0x48, + // The I key. + I = 0x49, + // The J key. + J = 0x4A, + // The K key. + K = 0x4B, + // The L key. + L = 0x4C, + // The M key. + M = 0x4D, + // The N key. + N = 0x4E, + // The O key. + O = 0x4F, + // The P key. + P = 0x50, + // The Q key. + Q = 0x51, + // The R key. + R = 0x52, + // The S key. + S = 0x53, + // The T key. + T = 0x54, + // The U key. + U = 0x55, + // The V key. + V = 0x56, + // The W key. + W = 0x57, + // The X key. + X = 0x58, + // The Y key. + Y = 0x59, + // The Z key. + Z = 0x5A, + // The left Windows logo key (Microsoft Natural Keyboard). + LWin = 0x5B, + // The right Windows logo key (Microsoft Natural Keyboard). + RWin = 0x5C, + // The Application key (Microsoft Natural Keyboard). + Apps = 0x5D, + // The Computer Sleep key. + Sleep = 0x5F, + // The 0 key on the numeric keypad. + NumPad0 = 0x60, + // The 1 key on the numeric keypad. + NumPad1 = 0x61, + // The 2 key on the numeric keypad. + NumPad2 = 0x62, + // The 3 key on the numeric keypad. + NumPad3 = 0x63, + // The 4 key on the numeric keypad. + NumPad4 = 0x64, + // The 5 key on the numeric keypad. + NumPad5 = 0x65, + // The 6 key on the numeric keypad. + NumPad6 = 0x66, + // The 7 key on the numeric keypad. + NumPad7 = 0x67, + // The 8 key on the numeric keypad. + NumPad8 = 0x68, + // The 9 key on the numeric keypad. + NumPad9 = 0x69, + // The Multiply key. + Multiply = 0x6A, + // The Add key. + Add = 0x6B, + // The Separator key. + Separator = 0x6C, + // The Subtract key. + Subtract = 0x6D, + // The Decimal key. + Decimal = 0x6E, + // The Divide key. + Divide = 0x6F, + // The F1 key. + F1 = 0x70, + // The F2 key. + F2 = 0x71, + // The F3 key. + F3 = 0x72, + // The F4 key. + F4 = 0x73, + // The F5 key. + F5 = 0x74, + // The F6 key. + F6 = 0x75, + // The F7 key. + F7 = 0x76, + // The F8 key. + F8 = 0x77, + // The F9 key. + F9 = 0x78, + // The F10 key. + F10 = 0x79, + // The F11 key. + F11 = 0x7A, + // The F12 key. + F12 = 0x7B, + // The F13 key. + F13 = 0x7C, + // The F14 key. + F14 = 0x7D, + // The F15 key. + F15 = 0x7E, + // The F16 key. + F16 = 0x7F, + // The F17 key. + F17 = 0x80, + // The F18 key. + F18 = 0x81, + // The F19 key. + F19 = 0x82, + // The F20 key. + F20 = 0x83, + // The F21 key. + F21 = 0x84, + // The F22 key. + F22 = 0x85, + // The F23 key. + F23 = 0x86, + // The F24 key. + F24 = 0x87, + // The NUM LOCK key. + NumLock = 0x90, + // The SCROLL LOCK key. + Scroll = 0x91, + // The left SHIFT key. + LShiftKey = 0xA0, + // The right SHIFT key. + RShiftKey = 0xA1, + // The left CTRL key. + LControlKey = 0xA2, + // The right CTRL key. + RControlKey = 0xA3, + // The left ALT key. + LMenu = 0xA4, + // The right ALT key. + RMenu = 0xA5, + // The Browser Back key. + BrowserBack = 0xA6, + // The Browser Forward key. + BrowserForward = 0xA7, + // The Browser Refresh key. + BrowserRefresh = 0xA8, + // The Browser Stop key. + BrowserStop = 0xA9, + // The Browser Search key. + BrowserSearch = 0xAA, + // The Browser Favorites key. + BrowserFavorites = 0xAB, + // The Browser Home key. + BrowserHome = 0xAC, + // The Volume Mute key. + VolumeMute = 0xAD, + // The Volume Down key. + VolumeDown = 0xAE, + // The Volume Up key. + VolumeUp = 0xAF, + // The Media Next Track key. + MediaNextTrack = 0xB0, + // The Media Previous Track key. + MediaPreviousTrack = 0xB1, + // The Media Stop key. + MediaStop = 0xB2, + // The Media Play Pause key. + MediaPlayPause = 0xB3, + // The Launch Mail key. + LaunchMail = 0xB4, + // The Select Media key. + SelectMedia = 0xB5, + // The Launch Application1 key. + LaunchApplication1 = 0xB6, + // The Launch Application2 key. + LaunchApplication2 = 0xB7, + // The Oem Semicolon key. + OemSemicolon = 0xBA, + // The Oem 1 key. + Oem1 = OemSemicolon, + // The Oem plus key. + Oemplus = 0xBB, + // The Oem comma key. + Oemcomma = 0xBC, + // The Oem Minus key. + OemMinus = 0xBD, + // The Oem Period key. + OemPeriod = 0xBE, + // The Oem Question key. + OemQuestion = 0xBF, + // The Oem 2 key. + Oem2 = OemQuestion, + // The Oem tilde key. + Oemtilde = 0xC0, + // The Oem 3 key. + Oem3 = Oemtilde, + // The Oem Open Brackets key. + OemOpenBrackets = 0xDB, + // The Oem 4 key. + Oem4 = OemOpenBrackets, + // The Oem Pipe key. + OemPipe = 0xDC, + // The Oem 5 key. + Oem5 = OemPipe, + // The Oem Close Brackets key. + OemCloseBrackets = 0xDD, + // The Oem 6 key. + Oem6 = OemCloseBrackets, + // The Oem Quotes key. + OemQuotes = 0xDE, + // The Oem 7 key. + Oem7 = OemQuotes, + // The Oem8 key. + Oem8 = 0xDF, + // The Oem Backslash key. + OemBackslash = 0xE2, + // The Oem 102 key. + Oem102 = OemBackslash, + // The PROCESS KEY key. + ProcessKey = 0xE5, + // The Packet KEY key. + Packet = 0xE7, + // The ATTN key. + Attn = 0xF6, + // The CRSEL key. + Crsel = 0xF7, + // The EXSEL key. + Exsel = 0xF8, + // The ERASE EOF key. + EraseEof = 0xF9, + // The PLAY key. + Play = 0xFA, + // The ZOOM key. + Zoom = 0xFB, + // A constant reserved for future use. + NoName = 0xFC, + // The PA1 key. + Pa1 = 0xFD, + // The CLEAR key. + OemClear = 0xFE, + // The SHIFT modifier key. + Shift = 0x00010000, + // The CTRL modifier key. + Control = 0x00020000, + // The ALT modifier key. + Alt = 0x00040000, + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Kore.h b/r5dev/thirdparty/cppnet/cppkore/Kore.h new file mode 100644 index 00000000..02793598 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Kore.h @@ -0,0 +1,203 @@ +#pragma once + +// These are the base implementations of the Kore library and are required for everything +#include "ListBase.h" +#include "StringBase.h" +#include "DictionaryBase.h" +#include "ImmutableStringBase.h" + +// Data\* is used in several support classes so it will always be defined +#include "Pattern.h" +#include "SecureString.h" + +// System\* is always included and used for organization +#include "Environment.h" +#include "Console.h" +#include "ConsoleKey.h" +#include "ConsoleColor.h" +#include "ConsoleKeyInfo.h" +#include "Settings.h" + +#ifndef KORE_ENABLE_IO +#define KORE_ENABLE_IO 1 +#endif + +#ifndef KORE_ENABLE_NET +#define KORE_ENABLE_NET 1 +#endif + +#ifndef KORE_ENABLE_THREAD +#define KORE_ENABLE_THREAD 1 +#endif + +#ifndef KORE_ENABLE_DIAG +#define KORE_ENABLE_DIAG 1 +#endif + +#ifndef KORE_ENABLE_MATH +#define KORE_ENABLE_MATH 1 +#endif + +#ifndef KORE_ENABLE_WIN32 +#define KORE_ENABLE_WIN32 1 +#endif + +#ifndef KORE_ENABLE_COMP +#define KORE_ENABLE_COMP 1 +#endif + +#ifndef KORE_ENABLE_HASH +#define KORE_ENABLE_HASH 1 +#endif + +#ifndef KORE_ENABLE_FORMS +#define KORE_ENABLE_FORMS 1 +#endif + +#ifndef KORE_ENABLE_DRAWING +#define KORE_ENABLE_DRAWING 1 +#endif + +#ifndef KORE_ENABLE_ASSETS +#define KORE_ENABLE_ASSETS 1 +#endif + +#if KORE_ENABLE_IO +#include "Path.h" +#include "File.h" +#include "Stream.h" +#include "IOError.h" +#include "FileMode.h" +#include "FileShare.h" +#include "Directory.h" +#include "SeekOrigin.h" +#include "FileAccess.h" +#include "FileStream.h" +#include "TextReader.h" +#include "TextWriter.h" +#include "MemoryStream.h" +#include "ProcessStream.h" +#include "ProcessReader.h" +#include "BinaryReader.h" +#include "BinaryWriter.h" +#include "StreamReader.h" +#include "StreamWriter.h" +#endif + +#if KORE_ENABLE_NET +#include "Uri.h" +#include "InternetPortType.h" +#endif + +#if KORE_ENABLE_THREAD +#include "Task.h" +#include "Thread.h" +#include "ParallelTask.h" +#include "ThreadStart.h" +#endif + +#if KORE_ENABLE_DIAG +#include "Process.h" +#include "ProcessInfo.h" +#endif + +#if KORE_ENABLE_MATH +#include "MathHelper.h" +#include "Vector2.h" +#include "Vector3.h" +#include "Quaternion.h" +#include "Matrix.h" +#include "Half.h" +#endif + +#if KORE_ENABLE_WIN32 +#include "RegistryView.h" +#include "RegistryHive.h" +#include "RegistryKey.h" +#include "RegistryValueType.h" +#include "Registry.h" +#include "Win32Error.h" +#include "clipboard/clip.h" +#endif + +#if KORE_ENABLE_COMP +#include "LZ4Codec.h" +#include "LZ4Stream.h" +#include "ZLibCodec.h" +#include "ZipArchive.h" +#include "DeflateStream.h" +#include "DeflateCodec.h" +#include "LZO1XCodec.h" +#include "LZHAMCodec.h" +#include "CompressionMode.h" +#endif + +#if KORE_ENABLE_HASH +#include "XXHash.h" +#include "CRC32.h" +#endif + +#if KORE_ENABLE_FORMS +#include "Application.h" +#include "Form.h" +#include "Keys.h" +#include "Control.h" +#include "ButtonBase.h" +#include "Button.h" +#include "Panel.h" +#include "GroupBox.h" +#include "Label.h" +#include "MessageBox.h" +#include "ListView.h" +#include "ComboBox.h" +#include "ToolTip.h" +#include "CheckBox.h" +#include "ListViewItem.h" +#include "RadioButton.h" +#include "Message.h" +#include "FlatStyle.h" +#include "TextBox.h" +#include "TextBoxBase.h" +#include "BorderStyle.h" +#include "ProgressBar.h" +#include "DialogResult.h" +#include "OpenGLViewport.h" +#include "CreateParams.h" +#include "MouseButtons.h" +#include "AnchorStyles.h" +#include "ControlStyles.h" +#include "OpenFileDialog.h" +#include "SaveFileDialog.h" +#include "ControlStates.h" +#include "PaintEventArgs.h" +#include "MouseEventArgs.h" +#include "KeyEventArgs.h" +#include "InvalidateEventArgs.h" +#include "KeyPressEventArgs.h" +#endif + +#if KORE_ENABLE_DRAWING +#include "Font.h" +#include "Icon.h" +#include "DrawingBase.h" +#include "TextRenderer.h" +#include "ContentAlignment.h" +#include "BufferedGraphics.h" +#endif + +#if KORE_ENABLE_ASSETS +#include "Model.h" +#include "DDS.h" +#include "WAV.h" +#include "WavefrontOBJ.h" +#include "Texture.h" +#include "AssetRenderer.h" +#include "UnrealEngine.h" +#include "ValveSMD.h" +#include "SEAsset.h" +#include "XNALaraAscii.h" +#include "KaydaraFBX.h" +#include "AutodeskMaya.h" +#include "XNALaraBinary.h" +#include "CoDXAssetExport.h" +#endif \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/KoreTheme.cpp b/r5dev/thirdparty/cppnet/cppkore/KoreTheme.cpp new file mode 100644 index 00000000..18297626 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/KoreTheme.cpp @@ -0,0 +1,484 @@ +#include "stdafx.h" +#include "KoreTheme.h" +#include "MessageBox.h" +#include "TextRenderer.h" +#include "CheckBoxImage.h" + +namespace Themes +{ + // Constants for brushes + /*const static auto BorderBrush = Drawing::Color(219, 56, 80); + const static auto DisabledBorderBrush = Drawing::Color(30, 32, 55); + + + const static auto BackgroundBrush = Drawing::Color(30, 32, 55); + const static auto BackgroundLightBrush = Drawing::Color(31, 37, 62); + + + const static auto BackgroundGrad1 = Drawing::Color(30, 32, 55); + const static auto BackgroundGrad2 = Drawing::Color(30, 32, 55); + + + const static auto BackgroundOverGrad1 = Drawing::Color(30, 32, 55); + const static auto BackgroundOverGrad2 = Drawing::Color(30, 32, 55); + + + const static auto TextEnabledBrush = Drawing::Color(Drawing::Color::White); + const static auto TextDisabledBrush = Drawing::Color(Drawing::Color::Gray); + + + const static auto ProgressGrad1 = Drawing::Color(219, 56, 80); + const static auto ProgressGrad2 = Drawing::Color(219, 56, 80); + + const static auto HeaderBrush = Drawing::Color(46, 53, 84);*/ + + // New Theme, saving for anyone else who wants to help. + const static auto BorderBrush = Drawing::Color(113, 156, 235); + const static auto DarkBorderBrush = Drawing::Color(113, 156, 235); + const static auto DisabledBorderBrush = Drawing::Color(160, 160, 160); + + const static auto BackgroundBrush = Drawing::Color(33, 33, 33); + const static auto BackgroundLightBrush = Drawing::Color(39, 39, 39); + + const static auto BackgroundGrad1 = Drawing::Color(45, 45, 45); + const static auto BackgroundGrad2 = Drawing::Color(36, 36, 36); + + const static auto BackgroundOverGrad1 = Drawing::Color(49, 49, 49); + const static auto BackgroundOverGrad2 = Drawing::Color(40, 40, 40); + + const static auto TextEnabledBrush = Drawing::Color(Drawing::Color::White); + const static auto TextDisabledBrush = Drawing::Color(Drawing::Color::Gray); + + const static auto ProgressGrad1 = Drawing::Color(113, 156, 235); + const static auto ProgressGrad2 = Drawing::Color(113, 156, 235); + + const static auto HeaderBrush = Drawing::Color(54, 54, 54); + + // Constants for images + static Drawing::Image* CheckBoxImage = nullptr; + + KoreTheme::KoreTheme() + : UIX::UIXRenderer() + { + CheckBoxImage = Drawing::ImageFromTgaData(CheckBoxImage_Src, sizeof(CheckBoxImage_Src)); + + // Change the message box colors to represent our theme + Forms::MessageBox::SetMessageBoxColors(Drawing::Color::White, BackgroundBrush, BackgroundLightBrush); + } + + KoreTheme::~KoreTheme() + { + delete CheckBoxImage; + } + + void KoreTheme::RenderControlBorder(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIX::UIXRenderState State) const + { + Drawing::Rectangle Rect(Ctrl->ClientRectangle()); + + // + // Override for textbox rendering due to a bug in the layout rect + // + + if (Ctrl->GetType() == Forms::ControlTypes::TextBox) + { + Rect.Width = Ctrl->Size().Width; + Rect.Height = Ctrl->Size().Height; + } + + Rect.Width--; + Rect.Height--; + + Drawing::SolidBrush Brush((State == UIX::UIXRenderState::Disabled) ? DisabledBorderBrush : BorderBrush); + Drawing::Pen Pen(&Brush); + + // Check again for textbox due to size issues + if (Ctrl->GetType() == Forms::ControlTypes::TextBox) + { + auto brush = Drawing::SolidBrush(BackgroundBrush); + auto pen = Drawing::Pen(&brush); + EventArgs->Graphics->DrawRectangle(&pen, Rect); + } + + // Now render smooth border + auto SmMode = EventArgs->Graphics->GetSmoothingMode(); + { + + EventArgs->Graphics->SetSmoothingMode(Gdiplus::SmoothingMode::SmoothingModeAntiAlias); + Drawing::DrawRoundRectangle(EventArgs->Graphics.get(), &Pen, Rect, 2); + } + EventArgs->Graphics->SetSmoothingMode(SmMode); + } + + void KoreTheme::RenderControlBackground(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIX::UIXRenderState State) const + { + Drawing::Rectangle Rect(Ctrl->ClientRectangle()); + + auto brush = Drawing::SolidBrush(BackgroundBrush); + EventArgs->Graphics->FillRectangle(&brush, Rect); + } + + void KoreTheme::RenderControlButtonBackground(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIX::UIXRenderState State) const + { + Drawing::Rectangle Rect(Ctrl->ClientRectangle()); + + std::unique_ptr DrawBrush = nullptr; + + switch (State) + { + case UIX::UIXRenderState::Default: + DrawBrush = std::make_unique(Rect, BackgroundGrad1, BackgroundGrad2, 90.f); + break; + case UIX::UIXRenderState::Disabled: + DrawBrush = std::make_unique(Rect, BackgroundGrad1, BackgroundGrad2, 90.f); + break; + case UIX::UIXRenderState::MouseOver: + DrawBrush = std::make_unique(Rect, BackgroundOverGrad1, BackgroundOverGrad2, 90.f); + break; + case UIX::UIXRenderState::MouseDown: + DrawBrush = std::make_unique(Rect, BackgroundGrad1, BackgroundGrad2, 270.f); + break; + } + + EventArgs->Graphics->FillRectangle(DrawBrush.get(), Rect); + } + + void KoreTheme::RenderControlText(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIX::UIXRenderState State, Drawing::Rectangle LayoutRect, Drawing::ContentAlignment Alignment) const + { + // Calculate formatting flags + auto FormatFlags = Drawing::TextFormatFlags::WordBreak; + + // Handle horizontal alignment + if (((int)Alignment & (int)Drawing::AnyLeftAlign) != 0) + FormatFlags |= Drawing::TextFormatFlags::Left; + else if (((int)Alignment & (int)Drawing::AnyRightAlign) != 0) + FormatFlags |= Drawing::TextFormatFlags::Right; + else + FormatFlags |= Drawing::TextFormatFlags::HorizontalCenter; + + // Handle vertical alignment + if (((int)Alignment & (int)Drawing::AnyTopAlign) != 0) + FormatFlags |= Drawing::TextFormatFlags::Top; + else if (((int)Alignment & (int)Drawing::AnyBottomAlign) != 0) + FormatFlags |= Drawing::TextFormatFlags::Bottom; + else + FormatFlags |= Drawing::TextFormatFlags::VerticalCenter | Drawing::TextFormatFlags::SingleLine; + + // Render to surface + Drawing::TextRenderer::DrawText(EventArgs->Graphics, Ctrl->Text(), *Ctrl->GetFont(), LayoutRect, (State == UIX::UIXRenderState::Disabled) ? TextDisabledBrush : TextEnabledBrush, FormatFlags); + } + + void KoreTheme::RenderControlProgressFill(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIX::UIXRenderState State, uint32_t Progress) const + { + // Bring client rect to stack + Drawing::Rectangle Rect(Ctrl->ClientRectangle()); + + // Generate the proper gradient if enabled/disabled + Drawing::LinearGradientBrush FillBrush(Rect, ProgressGrad1, ProgressGrad2, 90.f); + + // Render the fill to surface + + auto SmMode = EventArgs->Graphics->GetSmoothingMode(); + { + EventArgs->Graphics->SetSmoothingMode(Gdiplus::SmoothingMode::SmoothingModeAntiAlias); + Gdiplus::RectF FillBounds(0, 0, (Rect.Width - 1.f) * (Progress / 100.0f), Rect.Height - 1.f); + Drawing::FillRoundRectangle(EventArgs->Graphics.get(), &FillBrush, FillBounds, 2); + } + EventArgs->Graphics->SetSmoothingMode(SmMode); + + //EventArgs->Graphics->FillRectangle(&FillBrush, Gdiplus::RectF(2, 2, (Rect.Width - 4.f) * (Progress / 100.0f), Rect.Height - 4.f)); + } + + void KoreTheme::RenderControlGlyph(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIX::UIXRenderState State) const + { + // Bring client rect to stack + Drawing::Rectangle Rect(Ctrl->ClientRectangle()); + + // Create Brush + Drawing::SolidBrush FillBrush((State == UIX::UIXRenderState::Disabled) ? DisabledBorderBrush : BorderBrush); + + // It's already setup this way + Rect.Width--; + Rect.Height--; + + // Ensure smooth glyph + EventArgs->Graphics->SetSmoothingMode(Gdiplus::SmoothingMode::SmoothingModeAntiAlias); + + Gdiplus::GraphicsPath Path; + Drawing::Rectangle RectCheck(Rect.Width - 18, 0, 18, Rect.Height - 1); + + // Rotate the glyph + EventArgs->Graphics->TranslateTransform(RectCheck.X + RectCheck.Width / 2.f, RectCheck.Y + RectCheck.Height / 2.f); + + // Draw the triangle + Path.AddLine(Drawing::PointF(-6 / 2.0f, -3 / 2.0f), Drawing::PointF(6 / 2.0f, -3 / 2.0f)); + Path.AddLine(Drawing::PointF(6 / 2.0f, -3 / 2.0f), Drawing::PointF(0, 6 / 2.0f)); + Path.CloseFigure(); + + // Reset rotation + EventArgs->Graphics->RotateTransform(0); + + // Render the glyph to surface + EventArgs->Graphics->FillPath(&FillBrush, &Path); + } + + void KoreTheme::RenderControlCheckBoxBorder(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIX::UIXRenderState State) const + { + Drawing::Rectangle Rect(Ctrl->ClientRectangle()); + + // Create the border brush + auto brush = Drawing::SolidBrush((State == UIX::UIXRenderState::Disabled) ? DisabledBorderBrush : BorderBrush); + Drawing::Pen Pen(&brush); + + // Calculate box sizing + Drawing::Rectangle BoxRect(0, 0, Rect.Height - 1, Rect.Height - 1); + Drawing::Rectangle FillRect(1, 1, Rect.Height - 2, Rect.Height - 2); + + // Create the fill brush + std::unique_ptr FillBrush; + + // Change based on state + switch (State) + { + case UIX::UIXRenderState::Default: + case UIX::UIXRenderState::Disabled: + FillBrush = std::make_unique(FillRect, BackgroundGrad1, BackgroundGrad2, 90.f); + break; + case UIX::UIXRenderState::MouseOver: + FillBrush = std::make_unique(FillRect, BackgroundOverGrad1, BackgroundOverGrad2, 90.f); + break; + case UIX::UIXRenderState::Selected: + FillBrush = std::make_unique(FillRect, ProgressGrad1, ProgressGrad2, 90.f); + break; + } + + // Render the boxes to surface + EventArgs->Graphics->FillRectangle(FillBrush.get(), FillRect); + EventArgs->Graphics->DrawRectangle(&Pen, BoxRect); + } + + void KoreTheme::RenderControlCheckBoxCheck(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIX::UIXRenderState State) const + { + Drawing::Rectangle Rect(Ctrl->ClientRectangle()); + Drawing::Rectangle CheckRect(((Rect.Height - 12) / 2) + 1, (Rect.Height - 12) / 2, 12, 12); + + // Render the image to the surface + if (State == UIX::UIXRenderState::Selected) + EventArgs->Graphics->DrawImage(CheckBoxImage, CheckRect); + } + + void KoreTheme::RenderControlRadioBorder(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIX::UIXRenderState State) const + { + Drawing::Rectangle Rect(Ctrl->ClientRectangle()); + + // Determine which fill to use + auto brush = Drawing::SolidBrush((State == UIX::UIXRenderState::Disabled) ? DisabledBorderBrush : BorderBrush); + Drawing::Pen Pen(&brush); + + // Adjust for overhang + Rect.Width--; + Rect.Height--; + + // Render the circle to surface + auto SmMode = EventArgs->Graphics->GetSmoothingMode(); + { + EventArgs->Graphics->SetSmoothingMode(Gdiplus::SmoothingMode::SmoothingModeAntiAlias); + EventArgs->Graphics->DrawEllipse(&Pen, Drawing::Rectangle(0, 0, Rect.Height, Rect.Height)); + } + EventArgs->Graphics->SetSmoothingMode(SmMode); + } + + void KoreTheme::RenderControlRadioCheck(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIX::UIXRenderState State) const + { + Drawing::Rectangle Rect(Ctrl->ClientRectangle()); + Drawing::Rectangle FillRect(1, 1, Rect.Height - 3, Rect.Height - 3); + + // Create the fill brush + std::unique_ptr FillBrush; + + // Change based on state + switch (State) + { + case UIX::UIXRenderState::Disabled: + FillBrush = std::make_unique(FillRect, DisabledBorderBrush, DisabledBorderBrush, 90.f); + FillRect = { 3, 3, (INT)Rect.Height - 7, (INT)Rect.Height - 7 }; + break; + case UIX::UIXRenderState::Default: + FillBrush = std::make_unique(FillRect, BackgroundGrad1, BackgroundGrad2, 90.f); + break; + case UIX::UIXRenderState::MouseOver: + FillBrush = std::make_unique(FillRect, BackgroundOverGrad1, BackgroundOverGrad2, 90.f); + break; + case UIX::UIXRenderState::Selected: + FillBrush = std::make_unique(FillRect, ProgressGrad1, ProgressGrad2, 90.f); + FillRect = { 3, 3, (INT)Rect.Height - 7, (INT)Rect.Height - 7 }; + break; + } + + // Render the state + auto SmMode = EventArgs->Graphics->GetSmoothingMode(); + { + EventArgs->Graphics->SetSmoothingMode(Gdiplus::SmoothingMode::SmoothingModeAntiAlias); + EventArgs->Graphics->FillEllipse(FillBrush.get(), FillRect); + } + EventArgs->Graphics->SetSmoothingMode(SmMode); + } + + void KoreTheme::RenderControlGroupBox(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIX::UIXRenderState State) const + { + Drawing::Rectangle Rect(Ctrl->ClientRectangle()); + + Drawing::SolidBrush BackBrush(BackgroundBrush); + Drawing::SolidBrush OutlineBrush(DarkBorderBrush); + Drawing::SolidBrush TextBrush((State == UIX::UIXRenderState::Disabled) ? TextDisabledBrush : TextEnabledBrush); + + EventArgs->Graphics->FillRectangle(&BackBrush, Rect); + + auto Text = Ctrl->Text().ToWString(); + auto Font = Ctrl->GetFont()->GetFont(); + + Gdiplus::RectF TextLayoutRect(0.0f, 0.0f, (float)Rect.Width, (float)Rect.Height); + Gdiplus::RectF TextSize; + + EventArgs->Graphics->MeasureString((wchar_t*)Text, Text.Length(), Font.get(), TextLayoutRect, &TextSize); + EventArgs->Graphics->DrawString((wchar_t*)Text, Text.Length(), Font.get(), Gdiplus::PointF(12, 0), &TextBrush); + + Drawing::PointF Lines[] = + { + // Top-left + {0, TextSize.Height / 2.f}, + {12, TextSize.Height / 2.f}, + // Left + {0, TextSize.Height / 2.f}, + {0, Rect.Height - 1.f}, + // Bottom + {0, Rect.Height - 1.f}, + {Rect.Width - 1.f, Rect.Height - 1.f}, + // Right + {Rect.Width - 1.f, Rect.Height - 1.f}, + {Rect.Width - 1.f, TextSize.Height / 2.f}, + // Top-right + {TextSize.Width + 11.f, TextSize.Height / 2.f}, + {Rect.Width - 1.f, TextSize.Height / 2.f} + }; + + auto pen = Drawing::Pen(&OutlineBrush); + EventArgs->Graphics->DrawLines(&pen, &Lines[0], _countof(Lines)); + } + + void KoreTheme::RenderControlListColumnHeader(const std::unique_ptr& EventArgs, Forms::Control* Ctrl) const + { + // Fetch color from foreground + Drawing::SolidBrush BackBrush(HeaderBrush); + + // Render to the surface + Drawing::Rectangle NewBounds(EventArgs->Bounds); + + NewBounds.Inflate(0, -1); + NewBounds.Width -= 2; + + auto SmMode = EventArgs->Graphics->GetSmoothingMode(); + { + EventArgs->Graphics->SetSmoothingMode(Gdiplus::SmoothingMode::SmoothingModeAntiAlias); + Drawing::FillRoundRectangle(EventArgs->Graphics.get(), &BackBrush, NewBounds, 2); + } + EventArgs->Graphics->SetSmoothingMode(SmMode); + + // Shift control bounds for rendering text + NewBounds.X += 5; + NewBounds.Width -= 5; + + Drawing::TextRenderer::DrawText(EventArgs->Graphics, EventArgs->Header->Text(), *Ctrl->GetFont(), NewBounds, Drawing::Color::White, Drawing::TextFormatFlags::Left | Drawing::TextFormatFlags::VerticalCenter | Drawing::TextFormatFlags::SingleLine | Drawing::TextFormatFlags::EndEllipsis); + } + + void KoreTheme::RenderControlListHeader(const std::unique_ptr& EventArgs) const + { + auto brush = Drawing::SolidBrush(BackgroundLightBrush); + EventArgs->Graphics->FillRectangle(&brush, EventArgs->Region()); + Drawing::SolidBrush BackBrush(HeaderBrush); + Drawing::Rectangle NewBounds(EventArgs->Region()); + + NewBounds.Inflate(0, -1); + NewBounds.Width -= 2; + + auto SmMode = EventArgs->Graphics->GetSmoothingMode(); + { + EventArgs->Graphics->SetSmoothingMode(Gdiplus::SmoothingMode::SmoothingModeAntiAlias); + Drawing::FillRoundRectangle(EventArgs->Graphics.get(), &BackBrush, NewBounds, 2); + } + EventArgs->Graphics->SetSmoothingMode(SmMode); + EventArgs->Render(); + } + + void KoreTheme::RenderControlListItem(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, Drawing::Rectangle SubItemBounds) const + { + // This isn't used for modern rendering. + } + + void KoreTheme::RenderControlListSubItem(const std::unique_ptr& EventArgs, Forms::Control* Ctrl) const + { + // Use stock bounds, subitems are valid + Drawing::Rectangle SubItemBounds(EventArgs->Bounds); + + // Fetch the state because we are owner draw + auto State = SendMessageA(Ctrl->GetHandle(), LVM_GETITEMSTATE, (WPARAM)EventArgs->ItemIndex, (LPARAM)LVIS_SELECTED); + + // Fetch color from style + Drawing::SolidBrush BackBrush((State == LVIS_SELECTED) ? BorderBrush : EventArgs->Style.BackColor); + + // Build text layout rect + Drawing::Rectangle TextLayoutRect(SubItemBounds); + + // Pad start and end + TextLayoutRect.X += 1; + TextLayoutRect.Width -= 2; + + // Render background first, then text + EventArgs->Graphics->FillRectangle(&BackBrush, SubItemBounds); + Drawing::TextRenderer::DrawText(EventArgs->Graphics, EventArgs->Text, *Ctrl->GetFont(), TextLayoutRect, (State == LVIS_SELECTED) ? Drawing::Color::White : EventArgs->Style.ForeColor, Drawing::TextFormatFlags::Left | Drawing::TextFormatFlags::VerticalCenter | Drawing::TextFormatFlags::SingleLine | Drawing::TextFormatFlags::EndEllipsis); + } + + void KoreTheme::RenderControlToolTip(const std::unique_ptr& EventArgs, Forms::Control* Ctrl) const + { + Drawing::SolidBrush Brush(BackgroundLightBrush); + + // Render to surface + EventArgs->Graphics->FillRectangle(&Brush, EventArgs->Bounds); + + Drawing::Rectangle BoundsOne(EventArgs->Bounds); + BoundsOne.Inflate(-1, -1); + + + auto brush = Drawing::SolidBrush(BorderBrush); + auto pen = Drawing::Pen(&brush); + + EventArgs->Graphics->DrawRectangle(&pen, BoundsOne); + + Drawing::SolidBrush TextBrush(TextEnabledBrush); + Gdiplus::RectF BoundsF((float)EventArgs->Bounds.X, (float)EventArgs->Bounds.Y, (float)EventArgs->Bounds.Width, (float)EventArgs->Bounds.Height); + + Gdiplus::StringFormat Fmt; + Fmt.SetAlignment(Gdiplus::StringAlignment::StringAlignmentCenter); + Fmt.SetLineAlignment(Gdiplus::StringAlignment::StringAlignmentCenter); + + auto WideString = Ctrl->Text().ToWString(); + auto Fnt = Ctrl->GetFont()->GetFont(); + + // Render text + EventArgs->Graphics->DrawString((wchar_t*)WideString, WideString.Length(), Fnt.get(), BoundsF, &Fmt, &TextBrush); + } + + Drawing::Color KoreTheme::GetRenderColor(UIX::UIXRenderColor Color) const + { + switch (Color) + { + case UIX::UIXRenderColor::TextDefault: + return TextEnabledBrush; + case UIX::UIXRenderColor::BackgroundDefault: + return BackgroundBrush; + case UIX::UIXRenderColor::BackgroundLight: + return BackgroundLightBrush; + default: + return Drawing::Color(); + } + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/KoreTheme.h b/r5dev/thirdparty/cppnet/cppkore/KoreTheme.h new file mode 100644 index 00000000..2ff7878d --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/KoreTheme.h @@ -0,0 +1,42 @@ +#pragma once + +#include +#include "DrawingBase.h" +#include "ContentAlignment.h" +#include "UIXRenderer.h" + +namespace Themes +{ + class KoreTheme : public UIX::UIXRenderer + { + public: + KoreTheme(); + virtual ~KoreTheme(); + + private: + // Inherited via UIXRenderer + virtual void RenderControlBorder(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIX::UIXRenderState State) const override; + virtual void RenderControlBackground(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIX::UIXRenderState State) const override; + virtual void RenderControlButtonBackground(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIX::UIXRenderState State) const override; + virtual void RenderControlText(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIX::UIXRenderState State, Drawing::Rectangle LayoutRect, Drawing::ContentAlignment Alignment) const override; + virtual void RenderControlProgressFill(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIX::UIXRenderState State, uint32_t Progress) const override; + virtual void RenderControlGlyph(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIX::UIXRenderState State) const override; + virtual void RenderControlCheckBoxBorder(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIX::UIXRenderState State) const override; + virtual void RenderControlCheckBoxCheck(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIX::UIXRenderState State) const override; + virtual void RenderControlRadioBorder(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIX::UIXRenderState State) const override; + virtual void RenderControlRadioCheck(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIX::UIXRenderState State) const override; + virtual void RenderControlGroupBox(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIX::UIXRenderState State) const override; + + // Inherited via UIXRenderer + virtual void RenderControlListHeader(const std::unique_ptr& EventArgs) const override; + virtual void RenderControlListColumnHeader(const std::unique_ptr& EventArgs, Forms::Control* Ctrl) const override; + virtual void RenderControlListItem(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, Drawing::Rectangle SubItemBounds) const override; + virtual void RenderControlListSubItem(const std::unique_ptr& EventArgs, Forms::Control* Ctrl) const override; + + // Inherited via UIXRenderer + virtual void RenderControlToolTip(const std::unique_ptr& EventArgs, Forms::Control* Ctrl) const override; + + // Inherited via UIXRenderer + virtual Drawing::Color GetRenderColor(UIX::UIXRenderColor Color) const override; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/LZ4Codec.cpp b/r5dev/thirdparty/cppnet/cppkore/LZ4Codec.cpp new file mode 100644 index 00000000..d1424c82 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/LZ4Codec.cpp @@ -0,0 +1,75 @@ +#include "stdafx.h" +#include "LZ4Codec.h" + +#include "..\cppkore_incl\LZ4_XXHash\lz4.h" +#include "..\cppkore_incl\LZ4_XXHash\lz4hc.h" + +#if _WIN64 +#pragma comment(lib, "..\\cppkore_libs\\LZ4_XXHash\\liblz4_static_64.lib") +#else +#pragma comment(lib, "..\\cppkore_libs\\LZ4_XXHash\\liblz4_static_32.lib") +#endif + +namespace Compression +{ + uint64_t LZ4Codec::Compress(uint8_t* Input, uint64_t InputOffset, uint64_t InputLength, uint8_t* Output, uint64_t OutputOffset, uint64_t OutputLength) + { + return LZ4_compress_default((const char*)(Input + InputOffset), (char*)(Output + OutputOffset), (int)InputLength, (int)OutputLength); + } + + std::unique_ptr LZ4Codec::Compress(uint8_t* Input, uint64_t InputOffset, uint64_t InputLength, uint64_t& OutputLength) + { + auto ResultBounds = LZ4_compressBound((int)InputLength); + auto Result = std::make_unique(ResultBounds); + + OutputLength = 0; + + auto Encoded = LZ4_compress_default((const char*)(Input + InputOffset), (char*)Result.get(), (int)InputLength, ResultBounds); + if (Encoded == 0) + return nullptr; + + OutputLength = (uint64_t)Encoded; + + return Result; + } + + uint64_t LZ4Codec::CompressHC(uint8_t* Input, uint64_t InputOffset, uint64_t InputLength, uint8_t* Output, uint64_t OutputOffset, uint64_t OutputLength, LZ4CompressionLevel Level) + { + return LZ4_compress_HC((const char*)(Input + InputOffset), (char*)(Output + OutputOffset), (int)InputLength, (int)OutputLength, (uint8_t)Level); + } + + std::unique_ptr LZ4Codec::CompressHC(uint8_t* Input, uint64_t InputOffset, uint64_t InputLength, uint64_t& OutputLength, LZ4CompressionLevel Level) + { + auto ResultBounds = LZ4_compressBound((int)InputLength); + auto Result = std::make_unique(ResultBounds); + + OutputLength = 0; + + auto Encoded = LZ4_compress_HC((const char*)(Input + InputOffset), (char*)Result.get(), (int)InputLength, ResultBounds, (uint8_t)Level); + if (Encoded == 0) + return nullptr; + + OutputLength = (uint64_t)Encoded; + + return Result; + } + + uint64_t LZ4Codec::Decompress(uint8_t* Input, uint64_t InputOffset, uint64_t InputLength, uint8_t* Output, uint64_t OutputOffset, uint64_t OutputLength) + { + return LZ4_decompress_safe((const char*)(Input + InputOffset), (char*)(Output + OutputOffset), (int)InputLength, (int)OutputLength); + } + + std::unique_ptr LZ4Codec::Decompress(uint8_t* Input, uint64_t InputOffset, uint64_t InputLength, uint64_t KnownOutputLength) + { + if (InputLength == 0) + return nullptr; + + auto Result = std::make_unique(KnownOutputLength); + + auto ResultLength = LZ4_decompress_safe((const char*)(Input + InputOffset), (char*)Result.get(), (int)InputLength, (int)KnownOutputLength); + if (ResultLength <= 0) + return nullptr; + + return Result; + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/LZ4Codec.h b/r5dev/thirdparty/cppnet/cppkore/LZ4Codec.h new file mode 100644 index 00000000..9d1cf941 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/LZ4Codec.h @@ -0,0 +1,37 @@ +#pragma once + +#include +#include + +namespace Compression +{ + // This enumeration represents the various supported compression levels + enum class LZ4CompressionLevel : uint8_t + { + Min = 3, + Default = 9, + OptMin = 10, + Max = 12 + }; + + // A compression codec that implements the LZ4 algo. + class LZ4Codec + { + public: + + // Compress the input buffer using the LZ4 codec + static uint64_t Compress(uint8_t* Input, uint64_t InputOffset, uint64_t InputLength, uint8_t* Output, uint64_t OutputOffset, uint64_t OutputLength); + // Compress the input buffer using the LZ4 codec + static std::unique_ptr Compress(uint8_t* Input, uint64_t InputOffset, uint64_t InputLength, uint64_t& OutputLength); + + // Compress the input buffer using the LZ4 codec (High Compression) + static uint64_t CompressHC(uint8_t* Input, uint64_t InputOffset, uint64_t InputLength, uint8_t* Output, uint64_t OutputOffset, uint64_t OutputLength, LZ4CompressionLevel Level = LZ4CompressionLevel::Max); + // Compress the input buffer using the LZ4 codec (High Compression) + static std::unique_ptr CompressHC(uint8_t* Input, uint64_t InputOffset, uint64_t InputLength, uint64_t& OutputLength, LZ4CompressionLevel Level = LZ4CompressionLevel::Max); + + // Decompress the input buffer using the LZ4 codec + static uint64_t Decompress(uint8_t* Input, uint64_t InputOffset, uint64_t InputLength, uint8_t* Output, uint64_t OutputOffset, uint64_t OutputLength); + // Decompress the input buffer using the LZ4 codec (With known output length) + static std::unique_ptr Decompress(uint8_t* Input, uint64_t InputOffset, uint64_t InputLength, uint64_t KnownOutputLength); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/LZ4Stream.cpp b/r5dev/thirdparty/cppnet/cppkore/LZ4Stream.cpp new file mode 100644 index 00000000..c9ab6d90 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/LZ4Stream.cpp @@ -0,0 +1,277 @@ +#include "stdafx.h" +#include "LZ4Stream.h" + +#include "..\cppkore_incl\LZ4_XXHash\lz4.h" +#include "..\cppkore_incl\LZ4_XXHash\lz4hc.h" + +#if _WIN64 +#pragma comment(lib, "..\\cppkore_libs\\LZ4_XXHash\\liblz4_static_64.lib") +#else +#pragma comment(lib, "..\\cppkore_libs\\LZ4_XXHash\\liblz4_static_32.lib") +#endif + +namespace Compression +{ + LZ4Stream::LZ4Stream(std::unique_ptr Stream, CompressionMode Mode, bool HighCompression, uint32_t BlockSize, bool LeaveOpen) + : BaseStream(std::move(Stream)), _Mode(Mode), _HighCompression(HighCompression), _BlockSize(BlockSize), _LeaveOpen(LeaveOpen) + { + } + + LZ4Stream::LZ4Stream(IO::Stream* Stream, CompressionMode Mode, bool HighCompression, uint32_t BlockSize, bool LeaveOpen) + : BaseStream(Stream), _Mode(Mode), _HighCompression(HighCompression), _BlockSize(BlockSize), _LeaveOpen(LeaveOpen) + { + } + + LZ4Stream::~LZ4Stream() + { + this->Close(); + } + + bool LZ4Stream::CanRead() + { + return (this->_Mode == CompressionMode::Decompress); + } + + bool LZ4Stream::CanWrite() + { + return (this->_Mode == CompressionMode::Compress); + } + + bool LZ4Stream::CanSeek() + { + return false; + } + + bool LZ4Stream::GetIsEndOfFile() + { + return this->BaseStream->GetIsEndOfFile(); + } + + uint64_t LZ4Stream::GetLength() + { + return this->BaseStream->GetLength(); + } + + uint64_t LZ4Stream::GetPosition() + { + return this->BaseStream->GetPosition(); + } + + void LZ4Stream::SetLength(uint64_t Length) + { + IO::IOError::StreamSetLengthSupport(); + } + + void LZ4Stream::SetPosition(uint64_t Position) + { + IO::IOError::StreamNoSeekSupport(); + } + + void LZ4Stream::Close() + { + if (this->_LeaveOpen) + this->BaseStream.release(); + else + this->BaseStream.reset(); + + this->_Buffer.reset(); + } + + void LZ4Stream::Flush() + { + if (this->CanWrite()) + this->BaseStream->Flush(); + } + + void LZ4Stream::Seek(uint64_t Offset, IO::SeekOrigin Origin) + { + IO::IOError::StreamNoSeekSupport(); + } + + uint64_t LZ4Stream::Read(uint8_t* Buffer, uint64_t Offset, uint64_t Count) + { + uint64_t TotalRead = 0; + + while (Count > 0) + { + auto Chunk = std::min(Count, this->_BufferLength - this->_BufferOffset); + + if (Chunk > 0) + { + std::memcpy(Buffer + Offset, this->_Buffer.get() + this->_BufferOffset, Chunk); + + this->_BufferOffset += (uint32_t)Chunk; + TotalRead += Chunk; + + Offset += Chunk; + Count -= Chunk; + } + else + { + if (!this->AcquireNextChunk()) + break; + } + } + + return TotalRead; + } + + uint64_t LZ4Stream::Read(uint8_t* Buffer, uint64_t Offset, uint64_t Count, uint64_t Position) + { + return 0; + } + + void LZ4Stream::Write(uint8_t* Buffer, uint64_t Offset, uint64_t Count) + { + if (this->_Buffer == nullptr) + { + this->_Buffer.reset(new uint8_t[this->_BlockSize]); + this->_BufferOffset = 0; + this->_BufferLength = this->_BlockSize; + } + + while (Count > 0) + { + auto Chunk = std::min(Count, this->_BufferLength - this->_BufferOffset); + + if (Chunk > 0) + { + std::memcpy(this->_Buffer.get() + this->_BufferOffset, Buffer + Offset, Chunk); + + Offset += Chunk; + Count -= Chunk; + this->_BufferOffset += (uint32_t)Chunk; + } + else + { + this->FlushCurrentChunk(); + } + } + } + + void LZ4Stream::Write(uint8_t* Buffer, uint64_t Offset, uint64_t Count, uint64_t Position) + { + } + + bool LZ4Stream::AcquireNextChunk() + { + do + { + uint64_t VarInt; + if (!this->TryReadVarInt(VarInt)) + return false; + + bool isCompressed = (VarInt & 0x1) != 0; + + auto DecompressedLength = this->ReadVarInt(); + auto CompressedLength = (isCompressed) ? this->ReadVarInt() : DecompressedLength; + + if (!isCompressed) + { + if (this->_BufferLength < CompressedLength || this->_Buffer == nullptr) + this->_Buffer.reset(new uint8_t[CompressedLength]); + + this->BaseStream->Read(this->_Buffer.get(), 0, CompressedLength); + this->_BufferLength = (uint32_t)CompressedLength; + } + else + { + if (this->_BufferLength < DecompressedLength || this->_Buffer == nullptr) + this->_Buffer.reset(new uint8_t[DecompressedLength]); + + auto TempBuffer = std::make_unique(CompressedLength); + this->BaseStream->Read(TempBuffer.get(), 0, CompressedLength); + + LZ4_decompress_safe((const char*)TempBuffer.get(), (char*)this->_Buffer.get(), (int)CompressedLength, (int)DecompressedLength); + + this->_BufferLength = (uint32_t)DecompressedLength; + } + + this->_BufferOffset = 0; + + } while (this->_BufferLength == 0); + + return true; + } + + bool LZ4Stream::TryReadVarInt(uint64_t& Result) + { + uint8_t Buffer; + uint32_t Count = 0; + + Result = 0; + + while (true) + { + if (this->BaseStream->Read(&Buffer, 0, 1) == 0) + return false; + + Result = Result + ((uint64_t)(Buffer & 0x7F) << Count); + Count += 7; + + if ((Buffer & 0x80) == 0 || Count >= 64) + break; + } + + return true; + } + + uint64_t LZ4Stream::ReadVarInt() + { + uint64_t Result = 0; + + if (!TryReadVarInt(Result)) + return 0; + + return Result; + } + + void LZ4Stream::FlushCurrentChunk() + { + if (this->_BufferOffset == 0) + return; + + auto TempBuffer = std::make_unique(this->_BufferOffset); + auto TempSize = (this->_HighCompression) ? + LZ4_compress_HC((const char*)this->_Buffer.get(), (char*)TempBuffer.get(), this->_BufferOffset, this->_BufferOffset, LZ4HC_CLEVEL_MAX) + : LZ4_compress_default((const char*)this->_Buffer.get(), (char*)TempBuffer.get(), this->_BufferOffset, this->_BufferOffset); + + if (TempSize <= 0 || (uint32_t)TempSize >= this->_BufferOffset) + { + // No compression... + this->WriteVarInt(0); + this->WriteVarInt(this->_BufferOffset); + + this->BaseStream->Write(this->_Buffer.get(), 0, this->_BufferOffset); + } + else + { + // Use compression... + this->WriteVarInt(1); + this->WriteVarInt(this->_BufferOffset); + this->WriteVarInt(TempSize); + + this->BaseStream->Write(TempBuffer.get(), 0, TempSize); + } + + this->_BufferOffset = 0; + } + + void LZ4Stream::WriteVarInt(uint64_t Value) + { + uint8_t Buffer = 0; + + while (true) + { + auto Temp = (uint8_t)(Value & 0x7F); + Value >>= 7; + + Buffer = (uint8_t)(Temp | (Value == 0 ? 0 : 0x80)); + + this->BaseStream->Write(&Buffer, 0, 1); + + if (Value == 0) + break; + } + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/LZ4Stream.h b/r5dev/thirdparty/cppnet/cppkore/LZ4Stream.h new file mode 100644 index 00000000..dc285e2b --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/LZ4Stream.h @@ -0,0 +1,65 @@ +#pragma once + +#include +#include +#include "Stream.h" +#include "CompressionMode.h" + +namespace Compression +{ + // LZ4Stream supports decompressing and compressing LZ4 encoded data + class LZ4Stream : public IO::Stream + { + public: + LZ4Stream(std::unique_ptr Stream, CompressionMode Mode, bool HighCompression = false, uint32_t BlockSize = (1024 * 1024), bool LeaveOpen = false); + LZ4Stream(IO::Stream* Stream, CompressionMode Mode, bool HighCompression = false, uint32_t BlockSize = (1024 * 1024), bool LeaveOpen = false); + virtual ~LZ4Stream(); + + // Implement Getters and Setters + virtual bool CanRead(); + virtual bool CanWrite(); + virtual bool CanSeek(); + virtual bool GetIsEndOfFile(); + virtual uint64_t GetLength(); + virtual uint64_t GetPosition(); + virtual void SetLength(uint64_t Length); + virtual void SetPosition(uint64_t Position); + + // Implement functions + virtual void Close(); + virtual void Flush(); + virtual void Seek(uint64_t Offset, IO::SeekOrigin Origin); + virtual uint64_t Read(uint8_t* Buffer, uint64_t Offset, uint64_t Count); + virtual uint64_t Read(uint8_t* Buffer, uint64_t Offset, uint64_t Count, uint64_t Position); + virtual void Write(uint8_t* Buffer, uint64_t Offset, uint64_t Count); + virtual void Write(uint8_t* Buffer, uint64_t Offset, uint64_t Count, uint64_t Position); + + private: + // Internal cached flags + std::unique_ptr BaseStream; + bool _LeaveOpen; + bool _HighCompression; + + // The maximum size of each block + uint32_t _BlockSize; + + // Internal compression buffer + std::unique_ptr _Buffer; + uint32_t _BufferLength; + uint32_t _BufferOffset; + + // Mode to use on the data + CompressionMode _Mode; + + // Internal routine to load the next chunk + bool AcquireNextChunk(); + // Internal routine to parse a varint from the stream + bool TryReadVarInt(uint64_t& Result); + // Internal routine to parse a varint + uint64_t ReadVarInt(); + // Internal routine to compress the current chunk + void FlushCurrentChunk(); + // Internal routine to write a varint + void WriteVarInt(uint64_t Value); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/LZHAMCodec.cpp b/r5dev/thirdparty/cppnet/cppkore/LZHAMCodec.cpp new file mode 100644 index 00000000..d3e655e6 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/LZHAMCodec.cpp @@ -0,0 +1,94 @@ +#include "stdafx.h" +#include "LZHAMCodec.h" + +#define LZHAM_STATIC_LIB 1 + +#include "..\cppkore_incl\LZHAM\lzham.h" + +#if _WIN64 +#if _DEBUG +#pragma comment(lib, "..\\cppkore_libs\\LZHAM\\lzhamlib_x64D.lib") +#pragma comment(lib, "..\\cppkore_libs\\LZHAM\\lzhamcomp_x64D.lib") +#pragma comment(lib, "..\\cppkore_libs\\LZHAM\\lzhamdecomp_x64D.lib") +#else +#pragma comment(lib, "..\\cppkore_libs\\LZHAM\\lzhamlib_x64.lib") +#pragma comment(lib, "..\\cppkore_libs\\LZHAM\\lzhamcomp_x64.lib") +#pragma comment(lib, "..\\cppkore_libs\\LZHAM\\lzhamdecomp_x64.lib") +#endif +#else +#error LZHAM only supported via x64 builds... +#endif + +namespace Compression +{ + uint64_t LZHAMCodec::Compress(uint8_t* Input, uint64_t InputOffset, uint64_t InputLength, uint8_t* Output, uint64_t OutputOffset, uint64_t OutputLength, uint32_t DictSize) + { + uint64_t OutputSize = OutputLength; + + lzham_compress_params comp_params{}; + comp_params.m_struct_size = sizeof(comp_params); + comp_params.m_dict_size_log2 = DictSize; + comp_params.m_level = lzham_compress_level::LZHAM_COMP_LEVEL_DEFAULT; + comp_params.m_max_helper_threads = 1; + + lzham_uint32 Adler = 0; + lzham_compress_memory(&comp_params, (lzham_uint8*)(Output + OutputOffset), (size_t*)&OutputSize, (const lzham_uint8*)(Input + InputOffset), (size_t)InputLength, &Adler); + + return OutputSize; + } + + std::unique_ptr LZHAMCodec::Compress(uint8_t* Input, uint64_t InputOffset, uint64_t InputLength, uint64_t& OutputLength, uint32_t DictSize) + { + auto ResultBounds = lzham_z_compressBound((lzham_z_ulong)InputLength); + auto Result = std::make_unique(ResultBounds); + + OutputLength = ResultBounds; + + lzham_compress_params comp_params{}; + comp_params.m_struct_size = sizeof(comp_params); + comp_params.m_dict_size_log2 = DictSize; + comp_params.m_level = lzham_compress_level::LZHAM_COMP_LEVEL_DEFAULT; + comp_params.m_max_helper_threads = 1; + + lzham_uint32 Adler = 0; + + if (lzham_compress_memory(&comp_params, (lzham_uint8*)(Result.get()), (size_t*)&OutputLength, (const lzham_uint8*)(Input + InputOffset), (size_t)InputLength, &Adler) != lzham_compress_status_t::LZHAM_COMP_STATUS_SUCCESS) + { + OutputLength = 0; + return nullptr; + } + + return Result; + } + + uint64_t LZHAMCodec::Decompress(uint8_t* Input, uint64_t InputOffset, uint64_t InputLength, uint8_t* Output, uint64_t OutputOffset, uint64_t OutputLength, uint32_t DictSize) + { + uint64_t OutputSize = OutputLength; + + lzham_decompress_params dec_params{}; + dec_params.m_struct_size = sizeof(dec_params); + dec_params.m_dict_size_log2 = DictSize; + + lzham_uint32 Adler = 0; + lzham_decompress_memory(&dec_params, (lzham_uint8*)(Output + OutputOffset), (size_t*)&OutputSize, (const lzham_uint8*)(Input + InputOffset), (size_t)InputLength, &Adler); + + return OutputSize; + } + + std::unique_ptr LZHAMCodec::Decompress(uint8_t* Input, uint64_t InputOffset, uint64_t InputLength, uint64_t KnownOutputLength, uint32_t DictSize) + { + auto ResultSize = KnownOutputLength; + auto Result = std::make_unique(KnownOutputLength); + + lzham_decompress_params dec_params{}; + dec_params.m_struct_size = sizeof(dec_params); + dec_params.m_dict_size_log2 = DictSize; + + lzham_uint32 Adler = 0; + + if (lzham_decompress_memory(&dec_params, (lzham_uint8*)(Result.get()), (size_t*)&ResultSize, (const lzham_uint8*)(Input + InputOffset), (size_t)InputLength, &Adler) != lzham_decompress_status_t::LZHAM_DECOMP_STATUS_SUCCESS) + return nullptr; + + return Result; + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/LZHAMCodec.h b/r5dev/thirdparty/cppnet/cppkore/LZHAMCodec.h new file mode 100644 index 00000000..d1cac838 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/LZHAMCodec.h @@ -0,0 +1,23 @@ +#pragma once + +#include +#include + +namespace Compression +{ + // A compression codec that implements the LZHAM algo. + class LZHAMCodec + { + public: + + // Compress the input buffer using the LZHAM codec + static uint64_t Compress(uint8_t* Input, uint64_t InputOffset, uint64_t InputLength, uint8_t* Output, uint64_t OutputOffset, uint64_t OutputLength, uint32_t DictSize = 28); + // Compress the input buffer using the LZHAM codec + static std::unique_ptr Compress(uint8_t* Input, uint64_t InputOffset, uint64_t InputLength, uint64_t& OutputLength, uint32_t DictSize = 28); + + // Decompress the input buffer using the LZHAM codec + static uint64_t Decompress(uint8_t* Input, uint64_t InputOffset, uint64_t InputLength, uint8_t* Output, uint64_t OutputOffset, uint64_t OutputLength, uint32_t DictSize = 28); + // Decompress the input buffer using the LZHAM codec (With known output length) + static std::unique_ptr Decompress(uint8_t* Input, uint64_t InputOffset, uint64_t InputLength, uint64_t KnownOutputLength, uint32_t DictSize = 28); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/LZO1XCodec.cpp b/r5dev/thirdparty/cppnet/cppkore/LZO1XCodec.cpp new file mode 100644 index 00000000..e8a24196 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/LZO1XCodec.cpp @@ -0,0 +1,77 @@ +#include "stdafx.h" +#include "LZO1XCodec.h" + +#include "..\cppkore_incl\LZO1X\minilzo.h" + +#if _DEBUG +#pragma comment(lib, "..\\cppkore_libs\\LZO1X\\cppkorelzox64d.lib") +#else +#pragma comment(lib, "..\\cppkore_libs\\LZO1X\\cppkorelzox64r.lib") +#endif + +namespace Compression +{ + constexpr uint64_t LZO1X_CompressBound(uint64_t Size) + { + return (Size + Size / 16 + 64 + 3); + } + + uint64_t LZO1XCodec::Compress(uint8_t* Input, uint64_t InputOffset, uint64_t InputLength, uint8_t* Output, uint64_t OutputOffset, uint64_t OutputLength) + { + auto WorkingMemory = malloc(LZO1X_1_MEM_COMPRESS); + + lzo_uint ResultSize = (lzo_uint)OutputLength; + auto Result = lzo1x_1_compress(Input + InputOffset, (lzo_uint)InputLength, Output + OutputOffset, &ResultSize, WorkingMemory); + + if (WorkingMemory != nullptr) + free(WorkingMemory); + + if (Result == LZO_E_OK) + return (uint64_t)ResultSize; + + return 0; + } + + std::unique_ptr LZO1XCodec::Compress(uint8_t* Input, uint64_t InputOffset, uint64_t InputLength, uint64_t& OutputLength) + { + auto ResultBounds = LZO1X_CompressBound(InputLength); + auto Result = std::make_unique(ResultBounds); + auto WorkingMemory = malloc(LZO1X_1_MEM_COMPRESS); + + OutputLength = 0; + + lzo_uint ResultSize = (lzo_uint)ResultBounds; + auto ResultCode = lzo1x_1_compress(Input + InputOffset, (lzo_uint)InputLength, Result.get(), &ResultSize, WorkingMemory); + + if (WorkingMemory != nullptr) + free(WorkingMemory); + + if (ResultCode != LZO_E_OK) + return nullptr; + + OutputLength = (uint64_t)ResultSize; + + return Result; + } + + uint64_t LZO1XCodec::Decompress(uint8_t* Input, uint64_t InputOffset, uint64_t InputLength, uint8_t* Output, uint64_t OutputOffset, uint64_t OutputLength) + { + lzo_uint ResultSize = (lzo_uint)OutputLength; + + if (lzo1x_decompress_safe(Input + InputOffset, (lzo_uint)InputLength, Output + OutputOffset, &ResultSize, nullptr) == LZO_E_OK) + return (uint64_t)ResultSize; + + return 0; + } + + std::unique_ptr LZO1XCodec::Decompress(uint8_t* Input, uint64_t InputOffset, uint64_t InputLength, uint64_t KnownOutputLength) + { + auto Result = std::make_unique(KnownOutputLength); + lzo_uint ResultSize = (lzo_uint)KnownOutputLength; + + if (lzo1x_decompress_safe(Input + InputOffset, (lzo_uint)InputLength, Result.get(), &ResultSize, nullptr) == LZO_E_OK) + return Result; + + return nullptr; + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/LZO1XCodec.h b/r5dev/thirdparty/cppnet/cppkore/LZO1XCodec.h new file mode 100644 index 00000000..2786a526 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/LZO1XCodec.h @@ -0,0 +1,23 @@ +#pragma once + +#include +#include + +namespace Compression +{ + // A compression codec that implements the LZO1X algo. + class LZO1XCodec + { + public: + + // Compress the input buffer using the LZO1X codec + static uint64_t Compress(uint8_t* Input, uint64_t InputOffset, uint64_t InputLength, uint8_t* Output, uint64_t OutputOffset, uint64_t OutputLength); + // Compress the input buffer using the LZO1X codec + static std::unique_ptr Compress(uint8_t* Input, uint64_t InputOffset, uint64_t InputLength, uint64_t& OutputLength); + + // Decompress the input buffer using the LZO1X codec + static uint64_t Decompress(uint8_t* Input, uint64_t InputOffset, uint64_t InputLength, uint8_t* Output, uint64_t OutputOffset, uint64_t OutputLength); + // Decompress the input buffer using the LZO1X codec (With known output length) + static std::unique_ptr Decompress(uint8_t* Input, uint64_t InputOffset, uint64_t InputLength, uint64_t KnownOutputLength); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Label.cpp b/r5dev/thirdparty/cppnet/cppkore/Label.cpp new file mode 100644 index 00000000..6fd24a3e --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Label.cpp @@ -0,0 +1,169 @@ +#include "stdafx.h" +#include "Label.h" + +namespace Forms +{ + Label::Label() + : Control(), _OwnerDraw(false), _FlatStyle(FlatStyle::Standard), _TextAlign(Drawing::ContentAlignment::TopLeft), _BorderStyle(BorderStyle::None) + { + SetStyle(ControlStyles::UserPaint | + ControlStyles::SupportsTransparentBackColor | + ControlStyles::OptimizedDoubleBuffer, this->_OwnerDraw); + + SetStyle(ControlStyles::Selectable | + ControlStyles::FixedHeight, false); + + SetStyle(ControlStyles::ResizeRedraw, true); + + // We are a label control + this->_RTTI = ControlTypes::Label; + } + + bool Label::OwnerDraw() + { + return this->_OwnerDraw; + } + + void Label::SetOwnerDraw(bool Value) + { + this->_OwnerDraw = Value; + + SetStyle(ControlStyles::UserPaint | ControlStyles::SupportsTransparentBackColor | ControlStyles::OptimizedDoubleBuffer, Value); + + UpdateStyles(); + Invalidate(); + } + + Drawing::ContentAlignment Label::TextAlign() + { + return this->_TextAlign; + } + + void Label::SetTextAlign(Drawing::ContentAlignment Value) + { + this->_TextAlign = Value; + + if (this->_OwnerDraw) + Invalidate(); + else + UpdateStyles(); + } + + FlatStyle Label::GetFlatStyle() + { + return this->_FlatStyle; + } + + void Label::SetFlatStyle(FlatStyle Value) + { + this->_FlatStyle = Value; + + Invalidate(); + + // Force update styles... + SetStyle(ControlStyles::UserPaint | ControlStyles::SupportsTransparentBackColor | ControlStyles::OptimizedDoubleBuffer, this->_OwnerDraw); + UpdateStyles(); + } + + BorderStyle Label::GetBorderStyle() + { + return this->_BorderStyle; + } + + void Label::SetBorderStyle(BorderStyle Value) + { + this->_BorderStyle = Value; + + Invalidate(); + + // Force update styles... + SetStyle(ControlStyles::UserPaint | ControlStyles::SupportsTransparentBackColor | ControlStyles::OptimizedDoubleBuffer, this->_OwnerDraw); + UpdateStyles(); + } + + void Label::WndProc(Message& Msg) + { + switch (Msg.Msg) + { + case WM_NCHITTEST: + { + auto RcScreen = this->RectangleToScreen(Drawing::Rectangle(0, 0, this->_Width, this->_Height)); + + // A label normally returns HT_TRANSPARENT, we can modify this by calculating the + // hits ourself here + Msg.Result = (RcScreen.Contains(LOWORD(Msg.LParam), HIWORD(Msg.LParam)) ? HTCLIENT : HTNOWHERE); + break; + } + case WM_SETTEXT: + { + Control::WndProc(Msg); + + // A lable that is SS_OWNERDRAW does not render properly during WM_SETTEXT + // we must trigger this... + if (this->OwnerDraw()) + this->Invalidate(true); + + break; + } + default: + Control::WndProc(Msg); + break; + } + } + + CreateParams Label::GetCreateParams() + { + auto Cp = Control::GetCreateParams(); + Cp.ClassName = "STATIC"; + + if (this->_OwnerDraw) + { + Cp.Style |= SS_OWNERDRAW; + Cp.ExStyle &= ~WS_EX_RIGHT; + } + + if (!this->_OwnerDraw) + { + switch (this->_TextAlign) + { + case Drawing::ContentAlignment::TopLeft: + case Drawing::ContentAlignment::MiddleLeft: + case Drawing::ContentAlignment::BottomLeft: + Cp.Style |= SS_LEFT; + break; + + case Drawing::ContentAlignment::TopRight: + case Drawing::ContentAlignment::MiddleRight: + case Drawing::ContentAlignment::BottomRight: + Cp.Style |= SS_RIGHT; + break; + + case Drawing::ContentAlignment::TopCenter: + case Drawing::ContentAlignment::MiddleCenter: + case Drawing::ContentAlignment::BottomCenter: + Cp.Style |= SS_CENTER; + break; + } + + // Trick to vertically center built-in label text + if (((int)this->_TextAlign & (int)Drawing::AnyMiddleAlign) != 0) + Cp.Style |= SS_CENTERIMAGE; + } + else + Cp.Style |= SS_LEFT; + + switch (this->_BorderStyle) + { + case BorderStyle::FixedSingle: + Cp.Style |= WS_BORDER; + break; + case BorderStyle::Fixed3D: + Cp.Style |= SS_SUNKEN; + break; + } + + Cp.Style |= SS_NOPREFIX; + + return Cp; + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/Label.h b/r5dev/thirdparty/cppnet/cppkore/Label.h new file mode 100644 index 00000000..3e065281 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Label.h @@ -0,0 +1,55 @@ +#pragma once + +#include +#include "Control.h" +#include "FlatStyle.h" +#include "BorderStyle.h" +#include "ContentAlignment.h" + +namespace Forms +{ + // Represents a standard Windows label. + class Label : public Control + { + public: + Label(); + virtual ~Label() = default; + + // Gets the drawing mode of the label control. + bool OwnerDraw(); + // Sets the drawing mode of the label control. + void SetOwnerDraw(bool Value); + + // Gets the alignment of the text on the label control. + Drawing::ContentAlignment TextAlign(); + // Sets the alignment of the text on the label control. + void SetTextAlign(Drawing::ContentAlignment Value); + + // Gets the flat style appearance of the label control. + FlatStyle GetFlatStyle(); + // Sets the flat style appearance of the label control. + void SetFlatStyle(FlatStyle Value); + + // Gets the border style appearence of the label control. + BorderStyle GetBorderStyle(); + // Sets the border style appearence of the label control. + void SetBorderStyle(BorderStyle Value); + + // Override WndProc for specific label messages. + virtual void WndProc(Message& Msg); + + protected: + // Get custom control creation parameters for this instance. + virtual CreateParams GetCreateParams(); + + private: + // Whether or not the control will draw itself + bool _OwnerDraw; + // Controls the style of the control + FlatStyle _FlatStyle; + // Controls the style of the control border + BorderStyle _BorderStyle; + // Controls the alignment of text on the control + Drawing::ContentAlignment _TextAlign; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/LabelEditEventArgs.cpp b/r5dev/thirdparty/cppnet/cppkore/LabelEditEventArgs.cpp new file mode 100644 index 00000000..4da7536d --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/LabelEditEventArgs.cpp @@ -0,0 +1,15 @@ +#include "stdafx.h" +#include "LabelEditEventArgs.h" + +namespace Forms +{ + LabelEditEventArgs::LabelEditEventArgs(int32_t Item) + : Item(Item), Label(""), CancelEdit(false) + { + } + + LabelEditEventArgs::LabelEditEventArgs(int32_t Item, const string& Label) + : Item(Item), Label(Label), CancelEdit(false) + { + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/LabelEditEventArgs.h b/r5dev/thirdparty/cppnet/cppkore/LabelEditEventArgs.h new file mode 100644 index 00000000..03d7017b --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/LabelEditEventArgs.h @@ -0,0 +1,23 @@ +#pragma once + +#include +#include "StringBase.h" + +namespace Forms +{ + // Provides data for the LabelEdit event. + class LabelEditEventArgs + { + public: + LabelEditEventArgs(int32_t Item); + LabelEditEventArgs(int32_t Item, const string& Label); + ~LabelEditEventArgs() = default; + + // The new text for the item. + string Label; + // The index of the item being edited. + int32_t Item; + // Whether or not to cancel the changes. + bool CancelEdit; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/ListBase.h b/r5dev/thirdparty/cppnet/cppkore/ListBase.h new file mode 100644 index 00000000..8140e23e --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ListBase.h @@ -0,0 +1,392 @@ +#pragma once + +#include + +template +class List +{ +public: + constexpr List(); + constexpr List(uint32_t InitialSize, bool Initialized = false); + constexpr List(const Titem* Items, uint32_t Size); + + template + constexpr List(const Titem(&Value)[Size]); + + constexpr List(const List& Value); + constexpr List(List&& Value); + + // Assignment operator + constexpr List& operator=(const List& Rhs); + + ~List(); + + // Adds a copy of the item to the list + constexpr void Add(const Titem& Item); + // Adds a copy of the item to the list + constexpr void Add(Titem&& Item); + // Adds a range of items to the list + constexpr void AddRange(const Titem* Items, uint32_t Size); + + // Inserts a copy of the item to the list + constexpr void Insert(int32_t Index, const Titem& Item); + // Inserts a copy of the item to the list + constexpr void Insert(int32_t Index, Titem&& Item); + + template + // Construct or move the item in the list + constexpr void EmplaceBack(Args&&... Arguments); + + template + // Construct or move the item into the list, returning the new item + constexpr Titem& Emplace(Args&&... Arguments); + + // Clears all items from the list + constexpr void Clear(); + // Removes an item at the index + constexpr void RemoveAt(uint32_t Index); + // Attempts to remove the item from the list + constexpr bool Remove(Titem& Item); + + // Sorts the list with the default compare routine + constexpr void Sort(); + // Sorts the list with the compare routine + template + constexpr void Sort(Compare Routine); + + // Returns the index of the first occurance of value in the current instance + constexpr uint32_t IndexOf(const Titem& Item) const noexcept; + // Returns the index of the last occurance of the value in the current instance + constexpr uint32_t LastIndexOf(const Titem& Item) const noexcept; + // Whether or not the list contains the value + constexpr bool Contains(const Titem& Item) const; + + // Iterator definitions, for for(& :) loop + constexpr Titem* begin() const noexcept; + constexpr Titem* end() const noexcept; + + // Returns the count of items in the list + constexpr uint32_t Count() const; + // Returns whether or not the list is empty + constexpr bool Empty() const; + + // Standard logical cast + constexpr operator Titem*(void) const; + + // Array index operator + constexpr Titem& operator[](size_t Index); + + // Indicates no matches in the list + static constexpr auto InvalidPosition{ static_cast(-1) }; + +private: + Titem* _Buffer; + uint32_t _BufferSize; + uint32_t _StoreSize; + + constexpr void EnsureCapacity(uint32_t Capacity); +}; + +template +inline constexpr List::List() + : _Buffer(nullptr), _BufferSize(0), _StoreSize(0) +{ +} + +template +inline constexpr List::List(uint32_t InitialSize, bool Initialized) + : _Buffer(nullptr), _BufferSize(0), _StoreSize(0) +{ + this->EnsureCapacity(InitialSize); + + if (!Initialized) + this->_StoreSize = 0; // Must reset this so that we start from 0 +} + +template +inline constexpr List::List(const Titem* Items, uint32_t Size) + : _Buffer(nullptr), _BufferSize(0), _StoreSize(0) +{ + this->EnsureCapacity(Size); + + if constexpr (std::is_trivially_copyable::value) + std::memcpy(this->_Buffer, Items, Size * sizeof(Titem)); + else + std::copy(Items, Items + Size, this->_Buffer); +} + +template +template +inline constexpr List::List(const Titem(&Value)[Size]) + : _Buffer(nullptr), _BufferSize(0), _StoreSize(0) +{ + this->EnsureCapacity(Size); + + if constexpr (std::is_trivially_copyable::value) + std::memcpy(this->_Buffer, &Value[0], Size * sizeof(Titem)); + else + std::copy(&Value[0], &Value[0] + Size, this->_Buffer); +} + +template +template +inline constexpr void List::EmplaceBack(Args&&... Arguments) +{ + auto nPos = this->_StoreSize; + this->EnsureCapacity(nPos + 1); + + new (&this->_Buffer[nPos]) Titem(std::forward(Arguments)...); +} + +template +template +inline constexpr Titem& List::Emplace(Args&&... Arguments) +{ + auto nPos = this->_StoreSize; + this->EnsureCapacity(nPos + 1); + + new (&this->_Buffer[nPos]) Titem(std::forward(Arguments)...); + + return this->_Buffer[nPos]; +} + +template +inline constexpr List::List(const List& Value) + : List(Value._Buffer, Value._StoreSize) +{ +} + +template +inline constexpr List::List(List&& Value) +{ + this->_Buffer = Value._Buffer; + this->_BufferSize = Value._BufferSize; + this->_StoreSize = Value._StoreSize; + + Value._Buffer = nullptr; + Value._BufferSize = 0; + Value._StoreSize = 0; +} + +template +inline constexpr List& List::operator=(const List& Rhs) +{ + this->Clear(); + this->AddRange(Rhs.begin(), Rhs.Count()); + + return *this; +} + +template +inline List::~List() +{ + if (this->_Buffer) + delete[] this->_Buffer; + + this->_Buffer = nullptr; + this->_BufferSize = 0; + this->_StoreSize = 0; +} + +template +inline constexpr void List::Add(const Titem& Item) +{ + this->EmplaceBack(Item); +} + +template +inline constexpr void List::Add(Titem&& Item) +{ + this->EmplaceBack(std::move(Item)); +} + +template +inline constexpr void List::AddRange(const Titem* Items, uint32_t Size) +{ + auto nPos = this->_StoreSize; + this->EnsureCapacity(this->_StoreSize + Size); + + if constexpr (std::is_trivially_copyable::value) + std::memcpy(this->_Buffer + nPos, Items, Size * sizeof(Titem)); + else + std::copy(Items, Items + Size, this->_Buffer + nPos); +} + +template +inline constexpr void List::Insert(int32_t Index, const Titem& Item) +{ + auto nPos = this->_StoreSize; + this->EnsureCapacity(nPos + 1); + + if constexpr (std::is_trivially_copyable::value) + std::memmove(this->_Buffer + Index + 1, this->_Buffer + Index, (nPos - Index) * sizeof(Titem)); + else + std::copy_backward(this->_Buffer + Index, this->_Buffer + nPos, this->_Buffer + nPos + 1); + + new (&this->_Buffer[Index]) Titem(Item); +} + +template +inline constexpr void List::Insert(int32_t Index, Titem&& Item) +{ + auto nPos = this->_StoreSize; + this->EnsureCapacity(nPos + 1); + + if constexpr (std::is_trivially_copyable::value) + std::memmove(this->_Buffer + Index + 1, this->_Buffer + Index, (nPos - Index) * sizeof(Titem)); + else + std::copy_backward(this->_Buffer + Index, this->_Buffer + nPos, this->_Buffer + nPos + 1); + + new (&this->_Buffer[Index]) Titem(std::move(Item)); +} + +template +inline constexpr void List::Clear() +{ + if (this->_Buffer) + delete[] this->_Buffer; + + this->_Buffer = nullptr; + this->_BufferSize = 0; + this->_StoreSize = 0; +} + +template +inline constexpr void List::RemoveAt(uint32_t Index) +{ + if (Index >= this->_StoreSize) + return; + + this->_StoreSize--; + if (Index < this->_StoreSize) + std::move(this->_Buffer + (Index + 1), this->end() + 1, this->_Buffer + Index); + + this->_Buffer[this->_StoreSize] = Titem(); +} + +template +inline constexpr bool List::Remove(Titem& Item) +{ + auto Index = this->IndexOf(Item); + if (Index != List::InvalidPosition) + { + this->RemoveAt(Index); + return true; + } + + return false; +} + +template +inline constexpr void List::Sort() +{ + std::stable_sort(this->begin(), this->end()); +} + +template +template +inline constexpr void List::Sort(Compare Routine) +{ + std::stable_sort(this->begin(), this->end(), Routine); +} + +template +inline constexpr uint32_t List::IndexOf(const Titem& Item) const noexcept +{ + for (uint32_t i = 0; i < this->_StoreSize; i++) + { + if (this->_Buffer[i] == Item) + return i; + } + + return List::InvalidPosition; +} + +template +inline constexpr uint32_t List::LastIndexOf(const Titem& Item) const noexcept +{ + for (uint32_t i = this->_StoreSize; i >= 0; --i) + { + if (this->_Buffer[i] == Item) + return i; + } + + return List::InvalidPosition; +} + +template +inline constexpr bool List::Contains(const Titem& Item) const +{ + return (this->IndexOf(Item) != List::InvalidPosition); +} + +template +inline constexpr Titem* List::begin() const noexcept +{ + return this->_Buffer; +} + +template +inline constexpr Titem* List::end() const noexcept +{ + return (this->_Buffer + this->_StoreSize); +} + +template +inline constexpr uint32_t List::Count() const +{ + return this->_StoreSize; +} + +template +inline constexpr bool List::Empty() const +{ + return (this->Count() == 0); +} + +template +inline constexpr List::operator Titem*(void) const +{ + return this->_Buffer; +} + +template +inline constexpr Titem& List::operator[](size_t Index) +{ + return this->_Buffer[Index]; +} + +template +inline constexpr void List::EnsureCapacity(uint32_t Capacity) +{ + // Ensure that we have a proper buffer size for the string here, this is in units, NOT bytes... + // Check to ensure we aren't wasting our time first... + if (Capacity <= this->_BufferSize) + { + this->_StoreSize = Capacity; + return; + } + + auto nCapacity = Capacity; + if (nCapacity < 16) + nCapacity = 16; + + if (nCapacity < (this->_BufferSize + (this->_BufferSize / 2))) + nCapacity = (this->_BufferSize + (this->_BufferSize / 2)); + + auto tBuffer = this->_Buffer; + this->_Buffer = new Titem[nCapacity](); + + if (tBuffer) + { + if constexpr (std::is_trivially_copyable::value) + std::memcpy(this->_Buffer, tBuffer, this->_BufferSize * sizeof(Titem)); + else + std::copy(tBuffer, tBuffer + this->_BufferSize, this->_Buffer); + + delete[] tBuffer; + } + + this->_BufferSize = nCapacity; + this->_StoreSize = Capacity; +} diff --git a/r5dev/thirdparty/cppnet/cppkore/ListView.cpp b/r5dev/thirdparty/cppnet/cppkore/ListView.cpp new file mode 100644 index 00000000..19247a78 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ListView.cpp @@ -0,0 +1,1427 @@ +#include "stdafx.h" +#include "ListView.h" + +namespace Forms +{ + ListView::ListView() + : Control(), Columns(this), Items(this), _ItemActivation(ItemActivation::Standard), _ListViewAlignment(ListViewAlignment::Top), _BorderStyle(BorderStyle::Fixed3D), _ColumnHeaderStyle(ColumnHeaderStyle::Clickable), _SortOrder(SortOrder::None), _ViewStyle(View::LargeIcon), _VirtualListSize(0), _ColumnIndex(0), _DownButton(MouseButtons::None), _Flags(ListViewFlags::FlagScrollable | ListViewFlags::FlagMultiSelect | ListViewFlags::FlagLabelWrap | ListViewFlags::FlagHideSelection | ListViewFlags::FlagAutoArrange | ListViewFlags::FlagShowGroups) + { + SetStyle(ControlStyles::UserPaint | ControlStyles::StandardClick | ControlStyles::UseTextForAccessibility, false); + + // Default back color is different... + this->_BackColor = Drawing::GetSystemColor(Drawing::SystemColors::Window); + + // We are a ListView control. + this->_RTTI = ControlTypes::ListView; + } + + ItemActivation ListView::Activation() + { + return _ItemActivation; + } + + void ListView::SetActivation(ItemActivation Value) + { + if (_ItemActivation != Value) + { + _ItemActivation = Value; + UpdateExtendedStyles(); + } + } + + ListViewAlignment ListView::Alignment() + { + return this->_ListViewAlignment; + } + + void ListView::SetAlignment(ListViewAlignment Value) + { + if (_ListViewAlignment != Value) + { + _ListViewAlignment = Value; + UpdateStyles(); + } + } + + bool ListView::AllowColumnReorder() + { + return GetFlag(ListViewFlags::FlagAllowColumnReorder); + } + + void ListView::SetAllowColumnReorder(bool Value) + { + if (AllowColumnReorder() != Value) + { + SetFlag(ListViewFlags::FlagAllowColumnReorder, Value); + UpdateExtendedStyles(); + } + } + + bool ListView::AutoArrange() + { + return GetFlag(ListViewFlags::FlagAutoArrange); + } + + void ListView::SetAutoArrange(bool Value) + { + if (AutoArrange() != Value) + { + SetFlag(ListViewFlags::FlagAutoArrange, Value); + UpdateStyles(); + } + } + + BorderStyle ListView::GetBorderStyle() + { + return this->_BorderStyle; + } + + void ListView::SetBorderStyle(BorderStyle Value) + { + if (_BorderStyle != Value) + { + _BorderStyle = Value; + UpdateStyles(); + } + } + + int32_t ListView::FocusedItem() + { + return (int32_t)SendMessageA(this->_Handle, LVM_GETNEXTITEM, (WPARAM)-1, LVNI_FOCUSED); + } + + void ListView::SetFocusedItem(int32_t Value) + { + if (GetState(ControlStates::StateCreated)) + { + LVITEMA LvItem{}; + LvItem.mask = LVIF_STATE; + LvItem.state = LVNI_FOCUSED; + LvItem.stateMask = LVIS_FOCUSED; + + SendMessageA(this->_Handle, LVM_SETITEMSTATE, (WPARAM)Value, (LPARAM)&LvItem); + } + } + + bool ListView::FullRowSelect() + { + return GetFlag(ListViewFlags::FlagFullRowSelect); + } + + void ListView::SetFullRowSelect(bool Value) + { + if (FullRowSelect() != Value) + { + SetFlag(ListViewFlags::FlagFullRowSelect, Value); + UpdateExtendedStyles(); + } + } + + bool ListView::GridLines() + { + return GetFlag(ListViewFlags::FlagGridLines); + } + + void ListView::SetGridLines(bool Value) + { + if (GridLines() != Value) + { + SetFlag(ListViewFlags::FlagGridLines, Value); + UpdateExtendedStyles(); + } + } + + ColumnHeaderStyle ListView::HeaderStyle() + { + return this->_ColumnHeaderStyle; + } + + void ListView::SetHeaderStyle(ColumnHeaderStyle Value) + { + if (_ColumnHeaderStyle != Value) + { + _ColumnHeaderStyle = Value; + UpdateStyles(); + } + } + + bool ListView::HideSelection() + { + return GetFlag(ListViewFlags::FlagHideSelection); + } + + void ListView::SetHideSelection(bool Value) + { + if (HideSelection() != Value) + { + SetFlag(ListViewFlags::FlagHideSelection, Value); + UpdateStyles(); + } + } + + bool ListView::HotTracking() + { + return GetFlag(ListViewFlags::FlagHotTracking); + } + + void ListView::SetHotTracking(bool Value) + { + if (HotTracking() != Value) + { + SetFlag(ListViewFlags::FlagHotTracking, Value); + + if (Value) + { + SetHoverSelection(true); + SetActivation(ItemActivation::OneClick); + } + } + } + + bool ListView::HoverSelection() + { + return GetFlag(ListViewFlags::FlagHoverSelection); + } + + void ListView::SetHoverSelection(bool Value) + { + if (HoverSelection() != Value) + { + SetFlag(ListViewFlags::FlagHoverSelection, Value); + UpdateExtendedStyles(); + } + } + + bool ListView::LabelEdit() + { + return GetFlag(ListViewFlags::FlagLabelEdit); + } + + void ListView::SetLabelEdit(bool Value) + { + if (LabelEdit() != Value) + { + SetFlag(ListViewFlags::FlagLabelEdit, Value); + UpdateStyles(); + } + } + + bool ListView::LabelWrap() + { + return GetFlag(ListViewFlags::FlagLabelWrap); + } + + void ListView::SetLabelWrap(bool Value) + { + if (LabelWrap() != Value) + { + SetFlag(ListViewFlags::FlagLabelWrap, Value); + UpdateStyles(); + } + } + + bool ListView::MultiSelect() + { + return GetFlag(ListViewFlags::FlagMultiSelect); + } + + void ListView::SetMultiSelect(bool Value) + { + if (MultiSelect() != Value) + { + SetFlag(ListViewFlags::FlagMultiSelect, Value); + UpdateStyles(); + } + } + + bool ListView::OwnerDraw() + { + return GetFlag(ListViewFlags::FlagOwnerDraw); + } + + void ListView::SetOwnerDraw(bool Value) + { + if (OwnerDraw() != Value) + { + SetFlag(ListViewFlags::FlagOwnerDraw, Value); + Invalidate(true); + } + } + + bool ListView::Scrollable() + { + return GetFlag(ListViewFlags::FlagScrollable); + } + + void ListView::SetScrollable(bool Value) + { + if (Scrollable() != Value) + { + SetFlag(ListViewFlags::FlagScrollable, Value); + UpdateStyles(); + } + } + + List ListView::SelectedIndices() + { + // Fetch count of selected items + int32_t SelectedCount = (int32_t)(GetState(ControlStates::StateCreated) ? SendMessageA(this->_Handle, LVM_GETSELECTEDCOUNT, NULL, NULL) : -1); + + // Ignore false counts + if (SelectedCount <= 0) + return List(); + + // Generate a new list + List Result(SelectedCount, true); + + int32_t LastIndex = -1; + for (int32_t i = 0; i < SelectedCount; i++) + { + LastIndex = (int32_t)SendMessageA(this->_Handle, LVM_GETNEXTITEM, (WPARAM)LastIndex, LVNI_SELECTED); + Result[i] = (uint32_t)LastIndex; + } + + return Result; + } + + bool ListView::ShowGroups() + { + return GetFlag(ListViewFlags::FlagShowGroups); + } + + void ListView::SetShowGroups(bool Value) + { + if (ShowGroups() != Value) + { + SetFlag(ListViewFlags::FlagShowGroups, Value); + } + } + + SortOrder ListView::Sorting() + { + return this->_SortOrder; + } + + void ListView::SetSorting(SortOrder Value) + { + if (_SortOrder != Value) + { + _SortOrder = Value; + UpdateStyles(); + } + } + + int32_t ListView::TopItem() + { + return (int32_t)(GetState(ControlStates::StateCreated) ? SendMessageA(this->_Handle, LVM_GETTOPINDEX, NULL, NULL) : -1); + } + + void ListView::SetTopItem(int32_t Value) + { + if (GetState(ControlStates::StateCreated)) + { + if (Value <= 0) + Value = 0; + + // Make sure it's visible first + SendMessageA(this->_Handle, LVM_ENSUREVISIBLE, (WPARAM)Value, NULL); + + if (Scrollable()) + { + // Scroll to top + int32_t ScrollY = GetItemPosition(0).Y - GetItemPosition(Value).Y; + SendMessageA(this->_Handle, LVM_SCROLL, 0, ScrollY); + } + } + } + + int32_t ListView::CountPerPage() + { + return (int32_t)SendMessageA(this->_Handle, LVM_GETCOUNTPERPAGE, NULL, NULL); + } + + View ListView::GetView() + { + return this->_ViewStyle; + } + + void ListView::SetView(View Value) + { + if (_ViewStyle != Value) + { + _ViewStyle = Value; + + if (GetState(ControlStates::StateCreated)) + { + SendMessageA(this->_Handle, LVM_SETVIEW, (WPARAM)_ViewStyle, NULL); + } + else + { + UpdateStyles(); + } + } + } + + int32_t ListView::VirtualListSize() + { + return this->_VirtualListSize; + } + + void ListView::SetVirtualListSize(int32_t Value) + { + if (_VirtualListSize == Value) + return; + + bool KeepTopItem = GetState(ControlStates::StateCreated) && this->VirtualMode() && this->_ViewStyle == View::Details; + int32_t TopIndex = -1; + + if (KeepTopItem) + TopIndex = (int32_t)SendMessageA(this->_Handle, LVM_GETTOPINDEX, NULL, NULL); + + _VirtualListSize = Value; + + if (GetState(ControlStates::StateCreated) && this->VirtualMode()) + SendMessageA(this->_Handle, LVM_SETITEMCOUNT, (WPARAM)_VirtualListSize, NULL); + + if (KeepTopItem) + { + TopIndex = min(TopIndex, this->_VirtualListSize - 1); + + if (TopIndex > 0) + this->SetTopItem(TopIndex); + } + } + + bool ListView::VirtualMode() + { + return GetFlag(ListViewFlags::FlagVirtualMode); + } + + void ListView::SetVirtualMode(bool Value) + { + if (VirtualMode() != Value) + { + SetFlag(ListViewFlags::FlagVirtualMode, Value); + UpdateStyles(); + } + } + + void ListView::OnHandleCreated() + { + // Call tbe base event first + Control::OnHandleCreated(); + + // Ensure we have a proper comctl version + int32_t Version = (int32_t)SendMessageA(this->_Handle, CCM_GETVERSION, NULL, NULL); + if (Version < 5) + SendMessageA(this->_Handle, CCM_SETVERSION, (WPARAM)5, NULL); + + // Ensure extended styles are set + UpdateExtendedStyles(); + + // Update control colors + SendMessageA(this->_Handle, LVM_SETBKCOLOR, NULL, (LPARAM)Drawing::ColorToWin32(this->BackColor())); + SendMessageA(this->_Handle, LVM_SETTEXTCOLOR, NULL, (LPARAM)Drawing::ColorToWin32(this->ForeColor())); + SendMessageA(this->_Handle, LVM_SETTEXTBKCOLOR, NULL, CLR_NONE); + + if (!Scrollable()) + { + auto Style = (int32_t)GetWindowLong(this->_Handle, GWL_STYLE); + Style |= LVS_NOSCROLL; + SetWindowLong(this->_Handle, GWL_STYLE, Style); + } + + SendMessageA(this->_Handle, LVM_SETVIEW, (WPARAM)_ViewStyle, NULL); + + auto ColumnCount = Columns.Count(); + if (ColumnCount > 0) + { + auto Indices = std::make_unique(ColumnCount); + int32_t Index = 0; + + for (auto& Column : this->Columns) + { + Indices[Index] = Column.DisplayIndex(); + NativeInsertColumn(Index++, Column); + } + + SetDisplayIndices(Indices, ColumnCount); + } + + if (!VirtualMode()) + this->NativeInsertItems(0, Items.Count(), Items.ToList()); + + if (VirtualMode() && VirtualListSize() > -1) + SendMessageA(this->_Handle, LVM_SETITEMCOUNT, (WPARAM)VirtualListSize(), NULL); + } + + void ListView::OnBackColorChanged() + { + SendMessageA(this->_Handle, LVM_SETBKCOLOR, NULL, (LPARAM)Drawing::ColorToWin32(this->BackColor())); + + // We must call the base event last + Control::OnBackColorChanged(); + } + + void ListView::OnForeColorChanged() + { + SendMessageA(this->_Handle, LVM_SETTEXTCOLOR, NULL, (LPARAM)Drawing::ColorToWin32(this->ForeColor())); + + // We must call the base event last + Control::OnForeColorChanged(); + } + + void ListView::OnFontChanged() + { + Control::OnFontChanged(); + + if (!VirtualMode() && GetState(ControlStates::StateCreated)) + SendMessageA(this->_Handle, LVM_UPDATE, (WPARAM)-1, NULL); + + InvalidateColumnHeaders(); + } + + void ListView::OnItemActivate() + { + ItemActivate.RaiseEvent(this); + } + + void ListView::OnColumnClick(const std::unique_ptr& EventArgs) + { + ColumnClick.RaiseEvent(EventArgs, this); + } + + void ListView::OnBeforeLabelEdit(const std::unique_ptr& EventArgs) + { + BeforeLabelEdit.RaiseEvent(EventArgs, this); + } + + void ListView::OnAfterLabelEdit(const std::unique_ptr& EventArgs) + { + AfterLabelEdit.RaiseEvent(EventArgs, this); + } + + void ListView::OnDrawItem(const std::unique_ptr& EventArgs) + { + DrawItem.RaiseEvent(EventArgs, this); + } + + void ListView::OnDrawSubItem(const std::unique_ptr& EventArgs) + { + DrawSubItem.RaiseEvent(EventArgs, this); + } + + void ListView::OnDrawColumnHeader(const std::unique_ptr& EventArgs) + { + DrawColumnHeader.RaiseEvent(EventArgs, this); + } + + void ListView::OnCacheVirtualItems(const std::unique_ptr& EventArgs) + { + CacheVirtualItems.RaiseEvent(EventArgs, this); + } + + void ListView::OnRetrieveVirtualItem(const std::unique_ptr& EventArgs) + { + RetrieveVirtualItem.RaiseEvent(EventArgs, this); + } + + void ListView::OnVirtualItemsSelectionRangeChanged(const std::unique_ptr& EventArgs) + { + VirtualItemsSelectionRangeChanged.RaiseEvent(EventArgs, this); + } + + void ListView::WndProc(Message& Msg) + { + switch (Msg.Msg) + { + case WM_REFLECT + WM_NOTIFY: + WmReflectNotify(Msg); + break; + case WM_LBUTTONDBLCLK: + SetCapture(true); + WmMouseDown(Msg, MouseButtons::Left, 2); + break; + case WM_LBUTTONDOWN: + WmMouseDown(Msg, MouseButtons::Left, 1); + _DownButton = MouseButtons::Left; + break; + + case WM_LBUTTONUP: + case WM_RBUTTONUP: + case WM_MBUTTONUP: + { + LVHITTESTINFO LvHip{}; + auto Index = GetIndexOfClickedItem(LvHip); + + if (GetFlag(ListViewFlags::FlagDoubleclickFired) && Index != -1) + { + SetFlag(ListViewFlags::FlagDoubleclickFired, false); + OnDoubleClick(); + OnMouseDoubleClick(std::make_unique(_DownButton, 2, (int16_t)LOWORD(Msg.LParam), (int16_t)HIWORD(Msg.LParam), 0)); + } + + if (!GetFlag(ListViewFlags::FlagMouseUpFired)) + { + OnMouseUp(std::make_unique(_DownButton, 1, (int16_t)LOWORD(Msg.LParam), (int16_t)HIWORD(Msg.LParam), 0)); + SetFlag(ListViewFlags::FlagExpectingMouseUp, false); + } + + SetFlag(ListViewFlags::FlagMouseUpFired, true); + SetCapture(false); + } + break; + + case WM_MBUTTONDBLCLK: + WmMouseDown(Msg, MouseButtons::Middle, 2); + break; + case WM_MBUTTONDOWN: + WmMouseDown(Msg, MouseButtons::Middle, 1); + _DownButton = MouseButtons::Middle; + break; + case WM_RBUTTONDBLCLK: + WmMouseDown(Msg, MouseButtons::Right, 2); + break; + case WM_RBUTTONDOWN: + WmMouseDown(Msg, MouseButtons::Right, 1); + _DownButton = MouseButtons::Right; + break; + case WM_MOUSEMOVE: + if (GetFlag(ListViewFlags::FlagExpectingMouseUp) && !GetFlag(ListViewFlags::FlagMouseUpFired) && GetMouseButtons() == MouseButtons::None) + { + OnMouseUp(std::make_unique(_DownButton, 1, (int16_t)LOWORD(Msg.LParam), (int16_t)HIWORD(Msg.LParam), 0)); + SetFlag(ListViewFlags::FlagMouseUpFired, true); + } + + SetCapture(false); + Control::WndProc(Msg); + break; + case WM_NOTIFY: + if (WmNotify(Msg)) + return; + + Control::WndProc(Msg); + break; + case WM_MOUSEHOVER: + if (HoverSelection()) + Control::WndProc(Msg); + else + OnMouseHover(); + break; + + default: + Control::WndProc(Msg); + break; + } + } + + void ListView::CreateControl(Control* Parent) + { + INITCOMMONCONTROLSEX iCC{}; + iCC.dwSize = sizeof(iCC); + iCC.dwICC = ICC_LISTVIEW_CLASSES; + + InitCommonControlsEx(&iCC); + + Control::CreateControl(Parent); + } + + CreateParams ListView::GetCreateParams() + { + auto Cp = Control::GetCreateParams(); + + Cp.ClassName = "SysListView32"; + + if (GetState(ControlStates::StateCreated)) + { + int32_t CurrentStyle = (int32_t)GetWindowLong(this->_Handle, GWL_STYLE); + Cp.Style |= (CurrentStyle & (WS_HSCROLL | WS_VSCROLL)); + } + + Cp.Style |= LVS_SHAREIMAGELISTS; + + switch (_ListViewAlignment) + { + case ListViewAlignment::Top: + Cp.Style |= LVS_ALIGNTOP; + break; + case ListViewAlignment::Left: + Cp.Style |= LVS_ALIGNLEFT; + break; + } + + if (AutoArrange()) + Cp.Style |= LVS_AUTOARRANGE; + + switch (_BorderStyle) + { + case BorderStyle::Fixed3D: + Cp.ExStyle |= WS_EX_CLIENTEDGE; + break; + case BorderStyle::FixedSingle: + Cp.Style |= WS_BORDER; + break; + } + + switch (_ColumnHeaderStyle) + { + case ColumnHeaderStyle::None: + Cp.Style |= LVS_NOCOLUMNHEADER; + break; + case ColumnHeaderStyle::NonClickable: + Cp.Style |= LVS_NOSORTHEADER; + break; + } + + if (LabelEdit()) + Cp.Style |= LVS_EDITLABELS; + if (!LabelWrap()) + Cp.Style |= LVS_NOLABELWRAP; + if (!HideSelection()) + Cp.Style |= LVS_SHOWSELALWAYS; + if (!MultiSelect()) + Cp.Style |= LVS_SINGLESEL; + + switch (_SortOrder) + { + case SortOrder::Ascending: + Cp.Style |= LVS_SORTASCENDING; + break; + case SortOrder::Descending: + Cp.Style |= LVS_SORTDESCENDING; + break; + } + + if (VirtualMode()) + Cp.Style |= LVS_OWNERDATA; + + if (_ViewStyle != View::Tile) + Cp.Style |= (int32_t)_ViewStyle; + + return Cp; + } + + void ListView::ScaleControl(Drawing::SizeF Factor, BoundsSpecified Specified) + { + Control::ScaleControl(Factor, Specified); + + // We override this so we can scale the current column widths + for (auto& Column : this->Columns) + { + Column.SetWidth(this->ScaleSize({ Column.Width(), 0 }, Factor.Width, Factor.Height).Width); + } + } + + bool ListView::GetFlag(ListViewFlags Flag) + { + return ((int)this->_Flags & (int)Flag) == (int)Flag; + } + + void ListView::SetFlag(ListViewFlags Flags, bool Value) + { + this->_Flags = Value ? (ListViewFlags)((int)this->_Flags | (int)Flags) : (ListViewFlags)((int)this->_Flags & ~(int)Flags); + } + + void ListView::NativeAddColumn(ColumnHeader& Header) + { + NativeInsertColumn(this->Columns.Count(), Header); + } + + void ListView::NativeInsertColumn(const int32_t Index, ColumnHeader& Header) + { + LVCOLUMNA LvColumn{}; + LvColumn.mask = LVCF_FMT | LVCF_TEXT | LVCF_WIDTH; + + LvColumn.fmt = (int32_t)Header.TextAlign(); + LvColumn.cx = Header.Width(); + LvColumn.pszText = (char*)Header.Text(); + + SendMessageA(this->_Handle, LVM_INSERTCOLUMNA, (WPARAM)Index, (LPARAM)&LvColumn); + } + + void ListView::NativeClearColumns() + { + for (int32_t ColIdx = this->Columns.Count() - 1; ColIdx >= 0; ColIdx--) + SendMessageA(this->_Handle, LVM_DELETECOLUMN, (WPARAM)ColIdx, NULL); + } + + void ListView::NativeInsertItem(int32_t Index, const ListViewItem& Item) + { + SendMessageA(this->_Handle, LVM_SETITEMCOUNT, (WPARAM)Items.Count(), NULL); + + LVITEMA LvItem{}; + LvItem.mask = LVIF_TEXT; + LvItem.iItem = Index; + LvItem.pszText = (char*)Item.Text(); + + SendMessageA(this->_Handle, LVM_INSERTITEMA, NULL, (LPARAM)&LvItem); + + for (uint32_t i = 1; i <= Item.SubItemCount(); i++) + { + LVITEMA LvSub{}; + LvSub.mask = LVIF_TEXT; + LvSub.iItem = Index; + LvSub.iSubItem = i; + LvSub.pszText = (char*)Item.SubItem(i); + + SendMessageA(this->_Handle, LVM_SETITEMTEXTA, (WPARAM)Index, (LPARAM)&LvSub); + } + } + + void ListView::NativeInsertItems(int32_t Index, int32_t Count, const List& Items) + { + SendMessageA(this->_Handle, LVM_SETITEMCOUNT, (WPARAM)Items.Count(), NULL); + + for (int32_t i = 0; i < Count; i++) + { + auto& Item = Items[Index + i]; + + LVITEMA LvItem{}; + LvItem.mask = LVIF_TEXT; + LvItem.iItem = Index + i; + LvItem.pszText = (char*)Item.Text(); + + SendMessageA(this->_Handle, LVM_INSERTITEMA, NULL, (LPARAM)&LvItem); + + for (uint32_t j = 1; j <= Item.SubItemCount(); j++) + { + LVITEMA LvSub{}; + LvSub.mask = LVIF_TEXT; + LvSub.iItem = Index + i; + LvSub.iSubItem = j; + LvSub.pszText = (char*)Item.SubItem(j); + + SendMessageA(this->_Handle, LVM_SETITEMTEXTA, (WPARAM)(Index + i), (LPARAM)&LvSub); + } + } + } + + void ListView::NativeRemoveItem(int32_t Index) + { + SendMessageA(this->_Handle, LVM_DELETEITEM, (WPARAM)Index, NULL); + } + + void ListView::NativeClearItems() + { + SendMessageA(this->_Handle, LVM_DELETEALLITEMS, NULL, NULL); + } + + void ListView::InvalidateColumnHeaders() + { + if (GetState(ControlStates::StateCreated) && _ViewStyle == View::Details) + { + auto HwndHdr = (HWND)SendMessageA(this->_Handle, LVM_GETHEADER, NULL, NULL); + if (HwndHdr != NULL) + InvalidateRect(HwndHdr, NULL, TRUE); + } + } + + Drawing::Point ListView::GetItemPosition(int32_t Index) + { + POINT Pt{}; + SendMessageA(this->_Handle, LVM_GETITEMPOSITION, (WPARAM)Index, (LPARAM)&Pt); + + return Drawing::Point(Pt.x, Pt.y); + } + + Drawing::Rectangle ListView::GetItemRectOrEmpty(int32_t Index) + { + if (Index < 0 || Index >= (int32_t)this->Items.Count()) + return Drawing::Rectangle(); + if (_ViewStyle == View::Details && this->Columns.Count() == 0) + return Drawing::Rectangle(); + + RECT ItemRect{}; + if (SendMessageA(this->_Handle, LVM_GETITEMRECT, (WPARAM)Index, (LPARAM)&ItemRect) == 0) + return Drawing::Rectangle(); + + return Drawing::Rectangle(ItemRect.left, ItemRect.top, ItemRect.right - ItemRect.left, ItemRect.bottom - ItemRect.top); + } + + Drawing::Rectangle ListView::GetSubItemRect(int32_t Index, int32_t SubItem) + { + if (_ViewStyle != View::Details) + return Drawing::Rectangle(); + if (this->Columns.Count() == 0) + return Drawing::Rectangle(); + + RECT ItemRect{}; + ItemRect.top = SubItem; + + if (SendMessageA(this->_Handle, LVM_GETSUBITEMRECT, (WPARAM)Index, (LPARAM)&ItemRect) == 0) + return Drawing::Rectangle(); + + return Drawing::Rectangle(ItemRect.left, ItemRect.top, ItemRect.right - ItemRect.left, ItemRect.bottom - ItemRect.top); + } + + int32_t ListView::GetItemState(int32_t Index) + { + return (int32_t)SendMessageA(this->_Handle, LVM_GETITEMSTATE, (WPARAM)Index, LVIS_FOCUSED | LVIS_SELECTED | LVIS_CUT | LVIS_DROPHILITED | LVIS_OVERLAYMASK | LVIS_STATEIMAGEMASK); + } + + std::pair ListView::GetSubItem(int32_t Index, int32_t SubItem) + { + if (!VirtualMode()) + { + auto& Item = Items[Index]; + auto& Text = Item.SubItem(SubItem); + auto& Style = Item.SubItemStyle(SubItem); + + return std::pair(Text, Style); + } + + auto EventArgs = std::make_unique(Index, SubItem); + OnRetrieveVirtualItem(EventArgs); + + return std::pair(EventArgs->Text, EventArgs->Style); + } + + void ListView::SetColumnInfo(int32_t Mask, ColumnHeader& Header) + { + if (!GetState(ControlStates::StateCreated)) + return; + + LVCOLUMNA LvColumn{}; + LvColumn.mask = Mask; + + if ((Mask & LVCF_FMT) != 0) + { + LvColumn.fmt |= (int32_t)Header.TextAlign(); + } + + if ((Mask & LVCF_TEXT) != 0) + { + LvColumn.pszText = (char*)Header.Text(); + } + + SendMessageA(this->_Handle, LVM_SETCOLUMNA, (WPARAM)Header.Index(), (LPARAM)&LvColumn); + InvalidateColumnHeaders(); + } + + void ListView::SetColumnWidth(int32_t Index, int32_t Width) + { + if (GetState(ControlStates::StateCreated)) + SendMessageA(this->_Handle, LVM_SETCOLUMNWIDTH, (WPARAM)Index, MAKELPARAM(Width, 0)); + } + + void ListView::SetDisplayIndices(const std::unique_ptr& Indices, int32_t Count) + { + auto OrderedColumns = std::make_unique(Count); + for (int32_t i = 0; i < Count; i++) + { + this->Columns[i].SetDisplayIndexInternal(Indices[i]); + OrderedColumns[Indices[i]] = i; + } + + if (GetState(ControlStates::StateCreated)) + SendMessageA(this->_Handle, LVM_SETCOLUMNORDERARRAY, (WPARAM)Count, (LPARAM)OrderedColumns.get()); + } + + void ListView::UpdateExtendedStyles() + { + if (GetState(ControlStates::StateCreated)) + { + int32_t ExStyle = 0; + int32_t ExMask = LVS_EX_ONECLICKACTIVATE | LVS_EX_TWOCLICKACTIVATE | + LVS_EX_TRACKSELECT | LVS_EX_UNDERLINEHOT | LVS_EX_ONECLICKACTIVATE | + LVS_EX_HEADERDRAGDROP | LVS_EX_CHECKBOXES | + LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES | + LVS_EX_INFOTIP | LVS_EX_DOUBLEBUFFER; + + switch (_ItemActivation) + { + case ItemActivation::OneClick: + ExStyle |= LVS_EX_ONECLICKACTIVATE; + break; + case ItemActivation::TwoClick: + ExStyle |= LVS_EX_TWOCLICKACTIVATE; + break; + } + + if (AllowColumnReorder()) + ExStyle |= LVS_EX_HEADERDRAGDROP; + if (DoubleBuffered()) + ExStyle |= LVS_EX_DOUBLEBUFFER; + if (FullRowSelect()) + ExStyle |= LVS_EX_FULLROWSELECT; + if (GridLines()) + ExStyle |= LVS_EX_GRIDLINES; + if (HoverSelection()) + ExStyle |= LVS_EX_TRACKSELECT; + if (HotTracking()) + ExStyle |= LVS_EX_UNDERLINEHOT; + + SendMessageA(this->_Handle, LVM_SETEXTENDEDLISTVIEWSTYLE, (WPARAM)ExMask, (LPARAM)ExStyle); + Invalidate(); + } + } + + int32_t ListView::GetIndexOfClickedItem(LVHITTESTINFO & LvHI) + { + auto Pos = GetMousePosition(); + Pos = PointToClient(Pos); + + LvHI.pt.x = Pos.X; + LvHI.pt.y = Pos.Y; + + return (int32_t)SendMessageA(this->_Handle, LVM_HITTEST, NULL, (LPARAM)&LvHI); + } + + void ListView::WmMouseDown(Message& Msg, MouseButtons Button, uint32_t Clicks) + { + SetFlag(ListViewFlags::FlagMouseUpFired, false); + SetFlag(ListViewFlags::FlagExpectingMouseUp, true); + + this->Focus(); + + int32_t X = LOWORD((int)Msg.LParam); + int32_t Y = HIWORD((int)Msg.LParam); + auto EventArgs = std::make_unique(Button, Clicks, X, Y, 0); + + OnMouseDown(EventArgs); + + DefWndProc(Msg); + } + + void ListView::WmReflectNotify(Message& Msg) + { + auto NMHdr = (NMHDR*)Msg.LParam; + + switch (NMHdr->code) + { + case NM_CUSTOMDRAW: + NmCustomDraw(Msg); + break; + + case LVN_BEGINLABELEDITA: + case LVN_BEGINLABELEDITW: + { + auto DispInfo = (NMLVDISPINFOA*)Msg.LParam; + auto EventArgs = std::make_unique(DispInfo->item.iItem); + OnBeforeLabelEdit(EventArgs); + Msg.Result = (uintptr_t)(EventArgs->CancelEdit ? 1 : 0); + SetFlag(ListViewFlags::FlagInLabelEdit, !EventArgs->CancelEdit); + } + break; + + case LVN_COLUMNCLICK: + SetFlag(ListViewFlags::FlagColumnClicked, true); + _ColumnIndex = ((NMLISTVIEW*)Msg.LParam)->iSubItem; + break; + + case LVN_ENDLABELEDITA: + case LVN_ENDLABELEDITW: + { + auto DispInfo = (NMLVDISPINFOA*)Msg.LParam; + auto EventArgs = std::make_unique(DispInfo->item.iItem, DispInfo->item.pszText); + OnAfterLabelEdit(EventArgs); + Msg.Result = (uintptr_t)(EventArgs->CancelEdit ? 1 : 0); + + if (!EventArgs->CancelEdit && DispInfo->item.pszText != nullptr) + { + LVITEMA LvItem{}; + LvItem.mask = LVIF_TEXT; + LvItem.iItem = DispInfo->item.iItem; + LvItem.pszText = DispInfo->item.pszText; + SendMessageA(this->_Handle, LVM_SETITEMTEXTA, (WPARAM)DispInfo->item.iItem, (LPARAM)&LvItem); + } + } + break; + + case LVN_ITEMACTIVATE: + OnItemActivate(); + break; + + case NM_CLICK: + case NM_RCLICK: + { + LVHITTESTINFO LvHI{}; + auto DisplayIndex = GetIndexOfClickedItem(LvHI); + auto Button = NMHdr->code == NM_CLICK ? MouseButtons::Left : MouseButtons::Right; + auto Pos = GetMousePosition(); + Pos = PointToClient(Pos); + + if (DisplayIndex != -1) + { + OnClick(); + OnMouseClick(std::make_unique(Button, 1, Pos.X, Pos.Y, 0)); + } + if (!GetFlag(ListViewFlags::FlagMouseUpFired)) + { + OnMouseUp(std::make_unique(Button, 1, Pos.X, Pos.Y, 0)); + SetFlag(ListViewFlags::FlagMouseUpFired, true); + } + } + break; + + case NM_DBLCLK: + case NM_RDBLCLK: + { + LVHITTESTINFO LvHI{}; + auto DisplayIndex = GetIndexOfClickedItem(LvHI); + + if (DisplayIndex != -1) + SetFlag(ListViewFlags::FlagDoubleclickFired, true); + SetFlag(ListViewFlags::FlagMouseUpFired, false); + + SetCapture(true); + } + break; + + case LVN_ODCACHEHINT: + { + auto CacheHint = (NMLVCACHEHINT*)Msg.LParam; + OnCacheVirtualItems(std::make_unique(CacheHint->iFrom, CacheHint->iTo)); + } + break; + + case LVN_GETDISPINFOA: + case LVN_GETDISPINFOW: + if (VirtualMode()) + { + auto DispInfo = (NMLVDISPINFOA*)Msg.LParam; + + if ((DispInfo->item.mask & LVIF_TEXT) != 0) + { + auto EventArgs = std::make_unique(DispInfo->item.iItem, DispInfo->item.iSubItem); + OnRetrieveVirtualItem(EventArgs); + + auto TextSize = min(EventArgs->Text.Length(), (uint32_t)(DispInfo->item.cchTextMax - 1)); + std::memcpy(DispInfo->item.pszText, (char*)EventArgs->Text, (size_t)TextSize); + DispInfo->item.pszText[TextSize] = '\0'; + } + } + break; + + case LVN_ODSTATECHANGED: + { + auto OdStateChange = (NMLVODSTATECHANGE*)Msg.LParam; + if ((OdStateChange->uNewState & LVIS_SELECTED) != (OdStateChange->uOldState & LVIS_SELECTED)) + { + OnVirtualItemsSelectionRangeChanged(std::make_unique(OdStateChange->iFrom, OdStateChange->iTo, (OdStateChange->uNewState & LVIS_SELECTED) != 0)); + } + } + break; + + case LVN_ITEMCHANGED: + { + auto ChangeInfo = (NMLISTVIEW*)Msg.LParam; + if ((ChangeInfo->uChanged & LVIF_STATE) != 0) + { + int32_t oldState = ChangeInfo->uOldState & LVIS_SELECTED; + int32_t newState = ChangeInfo->uNewState & LVIS_SELECTED; + + if (newState != oldState) + { + // Trigger virtual item selection change here as well... + if (this->VirtualListSize() > 0) + { + OnVirtualItemsSelectionRangeChanged(std::make_unique(0, this->VirtualListSize() - 1, newState != 0)); + } + + // TODO: Trigger OnSelectedIndexChanged(); + // https://referencesource.microsoft.com/#System.Windows.Forms/winforms/Managed/System/WinForms/ListView.cs,5946 + } + } + } + break; + } + } + + bool ListView::WmNotify(Message& Msg) + { + auto NmHdr = (NMHDR*)Msg.LParam; + + if (NmHdr->code == NM_CUSTOMDRAW && OwnerDraw()) + { + auto NmCd = (NMCUSTOMDRAW*)Msg.LParam; + + switch (NmCd->dwDrawStage) + { + case CDDS_PREPAINT: + Msg.Result = (uintptr_t)CDRF_NOTIFYITEMDRAW; + return true; + + case CDDS_ITEMPREPAINT: + { + auto EventArgs = std::make_unique((HDC)NmCd->hdc, &Columns[(uint32_t)NmCd->dwItemSpec], (int32_t)NmCd->dwItemSpec, Drawing::Rectangle(NmCd->rc.left, NmCd->rc.top, NmCd->rc.right - NmCd->rc.left, NmCd->rc.bottom - NmCd->rc.top), (ListViewItemStates)NmCd->uItemState); + OnDrawColumnHeader(EventArgs); + + if (EventArgs->DrawDefault) + { + Msg.Result = (uintptr_t)CDRF_DODEFAULT; + return false; + } + else + { + Msg.Result = (uintptr_t)CDRF_SKIPDEFAULT; + return true; + } + } + break; + + default: + return false; + } + } + + if (NmHdr->code == NM_RELEASEDCAPTURE && GetFlag(ListViewFlags::FlagColumnClicked)) + { + SetFlag(ListViewFlags::FlagColumnClicked, false); + OnColumnClick(std::make_unique(_ColumnIndex)); + } + + // Still need default handling + return false; + } + + void ListView::NmCustomDraw(Message& Msg) + { + bool DontMess = false; + bool ItemDrawDefault = false; + + auto NmCd = (NMLVCUSTOMDRAW*)Msg.LParam; + + switch (NmCd->nmcd.dwDrawStage) + { + case CDDS_PREPAINT: + if (OwnerDraw()) + { + Msg.Result = (uintptr_t)CDRF_NOTIFYITEMDRAW; + return; + } + + Msg.Result = (uintptr_t)CDRF_NOTIFYSUBITEMDRAW; + return; + + case CDDS_ITEMPREPAINT: + { + int32_t ItemIndex = (int32_t)NmCd->nmcd.dwItemSpec; + auto ItemBounds = GetItemRectOrEmpty(ItemIndex); + + if (!ClientRectangle().IntersectsWith(ItemBounds)) + return; + + if (OwnerDraw()) + { + auto Item = this->GetSubItem(ItemIndex, 0); + auto EventArgs = std::make_unique((HDC)NmCd->nmcd.hdc, Item.first, Item.second, ItemBounds, ItemIndex, (ListViewItemStates)NmCd->nmcd.uItemState); + OnDrawItem(EventArgs); + + ItemDrawDefault = EventArgs->DrawDefault; + + if (_ViewStyle == View::Details) + Msg.Result = (uintptr_t)CDRF_NOTIFYSUBITEMDRAW; + else if (!EventArgs->DrawDefault) + Msg.Result = (uintptr_t)CDRF_SKIPDEFAULT; + + if (!EventArgs->DrawDefault) + return; + } + + if (_ViewStyle == View::Details || _ViewStyle == View::Tile) + { + Msg.Result = (uintptr_t)CDRF_NOTIFYSUBITEMDRAW; + DontMess = true; + } + } + + case (CDDS_SUBITEM | CDDS_ITEMPREPAINT): + { + int32_t ItemIndex = (int32_t)NmCd->nmcd.dwItemSpec; + auto ItemBounds = GetItemRectOrEmpty(ItemIndex); + + if (!ClientRectangle().IntersectsWith(ItemBounds)) + return; + + if (OwnerDraw() && !ItemDrawDefault) + { + bool SkipCustomDrawCode = true; + + if (NmCd->iSubItem < (int32_t)Columns.Count()) + { + auto SubItemBounds = GetSubItemRect(ItemIndex, NmCd->iSubItem); + + if (NmCd->iSubItem == 0 && Columns.Count() > 1) + { + SubItemBounds.Width = Columns[0].Width(); + } + + if (ClientRectangle().IntersectsWith(SubItemBounds)) + { + auto Item = this->GetSubItem(ItemIndex, NmCd->iSubItem); + auto EventArgs = std::make_unique((HDC)NmCd->nmcd.hdc, Item.first, Item.second, SubItemBounds, ItemIndex, NmCd->iSubItem, (ListViewItemStates)NmCd->nmcd.uItemState); + OnDrawSubItem(EventArgs); + + SkipCustomDrawCode = !EventArgs->DrawDefault; + } + } + + if (SkipCustomDrawCode) + { + Msg.Result = (uintptr_t)CDRF_SKIPDEFAULT; + return; + } + } + + auto State = NmCd->nmcd.uItemState; + if (!HideSelection()) + { + auto RealState = GetItemState((int32_t)NmCd->nmcd.dwItemSpec); + if ((RealState & LVIS_SELECTED) == 0) + State &= ~CDIS_SELECTED; + } + + auto SubItem = ((NmCd->nmcd.dwDrawStage & CDDS_SUBITEM) != 0) ? NmCd->iSubItem : 0; + auto Item = GetSubItem(ItemIndex, SubItem); + + bool ChangeColor = (GetState(ControlStates::StateEnabled) ? true : false); + if (Activation() == ItemActivation::OneClick || Activation() == ItemActivation::TwoClick) + { + if ((State & (CDIS_SELECTED | CDIS_GRAYED | CDIS_HOT | CDIS_DISABLED)) != 0) + ChangeColor = false; + } + + if (ChangeColor) + { + NmCd->clrText = Drawing::ColorToWin32(Item.second.ForeColor); + NmCd->clrTextBk = Drawing::ColorToWin32(Item.second.BackColor); + } + + if (!DontMess) + Msg.Result = (uintptr_t)CDRF_NEWFONT; + } + return; + + default: + Msg.Result = (uintptr_t)CDRF_DODEFAULT; + return; + } + } + + ListView::ColumnHeaderCollection::ColumnHeaderCollection(ListView* Owner) + : _Owner(Owner), _Columns() + { + } + + void ListView::ColumnHeaderCollection::Add(const ColumnHeader& Value) + { + auto& Result = _Columns.Emplace(Value); + + Result.SetListView(_Owner); + + if (Result.DisplayIndex() <= -1) + Result.SetDisplayIndexInternal(_Columns.Count() - 1); + + if (_Owner->GetState(ControlStates::StateCreated)) + _Owner->NativeAddColumn(Result); + } + + void ListView::ColumnHeaderCollection::Insert(int32_t Index, const ColumnHeader& Value) + { + _Columns.Insert(Index, Value); + + auto& Result = _Columns[Index]; + + Result.SetListView(_Owner); + + if (Result.DisplayIndex() <= -1) + Result.SetDisplayIndexInternal(Index); + + if (_Owner->GetState(ControlStates::StateCreated)) + _Owner->NativeInsertColumn(Index, Result); + } + + void ListView::ColumnHeaderCollection::Clear() + { + _Owner->NativeClearColumns(); + _Columns.Clear(); + } + + int32_t ListView::ColumnHeaderCollection::IndexOf(const ColumnHeader& Value) + { + return this->_Columns.IndexOf(Value); + } + + uint32_t ListView::ColumnHeaderCollection::Count() + { + return this->_Columns.Count(); + } + + ColumnHeader* ListView::ColumnHeaderCollection::begin() const + { + return this->_Columns.begin(); + } + + ColumnHeader* ListView::ColumnHeaderCollection::end() const + { + return this->_Columns.end(); + } + + ColumnHeader& ListView::ColumnHeaderCollection::operator[](uint32_t Index) + { + return this->_Columns[Index]; + } + + ListView::ListViewItemCollection::ListViewItemCollection(ListView* Owner) + : _Owner(Owner) + { + } + + void ListView::ListViewItemCollection::Add(const ListViewItem& Value) + { + _Items.EmplaceBack(Value); + + if (_Owner->GetState(ControlStates::StateCreated)) + _Owner->NativeInsertItem(_Items.Count(), Value); + } + + void ListView::ListViewItemCollection::Insert(int32_t Index, const ListViewItem& Value) + { + _Items.Insert(Index, Value); + + if (_Owner->GetState(ControlStates::StateCreated)) + _Owner->NativeInsertItem(Index, Value); + } + + void ListView::ListViewItemCollection::RemoveAt(int32_t Index) + { + _Items.RemoveAt(Index); + + if (_Owner->GetState(ControlStates::StateCreated)) + _Owner->NativeRemoveItem(Index); + } + + void ListView::ListViewItemCollection::Clear() + { + _Items.Clear(); + + if (_Owner->GetState(ControlStates::StateCreated)) + _Owner->NativeClearItems(); + } + + uint32_t ListView::ListViewItemCollection::Count() + { + return (_Owner->VirtualMode() ? (uint32_t)_Owner->_VirtualListSize : this->_Items.Count()); + } + + ListViewItem& ListView::ListViewItemCollection::operator[](uint32_t Index) + { + return _Items[Index]; + } + + ListViewItem* ListView::ListViewItemCollection::begin() const + { + return _Items.begin(); + } + + ListViewItem* ListView::ListViewItemCollection::end() const + { + return _Items.end(); + } + + const List& ListView::ListViewItemCollection::ToList() + { + return _Items; + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/ListView.h b/r5dev/thirdparty/cppnet/cppkore/ListView.h new file mode 100644 index 00000000..2108bf9c --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ListView.h @@ -0,0 +1,335 @@ +#pragma once + +#include +#include "View.h" +#include "ListBase.h" +#include "Control.h" +#include "SortOrder.h" +#include "BorderStyle.h" +#include "ColumnHeader.h" +#include "ListViewFlags.h" +#include "ListViewItem.h" +#include "ItemActivation.h" +#include "ListViewAlignment.h" +#include "ColumnHeaderStyle.h" +#include "LabelEditEventArgs.h" +#include "ListViewItemStates.h" +#include "ColumnClickEventArgs.h" +#include "DrawListViewItemEventArgs.h" +#include "CacheVirtualItemsEventArgs.h" +#include "RetrieveVirtualItemEventArgs.h" +#include "DrawListViewSubItemEventArgs.h" +#include "DrawListViewColumnHeaderEventArgs.h" +#include "ListViewVirtualItemsSelectionRangeChangedEventArgs.h" + +namespace Forms +{ + // Displays a list of items in one of four + // views. Each item displays a caption and optionally an image. + class ListView : public Control + { + public: + ListView(); + virtual ~ListView() = default; + + // Gets the style that specifies what kind of user action is required to activate an item. + ItemActivation Activation(); + // Sets the style that specifies what kind of user action is required to activate an item. + void SetActivation(ItemActivation Value); + + // The alignment style specifies which side of the window items are aligned to by default. + ListViewAlignment Alignment(); + // The alignment style specifies which side of the window items are aligned to by default. + void SetAlignment(ListViewAlignment Value); + + // Specifies whether the user can drag column headers. + bool AllowColumnReorder(); + // Specifies whether the user can drag column headers. + void SetAllowColumnReorder(bool Value); + + // If AutoArrange is true items are automatically arranged according to + // the alignment property. + bool AutoArrange(); + // If AutoArrange is true items are automatically arranged according to + // the alignment property. + void SetAutoArrange(bool Value); + + // Describes the border style of the window. + BorderStyle GetBorderStyle(); + // Describes the border style of the window. + void SetBorderStyle(BorderStyle Value); + + // The columns contained in the ListView. + struct ColumnHeaderCollection + { + ColumnHeaderCollection(ListView* Owner); + ~ColumnHeaderCollection() = default; + + // Adds a column header to the ListView. + void Add(const ColumnHeader& Value); + // Inserts a column header to the ListView. + void Insert(int32_t Index, const ColumnHeader& Value); + // Removes all column headers from the ListView. + void Clear(); + // Gets the index of a column header. + int32_t IndexOf(const ColumnHeader& Value); + // Gets the count of column headers in the ListView. + uint32_t Count(); + + // Iterater classes + ColumnHeader* begin() const; + ColumnHeader* end() const; + + // Array index operator + ColumnHeader& operator[](uint32_t Index); + + protected: + // Internal references + ListView* _Owner; + List _Columns; + } Columns; + + // Retreives the item which currently has the user focus. + int32_t FocusedItem(); + // Sets the item which currently has the user focus. + void SetFocusedItem(int32_t Value); + + // Specifies whether a click on an item will select the entire row. + bool FullRowSelect(); + // Specifies whether a click on an item will select the entire row. + void SetFullRowSelect(bool Value); + + // If true, draws grid lines between items and subItems. + bool GridLines(); + // If true, draws grid lines between items and subItems. + void SetGridLines(bool Value); + + // Column headers can either be invisible, clickable, or non-clickable. + ColumnHeaderStyle HeaderStyle(); + // Column headers can either be invisible, clickable, or non-clickable. + void SetHeaderStyle(ColumnHeaderStyle Value); + + // If false, selected items will still be highlighted. + bool HideSelection(); + // If false, selected items will still be highlighted. + void SetHideSelection(bool Value); + + // Enables or disables hot tracking. + bool HotTracking(); + // Enables or disables hot tracking. + void SetHotTracking(bool Value); + + // Determines whether items can be selected by hovering over them with the mouse. + bool HoverSelection(); + // Determines whether items can be selected by hovering over them with the mouse. + void SetHoverSelection(bool Value); + + // The items contained in the ListView if not virtual. + struct ListViewItemCollection + { + ListViewItemCollection(ListView* Owner); + ~ListViewItemCollection() = default; + + // Adds an item to the list view. + void Add(const ListViewItem& Value); + // Inserts an item to the list view. + void Insert(int32_t Index, const ListViewItem& Value); + // Removes an item at the given index. + void RemoveAt(int32_t Index); + // Clears the items in the list view. + void Clear(); + // Gets the count of items in the list view. + uint32_t Count(); + + // Array index operator + ListViewItem& operator[](uint32_t Index); + + // Iterater classes + ListViewItem* begin() const; + ListViewItem* end() const; + + // Gets a list of items from the collection + const List& ToList(); + + protected: + ListView* _Owner; + List _Items; + } Items; + + // Tells whether the EditLabels style is currently set. + bool LabelEdit(); + // Tells whether the EditLabels style is currently set. + void SetLabelEdit(bool Value); + + // Tells whether the LabelWrap style is currently set. + bool LabelWrap(); + // Tells whether the LabelWrap style is currently set. + void SetLabelWrap(bool Value); + + // Tells whether the MultiSelect style is currently set. + bool MultiSelect(); + // Tells whether the MultiSelect style is currently set. + void SetMultiSelect(bool Value); + + // Indicates whether the list view items (and sub-items in the Details view) will be + // drawn by the system or the user. + bool OwnerDraw(); + // Indicates whether the list view items (and sub-items in the Details view) will be + // drawn by the system or the user. + void SetOwnerDraw(bool Value); + + // Tells whether the ScrollBars are visible or not. + bool Scrollable(); + // Tells whether the ScrollBars are visible or not. + void SetScrollable(bool Value); + + // The indices of the currently selected list items. + List SelectedIndices(); + + // Tells whether or not groups are visible. + bool ShowGroups(); + // Tells whether or not groups are visible. + void SetShowGroups(bool Value); + + // Gets the sorting order for items. + SortOrder Sorting(); + // Sets the sorting order for items. + void SetSorting(SortOrder Value); + + // Gets the top item index. + int32_t TopItem(); + // Sets the top item by it's index. + void SetTopItem(int32_t Value); + + // Gets the total amount of visible items of the ListView. + int32_t CountPerPage(); + + // Gets or sets the view mode of the ListView. + View GetView(); + // Gets or sets the view mode of the ListView. + void SetView(View Value); + + // Gets the number of items in the virtual list. + int32_t VirtualListSize(); + // Sets the number of items in the virtual list. + void SetVirtualListSize(int32_t Value); + + // Gets whether or not the ListView is virtual. + bool VirtualMode(); + // Sets whether or not the ListView is virtual. + void SetVirtualMode(bool Value); + + // Used change column info. + void SetColumnInfo(int32_t Mask, ColumnHeader& Header); + // Used to change column widths. + void SetColumnWidth(int32_t Index, int32_t Width); + + // We must define control event bases here + virtual void OnHandleCreated(); + virtual void OnBackColorChanged(); + virtual void OnForeColorChanged(); + virtual void OnFontChanged(); + virtual void OnItemActivate(); + virtual void OnColumnClick(const std::unique_ptr& EventArgs); + virtual void OnBeforeLabelEdit(const std::unique_ptr& EventArgs); + virtual void OnAfterLabelEdit(const std::unique_ptr& EventArgs); + virtual void OnDrawItem(const std::unique_ptr& EventArgs); + virtual void OnDrawSubItem(const std::unique_ptr& EventArgs); + virtual void OnDrawColumnHeader(const std::unique_ptr& EventArgs); + virtual void OnCacheVirtualItems(const std::unique_ptr& EventArgs); + virtual void OnRetrieveVirtualItem(const std::unique_ptr& EventArgs); + virtual void OnVirtualItemsSelectionRangeChanged(const std::unique_ptr& EventArgs); + + // We must define event handlers here + EventBase ItemActivate; + EventBase&, Control*)> ColumnClick; + EventBase&, Control*)> BeforeLabelEdit; + EventBase&, Control*)> AfterLabelEdit; + EventBase&, Control*)> DrawItem; + EventBase&, Control*)> DrawSubItem; + EventBase&, Control*)> DrawColumnHeader; + EventBase&, Control*)> CacheVirtualItems; + EventBase&, Control*)> RetrieveVirtualItem; + EventBase&, Control*)> VirtualItemsSelectionRangeChanged; + + // Override WndProc for specific combo box messages. + virtual void WndProc(Message& Msg); + + // Creates a new instance of the specified control with the given parent. + virtual void CreateControl(Control* Parent = nullptr); + + protected: + // Get custom control creation parameters for this instance. + virtual CreateParams GetCreateParams(); + // Internal routine to scale a control by factor + virtual void ScaleControl(Drawing::SizeF Factor, BoundsSpecified Specified); + + // Internal cached flags + ListViewFlags _Flags; + + // Gets list view specific flags + bool GetFlag(ListViewFlags Flag); + // Sets list view specific flags + void SetFlag(ListViewFlags Flags, bool Value); + + // Internal routine to add a column + void NativeAddColumn(ColumnHeader& Header); + // Internal routine to insert a column + void NativeInsertColumn(const int32_t Index, ColumnHeader& Header); + // Internal routine to clear the columns + void NativeClearColumns(); + + // Internal routine to add an item at the given index + void NativeInsertItem(int32_t Index, const ListViewItem& Item); + // Internal routine to insert items at the given index + void NativeInsertItems(int32_t Index, int32_t Count, const List& Items); + // Internal routine to remove an item + void NativeRemoveItem(int32_t Index); + // Internal routine to clear all items + void NativeClearItems(); + + // Internal routine to invalidate headers + void InvalidateColumnHeaders(); + + // Internal routine to get an item position + Drawing::Point GetItemPosition(int32_t Index); + // Internal routine to get an item rectangle + Drawing::Rectangle GetItemRectOrEmpty(int32_t Index); + // Internal routine to get the sub item rectangle + Drawing::Rectangle GetSubItemRect(int32_t Index, int32_t SubItem); + // Internal routine to get an item state + int32_t GetItemState(int32_t Index); + + // Internal routine to get a sub item + std::pair GetSubItem(int32_t Index, int32_t SubItem); + + // Internal routine to set column indices + void SetDisplayIndices(const std::unique_ptr& Indices, int32_t Count); + + // Internal routine to update styles + void UpdateExtendedStyles(); + + private: + // Internal cached flags + ItemActivation _ItemActivation; + ListViewAlignment _ListViewAlignment; + BorderStyle _BorderStyle; + ColumnHeaderStyle _ColumnHeaderStyle; + SortOrder _SortOrder; + View _ViewStyle; + MouseButtons _DownButton; + + // Virtual mode size / column index + int32_t _VirtualListSize; + int32_t _ColumnIndex; + + // Internal routine to get index of an item + int32_t GetIndexOfClickedItem(LVHITTESTINFO& LvHI); + + // We must define each window message handler here... + void WmMouseDown(Message& Msg, MouseButtons Button, uint32_t Clicks); + void WmReflectNotify(Message& Msg); + bool WmNotify(Message& Msg); + void NmCustomDraw(Message& Msg); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/ListViewAlignment.h b/r5dev/thirdparty/cppnet/cppkore/ListViewAlignment.h new file mode 100644 index 00000000..7d730bcf --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ListViewAlignment.h @@ -0,0 +1,21 @@ +#pragma once + +#include +#include + +namespace Forms +{ + // Specifies how items align in the ListView + enum class ListViewAlignment + { + // When the user moves an + // item, it remains where it is dropped. + Default = LVA_DEFAULT, + // Items are aligned to the top of the ListView control. + Top = LVA_ALIGNTOP, + // Items are aligned to the left of the ListView control. + Left = LVA_ALIGNLEFT, + // Items are aligned to an invisible grid in the control. + SnapToGrid = LVA_SNAPTOGRID + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/ListViewFlags.h b/r5dev/thirdparty/cppnet/cppkore/ListViewFlags.h new file mode 100644 index 00000000..c8411551 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ListViewFlags.h @@ -0,0 +1,51 @@ +#pragma once + +#include +#include + +namespace Forms +{ + // This enumeration represents the ListView flags... + enum class ListViewFlags + { + FlagOwnerDraw = 0x00000001, + FlagAllowColumnReorder = 0x00000002, + FlagAutoArrange = 0x00000004, + FlagCheckBoxes = 0x00000008, + FlagFullRowSelect = 0x00000010, + FlagGridLines = 0x00000020, + FlagHideSelection = 0x00000040, + FlagHotTracking = 0x00000080, + FlagLabelEdit = 0x00000100, + FlagLabelWrap = 0x00000200, + FlagMultiSelect = 0x00000400, + FlagScrollable = 0x00000800, + FlagHoverSelection = 0x00001000, + FlagMonclickHdr = 0x00002000, + FlagInLabelEdit = 0x00004000, + FlagShowItemToolTips = 0x00008000, + FlagBackgroundImageTiled = 0x00010000, + FlagColumnClicked = 0x00020000, + FlagDoubleclickFired = 0x00040000, + FlagMouseUpFired = 0x00080000, + FlagExpectingMouseUp = 0x00100000, + FlagComctlSupportsVisualStyles = 0x00200000, + FlagComctlSupportsVisualStylesTested = 0x00400000, + FlagShowGroups = 0x00800000, + FlagHandleDestroyed = 0x01000000, + FlagVirtualMode = 0x02000000, + FlagHeaderControlTracking = 0x04000000, + FlagItemCollectionChangedInMouseDown = 0x08000000, + FlagFlipViewToLargeIconAndSmallIcon = 0x10000000, + FlagHeaderDividerDblClick = 0x20000000, + FlagColumnResizeCancelled = 0x40000000 + }; + + // + // Allow bitwise operations on this enumeration + // + constexpr ListViewFlags operator|(ListViewFlags Lhs, ListViewFlags Rhs) + { + return static_cast(static_cast::type>(Lhs) | static_cast::type>(Rhs)); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/ListViewItem.cpp b/r5dev/thirdparty/cppnet/cppkore/ListViewItem.cpp new file mode 100644 index 00000000..f47c55e9 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ListViewItem.cpp @@ -0,0 +1,72 @@ +#include "stdafx.h" +#include "ListViewItem.h" + +namespace Forms +{ + ListViewItem::ListViewItem() + : _SubItems(nullptr), _SubItemStyles(nullptr), Index(-1), _SubItemCount(0) + { + } + + ListViewItem::ListViewItem(std::initializer_list SubItems) + : _SubItems(std::make_unique(SubItems.size())), _SubItemStyles(std::make_unique(SubItems.size())), Index(-1), _SubItemCount((uint32_t)SubItems.size()) + { + std::copy(SubItems.begin(), SubItems.end(), _SubItems.get()); + } + + ListViewItem::ListViewItem(std::initializer_list SubItems, std::initializer_list SubItemStyles) + : _SubItems(std::make_unique(SubItems.size())), _SubItemStyles(std::make_unique(SubItemStyles.size())), Index(-1), _SubItemCount((uint32_t)SubItems.size()) + { + std::copy(SubItems.begin(), SubItems.end(), _SubItems.get()); + std::copy(SubItemStyles.begin(), SubItemStyles.end(), _SubItemStyles.get()); + } + + ListViewItem::ListViewItem(const ListViewItem& Rhs) + { + this->_SubItemCount = Rhs._SubItemCount; + + this->_SubItems = std::make_unique(_SubItemCount); + this->_SubItemStyles = std::make_unique(_SubItemCount); + + std::copy(Rhs._SubItems.get(), Rhs._SubItems.get() + _SubItemCount, this->_SubItems.get()); + std::copy(Rhs._SubItemStyles.get(), Rhs._SubItemStyles.get() + _SubItemCount, this->_SubItemStyles.get()); + } + + ListViewItem& ListViewItem::operator=(const ListViewItem& Rhs) + { + this->_SubItemCount = Rhs._SubItemCount; + + this->_SubItems = std::make_unique(_SubItemCount); + this->_SubItemStyles = std::make_unique(_SubItemCount); + + std::copy(Rhs._SubItems.get(), Rhs._SubItems.get() + _SubItemCount, this->_SubItems.get()); + std::copy(Rhs._SubItemStyles.get(), Rhs._SubItemStyles.get() + _SubItemCount, this->_SubItemStyles.get()); + + return *this; + } + + const string& ListViewItem::Text() const + { + return _SubItems[0]; + } + + const ListViewItemStyle& ListViewItem::Style() const + { + return _SubItemStyles[0]; + } + + const string& ListViewItem::SubItem(uint32_t Index) const + { + return _SubItems[Index]; + } + + const ListViewItemStyle& ListViewItem::SubItemStyle(uint32_t Index) const + { + return _SubItemStyles[Index]; + } + + uint32_t ListViewItem::SubItemCount() const + { + return _SubItemCount - 1; + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/ListViewItem.h b/r5dev/thirdparty/cppnet/cppkore/ListViewItem.h new file mode 100644 index 00000000..d938ac25 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ListViewItem.h @@ -0,0 +1,60 @@ +#pragma once + +#include +#include +#include +#include "StringBase.h" +#include "DrawingBase.h" + +namespace Forms +{ + // The style for this specific sub item + struct ListViewItemStyle + { + // The color behind the text of the item. + Drawing::Color BackColor; + // The color of the text for the item. + Drawing::Color ForeColor; + + ListViewItemStyle() + : BackColor(CLR_NONE), ForeColor(0, 0, 0) // These match the recommended ListView colors + { + } + }; + + // An item used to represent an item in a ListView. + class ListViewItem + { + public: + ListViewItem(); + ListViewItem(std::initializer_list SubItems); + ListViewItem(std::initializer_list SubItems, std::initializer_list SubItemStyles); + ListViewItem(const ListViewItem& Rhs); + ~ListViewItem() = default; + + // Assignment operator + ListViewItem& operator=(const ListViewItem& Rhs); + + // Gets the text associated with this list item. + const string& Text() const; + // Gets the style associated with this list Item. + const ListViewItemStyle& Style() const; + + // Gets the sub item text. + const string& SubItem(uint32_t Index) const; + // Gets the sub item style. + const ListViewItemStyle& SubItemStyle(uint32_t Index) const; + + // Gets the count of sub items. + uint32_t SubItemCount() const; + + // Gets or sets the index assigned to this list view item. + int32_t Index; + + private: + // Internal cached properties + std::unique_ptr _SubItems; + std::unique_ptr _SubItemStyles; + uint32_t _SubItemCount; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/ListViewItemStates.h b/r5dev/thirdparty/cppnet/cppkore/ListViewItemStates.h new file mode 100644 index 00000000..9779060e --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ListViewItemStates.h @@ -0,0 +1,21 @@ +#pragma once + +#include +#include + +namespace Forms +{ + // Gives state information about a ListView item/sub-item. Used with owner draw. + enum class ListViewItemStates + { + Checked = CDIS_CHECKED, + Default = CDIS_DEFAULT, + Focused = CDIS_FOCUS, + Grayed = CDIS_GRAYED, + Hot = CDIS_HOT, + Indeterminate = CDIS_INDETERMINATE, + Marked = CDIS_MARKED, + Selected = CDIS_SELECTED, + ShowKeyboardCues = CDIS_SHOWKEYBOARDCUES + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/ListViewVirtualItemsSelectionRangeChangedEventArgs.cpp b/r5dev/thirdparty/cppnet/cppkore/ListViewVirtualItemsSelectionRangeChangedEventArgs.cpp new file mode 100644 index 00000000..2db907ba --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ListViewVirtualItemsSelectionRangeChangedEventArgs.cpp @@ -0,0 +1,10 @@ +#include "stdafx.h" +#include "ListViewVirtualItemsSelectionRangeChangedEventArgs.h" + +namespace Forms +{ + ListViewVirtualItemsSelectionRangeChangedEventArgs::ListViewVirtualItemsSelectionRangeChangedEventArgs(int32_t Start, int32_t End, bool Selected) + : StartIndex(Start), EndIndex(End), IsSelected(Selected) + { + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/ListViewVirtualItemsSelectionRangeChangedEventArgs.h b/r5dev/thirdparty/cppnet/cppkore/ListViewVirtualItemsSelectionRangeChangedEventArgs.h new file mode 100644 index 00000000..297f5d0d --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ListViewVirtualItemsSelectionRangeChangedEventArgs.h @@ -0,0 +1,21 @@ +#pragma once + +#include + +namespace Forms +{ + // The event class that is created when the selection state of a ListViewItem is changed. + class ListViewVirtualItemsSelectionRangeChangedEventArgs + { + public: + ListViewVirtualItemsSelectionRangeChangedEventArgs(int32_t Start, int32_t End, bool Selected); + ~ListViewVirtualItemsSelectionRangeChangedEventArgs() = default; + + // The start of the new selection. + const int32_t StartIndex; + // The end of the new selection. + const int32_t EndIndex; + // Whether or not the range is selected or deselected. + const bool IsSelected; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Mangle.cpp b/r5dev/thirdparty/cppnet/cppkore/Mangle.cpp new file mode 100644 index 00000000..921f1c04 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Mangle.cpp @@ -0,0 +1,43 @@ +#include "stdafx.h" +#include "Mangle.h" + +// +// OpenGL procs +// + +FnDeleteBuffers glDeleteBuffers; +FnGenBuffers glGenBuffers; +FnBindBuffer glBindBuffer; +FnBindBufferBase glBindBufferBase; +FnBufferData glBufferData; +FnBindVertexArray glBindVertexArray; +FnDeleteVertexArrays glDeleteVertexArrays; +FnGenVertexArrays glGenVertexArrays; +FnCompileShader glCompileShader; +FnCreateProgram glCreateProgram; +FnCreateShader glCreateShader; +FnActiveTexture glActiveTexture; +FnDeleteProgram glDeleteProgram; +FnDeleteShader glDeleteShader; +FnDetachShader glDetachShader; +FnUseProgram glUseProgram; +FnShaderSource glShaderSource; +FnAttachShader glAttachShader; +FnGetUniformLocation glGetUniformLocation; +FnLinkProgram glLinkProgram; +FnUniformMatrix4fv glUniformMatrix4fv; +FnVertexAttribPointer glVertexAttribPointer; +FnEnableVertexAttribArray glEnableVertexAttribArray; +FnDisableVertexAttribArray glDisableVertexAttribArray; +FnGetShaderiv glGetShaderiv; +FnGetShaderInfoLog glGetShaderInfoLog; +FnUniform3fv glUniform3fv; +FnUniform1iv glUniform1iv; +FnCompressedTexImage2D glCompressedTexImage2D; + +// +// WinGL procs +// + +WFnSwapIntervalEXT wglSwapIntervalEXT; +WFnChoosePixelFormatARB wglChoosePixelFormatARB; \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Mangle.h b/r5dev/thirdparty/cppnet/cppkore/Mangle.h new file mode 100644 index 00000000..9458b277 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Mangle.h @@ -0,0 +1,203 @@ +#ifndef MGL_MANGLER +#define MGL_MANGLER + +// We're extending the already existing WinGL API +#include + +// +// This header defines all required OpenGL extension procs, flags, and types for Mangle to function. +// + +#define GL_CLAMP_TO_EDGE 0x812F +#define GL_CLAMP_TO_BORDER 0x812D +#define GL_STREAM_DRAW 0x88E0 +#define GL_STREAM_READ 0x88E1 +#define GL_STREAM_COPY 0x88E2 +#define GL_STATIC_DRAW 0x88E4 +#define GL_STATIC_READ 0x88E5 +#define GL_STATIC_COPY 0x88E6 +#define GL_DYNAMIC_DRAW 0x88E8 +#define GL_DYNAMIC_READ 0x88E9 +#define GL_DYNAMIC_COPY 0x88EA +#define GL_ARRAY_BUFFER 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER 0x8893 +#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_FRAGMENT_SHADER 0x8B30 +#define GL_VERTEX_SHADER 0x8B31 +#define GL_COMPILE_STATUS 0x8B81 +#define GL_INFO_LOG_LENGTH 0x8B84 +#define GL_TEXTURE0 0x84C0 +#define GL_TEXTURE1 (GL_TEXTURE0 + 1) +#define GL_TEXTURE2 (GL_TEXTURE0 + 2) +#define GL_TEXTURE3 (GL_TEXTURE0 + 3) +#define GL_TEXTURE4 (GL_TEXTURE0 + 4) +#define GL_TEXTURE5 (GL_TEXTURE0 + 5) +#define GL_TEXTURE6 (GL_TEXTURE0 + 6) +#define GL_TEXTURE7 (GL_TEXTURE0 + 7) +#define GL_TEXTURE8 (GL_TEXTURE0 + 8) +#define GL_TEXTURE9 (GL_TEXTURE0 + 9) +#define GL_TEXTURE10 (GL_TEXTURE0 + 10) + +// +// Internal image formats +// + +#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 +#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 +#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT 0x8E8E +#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT 0x8E8F +#define GL_COMPRESSED_RGBA_BPTC_UNORM 0x8E8C +#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM 0x8E8D + +// +// WinGL extensions +// + +#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000 +#define WGL_DRAW_TO_WINDOW_ARB 0x2001 +#define WGL_DRAW_TO_BITMAP_ARB 0x2002 +#define WGL_ACCELERATION_ARB 0x2003 +#define WGL_NEED_PALETTE_ARB 0x2004 +#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005 +#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006 +#define WGL_SWAP_METHOD_ARB 0x2007 +#define WGL_NUMBER_OVERLAYS_ARB 0x2008 +#define WGL_NUMBER_UNDERLAYS_ARB 0x2009 +#define WGL_TRANSPARENT_ARB 0x200A +#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037 +#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038 +#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039 +#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A +#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B +#define WGL_SHARE_DEPTH_ARB 0x200C +#define WGL_SHARE_STENCIL_ARB 0x200D +#define WGL_SHARE_ACCUM_ARB 0x200E +#define WGL_SUPPORT_GDI_ARB 0x200F +#define WGL_SUPPORT_OPENGL_ARB 0x2010 +#define WGL_DOUBLE_BUFFER_ARB 0x2011 +#define WGL_STEREO_ARB 0x2012 +#define WGL_PIXEL_TYPE_ARB 0x2013 +#define WGL_COLOR_BITS_ARB 0x2014 +#define WGL_RED_BITS_ARB 0x2015 +#define WGL_RED_SHIFT_ARB 0x2016 +#define WGL_GREEN_BITS_ARB 0x2017 +#define WGL_GREEN_SHIFT_ARB 0x2018 +#define WGL_BLUE_BITS_ARB 0x2019 +#define WGL_BLUE_SHIFT_ARB 0x201A +#define WGL_ALPHA_BITS_ARB 0x201B +#define WGL_ALPHA_SHIFT_ARB 0x201C +#define WGL_ACCUM_BITS_ARB 0x201D +#define WGL_ACCUM_RED_BITS_ARB 0x201E +#define WGL_ACCUM_GREEN_BITS_ARB 0x201F +#define WGL_ACCUM_BLUE_BITS_ARB 0x2020 +#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021 +#define WGL_DEPTH_BITS_ARB 0x2022 +#define WGL_STENCIL_BITS_ARB 0x2023 +#define WGL_AUX_BUFFERS_ARB 0x2024 +#define WGL_NO_ACCELERATION_ARB 0x2025 +#define WGL_GENERIC_ACCELERATION_ARB 0x2026 +#define WGL_FULL_ACCELERATION_ARB 0x2027 +#define WGL_SWAP_EXCHANGE_ARB 0x2028 +#define WGL_SWAP_COPY_ARB 0x2029 +#define WGL_SWAP_UNDEFINED_ARB 0x202A +#define WGL_TYPE_RGBA_ARB 0x202B +#define WGL_TYPE_COLORINDEX_ARB 0x202C +#define WGL_SAMPLE_BUFFERS_ARB 0x2041 +#define WGL_SAMPLES_ARB 0x2042 + +typedef ptrdiff_t GLintptr; +typedef ptrdiff_t GLsizeiptr; +typedef char GLchar; + +// +// OpenGL extensions +// + +typedef void(__stdcall* FnDeleteBuffers)(GLsizei n, const GLuint* buffers); +typedef void(__stdcall* FnGenBuffers)(GLsizei n, const GLuint* buffers); +typedef void(__stdcall* FnBindBuffer)(GLenum target, GLuint buffer); +typedef void(__stdcall* FnBindBufferBase)(GLenum target, GLuint index, GLuint buffer); +typedef void(__stdcall* FnBufferData)(GLenum target, GLsizeiptr size, const void* data, GLenum usage); +typedef void(__stdcall* FnShaderSource)(GLuint shader, GLsizei count, const GLchar* const* string, const GLint* length); +typedef void(__stdcall* FnUniformMatrix4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void(__stdcall* FnVertexAttribPointer)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* pointer); +typedef void(__stdcall* FnBindVertexArray)(GLuint array); +typedef void(__stdcall* FnDeleteVertexArrays)(GLsizei n, const GLuint* arrays); +typedef GLint(__stdcall* FnGetUniformLocation)(GLuint program, const GLchar* name); +typedef void(__stdcall* FnGenVertexArrays)(GLsizei n, GLuint* arrays); +typedef void(__stdcall* FnCompileShader) (GLuint shader); +typedef GLuint(__stdcall* FnCreateProgram)(void); +typedef GLuint(__stdcall* FnCreateShader)(GLenum type); +typedef void(__stdcall* FnActiveTexture)(GLenum texture); +typedef void(__stdcall* FnDeleteProgram)(GLuint program); +typedef void(__stdcall* FnDeleteShader)(GLuint shader); +typedef void(__stdcall* FnDetachShader)(GLuint program, GLuint shader); +typedef void(__stdcall* FnUseProgram)(GLuint program); +typedef void(__stdcall* FnAttachShader)(GLuint program, GLuint shader); +typedef void(__stdcall* FnLinkProgram)(GLuint program); +typedef void(__stdcall* FnDisableVertexAttribArray)(GLuint index); +typedef void(__stdcall* FnEnableVertexAttribArray)(GLuint index); +typedef void(__stdcall* FnGetShaderInfoLog)(GLuint shader, GLsizei bufSize, GLsizei* length, GLchar* infoLog); +typedef void(__stdcall* FnGetShaderiv)(GLuint shader, GLenum pname, GLint* param); +typedef void(__stdcall* FnUniform3fv)(GLint location, GLsizei count, const GLfloat* value); +typedef void(__stdcall* FnUniform1iv)(GLint locatiom, GLsizei count, const GLint* value); +typedef void(__stdcall* FnCompressedTexImage2D)(GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data); + +// +// WinGL extensions +// + +typedef BOOL(__stdcall* WFnSwapIntervalEXT)(int interval); +typedef BOOL(__stdcall* WFnChoosePixelFormatARB)(HDC hdc, const int* piAttribIList, const FLOAT* pfAttribFList, UINT nMaxFormats, int* piFormats, UINT* nNumFormats); + +// +// OpenGL procs +// + +extern FnDeleteBuffers glDeleteBuffers; +extern FnGenBuffers glGenBuffers; +extern FnBindBuffer glBindBuffer; +extern FnBindBufferBase glBindBufferBase; +extern FnBufferData glBufferData; +extern FnBindVertexArray glBindVertexArray; +extern FnDeleteVertexArrays glDeleteVertexArrays; +extern FnGenVertexArrays glGenVertexArrays; +extern FnCompileShader glCompileShader; +extern FnCreateProgram glCreateProgram; +extern FnCreateShader glCreateShader; +extern FnActiveTexture glActiveTexture; +extern FnDeleteProgram glDeleteProgram; +extern FnDeleteShader glDeleteShader; +extern FnDetachShader glDetachShader; +extern FnUseProgram glUseProgram; +extern FnShaderSource glShaderSource; +extern FnAttachShader glAttachShader; +extern FnGetUniformLocation glGetUniformLocation; +extern FnLinkProgram glLinkProgram; +extern FnUniformMatrix4fv glUniformMatrix4fv; +extern FnVertexAttribPointer glVertexAttribPointer; +extern FnEnableVertexAttribArray glEnableVertexAttribArray; +extern FnDisableVertexAttribArray glDisableVertexAttribArray; +extern FnGetShaderiv glGetShaderiv; +extern FnGetShaderInfoLog glGetShaderInfoLog; +extern FnUniform3fv glUniform3fv; +extern FnUniform1iv glUniform1iv; +extern FnCompressedTexImage2D glCompressedTexImage2D; + +// +// WinGL procs +// + +extern WFnSwapIntervalEXT wglSwapIntervalEXT; +extern WFnChoosePixelFormatARB wglChoosePixelFormatARB; + +#endif \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Mangler.cpp b/r5dev/thirdparty/cppnet/cppkore/Mangler.cpp new file mode 100644 index 00000000..d5b47d62 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Mangler.cpp @@ -0,0 +1,68 @@ +#include "stdafx.h" +#include "Mangler.h" + +// Link against OpenGL +#pragma comment(lib, "opengl32.lib") + +#define INITIALIZE_ROUTINE(fn, proc) proc = (fn)Mangler::LoadOpenGLProc(#proc) + +namespace MGL +{ + bool Mangler::Initalize() + { + // Initialize the APIs + INITIALIZE_ROUTINE(FnDeleteBuffers, glDeleteBuffers); + INITIALIZE_ROUTINE(FnGenBuffers, glGenBuffers); + INITIALIZE_ROUTINE(FnBindBuffer, glBindBuffer); + INITIALIZE_ROUTINE(FnBindBufferBase, glBindBufferBase); + INITIALIZE_ROUTINE(FnBufferData, glBufferData); + INITIALIZE_ROUTINE(FnBindVertexArray, glBindVertexArray); + INITIALIZE_ROUTINE(FnDeleteVertexArrays, glDeleteVertexArrays); + INITIALIZE_ROUTINE(FnGenVertexArrays, glGenVertexArrays); + INITIALIZE_ROUTINE(FnCompileShader, glCompileShader); + INITIALIZE_ROUTINE(FnCreateProgram, glCreateProgram); + INITIALIZE_ROUTINE(FnCreateShader, glCreateShader); + INITIALIZE_ROUTINE(FnActiveTexture, glActiveTexture); + INITIALIZE_ROUTINE(FnDeleteProgram, glDeleteProgram); + INITIALIZE_ROUTINE(FnDeleteShader, glDeleteShader); + INITIALIZE_ROUTINE(FnDetachShader, glDetachShader); + INITIALIZE_ROUTINE(FnUseProgram, glUseProgram); + INITIALIZE_ROUTINE(FnShaderSource, glShaderSource); + INITIALIZE_ROUTINE(FnAttachShader, glAttachShader); + INITIALIZE_ROUTINE(FnGetUniformLocation, glGetUniformLocation); + INITIALIZE_ROUTINE(FnLinkProgram, glLinkProgram); + INITIALIZE_ROUTINE(FnUniformMatrix4fv, glUniformMatrix4fv); + INITIALIZE_ROUTINE(FnVertexAttribPointer, glVertexAttribPointer); + INITIALIZE_ROUTINE(FnEnableVertexAttribArray, glEnableVertexAttribArray); + INITIALIZE_ROUTINE(FnDisableVertexAttribArray, glDisableVertexAttribArray); + INITIALIZE_ROUTINE(FnGetShaderiv, glGetShaderiv); + INITIALIZE_ROUTINE(FnGetShaderInfoLog, glGetShaderInfoLog); + INITIALIZE_ROUTINE(FnUniform3fv, glUniform3fv); + INITIALIZE_ROUTINE(FnUniform1iv, glUniform1iv); + INITIALIZE_ROUTINE(FnCompressedTexImage2D, glCompressedTexImage2D); + + // Initialize the WGL APIs + INITIALIZE_ROUTINE(WFnSwapIntervalEXT, wglSwapIntervalEXT); + INITIALIZE_ROUTINE(WFnChoosePixelFormatARB, wglChoosePixelFormatARB); + + // Success + return true; + } + + uintptr_t Mangler::LoadOpenGLProc(const char* Name) + { + // Try extensions first + auto Proc = (void*)wglGetProcAddress(Name); + + // Check for errors during load + if (Proc == 0 || (Proc == (void*)0x1) || (Proc == (void*)0x2) || (Proc == (void*)0x3) || (Proc == (void*)-1)) + { + // This is a built-in, not an extension + auto Module = LoadLibraryA("opengl32.dll"); + Proc = (void*)GetProcAddress(Module, Name); + } + + // Return address + return (uintptr_t)Proc; + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/Mangler.h b/r5dev/thirdparty/cppnet/cppkore/Mangler.h new file mode 100644 index 00000000..497afe91 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Mangler.h @@ -0,0 +1,20 @@ +#pragma once + +#include +#include +#include "Mangle.h" + +namespace MGL +{ + // A class that handles initializing the OpenGL extensions + class Mangler + { + public: + // Loads the required OpenGL extensions. + static bool Initalize(); + + private: + // Internal routine to load a proc address from OpenGL + static uintptr_t LoadOpenGLProc(const char* Name); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Material.cpp b/r5dev/thirdparty/cppnet/cppkore/Material.cpp new file mode 100644 index 00000000..cff2da07 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Material.cpp @@ -0,0 +1,16 @@ +#include "stdafx.h" +#include "Material.h" +#include "XXHash.h" + +namespace Assets +{ + Material::Material() + : Material("default_material", Hashing::XXHash::ComputeHash((uint8_t*)"default_material", 0, 16)) + { + } + + Material::Material(const string& Name, const uint64_t Hash) + : Name(Name), Hash(Hash), SourceHash((uint64_t)-1), SourceString("") + { + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/Material.h b/r5dev/thirdparty/cppnet/cppkore/Material.h new file mode 100644 index 00000000..af6cb100 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Material.h @@ -0,0 +1,65 @@ +#pragma once + +#include +#include "StringBase.h" +#include "DictionaryBase.h" + +namespace Assets +{ + // Represents the supported 3D material slots + enum class MaterialSlotType : uint32_t + { + // No valid mapping, but it's here + Invalid, + + // Albedo color, different from diffuse + Albedo, + // Full color with lighing + Diffuse, + + // Normal map, most likely XY compressed + Normal, + + // Reflectivity + Specular, + + // Glow / coloring + Emissive, + + // Gloss is inverted roughness + Gloss, + // Roughness is inverted gloss + Roughness, + + // Generalized lighting AO + AmbientOcclusion, + // More focused lighting AO + Cavity, + }; + + // Represents a 3D material and provided diffuse, normal, and specular images. + class Material + { + public: + // Initialize a new default material. + Material(); + // Initialize a new material. + Material(const string& Name, const uint64_t Hash); + // Destroy all material info. + ~Material() = default; + + // The unique name for this material. + string Name; + + // Name of the source identifier for this material. + string SourceString; + // Hash of the source identifier for this material. + uint64_t SourceHash; + + // The material texture slots + Dictionary> Slots; + + // The unique hash identifier for this material. + uint64_t Hash; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/MathHelper.h b/r5dev/thirdparty/cppnet/cppkore/MathHelper.h new file mode 100644 index 00000000..a4bdda4c --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/MathHelper.h @@ -0,0 +1,36 @@ +#pragma once + +#include + +namespace Math +{ + class MathHelper + { + public: + // Converts the input degrees to radian units + constexpr static float DegreesToRadians(float Value) + { + return (float)((Value * MathHelper::PI) / 180.0f); + } + // Converts the input radians to degree units + constexpr static float RadiansToDegrees(float Value) + { + return (float)(((Value * 180.0f) / MathHelper::PI)); + } + + template + // Clamp a number between two bounds + constexpr static T Clamp(const T& Value, const T& Lower, const T& Upper) + { + // Clamp it + return max(Lower, min(Value, Upper)); + } + + // The value of PI, a constant + constexpr static double PI = 3.14159265358979323846; + // The value of PI * 2, a constant + constexpr static double PI2 = (PI * 2); + // The epsilon value for comparisions + constexpr static double Epsilon = 4.37114e-05; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Matrix.cpp b/r5dev/thirdparty/cppnet/cppkore/Matrix.cpp new file mode 100644 index 00000000..85d4665a --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Matrix.cpp @@ -0,0 +1,422 @@ +#include "stdafx.h" +#include "Matrix.h" + +namespace Math +{ + Matrix::Matrix() + { + for (int i = 0; i < 16; i++) + _Data[i] = (i % 5) ? 0.0f : 1.0f; + } + + Matrix Matrix::operator+(const Matrix& Rhs) const + { + Matrix Result; + + for (int i = 0; i < 16; i++) + Result._Data[i] = _Data[i] + Rhs._Data[i]; + + return Result; + } + + Matrix Matrix::operator-(const Matrix& Rhs) const + { + Matrix Result; + + for (int i = 0; i < 16; i++) + Result._Data[i] = _Data[i] - Rhs._Data[i]; + + return Result; + } + + Matrix Matrix::operator*(const Matrix& Rhs) const + { + Matrix Result; + + for (int i = 0; i < 4; i++) + { + for (int j = 0; j < 4; j++) + { + float Buffer = 0; + + for (int k = 0; k < 4; k++) + { + Buffer += Rhs.Mat(i, k) * Mat(k, j); + } + + Result.Mat(i, j) = Buffer; + } + } + + return Result; + } + + Matrix Matrix::operator/(float Rhs) const + { + Matrix Result; + + for (int i = 0; i < 16; i++) + Result._Data[i] = _Data[i] / Rhs; + + return Result; + } + + bool Matrix::operator==(const Matrix & Rhs) const + { + for (int i = 0; i < 16; i++) + { + if (std::abs(_Data[i] - Rhs._Data[i]) >= MathHelper::Epsilon) + return false; + } + + return true; + } + + bool Matrix::operator!=(const Matrix& Rhs) const + { + return !(*this == Rhs); + } + + float& Matrix::Mat(int X, int Y) + { + return _Data[X * 4 + Y]; + } + + const float& Matrix::Mat(int X, int Y) const + { + return _Data[X * 4 + Y]; + } + + float* Matrix::GetMatrix() + { + return &this->_Data[0]; + } + + float Matrix::Determinant() + { + return Mat(3, 0) * Mat(2, 1) * Mat(1, 2) * Mat(0, 3) - Mat(2, 0) * Mat(3, 1) * Mat(1, 2) * Mat(0, 3) + - Mat(3, 0) * Mat(1, 1) * Mat(2, 2) * Mat(0, 3) + Mat(1, 0) * Mat(3, 1) * Mat(2, 2) * Mat(0, 3) + + + Mat(2, 0) * Mat(1, 1) * Mat(3, 2) * Mat(0, 3) - Mat(1, 0) * Mat(2, 1) * Mat(3, 2) * Mat(0, 3) + - Mat(3, 0) * Mat(2, 1) * Mat(0, 2) * Mat(1, 3) + Mat(2, 0) * Mat(3, 1) * Mat(0, 2) * Mat(1, 3) + + + Mat(3, 0) * Mat(0, 1) * Mat(2, 2) * Mat(1, 3) - Mat(0, 0) * Mat(3, 1) * Mat(2, 2) * Mat(1, 3) + - Mat(2, 0) * Mat(0, 1) * Mat(3, 2) * Mat(1, 3) + Mat(0, 0) * Mat(2, 1) * Mat(3, 2) * Mat(1, 3) + + + Mat(3, 0) * Mat(1, 1) * Mat(0, 2) * Mat(2, 3) - Mat(1, 0) * Mat(3, 1) * Mat(0, 2) * Mat(2, 3) + - Mat(3, 0) * Mat(0, 1) * Mat(1, 2) * Mat(2, 3) + Mat(0, 0) * Mat(3, 1) * Mat(1, 2) * Mat(2, 3) + + + Mat(1, 0) * Mat(0, 1) * Mat(3, 2) * Mat(2, 3) - Mat(0, 0) * Mat(1, 1) * Mat(3, 2) * Mat(2, 3) + - Mat(2, 0) * Mat(1, 1) * Mat(0, 2) * Mat(3, 3) + Mat(1, 0) * Mat(2, 1) * Mat(0, 2) * Mat(3, 3) + + + Mat(2, 0) * Mat(0, 1) * Mat(1, 2) * Mat(3, 3) - Mat(0, 0) * Mat(2, 1) * Mat(1, 2) * Mat(3, 3) + - Mat(1, 0) * Mat(0, 1) * Mat(2, 2) * Mat(3, 3) + Mat(0, 0) * Mat(1, 1) * Mat(2, 2) * Mat(3, 3); + } + + Matrix Matrix::Inverse() + { + Matrix Result; + + Result.Mat(0, 0) = + Mat(2, 1) * Mat(3, 2) * Mat(1, 3) - Mat(3, 1) * Mat(2, 2) * Mat(1, 3) + Mat(3, 1) * Mat(1, 2) * Mat(2, 3) + - Mat(1, 1) * Mat(3, 2) * Mat(2, 3) - Mat(2, 1) * Mat(1, 2) * Mat(3, 3) + Mat(1, 1) * Mat(2, 2) * Mat(3, 3); + + Result.Mat(1, 0) = + Mat(3, 0) * Mat(2, 2) * Mat(1, 3) - Mat(2, 0) * Mat(3, 2) * Mat(1, 3) - Mat(3, 0) * Mat(1, 2) * Mat(2, 3) + + Mat(1, 0) * Mat(3, 2) * Mat(2, 3) + Mat(2, 0) * Mat(1, 2) * Mat(3, 3) - Mat(1, 0) * Mat(2, 2) * Mat(3, 3); + + Result.Mat(2, 0) = + Mat(2, 0) * Mat(3, 1) * Mat(1, 3) - Mat(3, 0) * Mat(2, 1) * Mat(1, 3) + Mat(3, 0) * Mat(1, 1) * Mat(2, 3) + - Mat(1, 0) * Mat(3, 1) * Mat(2, 3) - Mat(2, 0) * Mat(1, 1) * Mat(3, 3) + Mat(1, 0) * Mat(2, 1) * Mat(3, 3); + + Result.Mat(3, 0) = + Mat(3, 0) * Mat(2, 1) * Mat(1, 2) - Mat(2, 0) * Mat(3, 1) * Mat(1, 2) - Mat(3, 0) * Mat(1, 1) * Mat(2, 2) + + Mat(1, 0) * Mat(3, 1) * Mat(2, 2) + Mat(2, 0) * Mat(1, 1) * Mat(3, 2) - Mat(1, 0) * Mat(2, 1) * Mat(3, 2); + + Result.Mat(0, 1) = + Mat(3, 1) * Mat(2, 2) * Mat(0, 3) - Mat(2, 1) * Mat(3, 2) * Mat(0, 3) - Mat(3, 1) * Mat(0, 2) * Mat(2, 3) + + Mat(0, 1) * Mat(3, 2) * Mat(2, 3) + Mat(2, 1) * Mat(0, 2) * Mat(3, 3) - Mat(0, 1) * Mat(2, 2) * Mat(3, 3); + + Result.Mat(1, 1) = + Mat(2, 0) * Mat(3, 2) * Mat(0, 3) - Mat(3, 0) * Mat(2, 2) * Mat(0, 3) + Mat(3, 0) * Mat(0, 2) * Mat(2, 3) + - Mat(0, 0) * Mat(3, 2) * Mat(2, 3) - Mat(2, 0) * Mat(0, 2) * Mat(3, 3) + Mat(0, 0) * Mat(2, 2) * Mat(3, 3); + + Result.Mat(2, 1) = + Mat(3, 0) * Mat(2, 1) * Mat(0, 3) - Mat(2, 0) * Mat(3, 1) * Mat(0, 3) - Mat(3, 0) * Mat(0, 1) * Mat(2, 3) + + Mat(0, 0) * Mat(3, 1) * Mat(2, 3) + Mat(2, 0) * Mat(0, 1) * Mat(3, 3) - Mat(0, 0) * Mat(2, 1) * Mat(3, 3); + + Result.Mat(3, 1) = + Mat(2, 0) * Mat(3, 1) * Mat(0, 2) - Mat(3, 0) * Mat(2, 1) * Mat(0, 2) + Mat(3, 0) * Mat(0, 1) * Mat(2, 2) + - Mat(0, 0) * Mat(3, 1) * Mat(2, 2) - Mat(2, 0) * Mat(0, 1) * Mat(3, 2) + Mat(0, 0) * Mat(2, 1) * Mat(3, 2); + + Result.Mat(0, 2) = + Mat(1, 1) * Mat(3, 2) * Mat(0, 3) - Mat(3, 1) * Mat(1, 2) * Mat(0, 3) + Mat(3, 1) * Mat(0, 2) * Mat(1, 3) + - Mat(0, 1) * Mat(3, 2) * Mat(1, 3) - Mat(1, 1) * Mat(0, 2) * Mat(3, 3) + Mat(0, 1) * Mat(1, 2) * Mat(3, 3); + + Result.Mat(1, 2) = + Mat(3, 0) * Mat(1, 2) * Mat(0, 3) - Mat(1, 0) * Mat(3, 2) * Mat(0, 3) - Mat(3, 0) * Mat(0, 2) * Mat(1, 3) + + Mat(0, 0) * Mat(3, 2) * Mat(1, 3) + Mat(1, 0) * Mat(0, 2) * Mat(3, 3) - Mat(0, 0) * Mat(1, 2) * Mat(3, 3); + + Result.Mat(2, 2) = + Mat(1, 0) * Mat(3, 1) * Mat(0, 3) - Mat(3, 0) * Mat(1, 1) * Mat(0, 3) + Mat(3, 0) * Mat(0, 1) * Mat(1, 3) + - Mat(0, 0) * Mat(3, 1) * Mat(1, 3) - Mat(1, 0) * Mat(0, 1) * Mat(3, 3) + Mat(0, 0) * Mat(1, 1) * Mat(3, 3); + + Result.Mat(3, 2) = + Mat(3, 0) * Mat(1, 1) * Mat(0, 2) - Mat(1, 0) * Mat(3, 1) * Mat(0, 2) - Mat(3, 0) * Mat(0, 1) * Mat(1, 2) + + Mat(0, 0) * Mat(3, 1) * Mat(1, 2) + Mat(1, 0) * Mat(0, 1) * Mat(3, 2) - Mat(0, 0) * Mat(1, 1) * Mat(3, 2); + + Result.Mat(0, 3) = + Mat(2, 1) * Mat(1, 2) * Mat(0, 3) - Mat(1, 1) * Mat(2, 2) * Mat(0, 3) - Mat(2, 1) * Mat(0, 2) * Mat(1, 3) + + Mat(0, 1) * Mat(2, 2) * Mat(1, 3) + Mat(1, 1) * Mat(0, 2) * Mat(2, 3) - Mat(0, 1) * Mat(1, 2) * Mat(2, 3); + + Result.Mat(1, 3) = + Mat(1, 0) * Mat(2, 2) * Mat(0, 3) - Mat(2, 0) * Mat(1, 2) * Mat(0, 3) + Mat(2, 0) * Mat(0, 2) * Mat(1, 3) + - Mat(0, 0) * Mat(2, 2) * Mat(1, 3) - Mat(1, 0) * Mat(0, 2) * Mat(2, 3) + Mat(0, 0) * Mat(1, 2) * Mat(2, 3); + + Result.Mat(2, 3) = + Mat(2, 0) * Mat(1, 1) * Mat(0, 3) - Mat(1, 0) * Mat(2, 1) * Mat(0, 3) - Mat(2, 0) * Mat(0, 1) * Mat(1, 3) + + Mat(0, 0) * Mat(2, 1) * Mat(1, 3) + Mat(1, 0) * Mat(0, 1) * Mat(2, 3) - Mat(0, 0) * Mat(1, 1) * Mat(2, 3); + + Result.Mat(3, 3) = + Mat(1, 0) * Mat(2, 1) * Mat(0, 2) - Mat(2, 0) * Mat(1, 1) * Mat(0, 2) + Mat(2, 0) * Mat(0, 1) * Mat(1, 2) + - Mat(0, 0) * Mat(2, 1) * Mat(1, 2) - Mat(1, 0) * Mat(0, 1) * Mat(2, 2) + Mat(0, 0) * Mat(1, 1) * Mat(2, 2); + + return Result / Determinant(); + } + + Vector3 Matrix::Position() + { + return Vector3(this->Mat(3, 0), this->Mat(3, 1), this->Mat(3, 2)); + } + + Quaternion Matrix::Rotation() + { + float X = 0, Y = 0, Z = 0, W = 0; + + float TransRemainder = this->Mat(0, 0) + this->Mat(1, 1) + this->Mat(2, 2); + + if (TransRemainder > 0) + { + float Scale = std::sqrt(TransRemainder + 1.0f) * 2; + W = 0.25f * Scale; + X = (this->Mat(2, 1) - this->Mat(1, 2)) / Scale; + Y = (this->Mat(0, 2) - this->Mat(2, 0)) / Scale; + Z = (this->Mat(1, 0) - this->Mat(0, 1)) / Scale; + } + else if ((this->Mat(0, 0) > this->Mat(1, 1)) && (this->Mat(0, 0) > this->Mat(2, 2))) + { + float Scale = std::sqrt(1.0f + this->Mat(0, 0) - this->Mat(1, 1) - this->Mat(2, 2)) * 2; + W = (this->Mat(2, 1) - this->Mat(1, 2)) / Scale; + X = 0.25f * Scale; + Y = (this->Mat(0, 1) + this->Mat(1, 0)) / Scale; + Z = (this->Mat(0, 2) + this->Mat(2, 0)) / Scale; + } + else if (this->Mat(1, 1) > this->Mat(2, 2)) + { + float Scale = std::sqrt(1.0f + this->Mat(1, 1) - this->Mat(0, 0) - this->Mat(2, 2)) * 2; + W = (this->Mat(0, 2) - this->Mat(2, 0)) / Scale; + X = (this->Mat(0, 1) + this->Mat(1, 0)) / Scale; + Y = 0.25f * Scale; + Z = (this->Mat(1, 2) + this->Mat(2, 1)) / Scale; + } + else + { + float Scale = std::sqrt(1.0f + this->Mat(2, 2) - this->Mat(0, 0) - this->Mat(1, 1)) * 2; + W = (this->Mat(1, 0) - this->Mat(0, 1)) / Scale; + X = (this->Mat(0, 2) + this->Mat(2, 0)) / Scale; + Y = (this->Mat(1, 2) + this->Mat(2, 1)) / Scale; + Z = 0.25f * Scale; + } + + return Quaternion(X, Y, Z, W); + } + + Vector3 Matrix::Scale() + { + auto Row1 = Vector3(this->Mat(0, 0), this->Mat(0, 1), this->Mat(0, 2)); + auto Row2 = Vector3(this->Mat(1, 0), this->Mat(1, 1), this->Mat(1, 2)); + auto Row3 = Vector3(this->Mat(2, 0), this->Mat(2, 1), this->Mat(2, 2)); + + return Vector3(Row1.Length(), Row2.Length(), Row3.Length()); + } + + void Matrix::SetPosition(const Vector3& Value) + { + this->Mat(3, 0) = Value.X; + this->Mat(3, 1) = Value.Y; + this->Mat(3, 2) = Value.Z; + } + + void Matrix::SetRotation(const Quaternion& Rotation) + { + auto Scale = this->Scale(); + auto& Result = *this; + + float XX = Rotation.X * Rotation.X; + float XY = Rotation.X * Rotation.Y; + float XZ = Rotation.X * Rotation.Z; + float XW = Rotation.X * Rotation.W; + + float YY = Rotation.Y * Rotation.Y; + float YZ = Rotation.Y * Rotation.Z; + float YW = Rotation.Y * Rotation.W; + + float ZZ = Rotation.Z * Rotation.Z; + float ZW = Rotation.Z * Rotation.W; + + Result.Mat(0, 0) = 1 - 2 * (YY + ZZ); + Result.Mat(1, 0) = 2 * (XY - ZW); + Result.Mat(2, 0) = 2 * (XZ + YW); + + Result.Mat(0, 1) = 2 * (XY + ZW); + Result.Mat(1, 1) = 1 - 2 * (XX + ZZ); + Result.Mat(2, 1) = 2 * (YZ - XW); + + Result.Mat(0, 2) = 2 * (XZ - YW); + Result.Mat(1, 2) = 2 * (YZ + XW); + Result.Mat(2, 2) = 1 - 2 * (XX + YY); + + Result.Mat(0, 3) = 0; + Result.Mat(1, 3) = 0; + Result.Mat(2, 3) = 0; + Result.Mat(3, 3) = 1; + + this->SetScale(Scale); + } + + void Matrix::SetScale(const Vector3& Scale) + { + // TODO: How do we scale a matrix / apply scale + } + + Matrix Matrix::CreateFromQuaternion(const Quaternion& Rotation) + { + Matrix Result; + + float XX = Rotation.X * Rotation.X; + float XY = Rotation.X * Rotation.Y; + float XZ = Rotation.X * Rotation.Z; + float XW = Rotation.X * Rotation.W; + + float YY = Rotation.Y * Rotation.Y; + float YZ = Rotation.Y * Rotation.Z; + float YW = Rotation.Y * Rotation.W; + + float ZZ = Rotation.Z * Rotation.Z; + float ZW = Rotation.Z * Rotation.W; + + Result.Mat(0, 0) = 1 - 2 * (YY + ZZ); + Result.Mat(1, 0) = 2 * (XY - ZW); + Result.Mat(2, 0) = 2 * (XZ + YW); + Result.Mat(3, 0) = 0; + + Result.Mat(0, 1) = 2 * (XY + ZW); + Result.Mat(1, 1) = 1 - 2 * (XX + ZZ); + Result.Mat(2, 1) = 2 * (YZ - XW); + Result.Mat(3, 1) = 0; + + Result.Mat(0, 2) = 2 * (XZ - YW); + Result.Mat(1, 2) = 2 * (YZ + XW); + Result.Mat(2, 2) = 1 - 2 * (XX + YY); + Result.Mat(3, 2) = 0; + + Result.Mat(0, 3) = 0; + Result.Mat(1, 3) = 0; + Result.Mat(2, 3) = 0; + Result.Mat(3, 3) = 1; + + return Result; + } + + Vector3 Matrix::TransformVector(const Vector3& Vector, const Matrix& Value) + { + Vector3 Result; + + Result.X = (Vector.X * Value.Mat(0, 0)) + (Vector.Y * Value.Mat(1, 0)) + (Vector.Z * Value.Mat(2, 0)) + Value.Mat(3, 0); + Result.Y = (Vector.X * Value.Mat(0, 1)) + (Vector.Y * Value.Mat(1, 1)) + (Vector.Z * Value.Mat(2, 1)) + Value.Mat(3, 1); + Result.Z = (Vector.X * Value.Mat(0, 2)) + (Vector.Y * Value.Mat(1, 2)) + (Vector.Z * Value.Mat(2, 2)) + Value.Mat(3, 2); + + return Result; + } + + Matrix Matrix::CreateLookAt(const Vector3& From, const Vector3& To, const Vector3& RightVec) + { + Matrix Result; + + auto Z = (From - To).GetNormalized(); + auto X = RightVec.Cross(Z).GetNormalized(); + auto Y = Z.Cross(X); + + Result.Mat(0, 0) = X.X; + Result.Mat(0, 1) = Y.X; + Result.Mat(0, 2) = Z.X; + Result.Mat(0, 3) = 0; + + Result.Mat(1, 0) = X.Y; + Result.Mat(1, 1) = Y.Y; + Result.Mat(1, 2) = Z.Y; + Result.Mat(1, 3) = 0; + + Result.Mat(2, 0) = X.Z; + Result.Mat(2, 1) = Y.Z; + Result.Mat(2, 2) = Z.Z; + Result.Mat(2, 3) = 0; + + Result.Mat(3, 0) = -((X.X * From.X) + (X.Y * From.Y) + (X.Z * From.Z)); + Result.Mat(3, 1) = -((Y.X * From.X) + (Y.Y * From.Y) + (Y.Z * From.Z)); + Result.Mat(3, 2) = -((Z.X * From.X) + (Z.Y * From.Y) + (Z.Z * From.Z)); + Result.Mat(3, 3) = 1; + + return Result; + } + + Matrix Matrix::CreatePerspectiveFov(float Fov, float Aspect, float Near, float Far) + { + Matrix Result; + + auto Top = Near * tanf(.5f * MathHelper::DegreesToRadians(Fov)); + auto Bottom = -Top; + auto Right = Top * Aspect; + auto Left = -Right; + + auto X = 2.f * Near / (Right - Left); + auto Y = 2.f * Near / (Top - Bottom); + auto A = (Right + Left) / (Right - Left); + auto B = (Top + Bottom) / (Top - Bottom); + auto C = -(Far + Near) / (Far - Near); + auto D = -(2.f * Far * Near) / (Far - Near); + + Result.Mat(0, 0) = X; + Result.Mat(0, 1) = 0; + Result.Mat(0, 2) = 0; + Result.Mat(0, 3) = 0; + + Result.Mat(1, 0) = 0; + Result.Mat(1, 1) = Y; + Result.Mat(1, 2) = 0; + Result.Mat(1, 3) = 0; + + Result.Mat(2, 0) = A; + Result.Mat(2, 1) = B; + Result.Mat(2, 2) = C; + Result.Mat(2, 3) = -1; + + Result.Mat(3, 0) = 0; + Result.Mat(3, 1) = 0; + Result.Mat(3, 2) = D; + Result.Mat(3, 3) = 0; + + return Result; + } + + Matrix Matrix::CreateOrthographic(float Left, float Right, float Bottom, float Top, float Near, float Far) + { + Matrix Result; + + Result.Mat(0, 0) = (2.f / (Right - Left)); + Result.Mat(0, 1) = 0; + Result.Mat(0, 2) = 0; + Result.Mat(0, 3) = 0; + + Result.Mat(1, 0) = 0; + Result.Mat(1, 1) = (2.f / (Top - Bottom)); + Result.Mat(1, 2) = 0; + Result.Mat(1, 3) = 0; + + Result.Mat(2, 0) = 0; + Result.Mat(2, 1) = 0; + Result.Mat(2, 2) = (1.f / (Near - Far)); + Result.Mat(2, 3) = 0; + + Result.Mat(3, 0) = ((Left + Right) / (Left - Right)); + Result.Mat(3, 1) = ((Top + Bottom) / (Bottom - Top)); + Result.Mat(3, 2) = (Near / (Near - Far)); + Result.Mat(3, 3) = 1; + + return Result; + } +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Matrix.h b/r5dev/thirdparty/cppnet/cppkore/Matrix.h new file mode 100644 index 00000000..08ffdf86 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Matrix.h @@ -0,0 +1,75 @@ +#pragma once + +#include +#include "MathHelper.h" +#include "Vector3.h" +#include "Quaternion.h" + +namespace Math +{ + // Represents a 4x4 matrix + class Matrix + { + public: + Matrix(); + + // Logical operators + Matrix operator+(const Matrix& Rhs) const; + Matrix operator-(const Matrix& Rhs) const; + Matrix operator*(const Matrix& Rhs) const; + + // Scale logical operators + Matrix operator/(float Rhs) const; + + // Equality operator + bool operator==(const Matrix& Rhs) const; + // Inequality operator + bool operator!=(const Matrix& Rhs) const; + + // Get a value from a normal matrix + float& Mat(int X, int Y); + // Get a value from a normal matrix + const float& Mat(int X, int Y) const; + + // Gets a pointer to the matrix 4x4 data + float* GetMatrix(); + + // Calculates the determinant of this instance + float Determinant(); + // Calculates the inverse of this instance + Matrix Inverse(); + + // Gets the position of this instance + Vector3 Position(); + // Gets the rotation of this instance + Quaternion Rotation(); + // Gets the scale of this instance + Vector3 Scale(); + + // Sets the position of this instance + void SetPosition(const Vector3& Value); + // Sets the rotaton of this instance + void SetRotation(const Quaternion& Rotation); + // Sets the scale of this instance + void SetScale(const Vector3& Scale); + + // TODO: SetScale + + // Create a rotation matrix from a quaternion rotation + static Matrix CreateFromQuaternion(const Quaternion& Rotation); + // Transform a vector3 by the given matrix + static Vector3 TransformVector(const Vector3& Vector, const Matrix& Value); + // Creates a matrix look at + static Matrix CreateLookAt(const Vector3& From, const Vector3& To, const Vector3& Right); + // Creates a matrix perspective FOV + static Matrix CreatePerspectiveFov(float Fov, float Aspect, float Near, float Far); + // Creates a matrix orthographic + static Matrix CreateOrthographic(float Left, float Right, float Bottom, float Top, float Near, float Far); + + private: + // Aligned matrix 4x4 buffer + __declspec(align(16)) float _Data[16]; + }; + + static_assert(sizeof(Matrix) == 0x40, "Invalid Math::Matrix size, expected 0x40"); +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/MemoryStream.cpp b/r5dev/thirdparty/cppnet/cppkore/MemoryStream.cpp new file mode 100644 index 00000000..da2e7c64 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/MemoryStream.cpp @@ -0,0 +1,228 @@ +#include "stdafx.h" +#include "MemoryStream.h" + +namespace IO +{ + MemoryStream::MemoryStream() + : MemoryStream(0) + { + } + + MemoryStream::MemoryStream(uint64_t Capacity) + { + this->_Buffer = new uint8_t[Capacity]; + this->_BufferSize = Capacity; + this->_Length = 0; + this->_CanWrite = true; + this->_Expandable = true; + this->_Origin = 0; + this->_KeepOpen = false; + } + + MemoryStream::MemoryStream(uint8_t* Buffer, uint64_t Index, uint64_t Count) + : MemoryStream(Buffer, Index, Count, true, false) + { + } + + MemoryStream::MemoryStream(uint8_t* Buffer, uint64_t Index, uint64_t Count, bool Writable) + : MemoryStream(Buffer, Index, Count, Writable, false) + { + } + + MemoryStream::MemoryStream(uint8_t* Buffer, uint64_t Index, uint64_t Count, bool Writable, bool LeaveOpen) + : MemoryStream(Buffer, Index, Count, Writable, LeaveOpen, false) + { + } + + MemoryStream::MemoryStream(uint8_t* Buffer, uint64_t Index, uint64_t Count, bool Writable, bool LeaveOpen, bool Expandable) + { + if (!Buffer) + throw std::exception("The buffer must not be null"); + + this->_Buffer = Buffer; + this->_Origin = Index; + this->_Position = Index; + this->_Length = (Index + Count); + this->_BufferSize = (Index + Count); + this->_CanWrite = Writable; + this->_KeepOpen = LeaveOpen; + this->_Expandable = Expandable; + } + + MemoryStream::~MemoryStream() + { + //this->Close(); + } + + bool MemoryStream::CanRead() + { + return (this->_Buffer); + } + + bool MemoryStream::CanWrite() + { + return (this->_Buffer) ? this->_CanWrite : false; + } + + bool MemoryStream::CanSeek() + { + return (this->_Buffer); + } + + bool MemoryStream::GetIsEndOfFile() + { + if (!this->_Expandable) + return (this->_Position == this->_Length); + return false; + } + + uint64_t MemoryStream::GetLength() + { + if (!this->_Buffer) + throw std::exception("Stream not open"); + + return (this->_Length - this->_Origin); + } + + uint64_t MemoryStream::GetPosition() + { + if (!this->_Buffer) + throw std::exception("Stream not open"); + + return this->_Position; + } + + void MemoryStream::SetLength(uint64_t Length) + { + auto nLength = this->_Origin + Length; + EnsureCapacity(nLength); + + this->_Length = nLength; + if (this->_Position > nLength) + this->_Position = nLength; + } + + void MemoryStream::SetPosition(uint64_t Position) + { + this->Seek(Position, SeekOrigin::Begin); + } + + void MemoryStream::Close() + { + if (!this->_KeepOpen && this->_Buffer) + delete[] this->_Buffer; + + this->_Buffer = nullptr; + this->_KeepOpen = false; + this->_BufferSize = 0; + this->_CanWrite = false; + this->_Expandable = true; + this->_Length = 0; + this->_Position = 0; + this->_Origin = 0; + } + + void MemoryStream::Flush() + { + // This is a non-cached buffer, flush does nothing + } + + void MemoryStream::Seek(uint64_t Offset, SeekOrigin Origin) + { + if (!this->_Buffer) + throw std::exception("Stream not open"); + + auto nOffset = this->_Position; + switch (Origin) + { + case SeekOrigin::Begin: + nOffset = this->_Origin + Offset; + if ((this->_Position + Offset) < this->_Origin || nOffset < this->_Origin) + throw std::exception("Attempt to seek outside the bounds of the stream"); + this->_Position = nOffset; + break; + case SeekOrigin::Current: + nOffset = this->_Position + Offset; + if ((this->_Position + Offset) < this->_Origin || nOffset < this->_Origin) + throw std::exception("Attempt to seek outside the bounds of the stream"); + this->_Position = nOffset; + break; + case SeekOrigin::End: + nOffset = this->_Length - Offset; + if ((this->_Length - Offset) < this->_Origin || nOffset < _Origin) + throw std::exception("Attempt to seek outside the bounds of the stream"); + this->_Position = nOffset; + break; + } + } + + uint64_t MemoryStream::Read(uint8_t* Buffer, uint64_t Offset, uint64_t Count) + { + if (!this->_Buffer) + throw std::exception("Stream not open"); + + // Ensure we are within the bounds of the buffer + int64_t nLength = (int64_t)this->_Length - (int64_t)this->_Position; + if (nLength > (int64_t)Count) nLength = Count; + if (nLength <= 0) + return 0; + + std::memcpy(Buffer + Offset, this->_Buffer + this->_Position, (size_t)nLength); + this->_Position += nLength; + + return nLength; + } + + uint64_t MemoryStream::Read(uint8_t* Buffer, uint64_t Offset, uint64_t Count, uint64_t Position) + { + this->SetPosition(Position); + return this->Read(Buffer, Offset, Count); + } + + void MemoryStream::Write(uint8_t* Buffer, uint64_t Offset, uint64_t Count) + { + if (!this->_Buffer) + throw std::exception("Stream not open"); + if (!this->_CanWrite) + throw std::exception("Write not supported"); + + auto nBuffer = this->_Position + Count; + if (nBuffer > this->_Length) + { + this->EnsureCapacity(nBuffer); + this->_Length = nBuffer; + } + + std::memcpy(this->_Buffer + this->_Position, Buffer + Offset, Count); + this->_Position = nBuffer; + } + + void MemoryStream::Write(uint8_t* Buffer, uint64_t Offset, uint64_t Count, uint64_t Position) + { + this->SetPosition(Position); + this->Write(Buffer, Offset, Count); + } + + void MemoryStream::EnsureCapacity(uint64_t Size) + { + if (Size < this->_BufferSize) + return; + if (!this->_Expandable) + throw std::exception("Expand not supported"); + + auto nCapacity = Size; + if (nCapacity < 256) + nCapacity = 256; + + if (nCapacity < this->_BufferSize * 2) + nCapacity = this->_BufferSize * 2; + + auto tBuffer = this->_Buffer; + this->_Buffer = new uint8_t[nCapacity]; + + std::memcpy(this->_Buffer, tBuffer, this->_BufferSize); + this->_BufferSize = nCapacity; + + delete[] tBuffer; + } +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/MemoryStream.h b/r5dev/thirdparty/cppnet/cppkore/MemoryStream.h new file mode 100644 index 00000000..a1ccffc5 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/MemoryStream.h @@ -0,0 +1,55 @@ +#pragma once + +#include +#include "Stream.h" + +namespace IO +{ + // MemoryStream supports reading and writing data to memory + class MemoryStream : public Stream + { + public: + MemoryStream(); + MemoryStream(uint64_t Capacity); + MemoryStream(uint8_t* Buffer, uint64_t Index, uint64_t Count); + MemoryStream(uint8_t* Buffer, uint64_t Index, uint64_t Count, bool Writable); + MemoryStream(uint8_t* Buffer, uint64_t Index, uint64_t Count, bool Writable, bool LeaveOpen); + MemoryStream(uint8_t* Buffer, uint64_t Index, uint64_t Count, bool Writable, bool LeaveOpen, bool Expandable); + virtual ~MemoryStream(); + + // Implement Getters and Setters + virtual bool CanRead(); + virtual bool CanWrite(); + virtual bool CanSeek(); + virtual bool GetIsEndOfFile(); + virtual uint64_t GetLength(); + virtual uint64_t GetPosition(); + virtual void SetLength(uint64_t Length); + virtual void SetPosition(uint64_t Position); + + // Implement functions + virtual void Close(); + virtual void Flush(); + virtual void Seek(uint64_t Offset, SeekOrigin Origin); + virtual uint64_t Read(uint8_t* Buffer, uint64_t Offset, uint64_t Count); + virtual uint64_t Read(uint8_t* Buffer, uint64_t Offset, uint64_t Count, uint64_t Position); + virtual void Write(uint8_t* Buffer, uint64_t Offset, uint64_t Count); + virtual void Write(uint8_t* Buffer, uint64_t Offset, uint64_t Count, uint64_t Position); + + private: + // Memory flags cached + bool _CanWrite; + bool _Expandable; + bool _KeepOpen; + uint64_t _Origin; + uint64_t _Length; + uint64_t _Position; + + // Memory buffer and size, internal + uint64_t _BufferSize; + uint8_t* _Buffer; + + // Handles reallocation of the internal buffer + void EnsureCapacity(uint64_t Size); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Mesh.cpp b/r5dev/thirdparty/cppnet/cppkore/Mesh.cpp new file mode 100644 index 00000000..57bb1c35 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Mesh.cpp @@ -0,0 +1,25 @@ +#include "stdafx.h" +#include "Mesh.h" + +namespace Assets +{ + Mesh::Mesh() + : Mesh(0, 0, 1, 1) + { + } + + Mesh::Mesh(uint8_t MaxInfluence, uint8_t UVLayers) + : Mesh(0, 0, MaxInfluence, UVLayers) + { + } + + Mesh::Mesh(uint32_t VertexCount, uint8_t MaxInfluence, uint8_t UVLayers) + : Mesh(VertexCount, 0, MaxInfluence, UVLayers) + { + } + + Mesh::Mesh(uint32_t VertexCount, uint32_t FaceCount, uint8_t MaxInfluence, uint8_t UVLayers) + : Vertices(VertexCount, MaxInfluence, UVLayers), Faces(FaceCount) + { + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/Mesh.h b/r5dev/thirdparty/cppnet/cppkore/Mesh.h new file mode 100644 index 00000000..e3e0044b --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Mesh.h @@ -0,0 +1,39 @@ +#pragma once + +#include +#include "ListBase.h" + +#include "Face.h" +#include "Vertex.h" +#include "VertexBuffer.h" + +namespace Assets +{ + // A face buffer used in a 3D mesh. + typedef List FaceBuffer; + // A buffer of indices for each UV layer in the mesh. + typedef List MatIndexBuffer; + + // A container class that holds 3D mesh data. + class Mesh + { + public: + // Initialize a blank 3D mesh. + Mesh(); + // Initialize a mesh with the given maximum influence and UV layers. + Mesh(uint8_t MaxInfluence, uint8_t UVLayers); + // Initialize a mesh with the given vertex count, maximum influence and UV layers. + Mesh(uint32_t VertexCount, uint8_t MaxInfluence, uint8_t UVLayers); + // Initialize a mesh with the given vertex count, face count, maximum influence and UV layers. + Mesh(uint32_t VertexCount, uint32_t FaceCount, uint8_t MaxInfluence, uint8_t UVLayers); + // Destroy all 3D mesh data. + ~Mesh() = default; + + // A collection of 3D vertices for this mesh. + VertexBuffer Vertices; + // A collection of 3D faces for this mesh. + FaceBuffer Faces; + // A collection of material indices for each UV layer. + MatIndexBuffer MaterialIndices; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Message.h b/r5dev/thirdparty/cppnet/cppkore/Message.h new file mode 100644 index 00000000..b2bcd834 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Message.h @@ -0,0 +1,24 @@ +#pragma once + +#include +#include + +namespace Forms +{ + // Implements a Windows message. + struct Message + { + uintptr_t HWnd; + uint32_t Msg; + + uintptr_t WParam; + uintptr_t LParam; + uintptr_t Result; + + // Construct a new Message instance from the parameters + Message(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) + : HWnd((uintptr_t)hWnd), Msg(msg), WParam(wParam), LParam(lParam), Result(NULL) + { + } + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/MessageBox.cpp b/r5dev/thirdparty/cppnet/cppkore/MessageBox.cpp new file mode 100644 index 00000000..8276da59 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/MessageBox.cpp @@ -0,0 +1,208 @@ +#include "stdafx.h" +#include "MessageBox.h" + +namespace Forms +{ + DialogResult MessageBox::Win32ToDialogResult(uint32_t Value) + { + switch (Value) + { + case IDOK: + return DialogResult::OK; + case IDCANCEL: + return DialogResult::Cancel; + case IDABORT: + return DialogResult::Abort; + case IDRETRY: + return DialogResult::Retry; + case IDIGNORE: + return DialogResult::Ignore; + case IDYES: + return DialogResult::Yes; + case IDNO: + return DialogResult::No; + default: + return DialogResult::No; + } + } + + static Drawing::Color ForegroundColor = Drawing::Color::Black; + static Drawing::Color BackgroundColor = Drawing::Color::White; + static Drawing::Color BottomColor = Drawing::Color(240, 240, 240); + + struct Win32MessageBoxThreadInfo + { + HHOOK hHook; // Hook handle + HWND hWnd; // Message box handle + WNDPROC lpMsgBoxProc; // Original window proc + COLORREF crText; // Foreground color + COLORREF crBack; // Background color + COLORREF crBottom; // Background bottom color + HBRUSH hBrush; // Background brush + HBRUSH hBrushBottom; // Background bottom brush + } static thread_local Win32PerThreadInfo; + + LRESULT CALLBACK Win32MessageBoxProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) + { + switch (uMsg) + { + case WM_INITDIALOG: + { + Win32PerThreadInfo.hBrush = ::CreateSolidBrush(Win32PerThreadInfo.crBack); + Win32PerThreadInfo.hBrushBottom = ::CreateSolidBrush(Win32PerThreadInfo.crBottom); + } + break; + case WM_CTLCOLORDLG: + case WM_CTLCOLORSTATIC: + { + HDC hDC = (HDC)wParam; + + ::SetBkMode(hDC, TRANSPARENT); + ::SetTextColor(hDC, Win32PerThreadInfo.crText); + + return (LRESULT)Win32PerThreadInfo.hBrush; + } + case WM_CTLCOLORBTN: + { + return (LRESULT)Win32PerThreadInfo.hBrushBottom; + } + case WM_PAINT: + { + auto Result = CallWindowProc(Win32PerThreadInfo.lpMsgBoxProc, hWnd, uMsg, wParam, lParam);; + + RECT Rc{}; + GetClientRect(hWnd, &Rc); + + auto DC = GetDC(hWnd); + + FillRect(DC, &Rc, Win32PerThreadInfo.hBrush); + + Rc.top = Rc.bottom - 42; + + FillRect(DC, &Rc, Win32PerThreadInfo.hBrushBottom); + + return Result; + } + case WM_COMMAND: + { + ::DeleteObject(Win32PerThreadInfo.hBrush); + ::DeleteObject(Win32PerThreadInfo.hBrushBottom); + } + break; + } + + return CallWindowProc(Win32PerThreadInfo.lpMsgBoxProc, hWnd, uMsg, wParam, lParam); + } + + LRESULT CALLBACK Win32CallbackProc(int nCode, WPARAM wParam, LPARAM lParam) + { + if (nCode < 0) + return ::CallNextHookEx(Win32PerThreadInfo.hHook, nCode, wParam, lParam); + + switch (nCode) + { + case HCBT_CREATEWND: + { + // Ensure that we have the right window to track + LPCBT_CREATEWND lpCbtCreate = (LPCBT_CREATEWND)lParam; + if (WC_DIALOG == lpCbtCreate->lpcs->lpszClass) + { + Win32PerThreadInfo.hWnd = (HWND)wParam; + } + else + { + if ((NULL == Win32PerThreadInfo.lpMsgBoxProc) && (NULL != Win32PerThreadInfo.hWnd)) + Win32PerThreadInfo.lpMsgBoxProc = (WNDPROC)::SetWindowLongPtr(Win32PerThreadInfo.hWnd, GWLP_WNDPROC, (LONG_PTR)Win32MessageBoxProc); + } + } + break; + case HCBT_DESTROYWND: + { + // Ensure that our tracked window is being destroyed + if (Win32PerThreadInfo.hWnd == (HWND)wParam) + ::SetWindowLongPtr(Win32PerThreadInfo.hWnd, GWLP_WNDPROC, (LONG_PTR)Win32PerThreadInfo.lpMsgBoxProc); + } + } + + return 0; + } + + DialogResult MessageBox::ShowCore(const string& Text, const string& Caption, MessageBoxButtons Buttons, MessageBoxIcon Icon, MessageBoxDefaultButton DefaultButton, MessageBoxOptions Options, bool ShowHelp, Control* Owner) + { + uint32_t Style = (ShowHelp) ? HELP_BUTTON : 0; + Style |= (int)Buttons | (int)Icon | (int)DefaultButton | (int)Options; + + HWND Handle = nullptr; + + if (ShowHelp || (((int)Options & ((int)MessageBoxOptions::ServiceNotification | (int)MessageBoxOptions::DefaultDesktopOnly)) == 0)) + { + if (Owner == nullptr) + Handle = GetActiveWindow(); + else + Handle = Owner->GetHandle(); + } + + // Reset hooking data for this thread + Win32PerThreadInfo.hHook = NULL; + Win32PerThreadInfo.hWnd = NULL; + Win32PerThreadInfo.lpMsgBoxProc = NULL; + + // Load the initial color values + Win32PerThreadInfo.crText = RGB(ForegroundColor.GetR(), ForegroundColor.GetG(), ForegroundColor.GetB()); + Win32PerThreadInfo.crBack = RGB(BackgroundColor.GetR(), BackgroundColor.GetG(), BackgroundColor.GetB()); + Win32PerThreadInfo.crBottom = RGB(BottomColor.GetR(), BottomColor.GetG(), BottomColor.GetB()); + + // Install the hook + Win32PerThreadInfo.hHook = ::SetWindowsHookExA(WH_CBT, Win32CallbackProc, GetModuleHandle(NULL), GetCurrentThreadId()); + + auto Result = MessageBoxA(Handle, (const char*)Text, (const char*)Caption, Style); + + // Remove the hook + ::UnhookWindowsHookEx(Win32PerThreadInfo.hHook); + + // Convert the result + return Win32ToDialogResult(Result); + } + + DialogResult MessageBox::Show(const string& Text) + { + return ShowCore(Text, "", MessageBoxButtons::OK, MessageBoxIcon::None, MessageBoxDefaultButton::Button1, (MessageBoxOptions)0, false, nullptr); + } + + DialogResult MessageBox::Show(const string& Text, const string& Caption) + { + return ShowCore(Text, Caption, MessageBoxButtons::OK, MessageBoxIcon::None, MessageBoxDefaultButton::Button1, (MessageBoxOptions)0, false, nullptr); + } + + DialogResult MessageBox::Show(const string& Text, const string& Caption, MessageBoxButtons Buttons) + { + return ShowCore(Text, Caption, Buttons, MessageBoxIcon::None, MessageBoxDefaultButton::Button1, (MessageBoxOptions)0, false, nullptr); + } + + DialogResult MessageBox::Show(const string& Text, const string& Caption, MessageBoxButtons Buttons, MessageBoxIcon Icon) + { + return ShowCore(Text, Caption, Buttons, Icon, MessageBoxDefaultButton::Button1, (MessageBoxOptions)0, false, nullptr); + } + + DialogResult MessageBox::Show(Control* Owner, const string& Text, const string& Caption, MessageBoxButtons Buttons, MessageBoxIcon Icon) + { + return ShowCore(Text, Caption, Buttons, Icon, MessageBoxDefaultButton::Button1, (MessageBoxOptions)0, false, Owner); + } + + DialogResult MessageBox::Show(Control* Owner, const string& Text, const string& Caption, MessageBoxButtons Buttons, MessageBoxIcon Icon, MessageBoxDefaultButton DefaultButton) + { + return ShowCore(Text, Caption, Buttons, Icon, DefaultButton, (MessageBoxOptions)0, false, Owner); + } + + DialogResult MessageBox::Show(Control* Owner, const string& Text, const string& Caption, MessageBoxButtons Buttons, MessageBoxIcon Icon, MessageBoxDefaultButton DefaultButton, MessageBoxOptions Options) + { + return ShowCore(Text, Caption, Buttons, Icon, DefaultButton, Options, false, Owner); + } + + void MessageBox::SetMessageBoxColors(Drawing::Color Foreground, Drawing::Color Background, Drawing::Color Bottom) + { + ForegroundColor = Foreground; + BackgroundColor = Background; + BottomColor = Bottom; + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/MessageBox.h b/r5dev/thirdparty/cppnet/cppkore/MessageBox.h new file mode 100644 index 00000000..0f218ac2 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/MessageBox.h @@ -0,0 +1,50 @@ +#pragma once + +#include +#include +#include "Control.h" +#include "StringBase.h" +#include "DialogResult.h" +#include "MessageBoxIcon.h" +#include "MessageBoxButtons.h" +#include "MessageBoxOptions.h" +#include "MessageBoxDefaultButton.h" + +// Remove built-in macros that interfere with the api +#undef MessageBox + +namespace Forms +{ + // Displays a message box that can contain text, buttons, and symbols that + // inform and instruct the user. + class MessageBox + { + public: + // Displays a message box with specified text. + static DialogResult Show(const string& Text); + // Displays a message box with specified text and caption. + static DialogResult Show(const string& Text, const string& Caption); + // Displays a message box with specified text, caption, and style. + static DialogResult Show(const string& Text, const string& Caption, MessageBoxButtons Buttons); + // Displays a message box with specified text, caption, and style. + static DialogResult Show(const string& Text, const string& Caption, MessageBoxButtons Buttons, MessageBoxIcon Icon); + // Displays a message box with specified text, caption, and style. + static DialogResult Show(Control* Owner, const string& Text, const string& Caption, MessageBoxButtons Buttons, MessageBoxIcon Icon); + // Displays a message box with specified text, caption, and style. + static DialogResult Show(Control* Owner, const string& Text, const string& Caption, MessageBoxButtons Buttons, MessageBoxIcon Icon, MessageBoxDefaultButton DefaultButton); + // Displays a message box with specified text, caption, and style. + static DialogResult Show(Control* Owner, const string& Text, const string& Caption, MessageBoxButtons Buttons, MessageBoxIcon Icon, MessageBoxDefaultButton DefaultButton, MessageBoxOptions Options); + + // Sets user defined message box colors for Foreground, Background, and Dialog Bottom Strip. + static void SetMessageBoxColors(Drawing::Color Foreground = Drawing::Color::Black, Drawing::Color Background = Drawing::Color::White, Drawing::Color Bottom = Drawing::Color(240, 240, 240)); + + private: + // Converts a native windows result to a dialog result + static DialogResult Win32ToDialogResult(uint32_t Value); + // Handles message box logic + static DialogResult ShowCore(const string& Text, const string& Caption, MessageBoxButtons Buttons, MessageBoxIcon Icon, MessageBoxDefaultButton DefaultButton, MessageBoxOptions Options, bool ShowHelp, Control* Owner); + + // Internal help button constant + constexpr static uint32_t HELP_BUTTON = 0x00004000; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/MessageBoxButtons.h b/r5dev/thirdparty/cppnet/cppkore/MessageBoxButtons.h new file mode 100644 index 00000000..206016b0 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/MessageBoxButtons.h @@ -0,0 +1,23 @@ +#pragma once + +#include + +namespace Forms +{ + // This enumeration represents the possible button options for a message box. + enum class MessageBoxButtons + { + // Specifies that the message box contains an OK button. + OK = 0x00000000, + // Specifies that the message box contains OK and Cancel buttons. + OKCancel = 0x00000001, + // Specifies that the message box contains Abort, Retry, and Ignore buttons. + AbortRetryIgnore = 0x00000002, + // Specifies that the message box contains Yes, No, and Cancel buttons. + YesNoCancel = 0x00000003, + // Specifies that the message box contains Yes and No buttons. + YesNo = 0x00000004, + // Specifies that the message box contains Retry and Cancel buttons. + RetryCancel = 0x00000005, + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/MessageBoxDefaultButton.h b/r5dev/thirdparty/cppnet/cppkore/MessageBoxDefaultButton.h new file mode 100644 index 00000000..f869d25a --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/MessageBoxDefaultButton.h @@ -0,0 +1,17 @@ +#pragma once + +#include + +namespace Forms +{ + // This enumeration represents the possible default message box buttons. + enum class MessageBoxDefaultButton + { + // Specifies that the first button on the message box should be the default button. + Button1 = 0x00000000, + // Specifies that the second button on the message box should be the default button. + Button2 = 0x00000100, + // Specifies that the third button on the message box should be the default button. + Button3 = 0x00000200, + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/MessageBoxIcon.h b/r5dev/thirdparty/cppnet/cppkore/MessageBoxIcon.h new file mode 100644 index 00000000..037bf65a --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/MessageBoxIcon.h @@ -0,0 +1,29 @@ +#pragma once + +#include + +namespace Forms +{ + // This enumeration represents the possible message box icons. + enum class MessageBoxIcon + { + // Specifies that the message box contain no symbols. + None = 0, + // Specifies that the message box contains a hand symbol. + Hand = 0x00000010, + // Specifies that the message box contains a question mark symbol. + Question = 0x00000020, + // Specifies that the message box contains an exclamation symbol. + Exclamation = 0x00000030, + // Specifies that the message box contains an asterisk symbol. + Asterisk = 0x00000040, + // Specifies that the message box contains a hand icon. + Stop = Hand, + // Specifies that the message box contains a hand icon. + Error = Hand, + // Specifies that the message box contains an exclamation icon. + Warning = Exclamation, + // Specifies that the message box contains an asterisk icon. + Information = Asterisk, + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/MessageBoxOptions.h b/r5dev/thirdparty/cppnet/cppkore/MessageBoxOptions.h new file mode 100644 index 00000000..7ee83735 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/MessageBoxOptions.h @@ -0,0 +1,19 @@ +#pragma once + +#include + +namespace Forms +{ + // This enumeration represents the possible message box options. + enum class MessageBoxOptions + { + // Specifies that the message box is displayed on the active desktop. + ServiceNotification = 0x00200000, + // Specifies that the message box is displayed on the active desktop. + DefaultDesktopOnly = 0x00020000, + // Specifies that the message box text is right-aligned. + RightAlign = 0x00080000, + // Specifies that the message box text is displayed with Rtl reading order. + RtlReading = 0x00100000, + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Model.cpp b/r5dev/thirdparty/cppnet/cppkore/Model.cpp new file mode 100644 index 00000000..0c473cf3 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Model.cpp @@ -0,0 +1,146 @@ +#include "stdafx.h" +#include "Model.h" +#include "Matrix.h" + +namespace Assets +{ + Model::Model() + : Model(0, 0, 0) + { + } + + Model::Model(uint32_t SubmeshCount) + : Model(SubmeshCount, 0, 0) + { + } + + Model::Model(uint32_t SubmeshCount, uint32_t BoneCount) + : Model(SubmeshCount, BoneCount, 0) + { + } + + Model::Model(uint32_t SubmeshCount, uint32_t BoneCount, uint32_t MaterialCount) + : Meshes(SubmeshCount), Bones(BoneCount), Materials(MaterialCount), Name("error") + { + } + + uint32_t Model::VertexCount() const + { + uint32_t Result = 0; + + for (auto& Mesh : Meshes) + Result += Mesh.Vertices.Count(); + + return Result; + } + + uint32_t Model::FaceCount() const + { + uint32_t Result = 0; + + for (auto& Mesh : Meshes) + Result += Mesh.Faces.Count(); + + return Result; + } + + void Model::GenerateLocalTransforms(bool Position, bool Rotation) + { + for (auto& Bone : Bones) + { + if (Bone.Parent() != -1) + { + if (Position) + { + auto ParentMatrix = Matrix::CreateFromQuaternion(~Bones[Bone.Parent()].GlobalRotation()); + + // Inverse parent matrix * parent position difference + Bone.SetLocalPosition(Matrix::TransformVector(Bone.GlobalPosition() - Bones[Bone.Parent()].GlobalPosition(), ParentMatrix)); + } + + // Inverse parent rotation * rotation + if (Rotation) + Bone.SetLocalRotation(~Bones[Bone.Parent()].GlobalRotation() * Bone.GlobalRotation()); + } + else + { + // The global transform is the same as the local + if (Position) + Bone.SetLocalPosition(Bone.GlobalPosition()); + if (Rotation) + Bone.SetLocalRotation(Bone.GlobalRotation()); + } + } + } + + void Model::GenerateGlobalTransforms(bool Position, bool Rotation) + { + for (auto& Bone : Bones) + { + if (Bone.Parent() != -1) + { + if (Position) + { + auto& ParentRotation = Bones[Bone.Parent()].GlobalRotation(); + auto& ParentPosition = Bones[Bone.Parent()].GlobalPosition(); + auto& LocalPosition = Bone.LocalPosition(); + + auto PositionQuaternion = Quaternion(LocalPosition.X, LocalPosition.Y, LocalPosition.Z, 0); + + // Parent rotation * local position transform, then * inverse parent rotation + auto Result = (ParentRotation * PositionQuaternion) * ~ParentRotation; + // Add to the parent's global position + Bone.SetGlobalPosition({ ParentPosition.X + Result.X, ParentPosition.Y + Result.Y, ParentPosition.Z + Result.Z }); + } + + // Parent rotation * local rotation transform + if (Rotation) + Bone.SetGlobalRotation(Bones[Bone.Parent()].GlobalRotation() * Bone.LocalRotation()); + } + else + { + // The local transform is the same as the global + if (Position) + Bone.SetGlobalPosition(Bone.LocalPosition()); + if (Rotation) + Bone.SetGlobalRotation(Bone.LocalRotation()); + } + } + } + + void Model::CalculateVertexNormals() + { + for (auto& Mesh : Meshes) + { + for (auto& Vertex : Mesh.Vertices) + Vertex.SetNormal({ 0, 0, 0 }); + + for (auto& Face : Mesh.Faces) + { + auto CrossProduct = (Mesh.Vertices[Face[1]].Position() - Mesh.Vertices[Face[0]].Position()).Cross(Mesh.Vertices[Face[2]].Position() - Mesh.Vertices[Face[0]].Position()); + + Mesh.Vertices[Face[0]].SetNormal(Mesh.Vertices[Face[0]].Normal() + CrossProduct); + Mesh.Vertices[Face[1]].SetNormal(Mesh.Vertices[Face[1]].Normal() + CrossProduct); + Mesh.Vertices[Face[2]].SetNormal(Mesh.Vertices[Face[2]].Normal() + CrossProduct); + } + + for (auto& Vertex : Mesh.Vertices) + Vertex.SetNormal(Vertex.Normal().GetNormalized()); + } + } + + void Model::Scale(float Factor) + { + for (auto& Bone : Bones) + { + Bone.SetLocalPosition(Bone.LocalPosition() * Factor); + Bone.SetGlobalPosition(Bone.GlobalPosition() * Factor); + } + + for (auto& Mesh : Meshes) + { + for (auto& Vertex : Mesh.Vertices) + Vertex.SetPosition(Vertex.Position() * Factor); + } + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/Model.h b/r5dev/thirdparty/cppnet/cppkore/Model.h new file mode 100644 index 00000000..65b0d0be --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Model.h @@ -0,0 +1,84 @@ +#pragma once + +#include +#include +#include "ListBase.h" +#include "StringBase.h" + +// The separate model parts +#include "Bone.h" +#include "Mesh.h" +#include "Material.h" + +// Hash algorithm for materials +#include "XXHash.h" + +namespace Assets +{ + // A container class that holds 3D model data. + class Model + { + public: + // Initialize a blank 3D model without any known count information. + Model(); + // Initialize a 3D model with the given model count for meshes. + Model(uint32_t SubmeshCount); + // Initialize a 3D model with the given model counts for meshes, and bones. + Model(uint32_t SubmeshCount, uint32_t BoneCount); + // Initialize a 3D model with the given model counts for meshes, bones, and materials. + Model(uint32_t SubmeshCount, uint32_t BoneCount, uint32_t MaterialCount); + // Destroy all 3D model resources. + ~Model() = default; + + // The name of the model + string Name; + + // Ensure that our model is not copied or assigned to for performance reasons. + Model(const Model&) = delete; + Model& operator=(Model const&) = delete; + + // A collection of 3D bones for this model. + List Bones; + // A collection of 3D meshes for this model. + List Meshes; + // A collection of 3D materials for this model. + List Materials; + + // Adds a material to the collection if it doesn't already exist, returning it's index. + template + uint32_t AddMaterial(const string& MaterialName, const T& SourceMap = T()) + { + auto MaterialHashCode = Hashing::XXHash::HashString(MaterialName); + + for (uint32_t i = 0; i < Materials.Count(); i++) + if (Materials[i].Hash == MaterialHashCode) + return i; + + if constexpr (std::is_integral::value) { + auto& Mat = Materials.Emplace(MaterialName, MaterialHashCode); + Mat.SourceHash = Mat.Hash = SourceMap; + } + else { + Materials.Emplace(MaterialName, MaterialHashCode).SourceString = SourceMap; + } + + return Materials.Count() - 1; + } + + // Calculates the total number of vertices that make up this model. + uint32_t VertexCount() const; + // Calculates the total number of faces that make up this model. + uint32_t FaceCount() const; + + // Calculates local transformations from the globals. + void GenerateLocalTransforms(bool Position, bool Rotation); + // Calculates global transformations from the locals. + void GenerateGlobalTransforms(bool Position, bool Rotation); + + // Calculates vertex normals from existing vertices. + void CalculateVertexNormals(); + + // Scales the model with the given factor. + void Scale(float Factor); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/ModelFragmentShader.h b/r5dev/thirdparty/cppnet/cppkore/ModelFragmentShader.h new file mode 100644 index 00000000..7fe6ec95 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ModelFragmentShader.h @@ -0,0 +1,58 @@ +#pragma once + +constexpr const char* ModelFragmentShader_Src = +"#version 430 core\n" +"layout(location = 0) out vec3 color;\n" +"\n" +"in vec3 vertColorFrag;\n" +"in vec3 vertFragPos;\n" +"in vec3 vertNormal;\n" +"in vec2 vertUVLayer;\n" +"\n" +"uniform mat4 view;\n" +"uniform mat4 projection;\n" +"\n" +"uniform int diffuseLoaded;\n" +"uniform sampler2D diffuseTexture;\n" +"uniform sampler2D normalTexture;\n" +"uniform sampler2D glossTexture;\n" +"uniform sampler2D specularTexture;\n" +"\n" +"void main()\n" +"{\n" +" // Ambient\n" +" float ambientStrength = 0.06;\n" +" vec3 ambient = ambientStrength * vec3(1, 1, 1); // Amb color\n" +" \n" +" // Diffuse\n" +" vec3 norm = normalize(vertNormal);\n" +" vec3 normMap = normalize((texture(normalTexture,vertUVLayer).rgb * -2) + 1);\n" +" float glossMap = texture(glossTexture,vertUVLayer).rgb.r;\n" +"\n" +" normMap.z = 1;\n" +" normMap = normalize(normMap);\n" +"\n" +"\n" +" vec3 lightDir = normalize(inverse(view)[3].xyz - vertFragPos);\n" +" float diff = max(dot(norm, lightDir), 0.0);\n" +" vec3 diffuse = diff * texture(diffuseTexture, vertUVLayer).rgb * (1 - glossMap); // Light color\n" +"\n" +" // Specular\n" +" float specularStrength = 1;\n" +"\n" +" vec3 viewPos = inverse(view)[3].xyz;\n" +"\n" +" vec3 viewDir = normalize(viewPos - vertFragPos);\n" +" vec3 reflectDir = reflect(-lightDir, norm); \n" +"\n" +"\n" +" float spec = pow(max(dot(viewDir, reflectDir), 0.0), 2);\n" +" vec3 specular = texture(specularTexture, vertUVLayer).rgb * spec * (glossMap);\n" +" \n" +" // Result\n" +" if (diffuseLoaded == 1) {\n" +" color = (ambient + diffuse + specular);\n" +" } else {\n" +" color = (ambient) * 0.6;\n" +" }\n" +"}"; \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/ModelVertexShader.h b/r5dev/thirdparty/cppnet/cppkore/ModelVertexShader.h new file mode 100644 index 00000000..1b35e1e6 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ModelVertexShader.h @@ -0,0 +1,20 @@ +#pragma once + +constexpr const char* ModelVertexShader_Src = +"#version 430 core\n" +"layout(location=0)in vec3 vertPos;" +"layout(location=1)in vec3 vertNorm;" +"layout(location=2)in uvec4 vertColor;" +"layout(location=3)in vec2 vertUV;" +"uniform mat4 model,view,projection;" +"out vec3 vertColorFrag,vertNormal,vertFragPos;" +"out vec2 vertUVLayer;" +"void main()" +"{" +"mat4 v=projection*view*model;" +"gl_Position=v*vec4(vertPos,1.);" +"vertNormal=mat3(transpose(inverse(model)))*vertNorm;" +"vertColorFrag=vec3(float(vertColor.r)/255.,float(vertColor.g)/255.,float(vertColor.b)/255.);" +"vertFragPos=vec3(model*vec4(vertPos,1.));" +"vertUVLayer=vertUV;" +"}"; \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/MouseButtons.h b/r5dev/thirdparty/cppnet/cppkore/MouseButtons.h new file mode 100644 index 00000000..e0c38542 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/MouseButtons.h @@ -0,0 +1,31 @@ +#pragma once + +#include + +namespace Forms +{ + // Specifies constants that define which mouse button was pressed. + enum class MouseButtons + { + // The left mouse button was pressed. + Left = 0x00100000, + // No mouse button was pressed. + None = 0x00000000, + // The right mouse button was pressed. + Right = 0x00200000, + // The middle mouse button was pressed. + Middle = 0x00400000, + // [To be supplied.] + XButton1 = 0x00800000, + // [To be supplied.] + XButton2 = 0x01000000, + }; + + // + // Allow bitwise operations on this enumeration + // + constexpr MouseButtons operator|(MouseButtons Lhs, MouseButtons Rhs) + { + return static_cast(static_cast::type>(Lhs) | static_cast::type>(Rhs)); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/MouseEventArgs.cpp b/r5dev/thirdparty/cppnet/cppkore/MouseEventArgs.cpp new file mode 100644 index 00000000..22068b49 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/MouseEventArgs.cpp @@ -0,0 +1,10 @@ +#include "stdafx.h" +#include "MouseEventArgs.h" + +namespace Forms +{ + MouseEventArgs::MouseEventArgs(MouseButtons Button, uint32_t Clicks, int32_t X, int32_t Y, int32_t Delta) + : Button(Button), Clicks(Clicks), X(X), Y(Y), Delta(Delta) + { + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/MouseEventArgs.h b/r5dev/thirdparty/cppnet/cppkore/MouseEventArgs.h new file mode 100644 index 00000000..671f53de --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/MouseEventArgs.h @@ -0,0 +1,27 @@ +#pragma once + +#include +#include "MouseButtons.h" + +namespace Forms +{ + // Provides data for all mouse events + class MouseEventArgs + { + public: + MouseEventArgs() = default; + MouseEventArgs(MouseButtons Button, uint32_t Clicks, int32_t X, int32_t Y, int32_t Delta); + ~MouseEventArgs() = default; + + // The button that was pressed + MouseButtons Button; + // The number of clicks + uint32_t Clicks; + // The X position of the mouse + int32_t X; + // The Y position of the mouse + int32_t Y; + // The delta movement of the mouse + int32_t Delta; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/OpenFileDialog.cpp b/r5dev/thirdparty/cppnet/cppkore/OpenFileDialog.cpp new file mode 100644 index 00000000..a847bc28 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/OpenFileDialog.cpp @@ -0,0 +1,122 @@ +#include "stdafx.h" +#include "OpenFileDialog.h" +#include "Path.h" +#include +#include + +namespace Forms +{ + const string BuildOpenFileFilter(const string& Filter) + { + string InitialFilter = (string::IsNullOrWhiteSpace(Filter)) ? string(" |*.*") : Filter; + auto Buffer = std::make_unique((size_t)InitialFilter.Length() + 2); // Final filter has two null chars + auto BufferMask = (char*)Buffer.get(); + + std::memcpy(Buffer.get(), InitialFilter.ToCString(), InitialFilter.Length()); + + for (uint32_t i = 0; i < InitialFilter.Length(); i++) + { + if (BufferMask[i] == '|') + BufferMask[i] = (char)0; + } + + BufferMask[InitialFilter.Length() + 1] = (char)0; + + return string((char*)Buffer.get(), (size_t)InitialFilter.Length() + 1); + } + + string OpenFileDialog::ShowFolderDialog(const string& Title, const string& BasePath, Control* Owner) + { + HWND OwnerHandle = (Owner != nullptr) ? Owner->GetHandle() : NULL; + + char path[MAX_PATH]; + BROWSEINFOA bi; + + bi.hwndOwner = OwnerHandle; + bi.pidlRoot = NULL; + bi.pszDisplayName = (LPSTR)path; + bi.lpszTitle = Title; + bi.ulFlags = BIF_RETURNONLYFSDIRS | BIF_NEWDIALOGSTYLE; + bi.lpfn = NULL; + bi.lParam = 0; + LPITEMIDLIST pidl = SHBrowseForFolderA(&bi); + if (pidl != NULL && SHGetPathFromIDListA(pidl, path)) + return string(path); + + // We need nothing as a default because we don't get a return value + return ""; + } + + string OpenFileDialog::ShowFileDialog(const string& Title, const string& BasePath, const string& Filter, Control* Owner) + { + HWND OwnerHandle = (Owner != nullptr) ? Owner->GetHandle() : NULL; + char Buffer[MAX_PATH]{}; + + OPENFILENAMEA oFileDialog{}; + oFileDialog.lStructSize = sizeof(OPENFILENAMEA); + + auto FilterBuffer = BuildOpenFileFilter(Filter); + + oFileDialog.hwndOwner = OwnerHandle; + oFileDialog.lpstrFilter = (LPSTR)FilterBuffer.ToCString(); + oFileDialog.lpstrInitialDir = (LPCSTR)BasePath.ToCString(); + oFileDialog.lpstrFile = (LPSTR)Buffer; + oFileDialog.nMaxFile = MAX_PATH; + oFileDialog.lpstrTitle = Title.ToCString(); + oFileDialog.Flags = OFN_HIDEREADONLY | OFN_EXPLORER; + + // Open the dialog with the config and then return result + if (GetOpenFileNameA(&oFileDialog)) + return string(Buffer); + + // We need nothing as a default because we don't get a return value + return ""; + } + + List OpenFileDialog::ShowMultiFileDialog(const string& Title, const string& BasePath, const string& Filter, Control* Owner) + { + HWND OwnerHandle = (Owner != nullptr) ? Owner->GetHandle() : NULL; + char Buffer[0x2000]{}; + + static bool bFileLessPath = false; + + OPENFILENAMEA oFileDialog{}; + oFileDialog.lStructSize = sizeof(OPENFILENAMEA); + + auto FilterBuffer = BuildOpenFileFilter(Filter); + + oFileDialog.hwndOwner = OwnerHandle; + oFileDialog.lpstrFilter = (LPSTR)FilterBuffer.ToCString(); + oFileDialog.lpstrInitialDir = (LPCSTR)BasePath.ToCString(); + oFileDialog.lpstrFile = (LPSTR)Buffer; + oFileDialog.nMaxFile = 0x2000; + oFileDialog.lpstrTitle = Title.ToCString(); + oFileDialog.Flags = OFN_ALLOWMULTISELECT | OFN_HIDEREADONLY | OFN_EXPLORER; + + List ResultList; + + // Open the dialog and parse each result + if (GetOpenFileNameA(&oFileDialog)) + { + const char* Path = oFileDialog.lpstrFile; + + auto BasePath = string(Path); + + while (*Path) + { + if (!bFileLessPath) + { + Path += ((size_t)BasePath.Length() + 1); + bFileLessPath = true; + } + + auto FileName = string(Path); + ResultList.EmplaceBack(IO::Path::Combine(BasePath, FileName)); + Path += ((size_t)FileName.Length() + 1); + } + } + + bFileLessPath = false; + return ResultList; // We need an empty list as default because we didn't get a return value + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/OpenFileDialog.h b/r5dev/thirdparty/cppnet/cppkore/OpenFileDialog.h new file mode 100644 index 00000000..3ce0debd --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/OpenFileDialog.h @@ -0,0 +1,22 @@ +#pragma once + +#include +#include "Control.h" +#include "ListBase.h" +#include "StringBase.h" +#include "DialogResult.h" + +namespace Forms +{ + // Handles a dialog prompt that asks for a file or files to open + class OpenFileDialog + { + public: + static string ShowFolderDialog(const string& Title, const string& BasePath = "", Control* Owner = nullptr); + + // Opens the dialog and allows the user to select one file + static string ShowFileDialog(const string& Title, const string& BasePath = "", const string& Filter = " |*.*", Control* Owner = nullptr); + // Opens the dialog and allows the user to select multiple files + static List ShowMultiFileDialog(const string& Title, const string& BasePath = "", const string& Filter = " |*.*", Control* Owner = nullptr); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/OpenGLViewport.cpp b/r5dev/thirdparty/cppnet/cppkore/OpenGLViewport.cpp new file mode 100644 index 00000000..bc19b11e --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/OpenGLViewport.cpp @@ -0,0 +1,110 @@ +#include "stdafx.h" +#include "OpenGLViewport.h" + +// We need to include the OpenGL classes +#include "Mangler.h" + +namespace Forms +{ + OpenGLViewport::OpenGLViewport() + : Control(), _DCHandle(nullptr), _GLHandle(nullptr) + { + SetStyle(ControlStyles::UserPaint | ControlStyles::AllPaintingInWmPaint | ControlStyles::Opaque | ControlStyles::UserMouse, true); + this->SetDoubleBuffered(false); + } + + OpenGLViewport::~OpenGLViewport() + { + if (_DCHandle) + ReleaseDC(this->_Handle, this->_DCHandle); + if (_GLHandle) + wglDeleteContext(this->_GLHandle); + } + + float OpenGLViewport::AspectRatio() + { + return (float)this->_ClientWidth / (float)this->_ClientHeight; + } + + void OpenGLViewport::Redraw() + { + this->OnRender(); + } + + void OpenGLViewport::OnHandleCreated() + { + // We initialize OpenGL here, this can only be setup once... + this->_DCHandle = GetDC(this->_Handle); + + // The recommended pixel format + PIXELFORMATDESCRIPTOR PixelFormat = + { + sizeof(PIXELFORMATDESCRIPTOR), + 1, + PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER, // Flags + PFD_TYPE_RGBA, // The kind of framebuffer. RGBA or palette. + 24, // Colordepth of the framebuffer. + 0, 0, 0, 0, 0, 0, + 0, + 0, + 0, + 0, 0, 0, 0, + 24, // Number of bits for the depthbuffer + 0, // Number of bits for the stencilbuffer + 0, // Number of Aux buffers in the framebuffer. + PFD_MAIN_PLANE, + 0, + 0, 0, 0 + }; + + auto PixelFormatIndex = ChoosePixelFormat(this->_DCHandle, &PixelFormat); + SetPixelFormat(this->_DCHandle, PixelFormatIndex, &PixelFormat); + + this->_GLHandle = wglCreateContext(this->_DCHandle); + wglMakeCurrent(this->_DCHandle, this->_GLHandle); + + if (!MGL::Mangler::Initalize()) + throw std::exception("Error initializing OpenGL!"); + + auto Background = this->BackColor(); + glClearColor(Background.GetR() / 255.f, Background.GetG() / 255.f, Background.GetB() / 255.f, Background.GetA() / 255.f); + + // We must call base event last + Control::OnHandleCreated(); + } + + void OpenGLViewport::OnRender() + { + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + Render.RaiseEvent(this); + + SwapBuffers(this->_DCHandle); + } + + void OpenGLViewport::OnBackColorChanged() + { + auto Background = this->BackColor(); + glClearColor(Background.GetR() / 255.f, Background.GetG() / 255.f, Background.GetB() / 255.f, Background.GetA() / 255.f); + + // We must call base event last + Control::OnBackColorChanged(); + } + + void OpenGLViewport::OnPaint(const std::unique_ptr& EventArgs) + { + // Proxy this off, they don't need paint event args... + OnRender(); + } + + CreateParams OpenGLViewport::GetCreateParams() + { + auto Cp = Control::GetCreateParams(); + Cp.ClassName = "OpenGLViewport"; + + Cp.Style |= WS_CLIPCHILDREN | WS_CLIPSIBLINGS; + Cp.ClassStyle |= CS_VREDRAW | CS_HREDRAW | CS_OWNDC; + + return Cp; + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/OpenGLViewport.h b/r5dev/thirdparty/cppnet/cppkore/OpenGLViewport.h new file mode 100644 index 00000000..9b41266e --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/OpenGLViewport.h @@ -0,0 +1,38 @@ +#pragma once + +#include +#include "Control.h" + +namespace Forms +{ + // Represents an OpenGL viewport control. + class OpenGLViewport : public Control + { + public: + OpenGLViewport(); + virtual ~OpenGLViewport(); + + // Gets the aspect ratio of this viewport. + float AspectRatio(); + + // Redraws the frame. + void Redraw(); + + // We must define base events here + virtual void OnHandleCreated(); + virtual void OnRender(); + virtual void OnBackColorChanged(); + virtual void OnPaint(const std::unique_ptr& EventArgs); + + // We must define event handlers here + EventBase Render; + + protected: + // Get custom control creation parameters for this instance. + virtual CreateParams GetCreateParams(); + + // Internal cached flags + HDC _DCHandle; + HGLRC _GLHandle; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/PaintEventArgs.cpp b/r5dev/thirdparty/cppnet/cppkore/PaintEventArgs.cpp new file mode 100644 index 00000000..8e873812 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/PaintEventArgs.cpp @@ -0,0 +1,42 @@ +#include "stdafx.h" +#include "PaintEventArgs.h" +#include "Control.h" + +namespace Forms +{ + PaintEventArgs::PaintEventArgs(Drawing::Graphics* Graphics, Drawing::Rectangle ClipRectangle) + : Graphics(Graphics), ClipRectangle(ClipRectangle), _NativeHandle(nullptr), _OldPalette(nullptr), SavedGraphicsState(NULL) + { + } + + PaintEventArgs::PaintEventArgs(HDC Dc, Drawing::Rectangle ClipRectangle) + : _NativeHandle(Dc), _OldPalette(nullptr), ClipRectangle(ClipRectangle), SavedGraphicsState(NULL) + { + this->_OldPalette = Control::SetUpPalette(Dc, false, false); + this->Graphics = std::make_unique(Dc); + this->Graphics->SetPageUnit(Gdiplus::Unit::UnitPixel); + this->SavedGraphicsState = this->Graphics->Save(); + } + + PaintEventArgs::~PaintEventArgs() + { + if (this->_OldPalette != nullptr && this->_NativeHandle != nullptr) + SelectPalette(this->_NativeHandle, this->_OldPalette, FALSE); + + this->_OldPalette = nullptr; + } + + HDC PaintEventArgs::NativeHandle() + { + return this->_NativeHandle; + } + + void PaintEventArgs::ResetGraphics() + { + if (this->SavedGraphicsState != NULL) + { + this->Graphics->Restore(this->SavedGraphicsState); + this->SavedGraphicsState = NULL; + } + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/PaintEventArgs.h b/r5dev/thirdparty/cppnet/cppkore/PaintEventArgs.h new file mode 100644 index 00000000..d3fbe635 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/PaintEventArgs.h @@ -0,0 +1,37 @@ +#pragma once + +#include +#include "DrawingBase.h" + +namespace Forms +{ + // Provides data for the OnPaint event. + class PaintEventArgs + { + public: + PaintEventArgs() = default; + PaintEventArgs(Drawing::Graphics* Graphics, Drawing::Rectangle ClipRectangle); + PaintEventArgs(HDC Dc, Drawing::Rectangle ClipRectangle); + virtual ~PaintEventArgs(); + + // The graphics object used to paint during this event + std::unique_ptr Graphics; + // The clipped area used for painting during this event + Drawing::Rectangle ClipRectangle; + + // Gets the native handle + HDC NativeHandle(); + + // Reset graphics state + void ResetGraphics(); + + private: + + // Internal handle references + HDC _NativeHandle; + HPALETTE _OldPalette; + + // Internal saved state, only used when working with an HDC + Drawing::GraphicsState SavedGraphicsState; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/PaintFrameEventArgs.cpp b/r5dev/thirdparty/cppnet/cppkore/PaintFrameEventArgs.cpp new file mode 100644 index 00000000..5861c830 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/PaintFrameEventArgs.cpp @@ -0,0 +1,10 @@ +#include "stdafx.h" +#include "PaintFrameEventArgs.h" + +namespace Forms +{ + PaintFrameEventArgs::PaintFrameEventArgs(HDC Dc, Drawing::Rectangle ClipRectangle, bool Active) + : PaintEventArgs(Dc, ClipRectangle), Active(Active) + { + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/PaintFrameEventArgs.h b/r5dev/thirdparty/cppnet/cppkore/PaintFrameEventArgs.h new file mode 100644 index 00000000..61858892 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/PaintFrameEventArgs.h @@ -0,0 +1,18 @@ +#pragma once + +#include +#include "PaintEventArgs.h" + +namespace Forms +{ + // Provides data for the OnPaintFrame event. + class PaintFrameEventArgs : public PaintEventArgs + { + public: + PaintFrameEventArgs(HDC Dc, Drawing::Rectangle ClipRectangle, bool Active); + virtual ~PaintFrameEventArgs() = default; + + // Whether or not the window frame is active. + bool Active; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Panel.cpp b/r5dev/thirdparty/cppnet/cppkore/Panel.cpp new file mode 100644 index 00000000..fff70863 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Panel.cpp @@ -0,0 +1,57 @@ +#include "stdafx.h" +#include "Panel.h" + +namespace Forms +{ + Panel::Panel() + : Control() + { + SetStyle(ControlStyles::Selectable | ControlStyles::AllPaintingInWmPaint, false); + SetStyle(ControlStyles::SupportsTransparentBackColor | ControlStyles::ContainerControl, true); + + // Setup the container + this->_Controls = std::make_unique(); + + // We are a panel control + this->_RTTI = ControlTypes::Panel; + } + + BorderStyle Panel::GetBorderStyle() + { + return this->_BorderStyle; + } + + void Panel::SetBorderStyle(BorderStyle Value) + { + this->_BorderStyle = Value; + UpdateStyles(); + } + + void Panel::AddControl(Control* Ctrl) + { + Control::AddControl(Ctrl); + } + + CreateParams Panel::GetCreateParams() + { + auto Cp = Control::GetCreateParams(); + + Cp.ClassName = "PANEL"; + Cp.ExStyle |= WS_EX_CONTROLPARENT; + + Cp.ExStyle &= (~WS_EX_CLIENTEDGE); + Cp.Style &= (~WS_BORDER); + + switch (_BorderStyle) + { + case BorderStyle::Fixed3D: + Cp.ExStyle |= WS_EX_CLIENTEDGE; + break; + case BorderStyle::FixedSingle: + Cp.Style |= WS_BORDER; + break; + } + + return Cp; + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/Panel.h b/r5dev/thirdparty/cppnet/cppkore/Panel.h new file mode 100644 index 00000000..1f5f9deb --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Panel.h @@ -0,0 +1,32 @@ +#pragma once + +#include +#include "Control.h" +#include "BorderStyle.h" + +namespace Forms +{ + // Represents a panel control. + class Panel : public Control + { + public: + Panel(); + virtual ~Panel() = default; + + // Gets the border style appearence of the panel control. + BorderStyle GetBorderStyle(); + // Sets the border style appearence of the panel control. + void SetBorderStyle(BorderStyle Value); + + // Add a control to this panel. + virtual void AddControl(Control* Ctrl); + + protected: + // Get custom control creation parameters for this instance. + virtual CreateParams GetCreateParams(); + + private: + // Internal cached flags + BorderStyle _BorderStyle; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/ParallelTask.h b/r5dev/thirdparty/cppnet/cppkore/ParallelTask.h new file mode 100644 index 00000000..9841fec6 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ParallelTask.h @@ -0,0 +1,49 @@ +#pragma once + +#include +#include +#include +#include "ListBase.h" +#include "Thread.h" + +namespace Threading +{ + // Handles running a task in parallel + class ParallelTask + { + public: + + // Runs a task in parallel given the thread count + ParallelTask(const std::function Task, uint32_t DegreeOfParallelism = 0) + { + // If value is 0, adjust to core count + if (DegreeOfParallelism == 0) + { + SYSTEM_INFO SysInfo{}; + GetSystemInfo(&SysInfo); + + // We must always have one thread + DegreeOfParallelism = max((uint32_t)1, (uint32_t)SysInfo.dwNumberOfProcessors); + } + + // Worker pool + List Workers; + + // Loop and add the jobs + for (uint32_t i = 0; i < DegreeOfParallelism; i++) + Workers.Emplace(Task).Start(); + + // Wait for all workers to end + for (auto& Worker : Workers) + { + try + { + Worker.Join(); + } + catch (...) + { + } + } + } + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Path.cpp b/r5dev/thirdparty/cppnet/cppkore/Path.cpp new file mode 100644 index 00000000..b61e9bd7 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Path.cpp @@ -0,0 +1,209 @@ +#include "stdafx.h" +#include "Path.h" + +namespace IO +{ + string Path::ChangeExtension(const string& FilePath, const string& Extension) + { + string Base; + for (int32_t i = FilePath.Length(); --i >= 0;) + { + auto& Ch = FilePath[i]; + if (Ch == '.') + { + Base = FilePath.Substring(0, i); + break; + } + + // Ignore the separators, we made it too far + if (Ch == DirectorySeparatorChar || Ch == AltDirectorySeparatorChar || Ch == VolumeSeparatorChar) + break; + } + + if (Base.Length() > 0) + { + if (Extension.Length() == 0 || Extension[0] != '.') + { + Base += "."; + Base += Extension; + } + else + { + Base += Extension; + } + } + + return Base; + } + + string Path::GetDirectoryName(const string& Path) + { + // Cache the full length and root length + int32_t cLength = (int32_t)Path.Length(); + int32_t rLength = (cLength > 2 && Path[1] == VolumeSeparatorChar && (Path[2] == DirectorySeparatorChar || Path[2] == AltDirectorySeparatorChar)) ? 3 : 0; + + if (cLength > rLength) + { + // Iterate while not modifying the string for performance + while (cLength > rLength && Path[--cLength] != DirectorySeparatorChar && Path[cLength] != AltDirectorySeparatorChar); + + return Path.Substring(0, cLength); + } + + return ""; + } + + string Path::GetExtension(const string& FilePath) + { + // Cache full length + int32_t cLength = (int32_t)FilePath.Length(); + + for (int32_t i = cLength; --i >= 0;) + { + auto& Ch = FilePath[i]; + if (Ch == '.') + { + if (i != cLength - 1) + return FilePath.Substring(i, cLength - i); + else + return ""; + } + + // If we found one of these, we made it too far + if (Ch == DirectorySeparatorChar || Ch == AltDirectorySeparatorChar || Ch == VolumeSeparatorChar) + break; + } + + return ""; + } + + string Path::GetFileName(const string& FilePath) + { + int32_t cLength = (int32_t)FilePath.Length(); + for (int32_t i = cLength; --i >= 0;) + { + auto& Ch = FilePath[i]; + + if (Ch == DirectorySeparatorChar || Ch == AltDirectorySeparatorChar || Ch == VolumeSeparatorChar) + return FilePath.Substring(i + 1, cLength - i - 1); + } + + return FilePath; + } + + string Path::GetFileNameWithoutExtension(const string& FilePath) + { + auto fPath = Path::GetFileName(FilePath); + auto fExt = fPath.LastIndexOf('.'); + + if (fExt != string::InvalidPosition) + return fPath.Substring(0, fExt); + else + return fPath; + } + + string Path::GetPathRoot(const string& Path) + { + return Path.Substring(0, Path::GetRootLength(Path)); + } + + string Path::GetTempPath() + { + char Buffer[MAX_PATH + 1]{}; + GetTempPathA(MAX_PATH, Buffer); + + return Buffer; + } + + string Path::GetTempFileName() + { + auto BasePath = Path::GetTempPath(); + + char Buffer[MAX_PATH + 1]{}; + GetTempFileNameA((const char*)BasePath, "tmp", 0, (char*)Buffer); + + return Buffer; + } + + bool Path::HasExtension(const string& FilePath) + { + auto cLength = FilePath.Length(); + + for (int32_t i = cLength; --i >= 0;) + { + auto& Ch = FilePath[i]; + if (Ch == '.') + { + if (i != cLength - 1) + return true; + else + return false; + } + + // If we found one of these, we made it too far + if (Ch == DirectorySeparatorChar || Ch == AltDirectorySeparatorChar || Ch == VolumeSeparatorChar) + break; + } + + return false; + } + + bool Path::IsPathRooted(const string& Path) + { + auto cLength = Path.Length(); + if ((cLength >= 1 && (Path[0] == DirectorySeparatorChar || Path[0] == AltDirectorySeparatorChar)) || (cLength >= 2 && Path[1] == VolumeSeparatorChar)) + return true; + + return false; + } + + string Path::Combine(const string& Path1, const string& Path2) + { + if (Path2.Length() == 0) + return Path1; + if (Path1.Length() == 0) + return Path2; + + if (Path::IsPathRooted(Path2)) + return Path2; + + auto& Ch = Path1[Path1.Length() - 1]; + if (Ch != DirectorySeparatorChar && Ch != AltDirectorySeparatorChar && Ch != VolumeSeparatorChar) + return Path1 + DirectorySeparatorChar + Path2; + + return Path1 + Path2; + } + + uint32_t Path::GetRootLength(const string& Path) + { + int32_t i = 0, cLength = Path.Length(); + + auto IsDirectorySeparator = [](char Ch) -> bool + { + return (Ch == DirectorySeparatorChar || Ch == AltDirectorySeparatorChar); + }; + + if (cLength >= 1 && IsDirectorySeparator(Path[0])) + { + // Handles UNC paths and currrent drive root paths + i = 1; + if (cLength >= 2 && IsDirectorySeparator(Path[1])) + { + i = 2; + int32_t nIter = 2; + + while (i < cLength && !IsDirectorySeparator(Path[i]) || --nIter > 0) + i++; + } + } + else if (cLength >= 2 && Path[1] == VolumeSeparatorChar) + { + // Handles C:\Windows + i = 2; + if (cLength >= 3 && IsDirectorySeparator(Path[2])) + i++; + } + + return i; + } +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Path.h b/r5dev/thirdparty/cppnet/cppkore/Path.h new file mode 100644 index 00000000..78355fe4 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Path.h @@ -0,0 +1,86 @@ +#pragma once + +#include +#include "StringBase.h" + +// +// Remove Win32 macros +// + +#undef GetTempPath +#undef GetTempFileName + +namespace IO +{ + class Path + { + public: + // Platform specific directory separator character + constexpr static char DirectorySeparatorChar = '\\'; + // Alternate platform specific directory separator character + constexpr static char AltDirectorySeparatorChar = '/'; + // Platform specific volume separatoer character + constexpr static char VolumeSeparatorChar = ':'; + + // Changes the extension of a file path + static string ChangeExtension(const string& FilePath, const string& Extension); + // Returns the directory path of a file path + static string GetDirectoryName(const string& Path); + // Returns the extension of the given path + static string GetExtension(const string& FilePath); + // Returns the name and extension parts of the given path + static string GetFileName(const string& FilePath); + // Returns the name without the extension of the given path + static string GetFileNameWithoutExtension(const string& FilePath); + // Returns the root portion of the given path + static string GetPathRoot(const string& Path); + // Returns a temporary folder path + static string GetTempPath(); + // Returns a temporary file name + static string GetTempFileName(); + // Checks if the file name has an extension + static bool HasExtension(const string& FilePath); + // Checks if the given path contains a root + static bool IsPathRooted(const string& Path); + // Combine two paths + static string Combine(const string& Path1, const string& Path2); + + // Returns a list of all the bad path characters + constexpr static std::array GetInvalidPathChars() + { + constexpr std::array Buffer = + { + '\"', '<', '>', '|', '\0', + (char)1, (char)2, (char)3, (char)4, (char)5, (char)6, (char)7, (char)8, (char)9, (char)10, + (char)11, (char)12, (char)13, (char)14, (char)15, (char)16, (char)17, (char)18, (char)19, (char)20, + (char)21, (char)22, (char)23, (char)24, (char)25, (char)26, (char)27, (char)28, (char)29, (char)30, + (char)31 + }; + + return Buffer; + } + + // Returns a list of all the bad file name characters + constexpr static std::array GetInvalidFileNameChars() + { + constexpr std::array Buffer = + { + '\"', '<', '>', '|', '\0', + (char)1, (char)2, (char)3, (char)4, (char)5, (char)6, (char)7, (char)8, (char)9, (char)10, + (char)11, (char)12, (char)13, (char)14, (char)15, (char)16, (char)17, (char)18, (char)19, (char)20, + (char)21, (char)22, (char)23, (char)24, (char)25, (char)26, (char)27, (char)28, (char)29, (char)30, + (char)31, ':', '*', '?', '\\', '/' + }; + + return Buffer; + } + + private: + + // + // Internal helper routines + // + + static uint32_t GetRootLength(const string& Path); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Pattern.cpp b/r5dev/thirdparty/cppnet/cppkore/Pattern.cpp new file mode 100644 index 00000000..2c780e62 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Pattern.cpp @@ -0,0 +1,152 @@ +#include "stdafx.h" +#include "Pattern.h" + +namespace Data +{ + int64_t Pattern::Search(uint8_t* Buffer, uint64_t Offset, uint64_t Size) + { + bool UseSSE = false; + int CPUIdentifier[4], DataSize = (int)this->_PatternLength; + + // SSE 4.2 support check + __cpuid(CPUIdentifier, 0); + if (DataSize <= 16) + { + if (CPUIdentifier[0] >= 1) + { + __cpuidex(CPUIdentifier, 1, 0); + UseSSE = ((CPUIdentifier[2] & (1 << 20)) > 0); + } + } + + if (!UseSSE) + { + auto bFirst = std::memchr(Buffer, this->_Data[0], Size); + if (bFirst == nullptr) + return -1; + + while (bFirst) + { + bool MatchFound = true; + + for (size_t c = 0; c < DataSize; c++) + { + if (this->_Mask[c] == '?') + continue; + + if ((uint8_t)this->_Data[c] != ((uint8_t*)bFirst)[c]) + { + MatchFound = false; + break; + } + } + + if (MatchFound) + { + return (int64_t)((uint8_t*)bFirst - Buffer); + } + + bFirst = std::memchr((uint8_t*)bFirst + 1, this->_Data[0], Size - ((uint8_t*)bFirst - Buffer)); + } + } + else + { + __declspec(align(16)) char DesiredMask[16] = { 0 }; + + for (size_t i = 0; i < DataSize; i++) + DesiredMask[i / 8] |= ((this->_Mask[i] == '?') ? 0 : 1) << (i % 8); + + __m128i Mask = _mm_load_si128(reinterpret_cast(DesiredMask)); + __m128i Comparand = _mm_loadu_si128(reinterpret_cast(this->_Data)); + + for (uint64_t i = Offset; i <= (Offset + Size); i++) + { + __m128i Value = _mm_loadu_si128(reinterpret_cast(Buffer + i)); + __m128i Result = _mm_cmpestrm(Value, 16, Comparand, DataSize, _SIDD_CMP_EQUAL_EACH); + + __m128i Matches = _mm_and_si128(Mask, Result); + __m128i Equivalence = _mm_xor_si128(Mask, Matches); + + if (_mm_test_all_zeros(Equivalence, Equivalence)) + return (int64_t)(i - Offset); + } + } + + // We failed to find the pattern... + return -1; + } + + List Pattern::SearchAll(uint8_t* Buffer, uint64_t Offset, uint64_t Size) + { + auto ResultList = List(); + + bool UseSSE = false; + int CPUIdentifier[4], DataSize = (int)this->_PatternLength; + + // SSE 4.2 support check + __cpuid(CPUIdentifier, 0); + if (DataSize <= 16) + { + if (CPUIdentifier[0] >= 1) + { + __cpuidex(CPUIdentifier, 1, 0); + UseSSE = ((CPUIdentifier[2] & (1 << 20)) > 0); + } + } + + if (!UseSSE) + { + auto bFirst = std::memchr(Buffer, this->_Data[0], Size); + if (bFirst == nullptr) + return -1; + + while (bFirst) + { + bool MatchFound = true; + + for (size_t c = 0; c < DataSize; c++) + { + if (this->_Mask[c] == '?') + continue; + + if ((uint8_t)this->_Data[c] != ((uint8_t*)bFirst)[c]) + { + MatchFound = false; + break; + } + } + + if (MatchFound) + { + ResultList.EmplaceBack(((uint8_t*)bFirst - Buffer)); + } + + bFirst = std::memchr((uint8_t*)bFirst + 1, this->_Data[0], Size - ((uint8_t*)bFirst - Buffer)); + } + } + else + { + __declspec(align(16)) char DesiredMask[16] = { 0 }; + + for (size_t i = 0; i < DataSize; i++) + DesiredMask[i / 8] |= ((this->_Mask[i] == '?') ? 0 : 1) << (i % 8); + + __m128i Mask = _mm_load_si128(reinterpret_cast(DesiredMask)); + __m128i Comparand = _mm_loadu_si128(reinterpret_cast(this->_Data)); + + for (uint64_t i = Offset; i <= (Offset + Size); i++) + { + __m128i Value = _mm_loadu_si128(reinterpret_cast(Buffer + i)); + __m128i Result = _mm_cmpestrm(Value, 16, Comparand, DataSize, _SIDD_CMP_EQUAL_EACH); + + __m128i Matches = _mm_and_si128(Mask, Result); + __m128i Equivalence = _mm_xor_si128(Mask, Matches); + + if (_mm_test_all_zeros(Equivalence, Equivalence)) + ResultList.EmplaceBack((int64_t)(i - Offset)); + } + } + + return ResultList; + } +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Pattern.h b/r5dev/thirdparty/cppnet/cppkore/Pattern.h new file mode 100644 index 00000000..26e29314 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Pattern.h @@ -0,0 +1,81 @@ +#pragma once + +#include "ListBase.h" +#include "StringBase.h" +#include "SecureString.h" + +namespace Data +{ + // Pattern handles signature matching in data buffers + class Pattern + { + public: + constexpr Pattern(const string& Signature) + : _PatternLength(0) + { + // Process the signature into a data / mask combo for later scanning + uint8_t DigitBuffer = 0; + bool LowerBound = false, LastWasUnknown = false; + + for (auto& Ch : Signature) + { + if (Ch == ' ') + { + LastWasUnknown = false; + continue; + } + else if (Ch == '?') + { + if (LastWasUnknown) + LastWasUnknown = false; + else + { + _Data[_PatternLength] = '\x00'; + _Mask[_PatternLength++] = '?'; + LastWasUnknown = true; + } + } + else if ((Ch >= '0' && Ch <= '9') || (Ch >= 'A' && Ch <= 'F') || (Ch >= 'a' && Ch <= 'f')) + { + int ThisDigit = (Ch >= 'A') ? (Ch >= 'a') ? (Ch - 'a' + 10) : (Ch - 'A' + 10) : (Ch - '0'); + + if (!LowerBound) + { + DigitBuffer = (ThisDigit << 4); + LowerBound = true; + } + else + { + DigitBuffer |= ThisDigit; + LowerBound = false; + + _Data[_PatternLength] = DigitBuffer; + _Mask[_PatternLength++] = 'x'; + } + } + } + } + + // Gets the size of the current data + constexpr size_t DataSize() const + { + return _PatternLength; + } + + // Gets the size of the current mask + constexpr size_t MaskSize() const + { + return _PatternLength; + } + + // Search for the pattern in the given buffer + int64_t Search(uint8_t* Buffer, uint64_t Offset, uint64_t Size); + // Search for all occurences of the pattern in the given buffer + List SearchAll(uint8_t* Buffer, uint64_t Offset, uint64_t Size); + + private: + char _Data[64]{}; + char _Mask[64]{}; + uint16_t _PatternLength; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/PopupEventArgs.cpp b/r5dev/thirdparty/cppnet/cppkore/PopupEventArgs.cpp new file mode 100644 index 00000000..fc11e0dd --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/PopupEventArgs.cpp @@ -0,0 +1,10 @@ +#include "stdafx.h" +#include "PopupEventArgs.h" + +namespace Forms +{ + PopupEventArgs::PopupEventArgs(Control* Window, Control* Ctrl, bool IsBalloon, Drawing::Size Size) + : CancelEventArgs(), AssociatedWindow(Window), AssociatedControl(Ctrl), IsBalloon(IsBalloon), ToolTipSize(Size) + { + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/PopupEventArgs.h b/r5dev/thirdparty/cppnet/cppkore/PopupEventArgs.h new file mode 100644 index 00000000..9d05b4b5 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/PopupEventArgs.h @@ -0,0 +1,28 @@ +#pragma once + +#include +#include "Control.h" +#include "DrawingBase.h" +#include "CancelEventArgs.h" + +namespace Forms +{ + // Provides data for the on popup event. + class PopupEventArgs : public CancelEventArgs + { + public: + PopupEventArgs(Control* Window, Control* Ctrl, bool IsBalloon, Drawing::Size Size); + ~PopupEventArgs() = default; + + // The Associated Window for which the tooltip is being painted. + Control* AssociatedWindow; + // The control for which the tooltip is being painted. + Control* AssociatedControl; + + // Whether the tooltip is Ballooned. + bool IsBalloon; + + // The rectangle outlining the area in which the painting should be done. + Drawing::Size ToolTipSize; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Process.cpp b/r5dev/thirdparty/cppnet/cppkore/Process.cpp new file mode 100644 index 00000000..453b0a36 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Process.cpp @@ -0,0 +1,854 @@ +#include "stdafx.h" +#include "Process.h" +#include "Path.h" +#include "Environment.h" +#include "Directory.h" +#include +#include + +// +// Internal routine for getting system information +// + +typedef LONG (NTAPI *NtSuspendProcess)(HANDLE); +typedef LONG (NTAPI *NtResumeProcess)(HANDLE); + +typedef struct _THREAD_BASIC_INFORMATION +{ + + NTSTATUS ExitStatus; + PVOID TebBaseAddress; + CLIENT_ID ClientId; + KAFFINITY AffinityMask; + KPRIORITY Priority; + KPRIORITY BasePriority; +} THREAD_BASIC_INFORMATION, *PTHREAD_BASIC_INFORMATION; + +#pragma comment(lib, "ntdll.lib") + +namespace Diagnostics +{ + Process::Process() + : _Handle(nullptr), _HasLoaded(false), _Access(PROCESS_ALL_ACCESS), _ProcessInfo() + { + } + + Process::Process(ProcessInfo Pi) + : _Handle(nullptr), _HasLoaded(true), _Access(PROCESS_ALL_ACCESS) + { + this->_ProcessInfo = Pi; + } + + Process::~Process() + { + this->Close(); + } + + Process::Process(const Process& Rhs) + : _Handle(nullptr), _HasLoaded(false), _Access(PROCESS_ALL_ACCESS) + { + this->_HasLoaded = Rhs._HasLoaded; + this->_ProcessInfo = Rhs._ProcessInfo; + } + + Process::Process(Process&& Rhs) + { + this->_Handle = Rhs._Handle; + this->_HasLoaded = Rhs._HasLoaded; + this->_Access = Rhs._Access; + this->_ProcessInfo = Rhs._ProcessInfo; + + Rhs._Handle = nullptr; + Rhs._Access = PROCESS_ALL_ACCESS; + Rhs._HasLoaded = false; + Rhs._ProcessInfo = {}; + } + + void Process::Close() + { + if (this->_Handle) + CloseHandle(this->_Handle); + + this->_Handle = nullptr; + } + + void Process::CloseMainWindow() + { + auto mWindow = this->GetProcessMainWindowHandle(); + if (!mWindow) + return; + + PostMessageA(mWindow, WM_CLOSE, NULL, NULL); + } + + bool Process::IsAlive() + { + if (!this->AquireProcessHandle()) + return false; + + return (WaitForSingleObject(this->_Handle, 0) == WAIT_TIMEOUT); + } + + void Process::Kill() + { + if (!this->AquireProcessHandle()) + return; + + TerminateProcess(this->_Handle, -1); + } + + void Process::Suspend() + { + if (!this->AquireProcessHandle()) + return; + + auto pSuspend = (NtSuspendProcess)GetProcAddress(GetModuleHandleA("ntdll.dll"), "NtSuspendProcess"); + + pSuspend(this->_Handle); + } + + void Process::Resume() + { + if (!this->AquireProcessHandle()) + return; + + auto pResume = (NtResumeProcess)GetProcAddress(GetModuleHandleA("ntdll.dll"), "NtResumeProcess"); + + pResume(this->_Handle); + } + + void Process::WaitForExit() + { + if (!this->AquireProcessHandle()) + return; + + WaitForSingleObject(this->_Handle, INFINITE); + } + + void Process::WaitForInputIdle() + { + if (!this->AquireProcessHandle()) + return; + + ::WaitForInputIdle(this->_Handle, INFINITE); + } + + bool Process::InjectModule(const string& ModulePath) + { + if (!this->AquireProcessHandle()) + return false; + + BOOL Is32BitProcess = false; + if (!IsWow64Process(this->_Handle, &Is32BitProcess)) + return false; + + auto PathBuffer = VirtualAllocEx(this->_Handle, NULL, (SIZE_T)(ModulePath.Length() + 1), MEM_COMMIT, PAGE_EXECUTE_READWRITE); + if (PathBuffer == NULL) + return false; + + auto WriteResult = WriteProcessMemory(this->_Handle, PathBuffer, (const char*)ModulePath, (SIZE_T)(ModulePath.Length() + 1), NULL); + if (WriteResult == FALSE) + return false; + + auto LoadLibraryProc = this->ResolveInjectionAddress(Is32BitProcess); + if (LoadLibraryProc == nullptr) + return false; + + DWORD ThreadID = 0; + auto ThreadHandle = CreateRemoteThread(this->_Handle, NULL, 0, LoadLibraryProc, PathBuffer, 0, &ThreadID); + if (ThreadHandle == NULL) + return false; + + WaitForSingleObject(ThreadHandle, INFINITE); + return true; + } + + const string& Process::GetProcessName() const + { + return this->_ProcessInfo.ProcessName; + } + + const uint32_t Process::GetBasePriority() const + { + return this->_ProcessInfo.BasePriority; + } + + const uint32_t Process::GetId() const + { + return this->_ProcessInfo.ProcessId; + } + + const uint32_t Process::GetHandleCount() const + { + return this->_ProcessInfo.HandleCount; + } + + const uint64_t Process::GetPagedSystemMemorySize() const + { + return this->_ProcessInfo.PoolPagedBytes; + } + + const uint64_t Process::GetNonPagedSystemMemorySize() const + { + return this->_ProcessInfo.PoolNonPagedBytes; + } + + const uint64_t Process::GetVirtualMemorySize() const + { + return this->_ProcessInfo.VirtualBytes; + } + + const uint64_t Process::GetPeakVirtualMemorySize() const + { + return this->_ProcessInfo.VirtualBytesPeak; + } + + const uint64_t Process::GetWorkingSet() const + { + return this->_ProcessInfo.WorkingSet; + } + + const uint64_t Process::GetPeakWorkingSet() const + { + return this->_ProcessInfo.WorkingSetPeak; + } + + const uint64_t Process::GetPagedMemorySize() const + { + return this->_ProcessInfo.PageFileBytes; + } + + const uint64_t Process::GetPeakPagedMemorySize() const + { + return this->_ProcessInfo.PageFileBytesPeak; + } + + const uint64_t Process::GetPrivateMemorySize() const + { + return this->_ProcessInfo.PrivateBytes; + } + + const uint32_t Process::GetSessionId() const + { + return this->_ProcessInfo.SessionId; + } + + const HANDLE Process::GetHandle() + { + if (!this->AquireProcessHandle()) + return nullptr; + + return this->_Handle; + } + + const HWND Process::GetMainWindowHandle() + { + return this->GetProcessMainWindowHandle(); + } + + const string Process::GetMainWindowTitle() + { + auto mHandle = this->GetProcessMainWindowHandle(); + if (!mHandle) + return ""; + + char Buffer[MAX_PATH + 1]{}; + auto mResult = GetWindowTextA(mHandle, Buffer, MAX_PATH); + + return string(Buffer, mResult); + } + + const uint32_t Process::GetExitCode() + { + if (!this->AquireProcessHandle()) + return -1; + + DWORD eCode = -1; + GetExitCodeProcess(this->_Handle, &eCode); + + return eCode; + } + + const List Process::GetProcessModules() + { + auto Result = List(); + + if (!this->AquireProcessHandle()) + return Result; + + HMODULE ModHandles[1024]; + DWORD ResultRead; + + if (!EnumProcessModulesEx(this->_Handle, ModHandles, sizeof(ModHandles), &ResultRead, LIST_MODULES_ALL)) + return Result; + + for (uint32_t i = 0; i < (ResultRead / sizeof(HMODULE)); i++) + { + auto ModuleInfo = ProcessModule(); + + MODULEINFO ModInfo{}; + GetModuleInformation(this->_Handle, ModHandles[i], &ModInfo, sizeof(ModInfo)); + + ModuleInfo.ModuleMemorySize = ModInfo.SizeOfImage; + ModuleInfo.EntryPointAddress = (uint64_t)ModInfo.EntryPoint; + ModuleInfo.BaseAddress = (uint64_t)ModInfo.lpBaseOfDll; + + char Buffer[1024]{}; + GetModuleBaseNameA(this->_Handle, ModHandles[i], Buffer, 1024); + ModuleInfo.ModuleName = string(Buffer); + + std::memset(Buffer, 0, 1024); + GetModuleFileNameExA(this->_Handle, ModHandles[i], Buffer, 1024); + ModuleInfo.FileName = string(Buffer); + + Result.EmplaceBack(std::move(ModuleInfo)); + } + + return Result; + } + + const List Process::GetProcessThreads() + { + auto Result = List(); + + if (!this->AquireProcessHandle()) + return Result; + + auto hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, 0); + if (hSnapshot == INVALID_HANDLE_VALUE) + return Result; + + THREADENTRY32 TInfo{}; + TInfo.dwSize = sizeof(THREADENTRY32); + + if (!Thread32First(hSnapshot, &TInfo)) + { + CloseHandle(hSnapshot); + return Result; + } + + do + { + if (TInfo.th32OwnerProcessID == this->_ProcessInfo.ProcessId) + { + auto ThreadInfo = ProcessThread(); + + ThreadInfo.Id = TInfo.th32ThreadID; + ThreadInfo.BasePriority = TInfo.tpBasePri; + + auto hThread = OpenThread(THREAD_QUERY_INFORMATION, FALSE, TInfo.th32ThreadID); + if (hThread == NULL) + continue; + + THREAD_BASIC_INFORMATION ExThreadInfo{}; + uint64_t ExThreadStart = 0; + NtQueryInformationThread(hThread, (THREADINFOCLASS)0x0, &ExThreadInfo, sizeof(ExThreadInfo), NULL); + NtQueryInformationThread(hThread, (THREADINFOCLASS)0x9, &ExThreadStart, sizeof(uint64_t), NULL); + + ThreadInfo.CurrentPriority = ExThreadInfo.Priority; + ThreadInfo.StartAddress = ExThreadStart; + + CloseHandle(hThread); + Result.EmplaceBack(std::move(ThreadInfo)); + } + + } while (Thread32Next(hSnapshot, &TInfo)); + + CloseHandle(hSnapshot); + return Result; + } + + Process Process::GetProcessById(uint32_t Pid) + { + uint32_t OurId[1] = { Pid }; + auto ProcessInfo = Process::GetProcessInfos({ OurId }); + if (ProcessInfo.Count() == 0) + return Process(); + + return Process(ProcessInfo[0]); + } + + List Process::GetProcessesByName(const string& Name) + { + auto ProcessInfos = Process::GetProcessInfos({}); + auto Result = List(); + + auto NameCompare = Name.ToLower(); + + // Iterate and filter + for (uint32_t i = 0; i < ProcessInfos.Count(); i++) + { + if (ProcessInfos[i].ProcessName.ToLower() == NameCompare) + Result.EmplaceBack(ProcessInfos[i]); + } + + return Result; + } + + List Process::GetProcesses() + { + auto ProcessInfos = Process::GetProcessInfos({}); + auto Result = List(ProcessInfos.Count()); + + // Iterate and setup + for (uint32_t i = 0; i < ProcessInfos.Count(); i++) + Result.EmplaceBack(ProcessInfos[i]); + + return Result; + } + + Process Process::GetCurrentProcess() + { + uint32_t OurId[1] = { ::GetCurrentProcessId() }; + + return Process(Process::GetProcessInfos({ OurId })[0]); + } + + Process Process::Start(const string& FileName) + { + return Process::Start(ProcessStartInfo(FileName)); + } + + Process Process::Start(const string& FileName, const string& Arguments) + { + return Process::Start(ProcessStartInfo(FileName, Arguments)); + } + + Process Process::Start(const ProcessStartInfo& Start) + { + // Create it depending on launch type + if (Start.UseShellExecute) + { + SHELLEXECUTEINFOA StartInfo{}; + StartInfo.fMask = SEE_MASK_NOCLOSEPROCESS; + StartInfo.cbSize = sizeof(StartInfo); + + switch (Start.WindowStyle) + { + case ProcessWindowStyle::Hidden: + StartInfo.nShow = SW_HIDE; + break; + case ProcessWindowStyle::Minimized: + StartInfo.nShow = SW_SHOWMINIMIZED; + break; + case ProcessWindowStyle::Maximized: + StartInfo.nShow = SW_SHOWMAXIMIZED; + break; + default: + StartInfo.nShow = SW_SHOWNORMAL; + break; + } + + if (Start.FileName.Length() != 0) + StartInfo.lpFile = (char*)Start.FileName; + if (Start.Verb.Length() != 0) + StartInfo.lpVerb = (char*)Start.Verb; + if (Start.Arguments.Length() != 0) + StartInfo.lpParameters = (char*)Start.Arguments; + if (Start.WorkingDirectory.Length() != 0) + StartInfo.lpDirectory = (char*)Start.WorkingDirectory; + + StartInfo.fMask |= SEE_MASK_FLAG_DDEWAIT; + + if (!ShellExecuteExA(&StartInfo)) + return Process(); + + return GetProcessById(GetProcessId(StartInfo.hProcess)); + } + else + { + STARTUPINFOA StartInfo{}; + PROCESS_INFORMATION ProcessInfo{}; + + string CommandLine; + if (Start.FileName.StartsWith("\"") && Start.FileName.EndsWith("\"")) + CommandLine += Start.FileName; + else + CommandLine = "\"" + Start.FileName + "\""; + + if (!string::IsNullOrWhiteSpace(Start.Arguments)) + { + CommandLine += " " + Start.Arguments; + } + + DWORD CreationFlags = 0; + if (Start.CreateNoWindow) + CreationFlags |= CREATE_NO_WINDOW; + + auto WorkingDirectory = (Start.WorkingDirectory.Length() == 0) ? IO::Directory::GetCurrentDirectory() : Start.WorkingDirectory; + + if (!CreateProcessA(NULL, (char*)CommandLine, NULL, NULL, TRUE, CreationFlags, NULL, (const char*)WorkingDirectory, &StartInfo, &ProcessInfo)) + return Process(); + + return GetProcessById(ProcessInfo.dwProcessId); + } + } + + void Process::EnterDebugMode() + { + Process::SetPrivilage("SeDebugPrivilege", true); + } + + void Process::LeaveDebugMode() + { + Process::SetPrivilage("SeDebugPrivilege", false); + } + + Process& Process::operator=(const Process& Rhs) + { + this->_Access = Rhs._Access; + this->_HasLoaded = Rhs._HasLoaded; + this->_ProcessInfo = Rhs._ProcessInfo; + this->_Handle = nullptr; + + return *this; + } + + bool Process::operator==(const nullptr_t Rhs) const + { + if (this->_Handle == nullptr && this->_HasLoaded == false && this->_ProcessInfo.ProcessId == 0) + return true; + + return false; + } + + bool Process::operator!=(const nullptr_t Rhs) const + { + return !(*this == Rhs); + } + + void Process::SetPrivilage(const string& PrivilegeName, bool Enabled) + { + HANDLE hToken = nullptr; + if (!OpenProcessToken(::GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken)) + { + if (GetLastError() == ERROR_NO_TOKEN) + { + if (!ImpersonateSelf(SECURITY_IMPERSONATION_LEVEL::SecurityImpersonation)) + return; + if (!OpenProcessToken(::GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken)) + return; + } + else + { + return; + } + } + + TOKEN_PRIVILEGES tp; + LUID luid; + TOKEN_PRIVILEGES tpPrevious; + DWORD cbPrevious = sizeof(TOKEN_PRIVILEGES); + + if (!LookupPrivilegeValueA(NULL, (const char*)PrivilegeName, &luid)) + return; + + tp.PrivilegeCount = 1; + tp.Privileges[0].Luid = luid; + tp.Privileges[0].Attributes = 0; + + AdjustTokenPrivileges(hToken, FALSE, &tp, sizeof(TOKEN_PRIVILEGES), &tpPrevious, &cbPrevious); + + if (GetLastError() != ERROR_SUCCESS) + return; + + tpPrevious.PrivilegeCount = 1; + tpPrevious.Privileges[0].Luid = luid; + + if (Enabled) + tpPrevious.Privileges[0].Attributes |= (SE_PRIVILEGE_ENABLED); + else + tpPrevious.Privileges[0].Attributes ^= (SE_PRIVILEGE_ENABLED & tpPrevious.Privileges[0].Attributes); + + AdjustTokenPrivileges(hToken, FALSE, &tpPrevious, cbPrevious, NULL, NULL); + } + + List Process::GetProcessInfos(const List& ProcessIdMatch) + { + auto Result = List(68); + + ULONG Required = 0; NTSTATUS Status = 0; + std::unique_ptr ProcessInfoBuffer = nullptr; + + do + { + Status = NtQuerySystemInformation(SYSTEM_INFORMATION_CLASS::SystemProcessInformation, (PVOID)ProcessInfoBuffer.get(), Required, &Required); + + if (Status == Process::StatusInfoLengthMismatch) + ProcessInfoBuffer.reset(new uint8_t[Required]); + + } while (Status == Process::StatusInfoLengthMismatch); + + uint64_t CurrentOffset = 0; + + while (true) + { + auto NProcessInfo = (SYSTEM_PROCESS_INFORMATION*)(ProcessInfoBuffer.get() + CurrentOffset); + auto NProcessId = (uint32_t)(uint64_t)NProcessInfo->UniqueProcessId; + + ProcessInfo Pi; + + Pi.ProcessId = NProcessId; + Pi.HandleCount = (uint32_t)NProcessInfo->HandleCount; + Pi.SessionId = (uint32_t)NProcessInfo->SessionId; + Pi.PoolPagedBytes = (uint64_t)NProcessInfo->QuotaPagedPoolUsage;; + Pi.PoolNonPagedBytes = (uint64_t)NProcessInfo->QuotaNonPagedPoolUsage; + Pi.VirtualBytes = (uint64_t)NProcessInfo->VirtualSize; + Pi.VirtualBytesPeak = (uint64_t)NProcessInfo->PeakVirtualSize; + Pi.WorkingSetPeak = (uint64_t)NProcessInfo->PeakWorkingSetSize; + Pi.WorkingSet = (uint64_t)NProcessInfo->WorkingSetSize; + Pi.PageFileBytesPeak = (uint64_t)NProcessInfo->PeakPagefileUsage; + Pi.PageFileBytes = (uint64_t)NProcessInfo->PagefileUsage; + Pi.PrivateBytes = (uint64_t)NProcessInfo->PrivatePageCount; + Pi.BasePriority = (uint32_t)NProcessInfo->BasePriority; + + if (NProcessInfo->ImageName.Buffer == NULL) + { + if (NProcessId == 0x4) + { + Pi.ProcessName = "System"; + } + else if (NProcessId == 0x0) + { + Pi.ProcessName = "Idle"; + } + else + { + Pi.ProcessName = string::Format("Process_%d", NProcessId); + } + } + else + { + Pi.ProcessName = Process::GetProcessShortName(wstring(NProcessInfo->ImageName.Buffer, NProcessInfo->ImageName.Length / sizeof(WCHAR)).ToString()); + } + + if (!ProcessIdMatch.Empty() && ProcessIdMatch.Contains(NProcessId)) + Result.EmplaceBack(std::move(Pi)); + else if (ProcessIdMatch.Empty()) + Result.EmplaceBack(std::move(Pi)); + + if (NProcessInfo->NextEntryOffset == 0) + break; + + CurrentOffset += NProcessInfo->NextEntryOffset; + } + + return Result; + } + + string Process::GetProcessShortName(const string& Name) + { + int32_t Slash = -1, Period = -1; + + for (uint32_t i = 0; i < Name.Length(); i++) + { + if (Name[i] == '\\') + Slash = i; + else if (Name[i] == '.') + Period = i; + } + + if (Period == -1) + Period = Name.Length() - 1; + else + { + auto Ext = Name.Substring(Period); + if (Ext.ToLower() == ".exe") + Period--; + else + Period = Name.Length() - 1; + } + + if (Slash == -1) + Slash = 0; + else + Slash++; + + return Name.Substring(Slash, Period - Slash + 1); + } + + LPTHREAD_START_ROUTINE Process::ResolveInjectionAddress(BOOL Is32BitProcess) + { + if (!Is32BitProcess && sizeof(uintptr_t) == 8) + return (LPTHREAD_START_ROUTINE)GetProcAddress(GetModuleHandleA("kernel32.dll"), "LoadLibraryA"); + else if (Is32BitProcess && sizeof(uintptr_t) == 4) + return (LPTHREAD_START_ROUTINE)GetProcAddress(GetModuleHandleA("kernel32.dll"), "LoadLibraryA"); + + // + // Get the base address of kernel32.dll + // + + HMODULE ModHandles[1024]; + DWORD ResultRead; + + if (!EnumProcessModulesEx(this->_Handle, ModHandles, sizeof(ModHandles), &ResultRead, LIST_MODULES_32BIT)) + return nullptr; + + HMODULE Kernel32Wow = nullptr; + for (uint32_t i = 0; i < (ResultRead / sizeof(HMODULE)); i++) + { + char ModNameTemp[MAX_PATH]; + if (GetModuleFileNameExA(this->_Handle, ModHandles[i], ModNameTemp, sizeof(ModNameTemp))) + { + auto NameLen = strlen(ModNameTemp); + auto K32Len = strlen("kernel32.dll"); + + if (NameLen >= K32Len && _stricmp(ModNameTemp + (NameLen - K32Len), "kernel32.dll") == 0) + { + Kernel32Wow = ModHandles[i]; + break; + } + } + } + + if (Kernel32Wow == nullptr) + return nullptr; + + // + // We have the base address, now, parse the module for the export + // + + auto ModulePath = IO::Path::Combine(System::Environment::GetFolderPath(System::SpecialFolder::SystemX86), "kernel32.dll"); + + HANDLE ExeHandle = CreateFileA((const char*)ModulePath, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + if (ExeHandle == INVALID_HANDLE_VALUE) + return nullptr; + + HANDLE ExeMapping = CreateFileMappingA(ExeHandle, NULL, PAGE_READONLY, 0, 0, NULL); + if (ExeMapping == NULL) + { + CloseHandle(ExeHandle); + return nullptr; + } + + LPVOID ExeBuffer = MapViewOfFile(ExeMapping, FILE_MAP_READ, 0, 0, 0); + if (ExeBuffer == NULL) + { + CloseHandle(ExeMapping); + CloseHandle(ExeHandle); + return nullptr; + } + + PIMAGE_DOS_HEADER DosHeader = (PIMAGE_DOS_HEADER)ExeBuffer; + PIMAGE_NT_HEADERS32 NTHeader = (PIMAGE_NT_HEADERS32)((uintptr_t)ExeBuffer + (uintptr_t)DosHeader->e_lfanew); + PIMAGE_SECTION_HEADER FirstSectionHeader = (PIMAGE_SECTION_HEADER)((PBYTE)&NTHeader->OptionalHeader + NTHeader->FileHeader.SizeOfOptionalHeader); + PIMAGE_EXPORT_DIRECTORY ExportDirectory = nullptr; + PULONG Functions = nullptr, Names = nullptr; + PUSHORT Ordinals = nullptr; + + uint32_t SectionIndex = 0; + + for (SectionIndex = 0; SectionIndex < NTHeader->FileHeader.NumberOfSections; SectionIndex++) + { + if (FirstSectionHeader[SectionIndex].VirtualAddress <= NTHeader->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress + && NTHeader->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress < (FirstSectionHeader[SectionIndex].VirtualAddress + FirstSectionHeader[SectionIndex].Misc.VirtualSize)) + { + ExportDirectory = (PIMAGE_EXPORT_DIRECTORY)((PBYTE)ExeBuffer + FirstSectionHeader[SectionIndex].PointerToRawData + + NTHeader->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress - FirstSectionHeader[SectionIndex].VirtualAddress); + + // Resolve each segment (Fn, Name, Ordinal) from the directory + Functions = (PULONG)((PBYTE)ExeBuffer + FirstSectionHeader[SectionIndex].PointerToRawData + + ExportDirectory->AddressOfFunctions - FirstSectionHeader[SectionIndex].VirtualAddress); + Names = (PULONG)((PBYTE)ExeBuffer + FirstSectionHeader[SectionIndex].PointerToRawData + + ExportDirectory->AddressOfNames - FirstSectionHeader[SectionIndex].VirtualAddress); + Ordinals = (PUSHORT)((PBYTE)ExeBuffer + FirstSectionHeader[SectionIndex].PointerToRawData + + ExportDirectory->AddressOfNameOrdinals - FirstSectionHeader[SectionIndex].VirtualAddress); + + break; + } + } + + if (ExportDirectory == nullptr) + { + UnmapViewOfFile(ExeBuffer); + CloseHandle(ExeMapping); + CloseHandle(ExeHandle); + + return nullptr; + } + + LPTHREAD_START_ROUTINE ResultAddress = nullptr; + + for (uint32_t ordinal = 0; (ordinal < ExportDirectory->NumberOfFunctions) && (ResultAddress == nullptr); ordinal++) + { + for (uint32_t i = 0; i < ExportDirectory->NumberOfNames; i++) + { + if (ordinal == Ordinals[i]) + { + auto FunctionName = (char*)((PBYTE)ExeBuffer + FirstSectionHeader[SectionIndex].PointerToRawData + + Names[i] - FirstSectionHeader[SectionIndex].VirtualAddress); + + if (_strnicmp(FunctionName, "LoadLibraryA", strlen("LoadLibraryA")) == 0) + { + ResultAddress = (LPTHREAD_START_ROUTINE)((uintptr_t)Kernel32Wow + Functions[Ordinals[i]]); + break; + } + } + } + } + + UnmapViewOfFile(ExeBuffer); + CloseHandle(ExeMapping); + CloseHandle(ExeHandle); + + return ResultAddress; + } + + HWND Process::GetProcessMainWindowHandle() + { + if (!this->_HasLoaded) + return nullptr; + + struct params + { + HWND hWnd; + DWORD pId; + } Params; + + Params.hWnd = nullptr; + Params.pId = this->_ProcessInfo.ProcessId; + + auto eResult = EnumWindows([](HWND hWnd, LPARAM lParam) -> BOOL + { + auto pParams = (params*)(lParam); + + DWORD ProcessId; + if (GetWindowThreadProcessId(hWnd, &ProcessId) && ProcessId == pParams->pId) + { + pParams->hWnd = hWnd; + return FALSE; + } + + return TRUE; + + }, (LPARAM)&Params); + + return Params.hWnd; + } + + bool Process::AquireProcessHandle() + { + if (!this->_HasLoaded) + return false; + if (this->_Handle != nullptr) + return true; + + // Default to all access if we can get it, required for injection + this->_Access = PROCESS_ALL_ACCESS; + + auto Handle = OpenProcess(this->_Access, FALSE, this->_ProcessInfo.ProcessId); + if (Handle == NULL) + { + this->_Access = (PROCESS_QUERY_INFORMATION | SYNCHRONIZE | PROCESS_VM_READ | PROCESS_TERMINATE); + Handle = OpenProcess(this->_Access, FALSE, this->_ProcessInfo.ProcessId); + } + + // TODO: insert error handling / exceptions when the process no longer exists... + + if (Handle == NULL) + return false; + + this->_Handle = Handle; + return true; + } +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Process.h b/r5dev/thirdparty/cppnet/cppkore/Process.h new file mode 100644 index 00000000..a32afea8 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Process.h @@ -0,0 +1,151 @@ +#pragma once + +#include +#include +#include "StringBase.h" +#include "ProcessInfo.h" +#include "ProcessModule.h" +#include "ProcessThread.h" +#include "ProcessStartInfo.h" + +namespace Diagnostics +{ + class Process + { + public: + Process(); + Process(ProcessInfo Pi); + ~Process(); + + Process(const Process& Rhs); + Process(Process&& Rhs); + + // Frees any resources associated with this process + void Close(); + // Closes a process that has a user interface by sending a close message + // to its main window + void CloseMainWindow(); + // Returns whether or not the process is valid and running + bool IsAlive(); + // Stops the associated process immediately + void Kill(); + // Suspends the process + void Suspend(); + // Resumes the process + void Resume(); + // Waits for the process to exit + void WaitForExit(); + // Waits for the process to enter an idle state + void WaitForInputIdle(); + // Injects a module into the given process + bool InjectModule(const string& ModulePath); + + // + // Getters + // + + // Returns the name of the process + const string& GetProcessName() const; + // Returns the process base priority + const uint32_t GetBasePriority() const; + // Returns the process id + const uint32_t GetId() const; + // Returns the process handle count + const uint32_t GetHandleCount() const; + // Returns the amount of memory that the system has allocated for the process + // that can be written to the virtual memory paging file + const uint64_t GetPagedSystemMemorySize() const; + // Returns the amount of memory that the system has allocated for the process + // that can not be written to the virtual memory paging file + const uint64_t GetNonPagedSystemMemorySize() const; + // Returns the amount of virtual memory that the process + // has requested + const uint64_t GetVirtualMemorySize() const; + // Returns the maximum amount of virtual memory that the process + // has requested + const uint64_t GetPeakVirtualMemorySize() const; + // Returns the amount of physical memory that the process + // has requested + const uint64_t GetWorkingSet() const; + // Returns the maximum amount of physical memory that the process + // has requested + const uint64_t GetPeakWorkingSet() const; + // Returns the amount of memory that the process has allocated + // that can be written to the virtual memory paging file + const uint64_t GetPagedMemorySize() const; + // Returns the maximum amount of memory that the process has allocated + // that can be written to the virtual memory paging file + const uint64_t GetPeakPagedMemorySize() const; + // Returns the number of bytes that the associated process has allocated that cannot + // be shared with other processes + const uint64_t GetPrivateMemorySize() const; + // Returns the session id + const uint32_t GetSessionId() const; + + // Returns the process handle + const HANDLE GetHandle(); + // Returns the main window handle + const HWND GetMainWindowHandle(); + // Returns the main window title + const string GetMainWindowTitle(); + // Returns the process exit code, if any + const uint32_t GetExitCode(); + // Returns a list of process modules + const List GetProcessModules(); + // Returns a list of process threads + const List GetProcessThreads(); + + // Attempts to get a process by the process id + static Process GetProcessById(uint32_t Pid); + // Attempts to get processes with a specific name + static List GetProcessesByName(const string& Name); + // Gets all processes running on the current system + static List GetProcesses(); + // Gets the current process + static Process GetCurrentProcess(); + + // Creates a new process with the given information + static Process Start(const string& FileName); + // Creates a new process with the given information + static Process Start(const string& FileName, const string& Arguments); + // Creates a new process with the given information + static Process Start(const ProcessStartInfo& Start); + + // Sets the SeDebugPrivilege token to true for this process + static void EnterDebugMode(); + // Sets the SeDebugPrivilege token to false for this process + static void LeaveDebugMode(); + + // Assignment operator + Process& operator=(const Process& Rhs); + + // Equality operator, against nullptr + bool operator==(const nullptr_t Rhs) const; + // Inequality operator, against nullptr + bool operator!=(const nullptr_t Rhs) const; + + private: + HANDLE _Handle; + DWORD _Access; + bool _HasLoaded; + ProcessInfo _ProcessInfo; + + // Internal routine to get a handle to the process + bool AquireProcessHandle(); + // Internal routine to locate the main window + HWND GetProcessMainWindowHandle(); + // Internal routine to get the address of LoadLibraryA + LPTHREAD_START_ROUTINE ResolveInjectionAddress(BOOL Is32BitProcess); + + // Internal routine to set a process token privilege + static void SetPrivilage(const string& PrivilegeName, bool Enabled); + + // Internal routine to get a list of processes on the current machines info + static List GetProcessInfos(const List& ProcessIdMatch); + // Internal routine to transform the process name + static string GetProcessShortName(const string& Name); + + // Internal constant that matches STATUS_INFO_LENGTH_MISMATCH from ntstatus.h + static constexpr uint32_t StatusInfoLengthMismatch = 0xC0000004; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/ProcessInfo.h b/r5dev/thirdparty/cppnet/cppkore/ProcessInfo.h new file mode 100644 index 00000000..82f153e9 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ProcessInfo.h @@ -0,0 +1,26 @@ +#pragma once + +#include +#include "StringBase.h" + +namespace Diagnostics +{ + // This data structure contains information about a process + struct ProcessInfo + { + uint32_t BasePriority; + string ProcessName; + uint32_t ProcessId; + uint32_t HandleCount; + uint64_t PoolPagedBytes; + uint64_t PoolNonPagedBytes; + uint64_t VirtualBytes; + uint64_t VirtualBytesPeak; + uint64_t WorkingSetPeak; + uint64_t WorkingSet; + uint64_t PageFileBytesPeak; + uint64_t PageFileBytes; + uint64_t PrivateBytes; + uint32_t SessionId; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/ProcessModule.h b/r5dev/thirdparty/cppnet/cppkore/ProcessModule.h new file mode 100644 index 00000000..57dbdac9 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ProcessModule.h @@ -0,0 +1,26 @@ +#pragma once + +#include +#include "StringBase.h" + +namespace Diagnostics +{ + // Information about a loaded module + struct ProcessModule + { + // Returns the memory address that the module was loaded at. + uint64_t BaseAddress; + // Returns the amount of memory required to load the module.This does + // not include any additional memory allocations made by the module once + // it is running; it only includes the size of the static code and data + // in the module file. + uint64_t ModuleMemorySize; + // Returns the memory address for function that runs when the module is loaded and run. + uint64_t EntryPointAddress; + + // Returns the name of the Module. + string ModuleName; + // Returns the full file path for the location of the module. + string FileName; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/ProcessReader.cpp b/r5dev/thirdparty/cppnet/cppkore/ProcessReader.cpp new file mode 100644 index 00000000..bf622cbe --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ProcessReader.cpp @@ -0,0 +1,272 @@ +#include "stdafx.h" +#include "ProcessReader.h" +#include "Pattern.h" + +#include "StreamWriter.h" +#include "File.h" + +namespace IO +{ + ProcessReader::ProcessReader() + : ProcessReader(nullptr, false) + { + } + + ProcessReader::ProcessReader(const Diagnostics::Process& Process) + : _LeaveOpen(false) + { + this->BaseStream = std::make_unique((uint32_t)Process.GetId()); + } + + ProcessReader::ProcessReader(std::unique_ptr Stream) + : ProcessReader(std::move(Stream), false) + { + } + + ProcessReader::ProcessReader(std::unique_ptr Stream, bool LeaveOpen) + { + this->BaseStream = std::move(Stream); + this->_LeaveOpen = LeaveOpen; + } + + ProcessReader::ProcessReader(ProcessStream* Stream) + : ProcessReader(Stream, false) + { + } + + ProcessReader::ProcessReader(ProcessStream* Stream, bool LeaveOpen) + { + this->BaseStream.reset(Stream); + this->_LeaveOpen = LeaveOpen; + } + + ProcessReader::~ProcessReader() + { + this->Close(); + } + + std::unique_ptr ProcessReader::Read(uint64_t Count, uint64_t Address, uint64_t& Result) + { + auto Buffer = std::make_unique(Count); + + Result = Read(Buffer.get(), 0, Count, Address); + + return Buffer; + } + + uint64_t ProcessReader::Read(uint8_t* Buffer, uint64_t Index, uint64_t Count, uint64_t Address) + { + if (!this->BaseStream) + IOError::StreamBaseStream(); + + return this->BaseStream->Read(Buffer, Index, Count, Address); + } + + uint64_t ProcessReader::Read(void* Buffer, uint64_t Index, uint64_t Count, uint64_t Address) + { + return Read((uint8_t*)Buffer, Index, Count, Address); + } + + string ProcessReader::ReadCString(uint64_t Address) + { + if (!this->BaseStream) + IOError::StreamBaseStream(); + + char iBuffer[0x100]{}; + auto Result = this->BaseStream->Read((uint8_t*)&iBuffer[0], 0, sizeof(iBuffer), Address); + auto nCharPos = std::memchr(iBuffer, 0x0, Result); + + if (nCharPos != nullptr) + { + return std::move(string(iBuffer, (char*)nCharPos - &iBuffer[0])); + } + else if (Result != sizeof(iBuffer)) + { + return std::move(string(iBuffer)); + } + + Address += 0x100; + string Buffer(iBuffer, sizeof(iBuffer)); + + auto tChar = this->Read(Address++); + while ((uint8_t)tChar > 0) + { + Buffer.Append(tChar); + tChar = this->Read(Address++); + } + + return std::move(Buffer); + } + + string ProcessReader::ReadSizeString(uint64_t Size, uint64_t Address) + { + if (!this->BaseStream) + IOError::StreamBaseStream(); + + auto Buffer = string((uint32_t)Size, '\0'); + this->BaseStream->Read((uint8_t*)&Buffer[0], 0, Size, Address); + + return std::move(Buffer); + } + + uint32_t ProcessReader::ReadVarInt(uint64_t Address) + { + uint32_t Count = 0, Shift = 0; + uint8_t Byte; + + do + { + if (Shift == 5 * 7) + return 0; + + Byte = this->Read(Address++); + Count |= (Byte & 0x7F) << Shift; + Shift += 7; + } while ((Byte & 0x80) != 0); + + return Count; + } + + int64_t ProcessReader::SignatureScan(const string& Signature, bool ScanAllMemory) + { + auto BaseAddress = this->GetBaseAddress(); + auto ScanSize = (ScanAllMemory) ? this->GetMemorySize() : this->GetSizeOfCode(); + + return this->SignatureScan(Signature, BaseAddress, ScanSize); + } + + int64_t ProcessReader::SignatureScan(const string& Signature, uint64_t Address, uint64_t Count) + { + if (!this->BaseStream) + IOError::StreamBaseStream(); + + auto Sig = Data::Pattern(Signature); + auto ScanBuffer = std::make_unique(Count); + + uint64_t TotalRead = 0; + for (uint64_t i = Address; i < (Address + Count); i += ProcessReader::DefaultScanBufferSize) + { + auto Want = ((Count - TotalRead) > ProcessReader::DefaultScanBufferSize) ? ProcessReader::DefaultScanBufferSize : (Count - TotalRead); + this->Read(ScanBuffer.get(), TotalRead, Want, i); + TotalRead += Want; + } + + auto SearchResult = Sig.Search(ScanBuffer.get(), 0, Count); + + if (SearchResult > -1) + return (SearchResult + Address); + + return SearchResult; + } + + List ProcessReader::SignatureScanAll(const string & Signature, bool ScanAllMemory) + { + auto BaseAddress = this->GetBaseAddress(); + auto ScanSize = (ScanAllMemory) ? this->GetMemorySize() : this->GetSizeOfCode(); + + return this->SignatureScanAll(Signature, BaseAddress, ScanSize); + } + + List ProcessReader::SignatureScanAll(const string & Signature, uint64_t Address, uint64_t Count) + { + if (!this->BaseStream) + IOError::StreamBaseStream(); + + auto Sig = Data::Pattern(Signature); + auto ScanBuffer = std::make_unique(Count); + + uint64_t TotalRead = 0; + for (uint64_t i = Address; i < (Address + Count); i += ProcessReader::DefaultScanBufferSize) + { + auto Want = ((Count - TotalRead) > ProcessReader::DefaultScanBufferSize) ? ProcessReader::DefaultScanBufferSize : (Count - TotalRead); + this->Read(ScanBuffer.get(), TotalRead, Want, i); + TotalRead += Want; + } + + auto ResultList = Sig.SearchAll(ScanBuffer.get(), 0, Count); + + for (auto& Result : ResultList) + Result += Address; + + return ResultList; + } + + bool ProcessReader::IsRunning() const + { + if (!this->BaseStream) + return false; + + return (WaitForSingleObject(this->BaseStream->GetProcessHandle(), 0) == WAIT_TIMEOUT); + } + + uint64_t ProcessReader::GetBaseAddress() const + { + if (!this->BaseStream) + IOError::StreamBaseStream(); + + auto hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, GetProcessId(this->BaseStream->GetProcessHandle())); + if (hSnapshot == INVALID_HANDLE_VALUE) + return NULL; + + uint64_t Result = 0; + MODULEENTRY32 mEntry; + mEntry.dwSize = sizeof(MODULEENTRY32); + + if (!Module32First(hSnapshot, &mEntry)) + { + CloseHandle(hSnapshot); + return NULL; + } + + CloseHandle(hSnapshot); + return (uint64_t)mEntry.modBaseAddr; + } + + uint64_t ProcessReader::GetMemorySize() const + { + if (!this->BaseStream) + IOError::StreamBaseStream(); + + auto hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, GetProcessId(this->BaseStream->GetProcessHandle())); + if (hSnapshot == INVALID_HANDLE_VALUE) + return NULL; + + uint64_t Result = 0; + MODULEENTRY32 mEntry; + mEntry.dwSize = sizeof(MODULEENTRY32); + + if (!Module32First(hSnapshot, &mEntry)) + { + CloseHandle(hSnapshot); + return NULL; + } + + CloseHandle(hSnapshot); + return (uint64_t)mEntry.modBaseSize; + } + + uint64_t ProcessReader::GetSizeOfCode() const + { + auto BaseAddress = this->GetBaseAddress(); + + // Resolve executable code size from the optional header + auto DOSHeader = this->Read(BaseAddress); + auto NTHeader = this->Read(BaseAddress + DOSHeader.e_lfanew); + + return (uint64_t)NTHeader.OptionalHeader.SizeOfCode; + } + + ProcessStream* ProcessReader::GetBaseStream() const + { + return this->BaseStream.get(); + } + + void ProcessReader::Close() + { + // Forcefully reset the stream + if (this->_LeaveOpen) + this->BaseStream.release(); + else + this->BaseStream.reset(); + } +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/ProcessReader.h b/r5dev/thirdparty/cppnet/cppkore/ProcessReader.h new file mode 100644 index 00000000..f3ffee3b --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ProcessReader.h @@ -0,0 +1,82 @@ +#pragma once + +#include +#include "ProcessStream.h" +#include "StringBase.h" +#include "Process.h" + +namespace IO +{ + // ProcessReader supports reading a processes memory + class ProcessReader + { + public: + ProcessReader(); + ProcessReader(const Diagnostics::Process& Process); + ProcessReader(std::unique_ptr Stream); + ProcessReader(std::unique_ptr Stream, bool LeaveOpen); + ProcessReader(ProcessStream* Stream); + ProcessReader(ProcessStream* Stream, bool LeaveOpen); + ~ProcessReader(); + + template + // Reads data of type T from the stream + T Read(uint64_t Address) const + { + if (!this->BaseStream) + IOError::StreamBaseStream(); + + T ResultValue{}; + this->BaseStream->Read((uint8_t*)&ResultValue, 0, sizeof(T), Address); + + return ResultValue; + } + + // Reads data from the stream + std::unique_ptr Read(uint64_t Count, uint64_t Address, uint64_t& Result); + // Reads data from the stream to the specified buffer + uint64_t Read(uint8_t* Buffer, uint64_t Index, uint64_t Count, uint64_t Address); + // Reads data from the stream to the specified buffer + uint64_t Read(void* Buffer, uint64_t Index, uint64_t Count, uint64_t Address); + + // Reads a null-terminated string from the stream + string ReadCString(uint64_t Address); + // Reads a size-string from the stream + string ReadSizeString(uint64_t Size, uint64_t Address); + + // Reads an integer encoded into 7 bits, top bit = read more + uint32_t ReadVarInt(uint64_t Address); + + // Scan the process for a given signature + int64_t SignatureScan(const string& Signature, bool ScanAllMemory = false); + // Scan the process for a given signature + int64_t SignatureScan(const string& Signature, uint64_t Address, uint64_t Count); + + // Scan the process for a given signature (All occurences) + List SignatureScanAll(const string& Signature, bool ScanAllMemory = false); + // Scan the process for a given signature (All occurences) + List SignatureScanAll(const string& Signature, uint64_t Address, uint64_t Count); + + // Whether or not the process is running + bool IsRunning() const; + + // Gets the adress of the main module + uint64_t GetBaseAddress() const; + // Gets the amount of memory in use + uint64_t GetMemorySize() const; + // Gets the size of executable code + uint64_t GetSizeOfCode() const; + + // Get the underlying stream + ProcessStream* GetBaseStream() const; + // Close the ProcessReader and underlying stream + void Close(); + + private: + std::unique_ptr BaseStream; + bool _LeaveOpen; + + // The default scan size for reading buffers + constexpr static uint64_t DefaultScanBufferSize = 4096; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/ProcessStartInfo.h b/r5dev/thirdparty/cppnet/cppkore/ProcessStartInfo.h new file mode 100644 index 00000000..f2357d24 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ProcessStartInfo.h @@ -0,0 +1,45 @@ +#pragma once + +#include "StringBase.h" + +namespace Diagnostics +{ + enum class ProcessWindowStyle + { + Normal, + Hidden, + Minimized, + Maximized + }; + + // Information used when starting a new process + struct ProcessStartInfo + { + // Sets the application, document, or URL that is to be launched. + string FileName; + // Specifies the set of command line arguments to use when starting the application. + string Arguments; + // Sets the initial directory for the process that is started. + string WorkingDirectory; + // Specifies the verb to use when opening the filename. + string Verb; + + // Whether or not to allow window creation. + bool CreateNoWindow; + // Whether to use ShellExecute vs CreateProcess. + bool UseShellExecute; + + // Sets the style of window that should be used for the newly created process. + ProcessWindowStyle WindowStyle; + + ProcessStartInfo(const string& FileName) + : FileName(FileName), UseShellExecute(true), CreateNoWindow(false), WindowStyle(ProcessWindowStyle::Normal) + { + } + + ProcessStartInfo(const string& FileName, const string& Arguments) + : FileName(FileName), Arguments(Arguments), UseShellExecute(true), CreateNoWindow(false), WindowStyle(ProcessWindowStyle::Normal) + { + } + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/ProcessStream.cpp b/r5dev/thirdparty/cppnet/cppkore/ProcessStream.cpp new file mode 100644 index 00000000..87194e24 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ProcessStream.cpp @@ -0,0 +1,176 @@ +#include "stdafx.h" +#include "ProcessStream.h" + +namespace IO +{ + ProcessStream::ProcessStream() + { + this->_ProcessHandle = nullptr; + this->_KeepOpen = false; + } + + ProcessStream::ProcessStream(uint32_t PID) + { + this->SetupStream(OpenProcess(PROCESS_ALL_ACCESS, FALSE, PID), false); + } + + ProcessStream::ProcessStream(const string& ProcessName) + { + DWORD aProcesses[1024], cbNeeded, cProcesses; + EnumProcesses(aProcesses, sizeof(aProcesses), &cbNeeded); + CHAR szProcessName[MAX_PATH]; + + cProcesses = cbNeeded / sizeof(DWORD); + + for (DWORD i = 0; i < cProcesses; i++) + { + if (aProcesses[i] != NULL) + { + auto hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, aProcesses[i]); + if (hProcess != NULL) + { + HMODULE hMod; + if (EnumProcessModules(hProcess, &hMod, sizeof(hMod), &cbNeeded)) + { + GetModuleBaseNameA(hProcess, hMod, szProcessName, sizeof(szProcessName)); + CloseHandle(hProcess); + + if (_strnicmp(ProcessName.begin(), szProcessName, ProcessName.Length()) == 0) + { + this->SetupStream(OpenProcess(PROCESS_ALL_ACCESS, FALSE, aProcesses[i]), false); + return; + } + } + } + } + } + + // If we got here, we couldn't find a process, so the handle is null + throw std::exception("The process handle must not be null"); + } + + ProcessStream::ProcessStream(HANDLE ProcessHandle) + : ProcessStream(ProcessHandle, false) + { + } + + ProcessStream::ProcessStream(HANDLE ProcessHandle, bool LeaveOpen) + { + this->SetupStream(ProcessHandle, LeaveOpen); + } + + ProcessStream::~ProcessStream() + { + this->Close(); + } + + bool ProcessStream::CanRead() + { + return (this->_ProcessHandle); + } + + bool ProcessStream::CanWrite() + { + return (this->_ProcessHandle); + } + + bool ProcessStream::CanSeek() + { + return (this->_ProcessHandle); + } + + bool ProcessStream::GetIsEndOfFile() + { + return false; + } + + uint64_t ProcessStream::GetLength() + { + // Always an unknown due to pages, so we allow full read/write at any address + return UINT64_MAX; + } + + uint64_t ProcessStream::GetPosition() + { + return this->_Position; + } + + void ProcessStream::SetLength(uint64_t Length) + { + IOError::StreamSetLengthSupport(); + } + + void ProcessStream::SetPosition(uint64_t Position) + { + this->Seek(Position, SeekOrigin::Begin); + } + + void ProcessStream::Close() + { + if (!this->_KeepOpen && this->_ProcessHandle) + CloseHandle(this->_ProcessHandle); + + this->_ProcessHandle = nullptr; + this->_Position = 0; + } + + void ProcessStream::Flush() + { + // This is a non-cached stream + } + + void ProcessStream::Seek(uint64_t Offset, SeekOrigin Origin) + { + // We are a process, so, SeekOrigin::End doesn't technically apply here... + if (Origin == SeekOrigin::Current) + this->_Position += Offset; + else + this->_Position = Offset; + } + + uint64_t ProcessStream::Read(uint8_t* Buffer, uint64_t Offset, uint64_t Count) + { + return this->Read(Buffer, Offset, Count, this->_Position); + } + + uint64_t ProcessStream::Read(uint8_t* Buffer, uint64_t Offset, uint64_t Count, uint64_t Position) + { + if (!this->_ProcessHandle) + IOError::StreamNotOpen(); + + SIZE_T Result = 0; + ReadProcessMemory(this->_ProcessHandle, (LPCVOID)Position, (LPVOID)(Buffer + Offset), (SIZE_T)Count, &Result); + this->_Position = (uint64_t)(Position + Count); + + return Result; + } + + void ProcessStream::Write(uint8_t* Buffer, uint64_t Offset, uint64_t Count) + { + this->Write(Buffer, Offset, Count, this->_Position); + } + + void ProcessStream::Write(uint8_t * Buffer, uint64_t Offset, uint64_t Count, uint64_t Position) + { + if (!this->_ProcessHandle) + IOError::StreamNotOpen(); + + SIZE_T Result = 0; + WriteProcessMemory(this->_ProcessHandle, (LPVOID)Position, (LPCVOID)(Buffer + Offset), Count, &Result); + this->_Position = (uint64_t)(Position + Count); + } + + HANDLE ProcessStream::GetProcessHandle() const + { + return this->_ProcessHandle; + } + + void ProcessStream::SetupStream(HANDLE ProcessHandle, bool LeaveOpen) + { + if (!ProcessHandle) + throw std::exception("The process handle must not be null"); + + this->_ProcessHandle = ProcessHandle; + this->_KeepOpen = LeaveOpen; + } +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/ProcessStream.h b/r5dev/thirdparty/cppnet/cppkore/ProcessStream.h new file mode 100644 index 00000000..ba28cc78 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ProcessStream.h @@ -0,0 +1,52 @@ +#pragma once + +#include +#include +#include "Stream.h" +#include "StringBase.h" + +namespace IO +{ + // ProcessStream supports reading and writing from processes + class ProcessStream : public Stream + { + public: + ProcessStream(); + ProcessStream(uint32_t PID); + ProcessStream(const string& ProcessName); + ProcessStream(HANDLE ProcessHandle); + ProcessStream(HANDLE ProcessHandle, bool LeaveOpen); + virtual ~ProcessStream(); + + // Implement Getters and Setters + virtual bool CanRead(); + virtual bool CanWrite(); + virtual bool CanSeek(); + virtual bool GetIsEndOfFile(); + virtual uint64_t GetLength(); + virtual uint64_t GetPosition(); + virtual void SetLength(uint64_t Length); + virtual void SetPosition(uint64_t Position); + + // Implement functions + virtual void Close(); + virtual void Flush(); + virtual void Seek(uint64_t Offset, SeekOrigin Origin); + virtual uint64_t Read(uint8_t* Buffer, uint64_t Offset, uint64_t Count); + virtual uint64_t Read(uint8_t* Buffer, uint64_t Offset, uint64_t Count, uint64_t Position); + virtual void Write(uint8_t* Buffer, uint64_t Offset, uint64_t Count); + virtual void Write(uint8_t* Buffer, uint64_t Offset, uint64_t Count, uint64_t Position); + + // Retreive the internal process handle + virtual HANDLE GetProcessHandle() const; + + private: + // Process flags cached + bool _KeepOpen; + HANDLE _ProcessHandle; + uint64_t _Position; + + // Sets up the ProcessStream + void SetupStream(HANDLE ProcessHandle, bool LeaveOpen); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/ProcessThread.h b/r5dev/thirdparty/cppnet/cppkore/ProcessThread.h new file mode 100644 index 00000000..ef73dfbc --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ProcessThread.h @@ -0,0 +1,21 @@ +#pragma once + +#include +#include "StringBase.h" + +namespace Diagnostics +{ + // Information about a specific process thread + struct ProcessThread + { + // Returns the unique identifier for the associated thread. + uint32_t Id; + // Returns the base priority of the thread which is computed by combining the + // process priority class with the priority level of the associated thread. + uint32_t BasePriority; + // The current priority indicates the actual priority of the associated thread + uint32_t CurrentPriority; + // The memory address of the function that was called when the associated thread was started. + uint64_t StartAddress; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/ProgressBar.cpp b/r5dev/thirdparty/cppnet/cppkore/ProgressBar.cpp new file mode 100644 index 00000000..83f062c1 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ProgressBar.cpp @@ -0,0 +1,211 @@ +#include "stdafx.h" +#include "ProgressBar.h" + +namespace Forms +{ + ProgressBar::ProgressBar() + : Control(), _Minimum(0), _Maximum(100), _Step(10), _Value(0), _MarqueeSpeed(100) + { + SetStyle(ControlStyles::UserPaint | + ControlStyles::UseTextForAccessibility | + ControlStyles::Selectable, false); + } + + void ProgressBar::CreateControl(Control* Parent) + { + INITCOMMONCONTROLSEX iCC{}; + iCC.dwSize = sizeof(iCC); + iCC.dwICC = ICC_PROGRESS_CLASS; + + InitCommonControlsEx(&iCC); + + Control::CreateControl(Parent); + } + + void ProgressBar::OnHandleCreated() + { + // Range position and step + SendMessageA(this->_Handle, PBM_SETRANGE32, _Minimum, _Maximum); + SendMessageA(this->_Handle, PBM_SETSTEP, _Step, NULL); + SendMessageA(this->_Handle, PBM_SETPOS, _Value, NULL); + // Colors + SendMessageA(this->_Handle, PBM_SETBKCOLOR, NULL, Drawing::ColorToWin32(this->_BackColor)); + SendMessageA(this->_Handle, PBM_SETBARCOLOR, NULL, Drawing::ColorToWin32(this->_ForeColor)); + // Animation + StartMarquee(); + + // We must call the base event last + Control::OnHandleCreated(); + } + + void ProgressBar::OnBackColorChanged() + { + Control::OnBackColorChanged(); + + if (GetState(ControlStates::StateCreated)) + SendMessageA(this->_Handle, PBM_SETBKCOLOR, NULL, Drawing::ColorToWin32(this->_BackColor)); + } + + void ProgressBar::OnForeColorChanged() + { + Control::OnForeColorChanged(); + + if (GetState(ControlStates::StateCreated)) + SendMessageA(this->_Handle, PBM_SETBARCOLOR, NULL, Drawing::ColorToWin32(this->_ForeColor)); + } + + uint32_t ProgressBar::Value() + { + return this->_Value; + } + + void ProgressBar::SetValue(uint32_t Value) + { + if (Value > this->_Maximum) + Value = this->_Maximum; + if (Value < this->_Minimum) + Value = this->_Minimum; + + this->_Value = Value; + + UpdatePos(); + } + + uint32_t ProgressBar::MarqueeAnimationSpeed() + { + return this->_MarqueeSpeed; + } + + void ProgressBar::SetMarqueeAnimationSpeed(uint32_t Value) + { + this->_MarqueeSpeed = Value; + StartMarquee(); + } + + uint32_t ProgressBar::Maximum() + { + return this->_Maximum; + } + + void ProgressBar::SetMaximum(uint32_t Value) + { + if (this->_Maximum != Value) + { + if (this->_Minimum > Value) + this->_Minimum = Value; + + this->_Maximum = Value; + + if (this->_Value > Value) + this->_Value = this->_Value; + + if (GetState(ControlStates::StateCreated)) + { + SendMessageA(this->_Handle, PBM_SETRANGE32, this->_Minimum, this->_Maximum); + UpdatePos(); + } + } + } + + uint32_t ProgressBar::Minimum() + { + return this->_Minimum; + } + + void ProgressBar::SetMinimum(uint32_t Value) + { + if (this->_Minimum != Value) + { + if (this->_Maximum < Value) + this->_Maximum = Value; + + this->_Minimum = Value; + + if (this->_Value < Value) + this->_Value = Value; + + if (GetState(ControlStates::StateCreated)) + { + SendMessageA(this->_Handle, PBM_SETRANGE32, this->_Minimum, this->_Maximum); + UpdatePos(); + } + } + } + + uint32_t ProgressBar::Step() + { + return this->_Step; + } + + void ProgressBar::SetStep(uint32_t Value) + { + this->_Step = Value; + + if (GetState(ControlStates::StateCreated)) + SendMessageA(this->_Handle, PBM_SETSTEP, this->_Step, NULL); + } + + ProgressBarStyle ProgressBar::ProgressStyle() + { + return this->_Style; + } + + void ProgressBar::SetProgressStyle(ProgressBarStyle Value) + { + if (this->_Style != Value) + { + this->_Style = Value; + + // Redraw for ownerdraw components, and force update our styles + Invalidate(); + UpdateStyles(); + } + } + + void ProgressBar::Increment(uint32_t Value) + { + this->_Value = Value; + + if (this->_Value > this->_Maximum) + this->_Value = this->_Maximum; + if (this->_Value < this->_Minimum) + this->_Value = this->_Minimum; + + UpdatePos(); + } + + void ProgressBar::PerformStep() + { + Increment(this->_Step); + } + + CreateParams ProgressBar::GetCreateParams() + { + auto Cp = Control::GetCreateParams(); + Cp.ClassName = "msctls_progress32"; + + if (this->_Style == ProgressBarStyle::Continuous) + Cp.Style |= PBS_SMOOTH; + else if (this->_Style == ProgressBarStyle::Marquee) + Cp.Style |= PBS_MARQUEE; + + return Cp; + } + + void ProgressBar::StartMarquee() + { + if (GetState(ControlStates::StateCreated) && this->_Style == ProgressBarStyle::Marquee) + { + if (this->_MarqueeSpeed == 0) + SendMessageA(this->_Handle, PBM_SETMARQUEE, 0, _MarqueeSpeed); + else + SendMessageA(this->_Handle, PBM_SETMARQUEE, 1, _MarqueeSpeed); + } + } + + void ProgressBar::UpdatePos() + { + if (GetState(ControlStates::StateCreated)) + SendMessageA(this->_Handle, PBM_SETPOS, _Value, NULL); + } +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/ProgressBar.h b/r5dev/thirdparty/cppnet/cppkore/ProgressBar.h new file mode 100644 index 00000000..e3274eac --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ProgressBar.h @@ -0,0 +1,82 @@ +#pragma once + +#include +#include "Control.h" +#include "FlatStyle.h" +#include "BorderStyle.h" +#include "ContentAlignment.h" +#include "ProgressBarStyle.h" + +namespace Forms +{ + // Represents a Windows progress bar control. + class ProgressBar : public Control + { + public: + ProgressBar(); + virtual ~ProgressBar() = default; + + // Creates a new instance of the specified control with the given parent. + virtual void CreateControl(Control* Parent = nullptr); + + // Gets the current position of the progress bar. + uint32_t Value(); + // Sets the current position of the progress bar. + void SetValue(uint32_t Value); + + // Gets the marquee animation speed of the progress bar. + uint32_t MarqueeAnimationSpeed(); + // Sets the marquee animation speed of the progress bar. + void SetMarqueeAnimationSpeed(uint32_t Value); + + // Gets the maximum value of the progress bar. + uint32_t Maximum(); + // Sets the maximum value of the progress bar. + void SetMaximum(uint32_t Value); + + // Gets the minimum value of the progress bar. + uint32_t Minimum(); + // Sets the minimum value of the progress bar. + void SetMinimum(uint32_t Value); + + // Gets the amount that a call to PerformStep() to increase the progress. + uint32_t Step(); + // Sets the amount that a call to PerformStep() to increase the progress. + void SetStep(uint32_t Value); + + // Gets the style of the progress bar. This is can be either Blocks or Continuous. + ProgressBarStyle ProgressStyle(); + // Sets the style of the progress bar. This is can be either Blocks or Continuous. + void SetProgressStyle(ProgressBarStyle Value); + + // Advances the current position of the progress bar. + void Increment(uint32_t Value); + // Advances the current position of the progress bar by the step count. + void PerformStep(); + + // We must define control event bases here + virtual void OnHandleCreated(); + virtual void OnBackColorChanged(); + virtual void OnForeColorChanged(); + + protected: + // Get custom control creation parameters for this instance. + virtual CreateParams GetCreateParams(); + + private: + // Cached flags + uint32_t _Minimum; + uint32_t _Maximum; + uint32_t _Step; + uint32_t _Value; + uint32_t _MarqueeSpeed; + + // The style the control displays + ProgressBarStyle _Style; + + // Starts the marquee animation. + void StartMarquee(); + // Updates the progress. + void UpdatePos(); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/ProgressBarStyle.h b/r5dev/thirdparty/cppnet/cppkore/ProgressBarStyle.h new file mode 100644 index 00000000..68baa707 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ProgressBarStyle.h @@ -0,0 +1,17 @@ +#pragma once + +#include + +namespace Forms +{ + // This Enumeration represents the styles the ProgressBar can take. + enum class ProgressBarStyle + { + // The progress bar displays the progress status as a segmented bar. + Blocks, + // The progress bar displays the progress status in a smooth scrolling bar. + Continuous, + // The progress bar displays the progress status in the marquee style. + Marquee + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Quaternion.cpp b/r5dev/thirdparty/cppnet/cppkore/Quaternion.cpp new file mode 100644 index 00000000..35d9d539 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Quaternion.cpp @@ -0,0 +1,247 @@ +#include "stdafx.h" +#include "Quaternion.h" + +namespace Math +{ + Quaternion::Quaternion() + : X(0), Y(0), Z(0), W(1) + { + } + + Quaternion::Quaternion(float X, float Y, float Z, float W) + : X(X), Y(Y), Z(Z), W(W) + { + } + + float& Quaternion::operator[](int Index) + { + if (Index == 0) + return X; + else if (Index == 1) + return Y; + else if (Index == 2) + return Z; + + return W; + } + + Quaternion Quaternion::operator+(const Quaternion& Rhs) const + { + return Quaternion(X + Rhs.X, Y + Rhs.Y, Z + Rhs.Z, W + Rhs.W); + } + + Quaternion Quaternion::operator-(const Quaternion& Rhs) const + { + return Quaternion(X - Rhs.X, Y - Rhs.Y, Z - Rhs.Z, W - Rhs.W); + } + + Quaternion Quaternion::operator*(const Quaternion& Rhs) const + { + return Quaternion( + W * Rhs.X + X * Rhs.W + Y * Rhs.Z - Z * Rhs.Y, + W * Rhs.Y - X * Rhs.Z + Y * Rhs.W + Z * Rhs.X, + W * Rhs.Z + X * Rhs.Y - Y * Rhs.X + Z * Rhs.W, + W * Rhs.W - X * Rhs.X - Y * Rhs.Y - Z * Rhs.Z); + } + + Quaternion& Quaternion::operator+=(const Quaternion& Rhs) + { + X += Rhs.X; + Y += Rhs.Y; + Z += Rhs.Z; + W += Rhs.W; + + return *this; + } + + Quaternion& Quaternion::operator-=(const Quaternion& Rhs) + { + X -= Rhs.X; + Y -= Rhs.Y; + Z -= Rhs.Z; + W -= Rhs.W; + + return *this; + } + + Quaternion& Quaternion::operator*=(const Quaternion& Rhs) + { + auto Result = (*this) * Rhs; + + X = Result.X; + Y = Result.Y; + Z = Result.Z; + W = Result.W; + + return (*this); + } + + bool Quaternion::operator==(const Quaternion& Rhs) const + { + return (std::abs(X - Rhs.X) < MathHelper::Epsilon) && (std::abs(Y - Rhs.Y) < MathHelper::Epsilon) && (std::abs(Z - Rhs.Z) < MathHelper::Epsilon) && (std::abs(W - Rhs.W) < MathHelper::Epsilon); + } + + bool Quaternion::operator!=(const Quaternion& Rhs) const + { + return !(*this == Rhs); + } + + Quaternion Quaternion::operator-() const + { + return Quaternion(-X, -Y, -Z, -W); + } + + Quaternion Quaternion::operator~() const + { + return Quaternion(-X, -Y, -Z, W); + } + + float Quaternion::Length() const + { + return (float)std::sqrt(X * X + Y * Y + Z * Z + W * W); + } + + float Quaternion::LengthSq() const + { + return X * X + Y * Y + Z * Z + W * W; + } + + void Quaternion::Normalize() + { + auto Length = this->Length(); + + X /= Length; + Y /= Length; + Z /= Length; + W /= Length; + } + + Quaternion Quaternion::GetNormalized() const + { + auto Length = this->Length(); + + return Quaternion(X / Length, Y / Length, Z / Length, W / Length); + } + + Vector3 Quaternion::ToEulerAngles() const + { + float Matrix[4][4]; + + float num = X * X + Y * Y + Z * Z + W * W; + float num2 = 0; + + if (num > 0.0) + { + num2 = 2.0f / num; + } + + float num3 = X * num2; + float num4 = Y * num2; + float num5 = Z * num2; + float num6 = W * num3; + float num7 = W * num4; + float num8 = W * num5; + float num9 = X * num3; + float num10 = X * num4; + float num11 = X * num5; + float num12 = Y * num4; + float num13 = Y * num5; + float num14 = Z * num5; + + Matrix[0][0] = 1.0f - (num12 + num14); + Matrix[0][1] = num10 - num8; + Matrix[0][2] = num11 + num7; + Matrix[1][0] = num10 + num8; + Matrix[1][1] = 1.0f - (num9 + num14); + Matrix[1][2] = num13 - num6; + Matrix[2][0] = num11 - num7; + Matrix[2][1] = num13 + num6; + Matrix[2][2] = 1.0f - (num9 + num12); + Matrix[3][3] = 1.0f; + + uint32_t i = 0, j = 1, k = 2; + float TempX = 0, TempY = 0, TempZ = 0; + + float SqSum = std::sqrt(Matrix[i][i] * Matrix[i][i] + Matrix[j][i] * Matrix[j][i]); + if (SqSum > 0.00016) // This value seems to be better than Math::Epsilon + { + TempX = std::atan2(Matrix[k][j], Matrix[k][k]); + TempY = std::atan2(-Matrix[k][i], SqSum); + TempZ = std::atan2(Matrix[j][i], Matrix[i][i]); + } + else + { + TempX = std::atan2(-Matrix[j][k], Matrix[j][j]); + TempY = std::atan2(-Matrix[k][i], SqSum); + TempZ = 0.0; + } + + return Vector3(MathHelper::RadiansToDegrees(TempX), MathHelper::RadiansToDegrees(TempY), MathHelper::RadiansToDegrees(TempZ)); + } + + Quaternion Quaternion::Inverse() const + { + auto LengthSq = this->LengthSq(); + auto HalfLength = 1.0f / LengthSq; + + return Quaternion(-X * HalfLength, -Y * HalfLength, -Z * HalfLength, W * HalfLength); + } + + Quaternion Quaternion::Slerp(Quaternion& Rhs, float Time) + { + float cosTheta = W * Rhs.W + X * Rhs.X + Y * Rhs.Y + Z * Rhs.Z; + float theta = (float)acosf(cosTheta); + + if (fabs(theta) < Math::MathHelper::Epsilon) + { + return *this; + } + else + { + Quaternion ret; + float sinTheta = sqrtf(1.0f - cosTheta * cosTheta); + if (fabs(sinTheta) < Math::MathHelper::Epsilon) + { + ret.W = 0.5f * W + 0.5f * Rhs.W; + + auto Tmp = Math::Vector3(X, Y, Z).Lerp(0.5, Math::Vector3(Rhs.X, Rhs.Y, Rhs.Z)); + ret.X = Tmp.X; + ret.Y = Tmp.Y; + ret.Z = Tmp.Z; + } + else + { + float rA = sinf((1.0f - Time) * theta) / sinTheta; + float rB = sinf(Time * theta) / sinTheta; + + ret.W = W * rA + Rhs.W * rB; + ret.X = X * rA + Rhs.X * rB; + ret.Y = Y * rA + Rhs.Y * rB; + ret.Z = Z * rA + Rhs.Z * rB; + } + + return ret; + } + } + + Quaternion Quaternion::FromEulerAngles(float X, float Y, float Z) + { + return FromAxisRotation(Vector3(1, 0, 0), X) * FromAxisRotation(Vector3(0, 1, 0), Y) * FromAxisRotation(Vector3(0, 0, 1), Z); + } + + Quaternion Quaternion::FromAxisRotation(Vector3 Axis, float Angle) + { + auto Radians = MathHelper::DegreesToRadians(Angle); + auto AngleScale = std::sin(Radians / 2.0f); + auto QuaternionScale = std::cos(Radians / 2.0f); + + auto AngleResult = Axis * AngleScale; + + return Quaternion(AngleResult.X, AngleResult.Y, AngleResult.Z, QuaternionScale); + } + + Quaternion Quaternion::Identity() + { + return Quaternion(); + } +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Quaternion.h b/r5dev/thirdparty/cppnet/cppkore/Quaternion.h new file mode 100644 index 00000000..0169fd8f --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Quaternion.h @@ -0,0 +1,71 @@ +#pragma once + +#include +#include "MathHelper.h" +#include "Vector3.h" + +namespace Math +{ + // Represents a 3D rotation (X/Y/Z/W) + class Quaternion + { + public: + Quaternion(); + Quaternion(float X, float Y, float Z, float W); + + float X; + float Y; + float Z; + float W; + + // Array index operator + float& operator[](int Index); + + // Logical operators + Quaternion operator+(const Quaternion& Rhs) const; + Quaternion operator-(const Quaternion& Rhs) const; + Quaternion operator*(const Quaternion& Rhs) const; + + // Logical assignment operators + Quaternion& operator+=(const Quaternion& Rhs); + Quaternion& operator-=(const Quaternion& Rhs); + Quaternion& operator*=(const Quaternion& Rhs); + + // Equality operator + bool operator==(const Quaternion& Rhs) const; + // Inequality operator + bool operator!=(const Quaternion& Rhs) const; + + // Unary operator + Quaternion operator-() const; + // Conjugate operator + Quaternion operator~() const; + + // Get the length of this instance + float Length() const; + // Get the length squared of this instance + float LengthSq() const; + // Normalize this instance + void Normalize(); + // Get a normalized version of this instance + Quaternion GetNormalized() const; + + // Convert this rotation to euler angles + Vector3 ToEulerAngles() const; + // Calculate the inverse of this instance + Quaternion Inverse() const; + + // Quaternion slerp interpolation + Quaternion Slerp(Quaternion& Rhs, float Time); + + // Convert this euler rotation to a quaternion rotation + static Quaternion FromEulerAngles(float X, float Y, float Z); + // Convert an axis rotation to a quaternion rotation + static Quaternion FromAxisRotation(Vector3 Axis, float Angle); + + // Get an identity quaternion + static Quaternion Identity(); + }; + + static_assert(sizeof(Quaternion) == 0x10, "Invalid Math::Quaternion size, expected 0x10"); +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/RadioButton.cpp b/r5dev/thirdparty/cppnet/cppkore/RadioButton.cpp new file mode 100644 index 00000000..b660f72f --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/RadioButton.cpp @@ -0,0 +1,162 @@ +#include "stdafx.h" +#include "RadioButton.h" + +namespace Forms +{ + RadioButton::RadioButton() + : ButtonBase(), _AutoCheck(true), _Appearence(Appearence::Normal), _Checked(false) + { + SetStyle(ControlStyles::StandardClick, false); + this->SetTextAlign(Drawing::ContentAlignment::MiddleLeft); + + // We are a radiobutton control + this->_RTTI = ControlTypes::RadioButton; + } + + Appearence RadioButton::GetAppearence() + { + return this->_Appearence; + } + + void RadioButton::SetAppearence(Appearence Value) + { + if (this->_Appearence != Value) + { + this->_Appearence = Value; + + if (this->_OwnerDraw) + Refresh(); + else + UpdateStyles(); + + OnAppearenceChanged(); + } + } + + bool RadioButton::AutoCheck() + { + return this->_AutoCheck; + } + + void RadioButton::SetAutoCheck(bool Value) + { + this->_AutoCheck = Value; + } + + bool RadioButton::Checked() + { + return this->_Checked; + } + + void RadioButton::SetChecked(bool Value) + { + if (this->_Checked != Value) + { + this->_Checked = Value; + + if (GetState(ControlStates::StateCreated)) + SendMessageA(this->_Handle, BM_SETCHECK, Value ? 1 : 0, 0); + + Invalidate(); + Update(); + + OnCheckedChanged(); + + if (!this->_Parent) + return; + + auto& ParentControls = this->_Parent->Controls(); + + if (Value && ParentControls) + { + // Store the counts on the stack + uint32_t ControlCount = ParentControls->Count(); + auto& ControlList = *ParentControls.get(); + + for (uint32_t i = 0; i < ControlCount; i++) + { + auto Child = ControlList[i]; + auto ChildHwnd = Child->GetHandle(); + + if (ChildHwnd == nullptr || Child == this) + continue; + + if (Child->GetType() == ControlTypes::RadioButton) + ((RadioButton*)Child)->SetChecked(false); + } + } + } + } + + void RadioButton::OnClick() + { + if (this->_AutoCheck) + this->SetChecked(true); + + // Call base event last + ButtonBase::OnClick(); + } + + void RadioButton::OnAppearenceChanged() + { + AppearenceChanged.RaiseEvent(this); + } + + void RadioButton::OnCheckedChanged() + { + CheckedChanged.RaiseEvent(this); + } + + void RadioButton::OnHandleCreated() + { + SendMessageA(this->_Handle, BM_SETCHECK, _Checked ? 1 : 0, NULL); + + // We must call the base event last + Control::OnHandleCreated(); + } + + void RadioButton::OnMouseUp(const std::unique_ptr& EventArgs) + { + if (EventArgs->Button == MouseButtons::Left && GetFlag(ButtonFlags::FlagMousePressed)) + { + if (GetFlag(ButtonFlags::FlagMouseDown)) + { + auto Pt = PointToScreen({ (INT)EventArgs->X, (INT)EventArgs->Y }); + + POINT nPt; + nPt.x = Pt.X; + nPt.y = Pt.Y; + + if (WindowFromPoint(nPt) == this->_Handle) + { + ResetFlagsAndPaint(); + + OnClick(); + OnMouseClick(EventArgs); + } + } + } + + // Call base event last + ButtonBase::OnMouseUp(EventArgs); + } + + CreateParams RadioButton::GetCreateParams() + { + auto Cp = ButtonBase::GetCreateParams(); + + Cp.ClassName = "BUTTON"; + + if (this->_OwnerDraw) + Cp.Style |= BS_OWNERDRAW; + else + { + Cp.Style |= BS_RADIOBUTTON; + + if (this->_Appearence == Appearence::Button) + Cp.Style |= BS_PUSHLIKE; + } + + return Cp; + } +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/RadioButton.h b/r5dev/thirdparty/cppnet/cppkore/RadioButton.h new file mode 100644 index 00000000..b4cf64c1 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/RadioButton.h @@ -0,0 +1,58 @@ +#pragma once + +#include +#include "Control.h" +#include "Appearence.h" +#include "ButtonBase.h" +#include "CheckState.h" +#include "ContentAlignment.h" + +namespace Forms +{ + // Represents a Windows radio button (option button). + class RadioButton : public ButtonBase + { + public: + RadioButton(); + virtual ~RadioButton() = default; + + // Gets the value that determines the appearance of a check box control. + Appearence GetAppearence(); + // Sets the value that determines the appearance of a check box control. + void SetAppearence(Appearence Value); + + // Gets a value indicating whether the check box automatically checks itself. + bool AutoCheck(); + // Sets a value indicating whether the check box automatically checks itself. + void SetAutoCheck(bool Value); + + // Gets a value indicating whether the check box is checked. + bool Checked(); + // Sets a value indicating whether the check box is checked. + void SetChecked(bool Value); + + // We must define base events here + virtual void OnClick(); + virtual void OnAppearenceChanged(); + virtual void OnCheckedChanged(); + virtual void OnHandleCreated(); + virtual void OnMouseUp(const std::unique_ptr& EventArgs); + + // We must define event handlers here + EventBase AppearenceChanged; + EventBase CheckedChanged; + + protected: + // Get custom control creation parameters for this instance. + virtual CreateParams GetCreateParams(); + + private: + // Whether or not the control handles checking itself. + bool _AutoCheck; + // Whether or not the control is checked. + bool _Checked; + + // The appearence of the control. + Appearence _Appearence; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Registry.cpp b/r5dev/thirdparty/cppnet/cppkore/Registry.cpp new file mode 100644 index 00000000..3595ce34 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Registry.cpp @@ -0,0 +1,11 @@ +#include "stdafx.h" +#include "Registry.h" + +namespace Win32 +{ + RegistryKey Registry::CurrentUser = RegistryKey::OpenBaseKey(RegistryHive::CurrentUser, RegistryView::Default); + RegistryKey Registry::LocalMachine = RegistryKey::OpenBaseKey(RegistryHive::LocalMachine, RegistryView::Default); + RegistryKey Registry::ClassesRoot = RegistryKey::OpenBaseKey(RegistryHive::ClassesRoot, RegistryView::Default); + RegistryKey Registry::Users = RegistryKey::OpenBaseKey(RegistryHive::Users, RegistryView::Default); + RegistryKey Registry::CurrentConfig = RegistryKey::OpenBaseKey(RegistryHive::CurrentConfig, RegistryView::Default); +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Registry.h b/r5dev/thirdparty/cppnet/cppkore/Registry.h new file mode 100644 index 00000000..01f76198 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Registry.h @@ -0,0 +1,22 @@ +#pragma once + +#include +#include "RegistryKey.h" + +namespace Win32 +{ + class Registry + { + public: + // This key should be used as the root for all user specific settings. + static RegistryKey CurrentUser; + // This key should be used as the root for all machine specific settings. + static RegistryKey LocalMachine; + // This is the root key of class information. + static RegistryKey ClassesRoot; + // This is the root of users. + static RegistryKey Users; + // This is where current configuration information is stored. + static RegistryKey CurrentConfig; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/RegistryHive.h b/r5dev/thirdparty/cppnet/cppkore/RegistryHive.h new file mode 100644 index 00000000..a3122b27 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/RegistryHive.h @@ -0,0 +1,18 @@ +#pragma once + +#include + +namespace Win32 +{ + // Registry hive values, built-in hive handles + enum class RegistryHive : uint32_t + { + ClassesRoot = 0x80000000, + CurrentUser = 0x80000001, + LocalMachine = 0x80000002, + Users = 0x80000003, + PerformanceData = 0x80000004, + CurrentConfig = 0x80000005, + DynData = 0x80000006, + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/RegistryKey.cpp b/r5dev/thirdparty/cppnet/cppkore/RegistryKey.cpp new file mode 100644 index 00000000..a99ae87c --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/RegistryKey.cpp @@ -0,0 +1,368 @@ +#include "stdafx.h" +#include "RegistryKey.h" + +namespace Win32 +{ + RegistryKey::RegistryKey(HKEY hKey, bool Writable, RegistryView View) + : RegistryKey(hKey, Writable, false, View) + { + } + + RegistryKey::RegistryKey(HKEY hKey, bool Writable, bool SystemKey, RegistryView View) + : _State(0), _Handle(hKey), _View(View), _KeyName("") + { + if (SystemKey) + this->_State |= RegistryKey::STATE_SYSTEMKEY; + if (Writable) + this->_State |= RegistryKey::STATE_WRITEACCESS; + } + + RegistryKey::~RegistryKey() + { + this->Close(); + } + + void RegistryKey::Close() + { + if (this->_Handle != nullptr && !this->IsSystemKey()) + RegCloseKey(this->_Handle); + + this->_Handle = nullptr; + } + + void RegistryKey::Flush() + { + if (this->_Handle != nullptr && this->IsDirty()) + RegFlushKey(this->_Handle); + } + + RegistryKey RegistryKey::CreateSubKey(const string& SubKey) + { + return this->CreateSubKeyInternal(SubKey); + } + + void RegistryKey::DeleteSubKey(const string& SubKey, bool ThrowOnMissingSubKey) + { + auto kPath = FixupName(SubKey); // Remove multiple slashes to a single slash + + try + { + auto Key = this->InternalOpenSubKey(kPath, false); + if (Key.InternalSubKeyCount() > 0) + throw Win32Error::RegSubKeyChildren(); + + Key.Close(); + } + catch (...) + { + if (ThrowOnMissingSubKey) + throw Win32Error::RegSubKeyMissing(); + } + + auto dResult = RegDeleteKeyExA(this->_Handle, (const char*)kPath, (int)this->_View, NULL); + if (dResult != 0) + { + if (dResult == ERROR_FILE_NOT_FOUND && ThrowOnMissingSubKey) + throw Win32Error::RegSubKeyMissing(); + } + } + + void RegistryKey::DeleteSubKeyTree(const string& SubKey, bool ThrowOnMissingSubKey) + { + if (SubKey.Length() == 0 && IsSystemKey()) + throw Win32Error::RegSubKeyMalformed(); + + auto kPath = FixupName(SubKey); + + try + { + auto Key = this->InternalOpenSubKey(kPath, false); + if (Key.InternalSubKeyCount() > 0) + { + auto SubKeyNames = this->InternalGetSubKeyNames(); + + for (auto& KeyName : SubKeyNames) + this->DeleteSubKeyTreeInternal(KeyName); + } + + Key.Close(); + } + catch (...) + { + if (ThrowOnMissingSubKey) + throw Win32Error::RegSubKeyMissing(); + } + + RegDeleteKeyExA(this->_Handle, (const char*)kPath, (int)this->_View, NULL); + } + + void RegistryKey::DeleteValue(const string& Name, bool ThrowOnMissingSubKey) + { + auto hResult = RegDeleteValueA(this->_Handle, (const char*)Name); + + if (hResult == ERROR_FILE_NOT_FOUND || hResult == ERROR_FILENAME_EXCED_RANGE) + if (ThrowOnMissingSubKey) + throw Win32Error::RegSubKeyMissing(); + } + + RegistryKey RegistryKey::OpenSubKey(const string& Name, bool Writable) + { + HKEY hHandle = nullptr; + auto hAccess = (Writable) ? (KEY_READ | KEY_WRITE) : KEY_READ; + auto kPath = FixupName(Name); + auto hResult = RegOpenKeyExA(this->_Handle, (const char*)kPath, NULL, (hAccess | (int)this->_View), &hHandle); + + if (hResult == ERROR_SUCCESS) + { + auto Result = RegistryKey(hHandle, Writable, this->_View); + Result._KeyName = this->_KeyName + "\\" + kPath; + + return Result; + } + + throw Win32Error::SystemError(GetLastError()); + } + + List RegistryKey::GetValueNames() + { + auto nValues = this->InternalValueCount(); + auto Result = List(); + + for (uint32_t i = 0; i < nValues; i++) + { + char NameBuffer[MaxKeyLength + 1]{}; + uint32_t NameLength = (MaxKeyLength + 1); + + auto hResult = RegEnumValueA(this->_Handle, i, NameBuffer, (LPDWORD)&NameLength, NULL, NULL, NULL, NULL); + if (hResult == ERROR_SUCCESS) + Result.EmplaceBack(NameBuffer); + } + + return Result; + } + + RegistryValueType RegistryKey::GetValueKind(const string& Name) + { + DWORD Type = 0, DataSize = 0; + auto qResult = RegQueryValueExA(this->_Handle, (const char*)Name, NULL, &Type, NULL, &DataSize); + + switch (Type) + { + case REG_DWORD: + return RegistryValueType::Dword; + case REG_DWORD_BIG_ENDIAN: + return RegistryValueType::DwordBigEndian; + case REG_SZ: + return RegistryValueType::String; + case REG_MULTI_SZ: + return RegistryValueType::MultiString; + case REG_BINARY: + return RegistryValueType::Binary; + case REG_LINK: + return RegistryValueType::SymbolicLink; + case REG_RESOURCE_LIST: + return RegistryValueType::ResourceList; + case REG_FULL_RESOURCE_DESCRIPTOR: + return RegistryValueType::FullResourceDescriptor; + case REG_QWORD: + return RegistryValueType::Qword; + case REG_RESOURCE_REQUIREMENTS_LIST: + return RegistryValueType::ResourceRequirementsList; + } + + return RegistryValueType::None; + } + + uint32_t RegistryKey::GetSubKeyCount() + { + return this->InternalSubKeyCount(); + } + + uint32_t RegistryKey::GetValueCount() + { + return this->InternalValueCount(); + } + + List RegistryKey::GetSubKeyNames() + { + return this->InternalGetSubKeyNames(); + } + + RegistryKey RegistryKey::OpenBaseKey(RegistryHive Hive, RegistryView View) + { + auto Index = ((int)Hive) & 0x0FFFFFFF; + auto Key = RegistryKey((HKEY)Hive, true, true, View); + + Key._KeyName = RegistryKey::HiveNames[Index]; + + return Key; + } + + RegistryKey RegistryKey::FromHandle(HKEY hKey, RegistryView View) + { + return RegistryKey(hKey, true, View); + } + + bool RegistryKey::IsDirty() + { + return (this->_State & RegistryKey::STATE_DIRTY) != 0; + } + + bool RegistryKey::IsSystemKey() + { + return (this->_State & RegistryKey::STATE_SYSTEMKEY) != 0; + } + + bool RegistryKey::IsWritable() + { + return (this->_State & RegistryKey::STATE_WRITEACCESS) != 0; + } + + RegistryKey RegistryKey::CreateSubKeyInternal(const string& SubKey) + { + auto kPath = FixupName(SubKey); // Remove multiple slashes to a single slash + + try + { + // Test if the key already exists + return RegistryKey::InternalOpenSubKey(kPath, this->IsWritable()); + } + catch (...) + { + // Doesn't exist, can be created + HKEY hHandle = nullptr; + DWORD Disposition = 0; + auto hResult = RegCreateKeyExA(this->_Handle, (const char*)kPath, NULL, NULL, REG_OPTION_NON_VOLATILE, ((KEY_READ | KEY_WRITE) | (int)this->_View), NULL, &hHandle, &Disposition); + + if (hResult == ERROR_SUCCESS) + { + auto nKey = RegistryKey(hHandle, true, this->_View); + + if (kPath.Length() == 0) + nKey._KeyName = _KeyName; + else + nKey._KeyName = _KeyName + "\\" + kPath; + + return nKey; + } + } + + throw Win32Error::SystemError(GetLastError()); + } + + void RegistryKey::DeleteSubKeyTreeInternal(const string& SubKey) + { + try + { + auto Key = this->InternalOpenSubKey(SubKey, true); + if (Key.InternalSubKeyCount() > 0) + { + auto SubKeyNames = Key.InternalGetSubKeyNames(); + + for (auto& KeyName : SubKeyNames) + Key.DeleteSubKeyTreeInternal(KeyName); + } + + Key.Close(); + } + catch (...) + { + // Nothing + } + + RegDeleteKeyExA(this->_Handle, (const char*)SubKey, (int)this->_View, NULL); + } + + RegistryKey RegistryKey::InternalOpenSubKey(const string& Name, bool Writable) + { + HKEY hHandle = nullptr; + auto hAccess = (Writable) ? (KEY_READ | KEY_WRITE) : KEY_READ; + auto hResult = RegOpenKeyExA(this->_Handle, (const char*)Name, NULL, (hAccess | (int)this->_View), &hHandle); + + if (hResult == ERROR_SUCCESS) + { + auto Result = RegistryKey(hHandle, Writable, this->_View); + Result._KeyName = this->_KeyName + "\\" + Name; + + return Result; + } + + throw Win32Error::SystemError(GetLastError()); + } + + std::unique_ptr RegistryKey::InternalGetValue(const string& Name, uint64_t& ValueSize) + { + DWORD Type = 0, DataSize = 0; + auto qResult = RegQueryValueExA(this->_Handle, (const char*)Name, NULL, &Type, NULL, &DataSize); + + if (qResult != ERROR_SUCCESS) + throw Win32Error::SystemError(GetLastError()); + + auto ResultBuffer = std::make_unique(DataSize); + RegQueryValueExA(this->_Handle, (const char*)Name, NULL, &Type, ResultBuffer.get(), &DataSize); + + ValueSize = DataSize; + + return ResultBuffer; + } + + void RegistryKey::InternalSetValue(const string& Name, uint32_t ValueType, uint8_t* Buffer, uint64_t BufferSize) + { + auto hResult = RegSetValueExA(this->_Handle, (const char*)Name, NULL, ValueType, Buffer, (DWORD)BufferSize); + if (hResult != ERROR_SUCCESS) + throw Win32Error::SystemError(GetLastError()); + } + + uint32_t RegistryKey::InternalSubKeyCount() + { + DWORD SubKeys = 0, Junk = 0; + RegQueryInfoKeyA(this->_Handle, NULL, NULL, NULL, &SubKeys, NULL, NULL, &Junk, NULL, NULL, NULL, NULL); + + return (uint32_t)SubKeys; + } + + uint32_t RegistryKey::InternalValueCount() + { + DWORD Values = 0, Junk = 0; + RegQueryInfoKeyA(this->_Handle, NULL, NULL, NULL, &Junk, NULL, NULL, &Values, NULL, NULL, NULL, NULL); + + return (uint32_t)Values; + } + + List RegistryKey::InternalGetSubKeyNames() + { + auto Result = List(); + auto sCount = this->InternalSubKeyCount(); + + char Buffer[RegistryKey::MaxKeyLength + 1]{}; + DWORD NameLength = RegistryKey::MaxKeyLength + 1; + + for (uint32_t i = 0; i < sCount; i++) + { + NameLength = RegistryKey::MaxKeyLength + 1; + auto hQuery = RegEnumKeyExA(this->_Handle, i, Buffer, &NameLength, NULL, NULL, NULL, NULL); + + if (hQuery == 0) + Result.EmplaceBack(Buffer); + } + + return Result; + } + + string RegistryKey::FixupName(string Name) + { + RegistryKey::FixupPath(Name); + + auto eChar = Name.Length() - 1; + if (eChar >= 0 && Name[eChar] == '\\') + return Name.Substring(0, eChar); + + return Name; + } + + void RegistryKey::FixupPath(string& Path) + { + // Replace double slash with single slashes + Path = Path.Replace("\\\\", "\\"); + } +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/RegistryKey.h b/r5dev/thirdparty/cppnet/cppkore/RegistryKey.h new file mode 100644 index 00000000..1ab47fba --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/RegistryKey.h @@ -0,0 +1,218 @@ +#pragma once + +#include +#include "StringBase.h" +#include +#include "Win32Error.h" +#include "ListBase.h" +#include "StringBase.h" +#include "RegistryHive.h" +#include "RegistryView.h" +#include "RegistryValueType.h" + +namespace Win32 +{ + class RegistryKey + { + private: + RegistryKey(HKEY hKey, bool Writable, RegistryView View); + RegistryKey(HKEY hKey, bool Writable, bool SystemKey, RegistryView View); + + public: + ~RegistryKey(); + + // Closes all resources tied to this key + void Close(); + // Flush all pending changes to the disk + void Flush(); + // Creates a new subkey + RegistryKey CreateSubKey(const string& SubKey); + // Deletes a subkey + void DeleteSubKey(const string& SubKey, bool ThrowOnMissingSubKey = false); + // Deletes a subkey and all nested values + void DeleteSubKeyTree(const string& SubKey, bool ThrowOnMissingSubKey = false); + // Deletes a value + void DeleteValue(const string& Name, bool ThrowOnMissingSubKey = false); + // Opens a subkey of this instance + RegistryKey OpenSubKey(const string& Name, bool Writable = true); + // Returns a value + template + auto GetValue(const string& Name); + // Returns a list of value names + List GetValueNames(); + // Returns the type of value this key is + RegistryValueType GetValueKind(const string& Name); + // Sets a value + template + void SetValue(const string& Name, const Tval& Value); + // Returns the count of subkeys + uint32_t GetSubKeyCount(); + // Returns the count of values + uint32_t GetValueCount(); + // Returns the subkey names + List GetSubKeyNames(); + + // Opens one of the base registry hives on the system + static RegistryKey OpenBaseKey(RegistryHive Hive, RegistryView View); + // Returns a key from the specified handle + static RegistryKey FromHandle(HKEY hKey, RegistryView View); + + private: + // Cached key flags + HKEY _Handle; + uint32_t _State; + RegistryView _View; + string _KeyName; + + // Helper routines + bool IsDirty(); + bool IsSystemKey(); + bool IsWritable(); + + // Internal routine to create a subkeu + RegistryKey CreateSubKeyInternal(const string& SubKey); + // Internal routine to delete a subkey tree + void DeleteSubKeyTreeInternal(const string& SubKey); + // Internal routine to open a subkey + RegistryKey InternalOpenSubKey(const string& SubKey, bool Writable); + // Internal routine to get a value + std::unique_ptr InternalGetValue(const string& Name, uint64_t& ValueSize); + // Internal routine to set a value + void InternalSetValue(const string& Name, uint32_t ValueType, uint8_t* Buffer, uint64_t BufferSize); + // Internal routine to get subkey count + uint32_t InternalSubKeyCount(); + // Internal routine to get value count + uint32_t InternalValueCount(); + // Internal routine to get subkey names + List InternalGetSubKeyNames(); + + // Cleans up a key name + static string FixupName(string Name); + // Cleans up a key path + static void FixupPath(string& Path); + + // Internal key states + constexpr static uint32_t STATE_DIRTY = 0x1; + constexpr static uint32_t STATE_SYSTEMKEY = 0x2; + constexpr static uint32_t STATE_WRITEACCESS = 0x4; + + // Maximum key lengths + constexpr static uint32_t MaxKeyLength = 255; + constexpr static uint32_t MaxValueLength = 16383; + + // Internal hive names + constexpr static const char* const HiveNames[] = + { + "HKEY_CLASSES_ROOT", + "HKEY_CURRENT_USER", + "HKEY_LOCAL_MACHINE", + "HKEY_USERS", + "HKEY_PERFORMANCE_DATA", + "HKEY_CURRENT_CONFIG", + "HKEY_DYN_DATA" + }; + }; + + template + inline auto RegistryKey::GetValue(const string& Name) + { + uint64_t BufferSize = 0; + auto Buffer = this->InternalGetValue(Name, BufferSize); + + if constexpr (T == RegistryValueType::Dword) + { + return *(uint32_t*)Buffer.get(); + } + else if constexpr (T == RegistryValueType::DwordBigEndian) + { + return _byteswap_ulong(*(uint32_t*)Buffer.get()); + } + else if constexpr (T == RegistryValueType::Qword) + { + return *(uint64_t*)Buffer.get(); + } + else if constexpr (T == RegistryValueType::String) + { + return string((const char*)Buffer.get()); + } + else if constexpr (T == RegistryValueType::MultiString) + { + auto Result = List(); + uint64_t Position = 0; + + // We must parse each string as we go, and ensure we haven't reached the buffer size + while (Position < BufferSize) + { + // Read the str with strlen() because it doesn't store the size of each one + auto cStr = string((const char*)(Buffer.get() + Position)); + + // Shift based on the size + null char... + Position += cStr.Length() + sizeof(char); + + // Move the str into it's list + Result.EmplaceBack(std::move(cStr)); + } + + return Result; + } + else if constexpr (T == RegistryValueType::Binary) + { + RegistryBinaryBlob Blob; + + Blob.Buffer = std::move(Buffer); + Blob.Size = BufferSize; + + return Blob; + } + + return nullptr; + } + + template + inline void RegistryKey::SetValue(const string& Name, const Tval& Value) + { + if constexpr (T == RegistryValueType::Dword) + { + uint32_t LittleEndian = (uint32_t)Value; + this->InternalSetValue(Name, REG_DWORD, (uint8_t*)&LittleEndian, sizeof(uint32_t)); + } + else if constexpr (T == RegistryValueType::DwordBigEndian) + { + uint32_t BigEndian = _byteswap_ulong((uint32_t)Value); + this->InternalSetValue(Name, REG_DWORD_BIG_ENDIAN, (uint8_t*)&BigEndian, sizeof(uint32_t)); + } + else if constexpr (T == RegistryValueType::Qword) + { + uint64_t LittleEndian = (uint64_t)Value; + this->InternalSetValue(Name, REG_QWORD, (uint8_t*)&LittleEndian, sizeof(uint64_t)); + } + else if constexpr (T == RegistryValueType::String) + { + this->InternalSetValue(Name, REG_SZ, (uint8_t*)&Value[0], Value.Length() + sizeof(char)); + } + else if constexpr (T == RegistryValueType::MultiString) + { + // Calculate the resulting buffer size + uint32_t BufferSize = 0; + for (auto& Str : Value) + BufferSize += Str.Length() + sizeof(char); + auto Buffer = std::make_unique(BufferSize); + + BufferSize = 0; + + // Iterate and copy the entire string including the null-char which is in StringBase<> + for (auto& Str : Value) + { + std::memcpy(Buffer.get() + BufferSize, &Str[0], Str.Length() + sizeof(char)); + BufferSize += Str.Length() + sizeof(char); + } + + // Pass our temporary buffer of all strings to the value + this->InternalSetValue(Name, REG_MULTI_SZ, (uint8_t*)Buffer.get(), BufferSize); + } + else if constexpr (T == RegistryValueType::Binary) + { + this->InternalSetValue(Name, REG_BINARY, (uint8_t*)Value.Buffer, Value.Size); + } + } +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/RegistryValueType.h b/r5dev/thirdparty/cppnet/cppkore/RegistryValueType.h new file mode 100644 index 00000000..f4e30ed0 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/RegistryValueType.h @@ -0,0 +1,29 @@ +#pragma once + +namespace Win32 +{ + // Represents the possible value types in the Registry + enum class RegistryValueType + { + None, + String, + Binary, + Dword, + DwordBigEndian, + SymbolicLink, + MultiString, + ResourceList, + FullResourceDescriptor, + ResourceRequirementsList, + Qword, + }; + + // Represents a raw buffer in the registry + struct RegistryBinaryBlob + { + // The data buffer + std::unique_ptr Buffer; + // The size of the buffer + uint64_t Size; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/RegistryView.h b/r5dev/thirdparty/cppnet/cppkore/RegistryView.h new file mode 100644 index 00000000..c1653ab6 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/RegistryView.h @@ -0,0 +1,15 @@ +#pragma once + +#include +#include + +namespace Win32 +{ + // Defines which version of the registry we want to view, on 64bit systems with SysWOW64 + enum class RegistryView + { + Default = 0, + Registry64 = KEY_WOW64_64KEY, + Registry32 = KEY_WOW64_32KEY + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/RenderFont.cpp b/r5dev/thirdparty/cppnet/cppkore/RenderFont.cpp new file mode 100644 index 00000000..a3addf0e --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/RenderFont.cpp @@ -0,0 +1,161 @@ +#include "stdafx.h" +#include "RenderFont.h" +#include "LZ4Codec.h" +#include "File.h" +#include "BinaryReader.h" + +// We need to include the OpenGL classes +#include "Mangler.h" + +namespace Assets +{ + RenderFont::RenderFont() + : FontHeader{}, Widths{}, Initialized(false) + { + } + + RenderFont::~RenderFont() + { + this->Dispose(); + } + + void RenderFont::LoadFont(const uint8_t* Buffer, uint64_t BufferLength) + { + this->Dispose(); + + glGenTextures(1, &TextureID); + + // Font configuration: + // Width: 256 + // Height: 512 + // Start: 32 + // Font Size: 21 + // + // LZ4_HC the buffer and save + + auto ResultDecompressed = Compression::LZ4Codec::Decompress((uint8_t*)Buffer, 0, BufferLength, 0x20116); + + std::memcpy(&this->FontHeader, ResultDecompressed.get(), sizeof(FontHeader)); + std::memcpy(&this->Widths, ResultDecompressed.get() + sizeof(FontHeader), sizeof(Widths)); + + RowPitch = FontHeader.Width / FontHeader.CellWidth; + + ColFactor = (float)FontHeader.CellWidth / (float)FontHeader.Width; + RowFactor = (float)FontHeader.CellHeight / (float)FontHeader.Height; + + glBindTexture(GL_TEXTURE_2D, TextureID); + + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER); + + glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, FontHeader.Width, FontHeader.Height, 0, GL_ALPHA, GL_UNSIGNED_BYTE, ResultDecompressed.get() + sizeof(FontHeader) + sizeof(Widths)); + + Initialized = true; + } + + void RenderFont::LoadFont(const string& FontPath) + { + this->Dispose(); + + auto Reader = IO::BinaryReader(IO::File::OpenRead(FontPath)); + + FontHeader = Reader.Read(); + + Reader.Read((uint8_t*)Widths, 0, 256); + + RowPitch = FontHeader.Width / FontHeader.CellWidth; + + ColFactor = (float)FontHeader.CellWidth / (float)FontHeader.Width; + RowFactor = (float)FontHeader.CellHeight / (float)FontHeader.Height; + + uint64_t ReadResult = 0; + auto BufferData = Reader.Read((Reader.GetBaseStream()->GetLength() - sizeof(Widths) - sizeof(FontHeader)), ReadResult); + + RowPitch = FontHeader.Width / FontHeader.CellWidth; + + ColFactor = (float)FontHeader.CellWidth / (float)FontHeader.Width; + RowFactor = (float)FontHeader.CellHeight / (float)FontHeader.Height; + + glBindTexture(GL_TEXTURE_2D, TextureID); + + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + + glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, FontHeader.Width, FontHeader.Height, 0, GL_ALPHA, GL_UNSIGNED_BYTE, BufferData.get()); + + Initialized = true; + } + + void RenderFont::RenderString(const char* Text, float X, float Y, float Scale) + { + RenderStringInternal(Text, (uint32_t)strlen(Text), X, Y, Scale); + } + + void RenderFont::RenderString(const string & Text, float X, float Y, float Scale) + { + RenderStringInternal((const char*)Text, Text.Length(), X, Y, Scale); + } + + void RenderFont::Dispose() + { + glDeleteTextures(1, &this->TextureID); + + FontHeader = {}; + std::memset(Widths, 0, sizeof(Widths)); + Initialized = false; + } + + void RenderFont::RenderStringInternal(const char* Text, uint32_t Length, float X, float Y, float Scale) + { + if (!Initialized) + return; + + glEnable(GL_TEXTURE_2D); + glBindTexture(GL_TEXTURE_2D, TextureID); + + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glEnable(GL_BLEND); + + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + glScalef(1, 1, Scale); + + glDisable(GL_DEPTH_TEST); + glDepthMask(false); + + int Row, Col; + float U, V, U1, V1; + + float CurrentX = X; + float CurrentY = Y; + + glBegin(GL_QUADS); + + for (uint32_t i = 0; i < Length; i++) + { + Row = (Text[i] - FontHeader.BaseIndex) / RowPitch; + Col = (Text[i] - FontHeader.BaseIndex) - Row * RowPitch; + + U = Col * ColFactor; + V = Row * RowFactor; + U1 = U + ColFactor; + V1 = V + RowFactor; + + glTexCoord2f(U, V); glVertex2f(CurrentX, CurrentY); + glTexCoord2f(U1, V); glVertex2f(CurrentX + (FontHeader.CellWidth * Scale), CurrentY); + glTexCoord2f(U1, V1); glVertex2f(CurrentX + (FontHeader.CellWidth * Scale), CurrentY + (FontHeader.CellHeight * Scale)); + glTexCoord2f(U, V1); glVertex2f(CurrentX, CurrentY + (FontHeader.CellHeight * Scale)); + + CurrentX += Widths[Text[i]] * Scale; + } + + glEnd(); + + glDisable(GL_BLEND); + glDepthMask(true); + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/RenderFont.h b/r5dev/thirdparty/cppnet/cppkore/RenderFont.h new file mode 100644 index 00000000..7b6d1778 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/RenderFont.h @@ -0,0 +1,60 @@ +#pragma once + +#include +#include +#include "StringBase.h" + +namespace Assets +{ + // Represents an OpenGl compatible font that can be embedded for rendering. + class RenderFont + { + public: + // Initialize a new render font from the provided LZ4 compressed buffer + RenderFont(); + ~RenderFont(); + + // Loads a font from the provided LZ4 compressed buffer + void LoadFont(const uint8_t* Buffer, uint64_t BufferLength); + // Loads a font from the provided file path. + void LoadFont(const string& FontPath); + + // Renders a string to the current opengl context. + void RenderString(const char* Text, float X, float Y, float Scale = 1.f); + // Renders a string to the current opengl context. + void RenderString(const string& Text, float X, float Y, float Scale = 1.f); + + private: + + // Internal cached flags for the atlas +#pragma pack(push, 1) + struct + { + uint32_t Magic; + uint32_t Width; + uint32_t Height; + uint32_t CellWidth; + uint32_t CellHeight; + + uint8_t Bpp; + uint8_t BaseIndex; + } FontHeader; +#pragma pack(pop) + + uint8_t Widths[256]; + + uint32_t TextureID; + uint32_t RowPitch; + + float RowFactor; + float ColFactor; + + bool Initialized; + + // Internal routine to render a string + void RenderStringInternal(const char* Text, uint32_t Length, float X, float Y, float Scale); + + // Internal routine to cleanup the texture instance + void Dispose(); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/RenderShader.cpp b/r5dev/thirdparty/cppnet/cppkore/RenderShader.cpp new file mode 100644 index 00000000..8d0343f8 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/RenderShader.cpp @@ -0,0 +1,105 @@ +#include "stdafx.h" +#include "RenderShader.h" +#include "File.h" + +// We need to include the OpenGL classes +#include "Mangler.h" + +namespace Assets +{ + RenderShader::RenderShader() + : _ProgramID(0) + { + } + + RenderShader::~RenderShader() + { + glDeleteProgram(this->_ProgramID); + } + + void RenderShader::LoadShader(const char* VertSource, const char* FragSource) + { + auto VertShaderID = glCreateShader(GL_VERTEX_SHADER); + auto FragShaderID = glCreateShader(GL_FRAGMENT_SHADER); + + if (VertSource != nullptr && FragSource != nullptr) + { + glShaderSource(VertShaderID, 1, &VertSource, nullptr); + glCompileShader(VertShaderID); + + glShaderSource(FragShaderID, 1, &FragSource, nullptr); + glCompileShader(FragShaderID); + } + + this->_ProgramID = glCreateProgram(); + + glAttachShader(this->_ProgramID, VertShaderID); + glAttachShader(this->_ProgramID, FragShaderID); + glLinkProgram(this->_ProgramID); + + glDetachShader(this->_ProgramID, VertShaderID); + glDetachShader(this->_ProgramID, FragShaderID); + + glDeleteShader(VertShaderID); + glDeleteShader(FragShaderID); + } + + void RenderShader::LoadShader(const string& VertPath, const string& FragPath) + { + auto VertShaderID = glCreateShader(GL_VERTEX_SHADER); + auto FragShaderID = glCreateShader(GL_FRAGMENT_SHADER); + + auto VertSource = IO::File::ReadAllText(VertPath); + auto FragSource = IO::File::ReadAllText(FragPath); + + char* VertPtr = (char*)VertSource.ToCString(); + char* FragPtr = (char*)FragSource.ToCString(); + + glShaderSource(VertShaderID, 1, &VertPtr, nullptr); + glCompileShader(VertShaderID); + + glShaderSource(FragShaderID, 1, &FragPtr, nullptr); + glCompileShader(FragShaderID); + +#if _DEBUG + GLint success = 0; + glGetShaderiv(VertShaderID, GL_COMPILE_STATUS, &success); + + if (!success) + { + GLint maxLength = 0; + glGetShaderiv(VertShaderID, GL_INFO_LOG_LENGTH, &maxLength); + auto log = std::make_unique(maxLength); + glGetShaderInfoLog(VertShaderID, maxLength, &maxLength, log.get()); + printf("Shader compile error: %s\n", log.get()); + } +#endif + + this->_ProgramID = glCreateProgram(); + + glAttachShader(this->_ProgramID, VertShaderID); + glAttachShader(this->_ProgramID, FragShaderID); + glLinkProgram(this->_ProgramID); + + glDetachShader(this->_ProgramID, VertShaderID); + glDetachShader(this->_ProgramID, FragShaderID); + + glDeleteShader(VertShaderID); + glDeleteShader(FragShaderID); + } + + void RenderShader::Use() + { + glUseProgram(this->_ProgramID); + } + + void RenderShader::Detatch() + { + glUseProgram(0); + } + + uint32_t RenderShader::GetUniformLocation(const char* Name) + { + return glGetUniformLocation(this->_ProgramID, Name); + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/RenderShader.h b/r5dev/thirdparty/cppnet/cppkore/RenderShader.h new file mode 100644 index 00000000..41de2cef --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/RenderShader.h @@ -0,0 +1,33 @@ +#pragma once + +#include +#include "StringBase.h" + +namespace Assets +{ + // Represents an OpenGL shader program. + class RenderShader + { + public: + RenderShader(); + ~RenderShader(); + + // Compiles the release shader, internal use only. + void LoadShader(const char* VertSource, const char* FragSource); + // Compiles the debug shader. + void LoadShader(const string& VertPath, const string& FragPath); + + // Sets this shader as current. + void Use(); + // Detatches the current shader. + void Detatch(); + + // Returns the uniform location for this shader. + uint32_t GetUniformLocation(const char* Name); + + private: + + // Internal shader program id + uint32_t _ProgramID; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/RenderViewCamera.cpp b/r5dev/thirdparty/cppnet/cppkore/RenderViewCamera.cpp new file mode 100644 index 00000000..a2007565 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/RenderViewCamera.cpp @@ -0,0 +1,135 @@ +#include "stdafx.h" +#include "RenderViewCamera.h" + +namespace Assets +{ + RenderViewCamera::RenderViewCamera() + : _Theta(0), _Phi(0), _Radius(0), _Up(1), _Target(0, 0, 0), _ViewMatrix(), _ProjectionMatrix(), _MatrixDirty(true) + { + } + + RenderViewCamera::RenderViewCamera(float Theta, float Phi, float Radius, RenderViewCameraUpAxis UpAxis) + : _Theta(Theta), _Phi(Phi), _Radius(Radius), _Up(1), _Target(0, 0, 0), _ViewMatrix(), _ProjectionMatrix(), _MatrixDirty(true) + { + } + + void RenderViewCamera::Rotate(float Theta, float Phi) + { + this->_MatrixDirty = true; + + if (_Up > 0.f) + _Theta += Theta; + else + _Theta -= Theta; + + _Phi += Phi; + + if (_Phi > (float)MathHelper::PI2) + _Phi -= (float)MathHelper::PI2; + else if (_Phi < -(float)MathHelper::PI2) + _Phi += (float)MathHelper::PI2; + + if ((_Phi > 0 && _Phi < (float)MathHelper::PI) || (_Phi < -(float)MathHelper::PI && _Phi > -(float)MathHelper::PI2)) + _Up = 1.f; + else + _Up = -1.f; + } + + void RenderViewCamera::Zoom(float Distance) + { + this->_MatrixDirty = true; + + _Radius -= Distance; + + if (_Radius <= 0.f) + { + _Radius = 30.f; + auto Look = (_Target - this->GetCameraPosition()).GetNormalized(); + _Target = (_Target + (Look * 30.f)); + } + } + + void RenderViewCamera::Pan(float X, float Y) + { + this->_MatrixDirty = true; + + auto Look = (_Target - this->GetCameraPosition()).GetNormalized(); + auto WorldUp = Vector3(0, _Up, 0); + + auto Right = Look.Cross(WorldUp); + auto Up = Look.Cross(Right); + + _Target = (_Target + ((Right * X) + (Up * Y))); + } + + void RenderViewCamera::Reset(float Theta, float Phi, float Radius) + { + _Theta = Theta; + _Phi = Phi; + _Radius = Radius; + _Up = 1; + _Target = { 0, 0, 0 }; + _ViewMatrix = {}; + _ProjectionMatrix = {}; + _MatrixDirty = true; + } + + void RenderViewCamera::SetUpAxis(RenderViewCameraUpAxis UpAxis) + { + switch (UpAxis) + { + case RenderViewCameraUpAxis::Y: + _ModelMatrix = Matrix(); + break; + case RenderViewCameraUpAxis::Z: + _ModelMatrix = Matrix::CreateFromQuaternion(Quaternion::FromEulerAngles(-90, 0, 0)); + break; + } + _MatrixDirty = true; + } + + void RenderViewCamera::UpdateProjectionMatrix(float Fov, float ClientWidth, float ClientHeight, float NearClip, float FarClip) + { + this->_ProjectionMatrix = Matrix::CreatePerspectiveFov(Fov, ClientWidth / ClientHeight, NearClip, FarClip); + } + + Vector3 RenderViewCamera::GetCameraPosition() const + { + return (this->_Target + this->ToCartesian()); + } + + Matrix& RenderViewCamera::GetProjectionMatrix() + { + return this->_ProjectionMatrix; + } + + Matrix& RenderViewCamera::GetViewMatrix() + { + if (this->_MatrixDirty) + { + this->UpdateViewMatrix(); + this->_MatrixDirty = false; + } + + return this->_ViewMatrix; + } + + Matrix& RenderViewCamera::GetModelMatrix() + { + return this->_ModelMatrix; + } + + void RenderViewCamera::UpdateViewMatrix() + { + this->_ViewMatrix = Matrix::CreateLookAt(GetCameraPosition(), this->_Target, Vector3(0.f, this->_Up, 0.f)); + } + + Vector3 RenderViewCamera::ToCartesian() const + { + return Vector3( + _Radius * sinf(_Phi) * sinf(_Theta), + _Radius * cosf(_Phi), + _Radius * sinf(_Phi) * cosf(_Theta) + ); + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/RenderViewCamera.h b/r5dev/thirdparty/cppnet/cppkore/RenderViewCamera.h new file mode 100644 index 00000000..57c03f2f --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/RenderViewCamera.h @@ -0,0 +1,72 @@ +#pragma once + +#include "Matrix.h" +#include "Vector3.h" + +namespace Assets +{ + using namespace Math; // We need the math classes + + enum class RenderViewCameraUpAxis : uint32_t + { + Y = 0, + Z = 1 + }; + + // Represents a 3D viewport camera with various resize routines. + class RenderViewCamera + { + public: + RenderViewCamera(); + RenderViewCamera(float Theta, float Phi, float Radius, RenderViewCameraUpAxis UpAxis = RenderViewCameraUpAxis::Y); + ~RenderViewCamera() = default; + + // Rotates the camera about a point in from of it, theta is forward and backward, phi is side to side. + void Rotate(float Theta, float Phi); + // Move the camera down the look vector. + void Zoom(float Distance); + // Moves the camera within it's local X-Y plane. + void Pan(float X, float Y); + + // Resets the render camera from the given values. + void Reset(float Theta, float Phi, float Radius); + // Sets the up axis properly + void SetUpAxis(RenderViewCameraUpAxis UpAxis); + + // Re-creates the internal projection matrix based on the input. + void UpdateProjectionMatrix(float Fov, float ClientWidth, float ClientHeight, float NearClip, float FarClip); + + // Gets the position of the camera in Cartesian coordinates. + Vector3 GetCameraPosition() const; + // Gets the projection matrix + Matrix& GetProjectionMatrix(); + // Gets the view matrix + Matrix& GetViewMatrix(); + // Gets the model matrix + Matrix& GetModelMatrix(); + + private: + // Internal cached flags + float _Theta; + float _Phi; + float _Radius; + float _Up; + + // Whether or not we need to update the matrix + bool _MatrixDirty; + + // Calculates a new view matrix + void UpdateViewMatrix(); + + // Internal helper routine to calculate the position relative to _Target. + Vector3 ToCartesian() const; + + // The target coordinates + Vector3 _Target; + + // The view, projection, and model matrix + Matrix _ViewMatrix; + Matrix _ProjectionMatrix; + Matrix _ModelMatrix; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/RetrieveVirtualItemEventArgs.cpp b/r5dev/thirdparty/cppnet/cppkore/RetrieveVirtualItemEventArgs.cpp new file mode 100644 index 00000000..72d600b7 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/RetrieveVirtualItemEventArgs.cpp @@ -0,0 +1,10 @@ +#include "stdafx.h" +#include "RetrieveVirtualItemEventArgs.h" + +namespace Forms +{ + RetrieveVirtualItemEventArgs::RetrieveVirtualItemEventArgs(int32_t Index, int32_t SubIndex) + : ItemIndex(Index), SubItemIndex(SubIndex), Text(""), Style() + { + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/RetrieveVirtualItemEventArgs.h b/r5dev/thirdparty/cppnet/cppkore/RetrieveVirtualItemEventArgs.h new file mode 100644 index 00000000..8f6fbdc8 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/RetrieveVirtualItemEventArgs.h @@ -0,0 +1,25 @@ +#pragma once + +#include +#include "StringBase.h" +#include "ListViewItem.h" + +namespace Forms +{ + // Provides data for the RetrieveVirtualItem event. + class RetrieveVirtualItemEventArgs + { + public: + RetrieveVirtualItemEventArgs(int32_t Index, int32_t SubIndex); + ~RetrieveVirtualItemEventArgs() = default; + + // The index of the item to get information on. + const int32_t ItemIndex; + // The sub item index. + const int32_t SubItemIndex; + // The text of the item. + string Text; + // The style of the item. + ListViewItemStyle Style; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/SEAsset.cpp b/r5dev/thirdparty/cppnet/cppkore/SEAsset.cpp new file mode 100644 index 00000000..91091e86 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/SEAsset.cpp @@ -0,0 +1,594 @@ +#include "stdafx.h" +#include "SEAsset.h" + +#include "File.h" +#include "BinaryWriter.h" + +namespace Assets::Exporters +{ + constexpr static const char* SEModelMagic = "SEModel"; + constexpr static const char* SEAnimMagic = "SEAnim"; + + // Specifies the data present for this file container + enum class SEModelDataPresenceFlags : uint8_t + { + // Whether or not this model contains a bone block + SEMODEL_PRESENCE_BONE = 1 << 0, + // Whether or not this model contains submesh blocks + SEMODEL_PRESENCE_MESH = 1 << 1, + // Whether or not this model contains inline material blocks + SEMODEL_PRESENCE_MATERIALS = 1 << 2, + // The file contains a custom data block + SEMODEL_PRESENCE_CUSTOM = 1 << 7, + }; + + // Specifies the data present for bones + enum class SEModelBonePresenceFlags : uint8_t + { + // Whether or not bones contain global-space matricies + SEMODEL_PRESENCE_GLOBAL_MATRIX = 1 << 0, + // Whether or not bones contain local-space matricies + SEMODEL_PRESENCE_LOCAL_MATRIX = 1 << 1, + // Whether or not bones contain scales + SEMODEL_PRESENCE_SCALES = 1 << 2, + }; + + // Specifies the data present for meshes + enum class SEModelMeshPresenceFlags : uint8_t + { + // Whether or not meshes contain at least 1 uv map + SEMODEL_PRESENCE_UVSET = 1 << 0, + // Whether or not meshes contain vertex normals + SEMODEL_PRESENCE_NORMALS = 1 << 1, + // Whether or not meshes contain vertex colors (RGBA) + SEMODEL_PRESENCE_COLOR = 1 << 2, + // Whether or not meshes contain at least 1 weighted skin + SEMODEL_PRESENCE_WEIGHTS = 1 << 3, + }; + + // Specifies how the data is interpreted by the importer + enum class SEAnimAnimationType : uint8_t + { + // Animation translations are set to this exact value each frame + SEANIM_ABSOLUTE = 0, + // This animation is applied to existing animation data in the scene + SEANIM_ADDITIVE = 1, + // Animation translations are based on rest position in scene + SEANIM_RELATIVE = 2 + }; + + // Specifies the data present for each frame of every bone (Internal use only, matches specification v1.0.1) + enum class SEAnimDataPresenceFlags : uint8_t + { + // Animation has bone location keyframes + SEANIM_BONE_LOC = 1 << 0, + // Animation has bone rotation keyframes + SEANIM_BONE_ROT = 1 << 1, + // Animation has bone scale keyframes + SEANIM_BONE_SCALE = 1 << 2, + // The file contains notetrack data + SEANIM_PRESENCE_NOTE = 1 << 6, + // The file contains a custom data block + SEANIM_PRESENCE_CUSTOM = 1 << 7, + }; + + bool SEAsset::ExportAnimation(const Animation& Animation, const string& Path) + { + auto Writer = IO::BinaryWriter(IO::File::Create(Path)); + + Writer.Write((void*)SEAnimMagic, 0, strlen(SEAnimMagic)); // Magic + Writer.Write(0x1); // Version + Writer.Write(0x1C); // Header size + + // We need to iterate all curves and find the must used type + // When we do, we'll default to that, and inject modifiers for the rest... + uint32_t Slots[3] = { 0, 0, 0 }; + + // This is a traditional map of bones for the format + List Bones; + + { + Dictionary SEBones; + + for (auto& Kvp : Animation.Curves) + { + for (auto& Curve : Kvp.Value()) + { + Slots[(uint32_t)Curve.Mode]++; + } + + if (Kvp.Value().Count() > 0) + SEBones.Add(Kvp.Key(), 0); + } + + for (auto& Kvp : SEBones) + Bones.EmplaceBack(Kvp.Key()); + } + + auto AnimationType = AnimationCurveMode::Absolute; + + uint32_t LargestSize = 0; + for (uint32_t i = 0; i < 3; i++) + { + if (Slots[i] > LargestSize) + { + LargestSize = Slots[i]; + AnimationType = (AnimationCurveMode)i; + } + } + + switch (AnimationType) + { + case AnimationCurveMode::Absolute: + Writer.Write((uint8_t)SEAnimAnimationType::SEANIM_ABSOLUTE); + break; + case AnimationCurveMode::Additive: + Writer.Write((uint8_t)SEAnimAnimationType::SEANIM_ADDITIVE); + break; + case AnimationCurveMode::Relative: + Writer.Write((uint8_t)SEAnimAnimationType::SEANIM_RELATIVE); + break; + } + + Dictionary BoneTypeModifiers; + + for (uint32_t i = 0; i < Bones.Count(); i++) + { + auto& Bone = Bones[i]; + + if (Animation.Curves.ContainsKey(Bone)) + { + auto& Curves = Animation.Curves[Bone]; + + for (auto& Curve : Curves) + { + if (Curve.Mode != AnimationType) + BoneTypeModifiers.Add(i, Curve.Mode); + } + } + } + + Writer.Write(Animation.Looping ? (1 << 0) : 0); + + auto DataPresentFlags = 0; + DataPresentFlags |= (uint8_t)SEAnimDataPresenceFlags::SEANIM_BONE_LOC; + DataPresentFlags |= (uint8_t)SEAnimDataPresenceFlags::SEANIM_BONE_ROT; + DataPresentFlags |= (uint8_t)SEAnimDataPresenceFlags::SEANIM_BONE_SCALE; + + if (Animation.Notificiations.Count() > 0) + DataPresentFlags |= (uint8_t)SEAnimDataPresenceFlags::SEANIM_PRESENCE_NOTE; + + Writer.Write((uint8_t)DataPresentFlags); + + Writer.Write(0); // Data property flags + Writer.Write(0); // Reserved bytes + + Writer.Write(Animation.FrameRate); + + auto FrameCount = Animation.FrameCount(true); // We must use legacy mode for SEAnims + auto BoneCount = Bones.Count(); + auto NotificationCount = Animation.NotificationCount(); // Same as SEAnims + + Writer.Write(FrameCount); + Writer.Write(BoneCount); + Writer.Write((uint8_t)BoneTypeModifiers.Count()); + + uint8_t Reserved[] = { 0, 0, 0 }; + Writer.Write(&Reserved[0], 0, 3); + + Writer.Write(NotificationCount); + + for (auto& Bone : Bones) + Writer.WriteCString(Bone); + + for (auto& BoneTypeKvp : BoneTypeModifiers) + { + if (BoneCount <= 0xFF) + Writer.Write((uint8_t)BoneTypeKvp.Key()); + else if (BoneCount <= 0xFFFF) + Writer.Write((uint16_t)BoneTypeKvp.Key()); + else + Writer.Write((uint32_t)BoneTypeKvp.Key()); + + switch (BoneTypeKvp.Value()) + { + case AnimationCurveMode::Absolute: + Writer.Write((uint8_t)SEAnimAnimationType::SEANIM_ABSOLUTE); + break; + case AnimationCurveMode::Relative: + Writer.Write((uint8_t)SEAnimAnimationType::SEANIM_RELATIVE); + break; + case AnimationCurveMode::Additive: + Writer.Write((uint8_t)SEAnimAnimationType::SEANIM_ADDITIVE); + break; + } + } + + for (uint32_t i = 0; i < BoneCount; i++) + { + Writer.Write(0); // Flags + + auto& BoneCurves = Animation.Curves[Bones[i]]; + + int32_t TrackSlots[7] = { -1, -1, -1, -1, -1, -1, -1 }; + + uint32_t PositionTrackCount = 0; + uint32_t RotationTrackCount = 0; + uint32_t ScaleTrackCount = 0; + + for (uint32_t i = 0; i < BoneCurves.Count(); i++) + { + auto& Curve = BoneCurves[i]; + if (Curve.Property == CurveProperty::RotateQuaternion) + { + TrackSlots[(uint32_t)Curve.Property - 1] = i; + RotationTrackCount = max(RotationTrackCount, Curve.Keyframes.Count()); + } + else if (Curve.Property >= CurveProperty::TranslateX && Curve.Property <= CurveProperty::TranslateZ) + { + TrackSlots[(uint32_t)Curve.Property - 4] = i; + PositionTrackCount = max(PositionTrackCount, Curve.Keyframes.Count()); + } + else if (Curve.Property >= CurveProperty::ScaleX && Curve.Property <= CurveProperty::ScaleZ) + { + TrackSlots[(uint32_t)Curve.Property - 4] = i; + ScaleTrackCount = max(ScaleTrackCount, Curve.Keyframes.Count()); + } + } + + // + // Positions + // + + if (FrameCount <= 0xFF) + Writer.Write((uint8_t)PositionTrackCount); + else if (FrameCount <= 0xFFFF) + Writer.Write((uint16_t)PositionTrackCount); + else + Writer.Write(PositionTrackCount); + + for (uint32_t i = 0; i < PositionTrackCount; i++) + { + uint32_t Frame = 0; + Vector3 Key{}; + + if (TrackSlots[1] > -1) + { + Frame = BoneCurves[TrackSlots[1]].Keyframes[i].Frame.Integer32; + Key.X = BoneCurves[TrackSlots[1]].Keyframes[i].Value.Float; + } + if (TrackSlots[2] > -1) + { + Frame = BoneCurves[TrackSlots[2]].Keyframes[i].Frame.Integer32; + Key.Y = BoneCurves[TrackSlots[2]].Keyframes[i].Value.Float; + } + if (TrackSlots[3] > -1) + { + Frame = BoneCurves[TrackSlots[3]].Keyframes[i].Frame.Integer32; + Key.Z = BoneCurves[TrackSlots[3]].Keyframes[i].Value.Float; + } + + if (FrameCount <= 0xFF) + Writer.Write((uint8_t)Frame); + else if (FrameCount <= 0xFFFF) + Writer.Write((uint16_t)Frame); + else + Writer.Write(Frame); + + Writer.Write(Key); + } + + // + // Rotations + // + + if (FrameCount <= 0xFF) + Writer.Write((uint8_t)RotationTrackCount); + else if (FrameCount <= 0xFFFF) + Writer.Write((uint16_t)RotationTrackCount); + else + Writer.Write(RotationTrackCount); + + for (uint32_t i = 0; i < RotationTrackCount; i++) + { + uint32_t Frame = 0; + Quaternion Key{0, 0, 0, 1}; + + if (TrackSlots[0] > -1) + { + Frame = BoneCurves[TrackSlots[0]].Keyframes[i].Frame.Integer32; + Key = BoneCurves[TrackSlots[0]].Keyframes[i].Value.Vector4; + } + + if (FrameCount <= 0xFF) + Writer.Write((uint8_t)Frame); + else if (FrameCount <= 0xFFFF) + Writer.Write((uint16_t)Frame); + else + Writer.Write(Frame); + + Writer.Write(Key); + } + + // + // Scales + // + + if (FrameCount <= 0xFF) + Writer.Write((uint8_t)ScaleTrackCount); + else if (FrameCount <= 0xFFFF) + Writer.Write((uint16_t)ScaleTrackCount); + else + Writer.Write(ScaleTrackCount); + + for (uint32_t i = 0; i < ScaleTrackCount; i++) + { + uint32_t Frame = 0; + Vector3 Key{}; + + if (TrackSlots[4] > -1) + { + Frame = BoneCurves[TrackSlots[4]].Keyframes[i].Frame.Integer32; + Key.X = BoneCurves[TrackSlots[4]].Keyframes[i].Value.Float; + } + if (TrackSlots[5] > -1) + { + Frame = BoneCurves[TrackSlots[5]].Keyframes[i].Frame.Integer32; + Key.Y = BoneCurves[TrackSlots[5]].Keyframes[i].Value.Float; + } + if (TrackSlots[6] > -1) + { + Frame = BoneCurves[TrackSlots[6]].Keyframes[i].Frame.Integer32; + Key.Z = BoneCurves[TrackSlots[6]].Keyframes[i].Value.Float; + } + + if (FrameCount <= 0xFF) + Writer.Write((uint8_t)Frame); + else if (FrameCount <= 0xFFFF) + Writer.Write((uint16_t)Frame); + else + Writer.Write(Frame); + + Writer.Write(Key); + } + } + + for (auto& NoteTrack : Animation.Notificiations) + { + for (auto& Key : NoteTrack.Value()) + { + if (FrameCount <= 0xFF) + Writer.Write((uint8_t)Key); + else if (FrameCount <= 0xFFFF) + Writer.Write((uint16_t)Key); + else + Writer.Write(Key); + + Writer.WriteCString(NoteTrack.Key()); + } + } + + return true; + } + + bool SEAsset::ExportModel(const Model& Model, const string& Path) + { + auto Writer = IO::BinaryWriter(IO::File::Create(Path)); + + Writer.Write((void*)SEModelMagic, 0, strlen(SEModelMagic)); // Magic + Writer.Write(0x1); // Version + Writer.Write(0x14); // Header size + + auto FileDpFlags = 0; + + if (!Model.Bones.Empty()) + FileDpFlags |= (uint8_t)SEModelDataPresenceFlags::SEMODEL_PRESENCE_BONE; + if (!Model.Meshes.Empty()) + FileDpFlags |= (uint8_t)SEModelDataPresenceFlags::SEMODEL_PRESENCE_MESH; + if (!Model.Materials.Empty()) + FileDpFlags |= (uint8_t)SEModelDataPresenceFlags::SEMODEL_PRESENCE_MATERIALS; + + bool HasGlobalMatrix = false; + bool HasLocalMatrix = false; + bool HasScales = false; + + for (auto& Bone : Model.Bones) + { + if (Bone.GetFlag(BoneFlags::HasGlobalSpaceMatrices)) + HasGlobalMatrix = true; + if (Bone.GetFlag(BoneFlags::HasLocalSpaceMatrices)) + HasLocalMatrix = true; + if (Bone.GetFlag(BoneFlags::HasScale)) + HasScales = true; + + if (HasGlobalMatrix && HasLocalMatrix && HasScales) + break; + } + + auto BoneDpFlags = 0; + + if (HasGlobalMatrix) + BoneDpFlags |= (uint8_t)SEModelBonePresenceFlags::SEMODEL_PRESENCE_GLOBAL_MATRIX; + if (HasLocalMatrix) + BoneDpFlags |= (uint8_t)SEModelBonePresenceFlags::SEMODEL_PRESENCE_LOCAL_MATRIX; + if (HasScales) + BoneDpFlags |= (uint8_t)SEModelBonePresenceFlags::SEMODEL_PRESENCE_SCALES; + + auto MeshDpFlags = 0; + + MeshDpFlags |= (uint8_t)SEModelMeshPresenceFlags::SEMODEL_PRESENCE_NORMALS; + MeshDpFlags |= (uint8_t)SEModelMeshPresenceFlags::SEMODEL_PRESENCE_COLOR; + MeshDpFlags |= (uint8_t)SEModelMeshPresenceFlags::SEMODEL_PRESENCE_UVSET; + + bool HasBones = false; + if (!Model.Bones.Empty()) + { + MeshDpFlags |= (uint8_t)SEModelMeshPresenceFlags::SEMODEL_PRESENCE_WEIGHTS; + HasBones = true; + } + + Writer.Write(FileDpFlags); + Writer.Write(BoneDpFlags); + Writer.Write(MeshDpFlags); + + auto BoneCount = Model.Bones.Count(); + auto MeshCount = Model.Meshes.Count(); + auto MaterialCount = Model.Materials.Count(); + + Writer.Write(BoneCount); + Writer.Write(MeshCount); + Writer.Write(MaterialCount); + + uint8_t Reserved[3]{}; + Writer.Write(Reserved, 0, 3); + + for (auto& Bone : Model.Bones) + Writer.WriteCString(Bone.Name()); + + for (auto& Bone : Model.Bones) + { + Writer.Write(0); // Bone Flags + Writer.Write(Bone.Parent()); // Parent + + if (HasGlobalMatrix) + { + Writer.Write(Bone.GlobalPosition()); + Writer.Write(Bone.GlobalRotation()); + } + + if (HasLocalMatrix) + { + Writer.Write(Bone.LocalPosition()); + Writer.Write(Bone.LocalRotation()); + } + + if (HasScales) + Writer.Write(Bone.Scale()); + } + + for (auto& Mesh : Model.Meshes) + { + Writer.Write(0); // Mesh Flags + + auto VertexCount = Mesh.Vertices.Count(); + auto FaceCount = Mesh.Faces.Count(); + auto UVLayerCount = Mesh.Vertices.UVLayerCount(); + auto MaxSkinCount = Mesh.Vertices.WeightCount(); + + Writer.Write(UVLayerCount); + Writer.Write(MaxSkinCount); + Writer.Write(VertexCount); + Writer.Write(FaceCount); + + for (auto& Vertex : Mesh.Vertices) + Writer.Write(Vertex.Position()); + + for (auto& Vertex : Mesh.Vertices) + { + for (uint32_t i = 0; i < UVLayerCount; i++) + Writer.Write(Vertex.UVLayers(i)); + } + + for (auto& Vertex : Mesh.Vertices) + Writer.Write(Vertex.Normal()); + + for (auto& Vertex : Mesh.Vertices) + Writer.Write(Vertex.Color()); + + if (MaxSkinCount > 0 && HasBones) + { + for (auto& Vertex : Mesh.Vertices) + { + for (uint32_t i = 0; i < MaxSkinCount; i++) + { + auto& Weight = Vertex.Weights(i); + + if (BoneCount <= 0xFF) + Writer.Write((uint8_t)Weight.Bone); + else if (BoneCount <= 0xFFFF) + Writer.Write((uint16_t)Weight.Bone); + else + Writer.Write(Weight.Bone); + + Writer.Write(Weight.Value); + } + } + } + + for (auto& Face : Mesh.Faces) + { + if (VertexCount <= 0xFF) + { + Writer.Write((uint8_t)Face[0]); + Writer.Write((uint8_t)Face[1]); + Writer.Write((uint8_t)Face[2]); + } + else if (VertexCount <= 0xFFFF) + { + Writer.Write((uint16_t)Face[0]); + Writer.Write((uint16_t)Face[1]); + Writer.Write((uint16_t)Face[2]); + } + else + { + Writer.Write(Face[0]); + Writer.Write(Face[1]); + Writer.Write(Face[2]); + } + } + + for (auto& MaterialIndex : Mesh.MaterialIndices) + Writer.Write(MaterialIndex); + } + + for (auto& Material : Model.Materials) + { + Writer.WriteCString(Material.Name); + Writer.Write(true); + + if (Material.Slots.ContainsKey(MaterialSlotType::Albedo)) + Writer.WriteCString(Material.Slots[MaterialSlotType::Albedo].first); + else if (Material.Slots.ContainsKey(MaterialSlotType::Diffuse)) + Writer.WriteCString(Material.Slots[MaterialSlotType::Diffuse].first); + else + Writer.Write(0); + + if (Material.Slots.ContainsKey(MaterialSlotType::Normal)) + Writer.WriteCString(Material.Slots[MaterialSlotType::Normal].first); + else + Writer.Write(0); + + if (Material.Slots.ContainsKey(MaterialSlotType::Specular)) + Writer.WriteCString(Material.Slots[MaterialSlotType::Specular].first); + else + Writer.Write(0); + } + + return true; + } + + imstring SEAsset::ModelExtension() + { + return ".semodel"; + } + + imstring SEAsset::AnimationExtension() + { + return ".seanim"; + } + + ExporterScale SEAsset::ExportScale() + { + return ExporterScale::Default; + } + + bool SEAsset::SupportsAnimations() + { + return true; + } + + bool SEAsset::SupportsModels() + { + return true; + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/SEAsset.h b/r5dev/thirdparty/cppnet/cppkore/SEAsset.h new file mode 100644 index 00000000..70321116 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/SEAsset.h @@ -0,0 +1,32 @@ +#pragma once + +#include +#include "Exporter.h" + +namespace Assets::Exporters +{ + class SEAsset : public Exporter + { + public: + SEAsset() = default; + ~SEAsset() = default; + + // Exports the given animation to the provided path. + virtual bool ExportAnimation(const Animation& Animation, const string& Path); + // Exports the given model to the provided path. + virtual bool ExportModel(const Model& Model, const string& Path); + + // Gets the file extension for this exporters model format. + virtual imstring ModelExtension(); + // Gets the file extension for this exporters animation format. + virtual imstring AnimationExtension(); + + // Gets the required scaling constant for this exporter. + virtual ExporterScale ExportScale(); + + // Gets whether or not the exporter supports animation exporting. + virtual bool SupportsAnimations(); + // Gets whether or not the exporter supports model exporting. + virtual bool SupportsModels(); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/SaveFileDialog.cpp b/r5dev/thirdparty/cppnet/cppkore/SaveFileDialog.cpp new file mode 100644 index 00000000..0a2b742c --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/SaveFileDialog.cpp @@ -0,0 +1,51 @@ +#include "stdafx.h" +#include "SaveFileDialog.h" +#include "Path.h" +#include + +namespace Forms +{ + const string BuildSaveFileFilter(const string& Filter) + { + string InitialFilter = (string::IsNullOrWhiteSpace(Filter)) ? string(" |*.*") : Filter; + auto Buffer = std::make_unique((size_t)InitialFilter.Length() + 2); // Final filter has two null chars + auto BufferMask = (char*)Buffer.get(); + + std::memcpy(Buffer.get(), InitialFilter.ToCString(), InitialFilter.Length()); + + for (uint32_t i = 0; i < InitialFilter.Length(); i++) + { + if (BufferMask[i] == '|') + BufferMask[i] = (char)0; + } + + BufferMask[InitialFilter.Length() + 1] = (char)0; + + return string((char*)Buffer.get(), (size_t)InitialFilter.Length() + 1); + } + + string SaveFileDialog::ShowFileDialog(const string& Title, const string& BasePath, const string& Filter, Control* Owner) + { + HWND OwnerHandle = (Owner != nullptr) ? Owner->GetHandle() : NULL; + char Buffer[MAX_PATH]{}; + + OPENFILENAMEA oFileDialog{}; + oFileDialog.lStructSize = sizeof(OPENFILENAMEA); + + auto FilterBuffer = BuildSaveFileFilter(Filter); + + oFileDialog.hwndOwner = OwnerHandle; + oFileDialog.lpstrFilter = (LPSTR)FilterBuffer.ToCString(); + oFileDialog.lpstrInitialDir = (LPCSTR)BasePath.ToCString(); + oFileDialog.lpstrFile = (LPSTR)Buffer; + oFileDialog.nMaxFile = MAX_PATH; + oFileDialog.lpstrTitle = Title.ToCString(); + + // Open the dialog with the config and then return result + if (GetSaveFileNameA(&oFileDialog)) + return string(Buffer); + + // We need nothing as a default because we don't get a return value + return ""; + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/SaveFileDialog.h b/r5dev/thirdparty/cppnet/cppkore/SaveFileDialog.h new file mode 100644 index 00000000..f61d7629 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/SaveFileDialog.h @@ -0,0 +1,18 @@ +#pragma once + +#include +#include "Control.h" +#include "ListBase.h" +#include "StringBase.h" +#include "DialogResult.h" + +namespace Forms +{ + // Handles a dialog prompt that asks for a file to save + class SaveFileDialog + { + public: + // Opens the dialog and allows the user to save one file + static string ShowFileDialog(const string& Title, const string& BasePath = "", const string& Filter = " |*.*", Control* Owner = nullptr); + }; +} diff --git a/r5dev/thirdparty/cppnet/cppkore/ScrollBars.h b/r5dev/thirdparty/cppnet/cppkore/ScrollBars.h new file mode 100644 index 00000000..3d9e0704 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ScrollBars.h @@ -0,0 +1,19 @@ +#pragma once + +#include + +namespace Forms +{ + // Specifies which scroll bars will be visible on a control. + enum class ScrollBars + { + // No scroll bars are shown. + None = 0, + // Only horizontal scroll bars are shown. + Horizontal = 1, + // Only vertical scroll bars are shown. + Vertical = 2, + // Both horizontal and vertical scroll bars are shown. + Both = 3 + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/SecureString.h b/r5dev/thirdparty/cppnet/cppkore/SecureString.h new file mode 100644 index 00000000..efdfa1d8 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/SecureString.h @@ -0,0 +1,72 @@ +#pragma once + +#include "StringBase.h" + +namespace Data +{ + namespace _Internal + { + template + struct Encryptor + { + static constexpr void Encrypt(char* Destination, const char* Source, size_t Size) + { + Destination[Index] = (char)(Source[Index] ^ Size); + Encryptor::Encrypt(Destination, Source, Size + 1); + } + }; + + template<> + struct Encryptor<0> + { + static constexpr void Encrypt(char* Destination, const char* Source, size_t Size) + { + Destination[0] = (char)(Source[0] ^ Size); + } + }; + } + + template + class SecureString + { + public: + // Initializes a string that is obfuscated during compiletime + constexpr SecureString(const char(&Str)[Size]) + { + _Internal::Encryptor::Encrypt(_Buffer, Str, Size); + } + + // Returns a decoded version of the encoded string + string GetDecoded() const + { + auto Result = string(_Buffer, (uint32_t)Size); + auto Key = Size * 2; + + for (auto& Ch : Result) + Ch ^= --Key; + + return Result; + } + + constexpr operator string(void) const + { + auto Result = string(_Buffer, (uint32_t)Size); + auto Key = Size * 2; + + for (auto& Ch : Result) + Ch ^= --Key; + + return Result; + } + + private: + mutable char _Buffer[Size]{}; + }; +} + +template +// Creates a new compile-time encrypted string +static constexpr auto sstring(const char(&String)[Size]) +{ + return Data::SecureString(String); +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/SeekOrigin.h b/r5dev/thirdparty/cppnet/cppkore/SeekOrigin.h new file mode 100644 index 00000000..e4b52ee3 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/SeekOrigin.h @@ -0,0 +1,12 @@ +#pragma once + +namespace IO +{ + // Provides seek reference points. + enum class SeekOrigin + { + Begin = 0, + Current = 1, + End = 2 + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Settings.cpp b/r5dev/thirdparty/cppnet/cppkore/Settings.cpp new file mode 100644 index 00000000..4b723050 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Settings.cpp @@ -0,0 +1,145 @@ +#include "stdafx.h" +#include "Settings.h" + +namespace System +{ + // Our protected string key + constexpr unsigned char KeyData[] = { 0x4C, 0x39, 0x56, 0x75, 0x42, 0x52, 0x65, 0x75, 0x70, 0x35, 0x31, 0x77, 0x4C, 0x51, 0x64, 0x61 }; + + SettingsObject::SettingsObject() + : Key(), Type(SettingType::Boolean), Values() + { + } + + SettingsObject::SettingsObject(string Key, SettingType Type, uint8_t* Value) + : Key(Key), Type(Type), Values() + { + switch (Type) + { + case SettingType::Boolean: + Values.Boolean = *(bool*)Value; + break; + case SettingType::Integer: + Values.Integer = *(uint32_t*)Value; + break; + case SettingType::Integer64: + Values.Integer64 = *(uint64_t*)Value; + break; + case SettingType::String: + case SettingType::ProtectedString: + { + auto Len = strlen((char*)Value); + Values.String = new char[Len + 1]{}; + std::memcpy(Values.String, Value, Len); + } + break; + } + } + + SettingsObject::~SettingsObject() + { + if (Values.String != NULL && (Type == SettingType::ProtectedString)) + delete[] Values.String; + } + + void Settings::Load(const string& Path) + { + auto Reader = IO::BinaryReader(IO::File::OpenRead(Path)); + + if (Reader.Read() != 0x4746434B) + return; + if (Reader.Read() != 0x1) + return; + + auto KeyCount = Reader.Read(); + + for (uint32_t i = 0; i < KeyCount; i++) + { + auto Type = (SettingType)Reader.Read(); + auto Key = Reader.ReadNetString(); + + switch (Type) + { + case SettingType::Boolean: + { + auto Val = Reader.Read(); + _Settings.EmplaceBack(Key, Type, (uint8_t*)&Val); + } + break; + case SettingType::Integer: + { + auto Val = Reader.Read(); + _Settings.EmplaceBack(Key, Type, (uint8_t*)&Val); + } + break; + case SettingType::Integer64: + { + auto Val = Reader.Read(); + _Settings.EmplaceBack(Key, Type, (uint8_t*)&Val); + } + break; + case SettingType::String: + { + auto Val = Reader.ReadNetString(); + _Settings.EmplaceBack(Key, Type, (uint8_t*)&Val[0]); + } + break; + case SettingType::ProtectedString: + { + auto Val = Reader.ReadNetString(); + + for (uint32_t i = 0; i < Val.Length(); i++) + Val[i] ^= KeyData[i % sizeof(KeyData)]; + + _Settings.EmplaceBack(Key, Type, (uint8_t*)&Val[0]); + } + break; + + default: + return; + } + } + } + + void Settings::Save(const string& Path) + { + auto Writer = IO::BinaryWriter(IO::File::Create(Path)); + + Writer.Write(0x4746434B); + Writer.Write(0x1); + Writer.Write(this->_Settings.Count()); + + for (auto& Setting : _Settings) + { + Writer.Write((char)Setting.Type); + Writer.WriteNetString(Setting.Key); + + switch (Setting.Type) + { + case SettingType::Boolean: + Writer.Write(Setting.Values.Boolean); + break; + case SettingType::Integer: + Writer.Write(Setting.Values.Integer); + break; + case SettingType::Integer64: + Writer.Write(Setting.Values.Integer64); + break; + case SettingType::String: + Writer.WriteNetString(Setting.Values.String); + break; + case SettingType::ProtectedString: + { + auto Value = string(Setting.Values.String); + auto ValueLen = Value.Length(); + + for (uint32_t i = 0; i < ValueLen; i++) + Value[i] ^= KeyData[i % sizeof(KeyData)]; + + Writer.WriteNetString(Value); + } + break; + } + } + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/Settings.h b/r5dev/thirdparty/cppnet/cppkore/Settings.h new file mode 100644 index 00000000..daba7398 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Settings.h @@ -0,0 +1,264 @@ +#pragma once + +#include +#include "ListBase.h" +#include "StringBase.h" +#include "ImmutableStringBase.h" +#include "File.h" +#include "BinaryReader.h" +#include "BinaryWriter.h" + +namespace System +{ + // Represents the type of setting we are using + enum class SettingType : char + { + Boolean = 'B', + Integer = 'I', + Integer64 = 'L', + String = 'S', + ProtectedString = 'P' + }; + + // Used to store a setting. + class SettingsObject + { + public: + SettingsObject(); + SettingsObject(string Key, SettingType Type, uint8_t* Value); + ~SettingsObject(); + + string Key; + SettingType Type; + + union ValueUn + { + char* String; + bool Boolean; + uint32_t Integer; + uint64_t Integer64; + } Values; + + SettingsObject& operator=(SettingsObject Rhs) + { + Key = Rhs.Key; + Type = Rhs.Type; + + if (Type == SettingType::String || Type == SettingType::ProtectedString) + { + if (this->Values.String) + delete[] this->Values.String; + + auto Len = strlen(Rhs.Values.String); + this->Values.String = new char[Len + 1]{}; + std::memcpy(this->Values.String, Rhs.Values.String, Len); + } + else + { + this->Values.Integer64 = Rhs.Values.Integer64; + } + + return *this; + } + + bool operator==(SettingsObject Rhs) + { + // yes yes yes i know this is bad but it doesn't cause issues for me so who cares + return Key == Rhs.Key && Type == Rhs.Type; + } + }; + + // Reads and writes configuration files. + class Settings + { + public: + Settings() = default; + ~Settings() = default; + + + _declspec(noinline) void SetBool(const imstring& Key, bool Value) + { + for (auto& Setting : _Settings) + { + if (Setting.Key == (const char*)Key) + { + Setting.Values.Boolean = Value; + } + } + _Settings.EmplaceBack(Key, SettingType::Boolean, (uint8_t*)&Value); + } + + _declspec(noinline) void SetInt(const imstring& Key, uint32_t Value) + { + for (auto& Setting : _Settings) + { + if (Setting.Key == (const char*)Key) + { + Setting.Values.Integer = Value; + } + } + _Settings.EmplaceBack(Key, SettingType::Integer, (uint8_t*)&Value); + } + + template + _declspec(noinline) void Set(const imstring& Key, V && Value) + { + for (auto& Setting : _Settings) + { + if (Setting.Key == (const char*)Key) + { + if constexpr (T == SettingType::Boolean) + Setting.Values.Boolean = Value; + else if constexpr (T == SettingType::Integer) + Setting.Values.Integer = Value; + else if constexpr (T == SettingType::Integer64) + Setting.Values.Integer64 = Value; + else if constexpr (T == SettingType::ProtectedString || T == SettingType::String) + { + if (Setting.Values.String != NULL) + delete[] Setting.Values.String; + + if constexpr (std::is_same::value) + { + Setting.Values.String = new char[Value.Length() + 1]{}; + std::memcpy(Setting.Values.String, (const char*)Value, Value.Length()); + } + else + { + auto Len = strlen(Value); + Setting.Values.String = new char[Len + 1]{}; + std::memcpy(Setting.Values.String, Value, Len); + } + } + + return; + } + } + if constexpr (T == SettingType::String) + _Settings.EmplaceBack(Key, T, (uint8_t*)Value.ToCString()); + else + _Settings.EmplaceBack(Key, T, (uint8_t*)&Value); + + } + + template + _declspec(noinline) bool Has(const imstring& Key) + { + SettingsObject* Value = nullptr; + + for (auto& Setting : _Settings) + { + if (Setting.Key == (const char*)Key) + { + Value = &Setting; + break; + } + } + + return (Value != nullptr); + } + + // for some reason the template one doesn't even check the type so what is the point in having it as a template? + bool Has(const imstring& Key) + { + SettingsObject* Value = nullptr; + + for (auto& Setting : _Settings) + { + if (Setting.Key == (const char*)Key) + { + Value = &Setting; + break; + } + } + + return (Value != nullptr); + } + + template + _declspec(noinline) void Remove(const imstring& Key) + { + for (SettingsObject& Setting : _Settings) + { + if (Setting.Key == (const char*)Key) + { + Setting = SettingsObject(); + break; + } + } + + return; + }; + + _declspec(noinline) bool GetBool(const imstring& Key) + { + SettingsObject* Value = nullptr; + + for (auto& Setting : _Settings) + { + if (Setting.Key == (const char*)Key) + { + Value = &Setting; + break; + } + } + if (Value) + return Value->Values.Boolean; + + return false; + } + + template + _declspec(noinline) auto Get(const imstring& Key) + { + SettingsObject* Value = nullptr; + + for (auto& Setting : _Settings) + { + if (Setting.Key == (const char*)Key) + { + Value = &Setting; + break; + } + } + + if constexpr (T == SettingType::Boolean) + { + if (Value) + return (bool)Value->Values.Boolean; + + return (bool)false; + } + else if constexpr (T == SettingType::Integer) + { + if (Value) + return (uint32_t)Value->Values.Integer; + + return (uint32_t)0; + } + else if constexpr (T == SettingType::Integer64) + { + if (Value) + return (uint64_t)Value->Values.Integer64; + + return (uint64_t)0; + } + else if constexpr (T == SettingType::String || T == SettingType::ProtectedString) + { + if (Value) + return (string)Value->Values.String; + + return (string)""; + } + } + + // Load the config file from the specified path. + void Load(const string& Path); + // Save the config file to the specified path. + void Save(const string& Path); + + private: + // Internal cached settings + List _Settings; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/SortOrder.h b/r5dev/thirdparty/cppnet/cppkore/SortOrder.h new file mode 100644 index 00000000..d25c109f --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/SortOrder.h @@ -0,0 +1,18 @@ +#pragma once + +#include + +namespace Forms +{ + // Specifies how items in + // a list are sorted. + enum class SortOrder + { + // The items are not sorted. + None = 0, + // The items are sorted in ascending order. + Ascending = 1, + // The items sorted in descending order. + Descending = 2 + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/SpecialFolder.h b/r5dev/thirdparty/cppnet/cppkore/SpecialFolder.h new file mode 100644 index 00000000..4311197e --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/SpecialFolder.h @@ -0,0 +1,201 @@ +#pragma once + +#include + +namespace System +{ + enum class SpecialFolder + { + // + // Represents the file system directory that serves as a common repository for + // application-specific data for the current, roaming user. + // A roaming user works on more than one computer on a network. A roaming user's + // profile is kept on a server on the network and is loaded onto a system when the + // user logs on. + // + ApplicationData = CSIDL_APPDATA, + // + // Represents the file system directory that serves as a common repository for application-specific data that + // is used by all users. + // + CommonApplicationData = CSIDL_COMMON_APPDATA, + // + // Represents the file system directory that serves as a common repository for application specific data that + // is used by the current, non-roaming user. + // + LocalApplicationData = CSIDL_LOCAL_APPDATA, + // + // Represents the file system directory that serves as a common repository for Internet + // cookies. + // + Cookies = CSIDL_COOKIES, + Desktop = CSIDL_DESKTOP, + // + // Represents the file system directory that serves as a common repository for the user's + // favorite items. + // + Favorites = CSIDL_FAVORITES, + // + // Represents the file system directory that serves as a common repository for Internet + // history items. + // + History = CSIDL_HISTORY, + // + // Represents the file system directory that serves as a common repository for temporary + // Internet files. + // + InternetCache = CSIDL_INTERNET_CACHE, + // + // Represents the file system directory that contains + // the user's program groups. + // + Programs = CSIDL_PROGRAMS, + MyComputer = CSIDL_DRIVES, + MyMusic = CSIDL_MYMUSIC, + MyPictures = CSIDL_MYPICTURES, + // "My Videos" folder + MyVideos = CSIDL_MYVIDEO, + // + // Represents the file system directory that contains the user's most recently used + // documents. + // + Recent = CSIDL_RECENT, + // + // Represents the file system directory that contains Send To menu items. + // + SendTo = CSIDL_SENDTO, + // + // Represents the file system directory that contains the Start menu items. + // + StartMenu = CSIDL_STARTMENU, + // + // Represents the file system directory that corresponds to the user's Startup program group. The system + // starts these programs whenever any user logs on to Windows NT, or + // starts Windows 95 or Windows 98. + // + Startup = CSIDL_STARTUP, + // + // System directory. + // + System = CSIDL_SYSTEM, + // + // Represents the file system directory that serves as a common repository for document + // templates. + // + Templates = CSIDL_TEMPLATES, + // + // Represents the file system directory used to physically store file objects on the desktop. + // This should not be confused with the desktop folder itself, which is + // a virtual folder. + // + DesktopDirectory = CSIDL_DESKTOPDIRECTORY, + // + // Represents the file system directory that serves as a common repository for documents. + // + Personal = CSIDL_PERSONAL, + // + // "MyDocuments" is a better name than "Personal" + // + MyDocuments = CSIDL_PERSONAL, + // + // Represents the program files folder. + // + ProgramFiles = CSIDL_PROGRAM_FILES, + // + // Represents the folder for components that are shared across applications. + // + CommonProgramFiles = CSIDL_PROGRAM_FILES_COMMON, + // + // \Start Menu\Programs\Administrative Tools + // + AdminTools = CSIDL_ADMINTOOLS, + // + // USERPROFILE\Local Settings\Application Data\Microsoft\CD Burning + // + CDBurning = CSIDL_CDBURN_AREA, + // + // All Users\Start Menu\Programs\Administrative Tools + // + CommonAdminTools = CSIDL_COMMON_ADMINTOOLS, + // + // All Users\Documents + // + CommonDocuments = CSIDL_COMMON_DOCUMENTS, + // + // All Users\My Music + // + CommonMusic = CSIDL_COMMON_MUSIC, + // + // Links to All Users OEM specific apps + // + CommonOemLinks = CSIDL_COMMON_OEM_LINKS, + // + // All Users\My Pictures + // + CommonPictures = CSIDL_COMMON_PICTURES, + // + // All Users\Start Menu + // + CommonStartMenu = CSIDL_COMMON_STARTMENU, + // + // All Users\Start Menu\Programs + // + CommonPrograms = CSIDL_COMMON_PROGRAMS, + // + // All Users\Startup + // + CommonStartup = CSIDL_COMMON_STARTUP, + // + // All Users\Desktop + // + CommonDesktopDirectory = CSIDL_COMMON_DESKTOPDIRECTORY, + // + // All Users\Templates + // + CommonTemplates = CSIDL_COMMON_TEMPLATES, + // + // All Users\My Video + // + CommonVideos = CSIDL_COMMON_VIDEO, + // + // windows\fonts + // + Fonts = CSIDL_FONTS, + // + // %APPDATA%\Microsoft\Windows\Network Shortcuts + // + NetworkShortcuts = CSIDL_NETHOOD, + // + // %APPDATA%\Microsoft\Windows\Printer Shortcuts + // + PrinterShortcuts = CSIDL_PRINTHOOD, + // + // USERPROFILE + // + UserProfile = CSIDL_PROFILE, + // + // x86 Program Files\Common on RISC + // + CommonProgramFilesX86 = CSIDL_PROGRAM_FILES_COMMONX86, + // + // x86 C:\Program Files on RISC + // + ProgramFilesX86 = CSIDL_PROGRAM_FILESX86, + // + // Resource Directory + // + Resources = CSIDL_RESOURCES, + // + // Localized Resource Directory + // + LocalizedResources = CSIDL_RESOURCES_LOCALIZED, + // + // %windir%\System32 or %windir%\syswow64 + // + SystemX86 = CSIDL_SYSTEMX86, + // + // GetWindowsDirectory() + // + Windows = CSIDL_WINDOWS, + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Stream.h b/r5dev/thirdparty/cppnet/cppkore/Stream.h new file mode 100644 index 00000000..f9ec8157 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Stream.h @@ -0,0 +1,73 @@ +#pragma once + +#include +#include "SeekOrigin.h" +#include "IOError.h" + +namespace IO +{ + class Stream + { + public: + // Abstract Dtor + virtual ~Stream() = default; + + // Abstract Getters and Setters + virtual bool CanRead() = 0; + virtual bool CanWrite() = 0; + virtual bool CanSeek() = 0; + virtual bool GetIsEndOfFile() = 0; + virtual uint64_t GetLength() = 0; + virtual uint64_t GetPosition() = 0; + virtual void SetLength(uint64_t Length) = 0; + virtual void SetPosition(uint64_t Position) = 0; + + // Abstract functions + virtual void Close() = 0; + virtual void Flush() = 0; + virtual void Seek(uint64_t Offset, SeekOrigin Origin) = 0; + virtual uint64_t Read(uint8_t* Buffer, uint64_t Offset, uint64_t Count) = 0; + virtual uint64_t Read(uint8_t* Buffer, uint64_t Offset, uint64_t Count, uint64_t Position) = 0; + virtual void Write(uint8_t* Buffer, uint64_t Offset, uint64_t Count) = 0; + virtual void Write(uint8_t* Buffer, uint64_t Offset, uint64_t Count, uint64_t Position) = 0; + + // Copies all of the data from the current position to the target stream + void CopyTo(Stream& Rhs) + { + if (!this->CanRead()) + IOError::StreamNoReadSupport(); + if (!Rhs.CanWrite()) + IOError::StreamNoWriteSupport(); + + auto Buffer = std::make_unique(DefaultCopyBufferSize); + uint64_t Read = 0; + while ((Read = this->Read(Buffer.get(), 0, DefaultCopyBufferSize)) != 0) + Rhs.Write(Buffer.get(), 0, Read); + } + + // Copies all of the data from the current position to the target stream + void CopyTo(std::unique_ptr& Rhs) + { + this->CopyTo(Rhs.get()); + } + + // Copies all of the data from the current position to the target stream + void CopyTo(Stream* Rhs) + { + if (!this->CanRead()) + IOError::StreamNoReadSupport(); + if (!Rhs->CanWrite()) + IOError::StreamNoWriteSupport(); + + auto Buffer = std::make_unique(DefaultCopyBufferSize); + uint64_t Read = 0; + while ((Read = this->Read(Buffer.get(), 0, DefaultCopyBufferSize)) != 0) + Rhs->Write(Buffer.get(), 0, Read); + } + + private: + + // The default copy size for transfering buffers + constexpr static uint64_t DefaultCopyBufferSize = 81920; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/StreamReader.cpp b/r5dev/thirdparty/cppnet/cppkore/StreamReader.cpp new file mode 100644 index 00000000..093c53f9 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/StreamReader.cpp @@ -0,0 +1,100 @@ +#include "stdafx.h" +#include "StreamReader.h" + +namespace IO +{ + StreamReader::StreamReader() + : StreamReader(nullptr, false) + { + } + + StreamReader::StreamReader(std::unique_ptr Stream) + : StreamReader(std::move(Stream), false) + { + } + + StreamReader::StreamReader(std::unique_ptr Stream, bool LeaveOpen) + : _CharLen(0), _CharPos(0) + { + this->BaseStream = std::move(Stream); + this->_LeaveOpen = LeaveOpen; + this->_InternalBuffer = std::make_unique(StreamReader::DefaultCharBufferSize); + } + + StreamReader::StreamReader(Stream* Stream) + : StreamReader(Stream, false) + { + } + + StreamReader::StreamReader(Stream* Stream, bool LeaveOpen) + : _CharLen(0), _CharPos(0) + { + this->BaseStream.reset(Stream); + this->_LeaveOpen = LeaveOpen; + this->_InternalBuffer = std::make_unique(StreamReader::DefaultCharBufferSize); + } + + StreamReader::~StreamReader() + { + this->Close(); + } + + void StreamReader::Close() + { + // Forcefully reset the stream + if (this->_LeaveOpen) + this->BaseStream.release(); + else + this->BaseStream.reset(); + + // Always clean up the internal buffer + this->_InternalBuffer.reset(); + } + + int32_t StreamReader::Peek() + { + if (!this->BaseStream) + IOError::StreamBaseStream(); + + if (this->_CharPos == this->_CharLen) + { + if (ReadBuffer() == 0) + return -1; + } + + return this->_InternalBuffer[this->_CharPos]; + } + + int32_t StreamReader::Read() + { + if (!this->BaseStream) + IOError::StreamBaseStream(); + + if (this->_CharPos == this->_CharLen) + { + if (ReadBuffer() == 0) + return -1; + } + + return this->_InternalBuffer[this->_CharPos++]; + } + + Stream* StreamReader::GetBaseStream() const + { + return this->BaseStream.get(); + } + + int32_t StreamReader::ReadBuffer() + { + this->_CharLen = 0; + this->_CharPos = 0; + + auto ReadResult = this->BaseStream->Read((uint8_t*)this->_InternalBuffer.get(), 0, StreamReader::DefaultCharBufferSize); + + // TODO: Eventually, we need to add support for BOM detection on first read, then, decoding from non UTF-8 BOM to UTF-8 for StringBase + // This will be the same as preamble checks in StreamReader.cs + + this->_CharLen = (uint32_t)ReadResult; + return this->_CharLen; + } +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/StreamReader.h b/r5dev/thirdparty/cppnet/cppkore/StreamReader.h new file mode 100644 index 00000000..b12bcde3 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/StreamReader.h @@ -0,0 +1,42 @@ +#pragma once + +#include +#include +#include "Stream.h" +#include "IOError.h" +#include "TextReader.h" + +namespace IO +{ + class StreamReader : public TextReader + { + public: + StreamReader(); + StreamReader(std::unique_ptr Stream); + StreamReader(std::unique_ptr Stream, bool LeaveOpen); + StreamReader(Stream* Stream); + StreamReader(Stream* Stream, bool LeaveOpen); + virtual ~StreamReader(); + + // Implement functions + virtual void Close(); + virtual int32_t Peek(); + virtual int32_t Read(); + + // Get the underlying stream + Stream* GetBaseStream() const; + + private: + std::unique_ptr BaseStream; + std::unique_ptr _InternalBuffer; + bool _LeaveOpen; + uint32_t _CharPos; + uint32_t _CharLen; + + // Internal routine to read more data into the buffer + int32_t ReadBuffer(); + + // The default copy size for transfering buffers + constexpr static uint64_t DefaultCharBufferSize = 4096; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/StreamWriter.cpp b/r5dev/thirdparty/cppnet/cppkore/StreamWriter.cpp new file mode 100644 index 00000000..d60d08a7 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/StreamWriter.cpp @@ -0,0 +1,151 @@ +#include "stdafx.h" +#include "StreamWriter.h" + +namespace IO +{ + StreamWriter::StreamWriter() + : StreamWriter(nullptr, false) + { + } + + StreamWriter::StreamWriter(std::unique_ptr Stream) + : StreamWriter(std::move(Stream), false) + { + } + + StreamWriter::StreamWriter(std::unique_ptr Stream, bool LeaveOpen) + { + this->BaseStream = std::move(Stream); + this->_LeaveOpen = LeaveOpen; + } + + StreamWriter::StreamWriter(Stream* Stream) + : StreamWriter(Stream, false) + { + } + + StreamWriter::StreamWriter(Stream* Stream, bool LeaveOpen) + { + this->BaseStream.reset(Stream); + this->_LeaveOpen = LeaveOpen; + } + + StreamWriter::~StreamWriter() + { + this->Close(); + } + + void StreamWriter::Close() + { + // Forcefully reset the stream + if (this->_LeaveOpen) + this->BaseStream.release(); + else + this->BaseStream.reset(); + } + + void StreamWriter::Flush() + { + if (!this->BaseStream) + IOError::StreamBaseStream(); + + this->BaseStream->Flush(); + } + + void StreamWriter::Write(const char Value) + { + if (!this->BaseStream) + IOError::StreamBaseStream(); + + this->BaseStream->Write((uint8_t*)&Value, 0, 1); + } + + void StreamWriter::Write(const char* Buffer, uint32_t Index, uint32_t Count) + { + if (!this->BaseStream) + IOError::StreamBaseStream(); + + this->BaseStream->Write((uint8_t*)&Buffer[0], Index, Count); + } + + void StreamWriter::Write(const string& Value) + { + this->Write((const char*)Value, 0, Value.Length()); + } + + void StreamWriter::WriteLine(const string& Value) + { + TextWriter::WriteLine((const char*)Value, 0, Value.Length()); + } + + void StreamWriter::Write(const char* Value) + { + this->Write(Value, 0, (uint32_t)strlen(Value)); + } + + void StreamWriter::WriteLine(const char* Value) + { + if (Value == nullptr) + TextWriter::WriteLine(nullptr, 0, 0); + else + TextWriter::WriteLine(Value, 0, (uint32_t)strlen(Value)); + } + + void StreamWriter::WriteFmt(const char* Format, ...) + { + va_list vArgs; + va_start(vArgs, Format); + + char StackFmt[FormatBufferSize]; + auto ResultFmt = vsnprintf(StackFmt, FormatBufferSize, Format, vArgs); + + if (ResultFmt > 0 && ResultFmt < FormatBufferSize) + { + va_end(vArgs); + this->Write((const char*)StackFmt, 0, (uint32_t)ResultFmt); + return; + } + + auto HeapFmt = std::make_unique(ResultFmt + 1); + + vsnprintf(HeapFmt.get(), ResultFmt + 1, Format, vArgs); + va_end(vArgs); + + this->Write((const char*)HeapFmt.get(), 0, (uint32_t)ResultFmt); + } + + void StreamWriter::WriteLineFmt(const char* Format, ...) + { + if (Format == nullptr) + { + TextWriter::WriteLine(nullptr, 0, 0); + } + else + { + va_list vArgs; + va_start(vArgs, Format); + + char StackFmt[FormatBufferSize]; + auto ResultFmt = vsnprintf(StackFmt, FormatBufferSize, Format, vArgs); + + if (ResultFmt > 0 && ResultFmt < FormatBufferSize) + { + va_end(vArgs); + TextWriter::WriteLine((const char*)StackFmt, 0, (uint32_t)ResultFmt); + return; + } + + auto HeapFmt = std::make_unique(ResultFmt + 1); + + vsnprintf(HeapFmt.get(), ResultFmt + 1, Format, vArgs); + va_end(vArgs); + + TextWriter::WriteLine((const char*)HeapFmt.get(), 0, (uint32_t)ResultFmt); + } + } + + Stream* StreamWriter::GetBaseStream() const + { + return this->BaseStream.get(); + } +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/StreamWriter.h b/r5dev/thirdparty/cppnet/cppkore/StreamWriter.h new file mode 100644 index 00000000..a585e676 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/StreamWriter.h @@ -0,0 +1,52 @@ +#pragma once + +#include +#include +#include "Stream.h" +#include "IOError.h" +#include "TextWriter.h" + +namespace IO +{ + class StreamWriter : public TextWriter + { + public: + StreamWriter(); + StreamWriter(std::unique_ptr Stream); + StreamWriter(std::unique_ptr Stream, bool LeaveOpen); + StreamWriter(Stream* Stream); + StreamWriter(Stream* Stream, bool LeaveOpen); + virtual ~StreamWriter(); + + // Implement functions + virtual void Close(); + virtual void Flush(); + virtual void Write(const char Value); + virtual void Write(const char* Buffer, uint32_t Index, uint32_t Count); + + // Writes a string to the file + void Write(const string& Value); + // Writes a string to the file and ends the line + void WriteLine(const string& Value); + + // Writes a null-terminated string to the file + void Write(const char* Value); + // Writes a null-terminated string to the file and ends the line + void WriteLine(const char* Value = nullptr); + + // Writes a formatted string to the file + void WriteFmt(const char* Format, ...); + // Writes a formatted string to the file and ends the line + void WriteLineFmt(const char* Format, ...); + + // Get the underlying stream + Stream* GetBaseStream() const; + + private: + std::unique_ptr BaseStream; + bool _LeaveOpen; + + // Used for the built-in format buffer + static uint32_t constexpr FormatBufferSize = 4096; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/StringBase.h b/r5dev/thirdparty/cppnet/cppkore/StringBase.h new file mode 100644 index 00000000..f9b516db --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/StringBase.h @@ -0,0 +1,1641 @@ +#pragma once + +#include +#include +#include +#include +#include "stdext.h" +#include "ListBase.h" +#include "ImmutableStringBase.h" + +template +class StringBase +{ +public: + constexpr StringBase(); + constexpr StringBase(const uint32_t InitialSize, const Tchar InitialValue = (Tchar)'\0\0', const bool Initialized = true); + constexpr StringBase(const Tchar* Value); + constexpr StringBase(const Tchar* Value, size_t ValueSize); + constexpr StringBase(std::basic_string_view Value); + constexpr StringBase(ImmutableStringBase Value); + + template + constexpr StringBase(const Tchar(&Value)[Size]); + + constexpr StringBase(const StringBase& Value); + constexpr StringBase(StringBase&& Value) noexcept; + + ~StringBase(); + + // Returns a null-terminated string + constexpr const Tchar* ToCString() const; + // Returns a copy of the current instance + constexpr StringBase ToString() const; + // Returns a wide copy of the current instance + constexpr StringBase ToWString() const; + // Returns a string_view of the current instance + constexpr std::basic_string_view ToStringView() const; + // Returns the length of the string in characters + constexpr uint32_t Length() const; + + // Checks the string for equality, returns 0 when a match is found + constexpr int32_t Compare(const Tchar* Rhs) const noexcept; + // Checks the string for equality, returns 0 when a match is found + constexpr int32_t Compare(const StringBase& Rhs) const noexcept; + // Checks the string for equality, returns 0 when a match is found + constexpr int32_t Compare(std::basic_string_view Rhs) const noexcept; + + // Creates an array of strings by splitting this string at each occurence of the separator + constexpr List> Split(const Tchar Separator) const; + // Creates an array of strings by splitting this string at each occurence of the separator + constexpr List> Split(const Tchar* Separator) const; + // Creates an array of strings by splitting this string at each occurence of the separator + constexpr List> Split(const StringBase& Separator) const; + // Creates an array of strings by splitting this string at each occurence of the separator + constexpr List> Split(const std::basic_string_view Separator) const; + + // Trims the whitespace from both ends of the string + constexpr StringBase Trim() const; + // Trims the whitespace from the start of the string + constexpr StringBase TrimStart() const; + // Trims the whitespace from the end of the string + constexpr StringBase TrimEnd() const; + + // Returns the index of the first occurance of value in the current instance + constexpr uint32_t IndexOf(const Tchar Rhs, uint32_t Pos = 0) const noexcept; + // Returns the index of the first occurance of value in the current instance + constexpr uint32_t IndexOf(const Tchar* Rhs, uint32_t Pos = 0) const; + // Returns the index of the first occurance of value in the current instance + constexpr uint32_t IndexOf(const Tchar* Rhs, uint32_t Pos, uint32_t Count) const; + // Returns the index of the first occurance of value in the current instance + constexpr uint32_t IndexOf(const StringBase& Rhs, uint32_t Pos = 0) const noexcept; + // Returns the index of the first occurance of value in the current instance + constexpr uint32_t IndexOf(const StringBase& Rhs, uint32_t Pos, uint32_t Count) const noexcept; + // Returns the index of the first occurance of value in the current instance + constexpr uint32_t IndexOf(std::basic_string_view Rhs, uint32_t Pos = 0) const noexcept; + // Returns the index of the first occurance of value in the current instance + constexpr uint32_t IndexOf(std::basic_string_view Rhs, uint32_t Pos, uint32_t Count) const noexcept; + + // Returns the index of the last occurance of value in the current instance + constexpr uint32_t LastIndexOf(const Tchar Rhs, uint32_t Pos = 0) const noexcept; + // Returns the index of the last occurance of value in the current instance + constexpr uint32_t LastIndexOf(const Tchar* Rhs, uint32_t Pos = 0) const; + // Returns the index of the last occurance of value in the current instance + constexpr uint32_t LastIndexOf(const Tchar* Rhs, uint32_t Pos, uint32_t Count) const; + // Returns the index of the last occurance of value in the current instance + constexpr uint32_t LastIndexOf(const StringBase& Rhs, uint32_t Pos = 0) const noexcept; + // Returns the index of the last occurance of value in the current instance + constexpr uint32_t LastIndexOf(const StringBase& Rhs, uint32_t Pos, uint32_t Count) const noexcept; + // Returns the index of the last occurance of value in the current instance + constexpr uint32_t LastIndexOf(std::basic_string_view Rhs, uint32_t Pos = 0) const noexcept; + // Returns the index of the last occurance of value in the current instance + constexpr uint32_t LastIndexOf(std::basic_string_view Rhs, uint32_t Pos, uint32_t Count) const noexcept; + + // Creates a copy of this string in lower case + constexpr StringBase ToLower() const; + // Creates a copy of this string in upper case + constexpr StringBase ToUpper() const; + + // Replaces all instances of the Old value with New + constexpr StringBase Replace(const Tchar Old, const Tchar New) const; + // Replaces all instances of the Old value with New + constexpr StringBase Replace(const Tchar* Old, const Tchar* New) const; + // Replaces all instances of the Old value with New + constexpr StringBase Replace(const StringBase& Old, const StringBase& New) const; + // Replaces all instances of the Old value with New + constexpr StringBase Replace(std::basic_string_view Old, std::basic_string_view New) const; + + // Whether or not the string starts with the value + constexpr bool StartsWith(const Tchar* Rhs) const; + // Whether or not the string starts with the value + constexpr bool StartsWith(const StringBase& Rhs) const; + // Whether or not the string starts with the value + constexpr bool StartsWith(std::basic_string_view Rhs) const; + + // Whether or not the string ends with the value + constexpr bool EndsWith(const Tchar* Rhs) const; + // Whether or not the string ends with the value + constexpr bool EndsWith(const StringBase& Rhs) const; + // Whether or not the string ends with the value + constexpr bool EndsWith(std::basic_string_view Rhs) const; + + // Whether or not the string contains the value + constexpr bool Contains(const Tchar* Rhs) const; + // Whether or not the string contains the value + constexpr bool Contains(const StringBase& Rhs) const; + // Whether or not the string contains the value + constexpr bool Contains(std::basic_string_view Rhs) const; + + // Returns a substring of this string + constexpr StringBase Substring(uint32_t StartIndex) const; + // Returns a substring of this string + constexpr StringBase Substring(uint32_t StartIndex, uint32_t Length) const; + + // Appends a character to this string + constexpr void Append(Tchar Rhs); + // Appends a null-terminated string to this string + constexpr void Append(const Tchar* Rhs); + // Appends a predetermined size string to this string + constexpr void Append(Tchar* Rhs, uint32_t Count); + // Appends a string to this string + constexpr void Append(const StringBase& Rhs); + + // Standard logical casts + constexpr operator Tchar*(void) const; + constexpr operator const Tchar*(void) const; + + // Cast to string_view + constexpr operator std::basic_string_view(void) const; // NOTE: Breaks intellisense but IS defined and DOES function... + + // Iterator definitions, for for(& :) loop + constexpr Tchar* begin() const noexcept; + constexpr Tchar* end() const noexcept; + + // Standard logical operators + constexpr StringBase& operator+=(const Tchar Rhs); + constexpr StringBase& operator+=(const Tchar* Rhs); + constexpr StringBase& operator+=(const StringBase& Rhs); + constexpr StringBase& operator+=(std::basic_string_view Rhs); + constexpr StringBase& operator+=(ImmutableStringBase Rhs); + + // Assignment operators + constexpr StringBase& operator=(const Tchar* Rhs); + constexpr StringBase& operator=(const StringBase& Rhs); + constexpr StringBase& operator=(std::basic_string_view Rhs); + constexpr StringBase& operator=(ImmutableStringBase Rhs); + + // Equality operators + constexpr bool operator==(const Tchar* Rhs) const; + constexpr bool operator==(const StringBase& Rhs) const; + constexpr bool operator==(std::basic_string_view Rhs) const; + + // Inequality operators + constexpr bool operator!=(const Tchar* Rhs) const; + constexpr bool operator!=(const StringBase& Rhs) const; + constexpr bool operator!=(std::basic_string_view Rhs) const; + + // Complex logical operators + friend StringBase operator+(StringBase Lhs, const Tchar Rhs) + { + Lhs += Rhs; + return Lhs; + } + friend StringBase operator+(StringBase Lhs, const Tchar* Rhs) + { + Lhs += Rhs; + return Lhs; + } + friend StringBase operator+(StringBase Lhs, const StringBase& Rhs) + { + Lhs += Rhs; + return Lhs; + } + friend StringBase operator+(StringBase Lhs, std::basic_string_view& Rhs) + { + Lhs += Rhs; + return Lhs; + } + friend StringBase operator+(StringBase Lhs, ImmutableStringBase& Rhs) + { + Lhs += Rhs; + return Lhs; + } + + // Array index operator + constexpr Tchar& operator[](size_t Index); + constexpr Tchar& operator[](size_t Index) const; + + // Indicates no matches in the string + static constexpr auto InvalidPosition{ static_cast(-1) }; + + // + // Static helper routines + // + + // Whether or not the string is initialized and not blank + static constexpr bool IsNullOrEmpty(const StringBase& Rhs); + // Whether or not the string is initialized and not whitespace + static constexpr bool IsNullOrWhiteSpace(const StringBase& Rhs); + + // Formats a string based on the provided input + static constexpr StringBase Format(const Tchar* Format, ...); + + static constexpr StringBase Format(const Tchar* Format, va_list vArgs); + + +private: + Tchar* _Buffer; + uint32_t _BufferSize; + uint32_t _StoreSize; + + constexpr void EnsureCapacity(uint32_t Capacity); +}; + +template +inline constexpr StringBase::StringBase() + : _Buffer(nullptr), _BufferSize(0), _StoreSize(0) +{ +} + +template +inline constexpr StringBase::StringBase(const uint32_t InitialSize, const Tchar InitialValue, const bool Initialized) + : _Buffer(nullptr), _BufferSize(0), _StoreSize(0) +{ + this->EnsureCapacity(InitialSize); + + if (!Initialized) + _StoreSize = 0; + + if constexpr (sizeof(Tchar) == sizeof(char)) + std::memset(this->_Buffer, InitialValue, InitialSize); + else if constexpr (sizeof(Tchar) == sizeof(wchar_t)) + std::wmemset(this->_Buffer, InitialValue, InitialSize); +} + +template +inline constexpr StringBase::StringBase(const Tchar* Value) + : _Buffer(nullptr), _BufferSize(0), _StoreSize(0) +{ + size_t vLen = 0; + if constexpr (sizeof(Tchar) == sizeof(char)) + vLen = strlen(Value); + else if constexpr (sizeof(Tchar) == sizeof(wchar_t)) + vLen = wcslen(Value); + + this->EnsureCapacity((uint32_t)vLen); + + std::memcpy(this->_Buffer, Value, vLen * sizeof(Tchar)); +} + +template +inline constexpr StringBase::StringBase(const Tchar* Value, size_t ValueSize) + : _Buffer(nullptr), _BufferSize(0), _StoreSize(0) +{ + this->EnsureCapacity((uint32_t)ValueSize); + + std::memcpy(this->_Buffer, Value, ValueSize * sizeof(Tchar)); +} + +template +inline constexpr StringBase::StringBase(std::basic_string_view Value) + : _Buffer(nullptr), _BufferSize(0), _StoreSize(0) +{ + auto vLen = Value.size(); + this->EnsureCapacity((uint32_t)vLen); + + std::memcpy(this->_Buffer, Value.data(), vLen * sizeof(Tchar)); +} + +template +inline constexpr StringBase::StringBase(ImmutableStringBase Value) + : _Buffer(nullptr), _BufferSize(0), _StoreSize(0) +{ + auto vLen = Value.Length(); + this->EnsureCapacity((uint32_t)vLen); + + std::memcpy(this->_Buffer, (Tchar*)Value, vLen * sizeof(Tchar)); +} + +template +template +inline constexpr StringBase::StringBase(const Tchar(&Value)[Size]) + : _Buffer(nullptr), _BufferSize(0), _StoreSize(0) +{ + size_t vLen = 0; + if constexpr (sizeof(Tchar) == sizeof(char)) + vLen = strlen(Value); + else if constexpr (sizeof(Tchar) == sizeof(wchar_t)) + vLen = wcslen(Value); + + this->EnsureCapacity((uint32_t)vLen); + + std::memcpy(this->_Buffer, Value, vLen * sizeof(Tchar)); +} + +template +inline constexpr StringBase::StringBase(const StringBase& Value) + : StringBase(Value._Buffer, Value._StoreSize) +{ +} + +template +inline constexpr StringBase::StringBase(StringBase&& Value) noexcept +{ + this->_Buffer = Value._Buffer; + this->_BufferSize = Value._BufferSize; + this->_StoreSize = Value._StoreSize; + + Value._Buffer = nullptr; + Value._BufferSize = 0; + Value._StoreSize = 0; +} + +template +inline StringBase::~StringBase() +{ + if (this->_Buffer) + delete[] this->_Buffer; + + this->_Buffer = nullptr; + this->_BufferSize = 0; + this->_StoreSize = 0; +} + +template +inline constexpr const Tchar * StringBase::ToCString() const +{ + return this->_Buffer; +} + +template +inline constexpr StringBase StringBase::ToString() const +{ + if constexpr (sizeof(Tchar) == sizeof(char)) + return StringBase(this->_Buffer, this->_StoreSize); + else + { + auto cbBuffer = WideCharToMultiByte(CP_UTF8, NULL, this->_Buffer, this->_StoreSize, NULL, NULL, NULL, FALSE); + if (cbBuffer == 0) + return ""; + + auto Result = StringBase(cbBuffer); + + WideCharToMultiByte(CP_UTF8, NULL, this->_Buffer, this->_StoreSize, (char*)Result, cbBuffer, NULL, FALSE); + + return std::move(Result); + } +} + +template +inline constexpr StringBase StringBase::ToWString() const +{ + if (sizeof(Tchar) == sizeof(wchar_t)) + return StringBase((const wchar_t*)this->_Buffer, this->_StoreSize); + else + { + auto cbBuffer = MultiByteToWideChar(CP_UTF8, NULL, this->_Buffer, this->_StoreSize, NULL, NULL); + if (cbBuffer == 0) + return L""; + + auto Result = StringBase(cbBuffer); + + MultiByteToWideChar(CP_UTF8, NULL, this->_Buffer, this->_StoreSize, (wchar_t*)Result, cbBuffer); + + return std::move(Result); + } +} + +template +inline constexpr std::basic_string_view StringBase::ToStringView() const +{ + return std::basic_string_view(this->_Buffer, this->_StoreSize); +} + +template +inline constexpr uint32_t StringBase::Length() const +{ + return this->_StoreSize; +} + +template +inline constexpr int32_t StringBase::Compare(const Tchar* Rhs) const noexcept +{ + auto LhsSize = this->_StoreSize * sizeof(Tchar); + + size_t RhsSize = 0; + if constexpr (sizeof(Tchar) == sizeof(char)) + RhsSize = strlen(Rhs) * sizeof(Tchar); + else if constexpr (sizeof(Tchar) == sizeof(wchar_t)) + RhsSize = wcslen(Rhs) * sizeof(Tchar); + + const int Res = std::memcmp(this->_Buffer, Rhs, (size_t)std::min((uint32_t)LhsSize, (uint32_t)RhsSize)); + + if (Res != 0) + return Res; + if (LhsSize < RhsSize) + return (-1); + if (LhsSize > RhsSize) + return (1); + + return 0; +} + +template +inline constexpr int32_t StringBase::Compare(const StringBase& Rhs) const noexcept +{ + auto LhsSize = this->_StoreSize * sizeof(Tchar); + auto RhsSize = Rhs._StoreSize * sizeof(Tchar); + + const int Res = std::memcmp(this->_Buffer, Rhs._Buffer, (size_t)std::min((uint32_t)LhsSize, (uint32_t)RhsSize)); + + if (Res != 0) + return Res; + if (LhsSize < RhsSize) + return (-1); + if (LhsSize > RhsSize) + return (1); + + return 0; +} + +template +inline constexpr int32_t StringBase::Compare(std::basic_string_view Rhs) const noexcept +{ + auto LhsSize = this->_StoreSize * sizeof(Tchar); + auto RhsSize = Rhs.size() * sizeof(Tchar); + + const int Res = std::memcmp(this->_Buffer, Rhs.data(), (size_t)std::min((uint32_t)LhsSize, (uint32_t)RhsSize)); + + if (Res != 0) + return Res; + if (LhsSize < RhsSize) + return (-1); + if (LhsSize > RhsSize) + return (1); + + return 0; +} + +template +inline constexpr List> StringBase::Split(const Tchar Delimiter) const +{ + // TODO: This sometimes skips last one: "Imakewins = {".split(' ') missing { + auto Result = List>(); + + uint32_t CurrentIndex = 0, LocatedPosition = 0; + + // Optimized for large strings and lots of occurences + while ((LocatedPosition = this->IndexOf(Delimiter, CurrentIndex)) != StringBase::InvalidPosition) + { + Result.Emplace(this->Substring(CurrentIndex, LocatedPosition - CurrentIndex)); + + // Advance past the size of old and the position + CurrentIndex = LocatedPosition + 1; + } + + if (CurrentIndex != this->_StoreSize) + Result.Emplace(this->Substring(CurrentIndex, this->_StoreSize - CurrentIndex)); + + return Result; +} + +template +inline constexpr List> StringBase::Split(const Tchar* Separator) const +{ + auto Result = List>(); + + uint32_t CurrentIndex = 0, LocatedPosition = 0; + + uint32_t LhsSize = 0; + if constexpr (sizeof(Tchar) == sizeof(char)) + LhsSize = (uint32_t)strlen(Separator); + else if constexpr (sizeof(Tchar) == sizeof(wchar_t)) + LhsSize = (uint32_t)wcslen(Separator); + + // Optimized for large strings and lots of occurences + while ((LocatedPosition = this->IndexOf(Separator, CurrentIndex)) != StringBase::InvalidPosition) + { + Result.Emplace(this->Substring(CurrentIndex, LocatedPosition - CurrentIndex)); + + // Advance past the size of old and the position + CurrentIndex = LocatedPosition + LhsSize; + } + + if (CurrentIndex != this->_StoreSize) + Result.Emplace(this->Substring(CurrentIndex, this->_StoreSize - CurrentIndex)); + + return Result; +} + +template +inline constexpr List> StringBase::Split(const StringBase& Separator) const +{ + auto Result = List>(); + + uint32_t CurrentIndex = 0, LocatedPosition = 0; + + auto LhsSize = Separator._StoreSize; + + // Optimized for large strings and lots of occurences + while ((LocatedPosition = this->IndexOf(Separator, CurrentIndex)) != StringBase::InvalidPosition) + { + Result.Emplace(this->Substring(CurrentIndex, LocatedPosition - CurrentIndex)); + + // Advance past the size of old and the position + CurrentIndex = LocatedPosition + LhsSize; + } + + if (CurrentIndex != this->_StoreSize) + Result.Emplace(this->Substring(CurrentIndex, this->_StoreSize - CurrentIndex)); + + return Result; +} + +template +inline constexpr List> StringBase::Split(const std::basic_string_view Separator) const +{ + auto Result = List>(); + + uint32_t CurrentIndex = 0, LocatedPosition = 0; + + auto LhsSize = Separator.size(); + + // Optimized for large strings and lots of occurences + while ((LocatedPosition = this->IndexOf(Separator, CurrentIndex)) != StringBase::InvalidPosition) + { + Result.Emplace(this->Substring(CurrentIndex, LocatedPosition - CurrentIndex)); + + // Advance past the size of old and the position + CurrentIndex = LocatedPosition + LhsSize; + } + + if (CurrentIndex != this->_StoreSize) + Result.Emplace(this->Substring(CurrentIndex, this->_StoreSize - CurrentIndex)); + + return Result; +} + +template +inline constexpr StringBase StringBase::Trim() const +{ + int64_t Index = 0, Ending = (int64_t)this->_StoreSize - 1; + + for (Index = 0; Index < this->_StoreSize; Index++) + { + if constexpr (sizeof(Tchar) == sizeof(char)) + { + if (!::isspace(this->_Buffer[Index])) + break; + } + else if constexpr (sizeof(Tchar) == sizeof(wchar_t)) + { + if (!::iswspace(this->_Buffer[Index])) + break; + } + } + + for (Ending = (int64_t)this->_StoreSize - 1; Ending >= Index; Ending--) + { + if constexpr (sizeof(Tchar) == sizeof(char)) + { + if (!::isspace(this->_Buffer[Ending])) + break; + } + else if constexpr (sizeof(Tchar) == sizeof(wchar_t)) + { + if (!::iswspace(this->_Buffer[Ending])) + break; + } + } + + auto Length = Ending - Index + 1; + if (Length == this->_StoreSize) + return *this; + else if (Length == 0) + return ""; + + return StringBase(this->_Buffer + Index, (uint32_t)Length); +} + +template +inline constexpr StringBase StringBase::TrimStart() const +{ + int64_t Index = 0, Ending = (int64_t)this->_StoreSize - 1; + + for (Index = 0; Index < this->_StoreSize; Index++) + { + if constexpr (sizeof(Tchar) == sizeof(char)) + { + if (!::isspace(this->_Buffer[Index])) + break; + } + else if constexpr (sizeof(Tchar) == sizeof(wchar_t)) + { + if (!::iswspace(this->_Buffer[Index])) + break; + } + } + + auto Length = Ending - Index + 1; + if (Length == this->_StoreSize) + return *this; + else if (Length == 0) + return ""; + + return StringBase(this->_Buffer + Index, (uint32_t)Length); +} + +template +inline constexpr StringBase StringBase::TrimEnd() const +{ + int64_t Index = 0, Ending = (int64_t)this->_StoreSize - 1; + + for (Ending = (int64_t)this->_StoreSize - 1; Ending >= Index; Ending--) + { + if constexpr (sizeof(Tchar) == sizeof(char)) + { + if (!::isspace(this->_Buffer[Ending])) + break; + } + else if constexpr (sizeof(Tchar) == sizeof(wchar_t)) + { + if (!::iswspace(this->_Buffer[Ending])) + break; + } + } + + auto Length = Ending - Index + 1; + if (Length == this->_StoreSize) + return *this; + else if (Length == 0) + return ""; + + return StringBase(this->_Buffer + Index, (uint32_t)Length); +} + +template +inline constexpr uint32_t StringBase::IndexOf(const Tchar Rhs, uint32_t Pos) const noexcept +{ + if (this->_StoreSize == 0 || Pos >= this->_StoreSize) + return StringBase::InvalidPosition; + + auto fChPos = (sizeof(Tchar) == sizeof(char)) ? (Tchar*)std::memchr((void*)(this->_Buffer + Pos), (int32_t)Rhs, this->_StoreSize) : (Tchar*)std::wmemchr((const wchar_t*)(this->_Buffer + Pos), (wchar_t)Rhs, this->_StoreSize); + if (fChPos != nullptr) + return (uint32_t)(fChPos - this->_Buffer); + + return StringBase::InvalidPosition; +} + +template +inline constexpr uint32_t StringBase::IndexOf(const Tchar* Rhs, uint32_t Pos) const +{ + auto LhsSize = this->_StoreSize * sizeof(Tchar); + + size_t RhsSize = 0; + if constexpr (sizeof(Tchar) == sizeof(char)) + RhsSize = strlen(Rhs) * sizeof(Tchar); + else if constexpr (sizeof(Tchar) == sizeof(wchar_t)) + RhsSize = wcslen(Rhs) * sizeof(Tchar); + + if (RhsSize == 0 || RhsSize > LhsSize || Pos >= this->_StoreSize) + return StringBase::InvalidPosition; + + auto fChPos = (sizeof(Tchar) == sizeof(char)) ? (Tchar*)std::strchr((const char*)(this->_Buffer + Pos), (int32_t)Rhs[0]) : (Tchar*)std::wcschr((const wchar_t*)(this->_Buffer + Pos), (wchar_t)Rhs[0]); + if (fChPos != nullptr) + { + while (std::memcmp(fChPos, Rhs, RhsSize)) + { + fChPos = (sizeof(Tchar) == sizeof(char)) ? (Tchar*)std::strchr((const char*)(fChPos + 1), (int32_t)Rhs[0]) : (Tchar*)std::wcschr((const wchar_t*)(fChPos + 1), (wchar_t)Rhs[0]); + if (!fChPos) + break; + } + + if (fChPos != nullptr) + return (uint32_t)(fChPos - this->_Buffer); + } + + return StringBase::InvalidPosition; +} + +template +inline constexpr uint32_t StringBase::IndexOf(const Tchar* Rhs, uint32_t Pos, uint32_t Count) const +{ + auto LhsSize = this->_StoreSize * sizeof(Tchar); + + size_t RhsSize = 0; + if constexpr (sizeof(Tchar) == sizeof(char)) + RhsSize = strlen(Rhs) * sizeof(Tchar); + else if constexpr (sizeof(Tchar) == sizeof(wchar_t)) + RhsSize = wcslen(Rhs) * sizeof(Tchar); + + if (RhsSize == 0 || RhsSize > LhsSize || Pos >= this->_StoreSize || RhsSize < (Count * sizeof(Tchar))) + return StringBase::InvalidPosition; + + RhsSize = (Count * sizeof(Tchar)); + + auto fChPos = (sizeof(Tchar) == sizeof(char)) ? (Tchar*)std::strchr((const char*)(this->_Buffer + Pos), (int32_t)Rhs[0]) : (Tchar*)std::wcschr((const wchar_t*)(this->_Buffer + Pos), (wchar_t)Rhs[0]); + if (fChPos != nullptr) + { + while (std::memcmp(fChPos, Rhs, RhsSize)) + { + fChPos = (sizeof(Tchar) == sizeof(char)) ? (Tchar*)std::strchr((const char*)(fChPos + 1), (int32_t)Rhs[0]) : (Tchar*)std::wcschr((const wchar_t*)(fChPos + 1), (wchar_t)Rhs[0]); + if (!fChPos) + break; + } + + if (fChPos != nullptr) + return (uint32_t)(fChPos - this->_Buffer); + } + + return StringBase::InvalidPosition; +} + +template +inline constexpr uint32_t StringBase::IndexOf(const StringBase& Rhs, uint32_t Pos) const noexcept +{ + auto LhsSize = this->_StoreSize * sizeof(Tchar); + auto RhsSize = Rhs._StoreSize * sizeof(Tchar); + + if (RhsSize == 0 || RhsSize > LhsSize || Pos >= this->_StoreSize) + return StringBase::InvalidPosition; + + auto fChPos = (sizeof(Tchar) == sizeof(char)) ? (Tchar*)std::strchr((const char*)(this->_Buffer + Pos), (int32_t)Rhs._Buffer[0]) : (Tchar*)std::wcschr((const wchar_t*)(this->_Buffer + Pos), (wchar_t)Rhs._Buffer[0]); + if (fChPos != nullptr) + { + while (std::memcmp(fChPos, Rhs._Buffer, RhsSize)) + { + fChPos = (sizeof(Tchar) == sizeof(char)) ? (Tchar*)std::strchr((const char*)(fChPos + 1), (int32_t)Rhs._Buffer[0]) : (Tchar*)std::wcschr((const wchar_t*)(fChPos + 1), (wchar_t)Rhs._Buffer[0]); + if (!fChPos) + break; + } + + if (fChPos != nullptr) + return (uint32_t)(fChPos - this->_Buffer); + } + + return StringBase::InvalidPosition; +} + +template +inline constexpr uint32_t StringBase::IndexOf(const StringBase& Rhs, uint32_t Pos, uint32_t Count) const noexcept +{ + auto LhsSize = this->_StoreSize * sizeof(Tchar); + auto RhsSize = Rhs._StoreSize * sizeof(Tchar); + + if (RhsSize == 0 || RhsSize > LhsSize || Pos >= this->_StoreSize || Rhs._StoreSize < Count) + return StringBase::InvalidPosition; + + RhsSize = (Count * sizeof(Tchar)); + + auto fChPos = (sizeof(Tchar) == sizeof(char)) ? (Tchar*)std::strchr((void*)(this->_Buffer + Pos), (int32_t)Rhs._Buffer[0]) : (Tchar*)std::wcschr((const wchar_t*)(this->_Buffer + Pos), (wchar_t)Rhs._Buffer[0]); + if (fChPos != nullptr) + { + while (std::memcmp(fChPos, Rhs._Buffer, RhsSize)) + { + fChPos = (sizeof(Tchar) == sizeof(char)) ? (Tchar*)std::strchr((void*)(fChPos + 1), (int32_t)Rhs._Buffer[0]) : (Tchar*)std::wcschr((const wchar_t*)(fChPos + 1), (wchar_t)Rhs._Buffer[0]); + if (!fChPos) + break; + } + + if (fChPos != nullptr) + return (uint32_t)(fChPos - this->_Buffer); + } + + return StringBase::InvalidPosition; +} + +template +inline constexpr uint32_t StringBase::IndexOf(std::basic_string_view Rhs, uint32_t Pos) const noexcept +{ + auto LhsSize = this->_StoreSize * sizeof(Tchar); + auto RhsSize = Rhs.size() * sizeof(Tchar); + + if (RhsSize == 0 || RhsSize > LhsSize || Pos >= this->_StoreSize) + return StringBase::InvalidPosition; + + auto fChPos = (sizeof(Tchar) == sizeof(char)) ? (Tchar*)std::strchr((void*)(this->_Buffer + Pos), (int32_t)Rhs[0]) : (Tchar*)std::wcschr((const wchar_t*)(this->_Buffer + Pos), (wchar_t)Rhs[0]); + if (fChPos != nullptr) + { + while (std::memcmp(fChPos, Rhs.data(), RhsSize)) + { + fChPos = (sizeof(Tchar) == sizeof(char)) ? (Tchar*)std::strchr((void*)(fChPos + 1), (int32_t)Rhs[0]) : (Tchar*)std::wcschr((const wchar_t*)(fChPos + 1), (wchar_t)Rhs[0]); + if (!fChPos) + break; + } + + if (fChPos != nullptr) + return (uint32_t)(fChPos - this->_Buffer); + } + + return StringBase::InvalidPosition; +} + +template +inline constexpr uint32_t StringBase::IndexOf(std::basic_string_view Rhs, uint32_t Pos, uint32_t Count) const noexcept +{ + auto LhsSize = this->_StoreSize * sizeof(Tchar); + auto RhsSize = Rhs.size() * sizeof(Tchar); + + if (RhsSize == 0 || RhsSize > LhsSize || Pos >= this->_StoreSize || Rhs.size() < Count) + return StringBase::InvalidPosition; + + RhsSize = (Count * sizeof(Tchar)); + + auto fChPos = (sizeof(Tchar) == sizeof(char)) ? (Tchar*)std::strchr((void*)(this->_Buffer + Pos), (int32_t)Rhs[0]) : (Tchar*)std::wcschr((const wchar_t*)(this->_Buffer + Pos), (wchar_t)Rhs[0]); + if (fChPos != nullptr) + { + while (std::memcmp(fChPos, Rhs.data(), RhsSize)) + { + fChPos = (sizeof(Tchar) == sizeof(char)) ? (Tchar*)std::strchr((void*)(fChPos + 1), (int32_t)Rhs[0]) : (Tchar*)std::wcschr((const wchar_t*)(fChPos + 1), (wchar_t)Rhs[0]); + if (!fChPos) + break; + } + + if (fChPos != nullptr) + return (uint32_t)(fChPos - this->_Buffer); + } + + return StringBase::InvalidPosition; +} + +template +inline constexpr uint32_t StringBase::LastIndexOf(const Tchar Rhs, uint32_t Pos) const noexcept +{ + if (this->_StoreSize == 0 || Pos >= this->_StoreSize) + return StringBase::InvalidPosition; + + auto fChPos = (sizeof(Tchar) == sizeof(char)) ? (Tchar*)std::memrchr((void*)(this->_Buffer + Pos), (int32_t)Rhs, this->_StoreSize) : (Tchar*)std::wmemrchr((const wchar_t*)(this->_Buffer + Pos), (wchar_t)Rhs, this->_StoreSize); + if (fChPos != nullptr) + return (uint32_t)(fChPos - this->_Buffer); + + return StringBase::InvalidPosition; +} + +template +inline constexpr uint32_t StringBase::LastIndexOf(const Tchar* Rhs, uint32_t Pos) const +{ + auto LhsSize = this->_StoreSize * sizeof(Tchar); + + size_t RhsSize = 0; + if constexpr (sizeof(Tchar) == sizeof(char)) + RhsSize = strlen(Rhs) * sizeof(Tchar); + else if constexpr (sizeof(Tchar) == sizeof(wchar_t)) + RhsSize = wcslen(Rhs) * sizeof(Tchar); + + if (RhsSize == 0 || RhsSize > LhsSize || Pos >= this->_StoreSize) + return StringBase::InvalidPosition; + + auto fChPos = (sizeof(Tchar) == sizeof(char)) ? (Tchar*)std::memrchr((void*)(this->_Buffer + Pos), (int32_t)Rhs[0], (size_t)this->_StoreSize) : (Tchar*)std::wmemrchr((const wchar_t*)(this->_Buffer + Pos), (wchar_t)Rhs[0], (size_t)this->_StoreSize); + if (fChPos != nullptr) + { + while (std::memcmp(fChPos, Rhs, RhsSize)) + { + fChPos = (sizeof(Tchar) == sizeof(char)) ? (Tchar*)std::memrchr((void*)(fChPos + 1), (int32_t)Rhs[0], (size_t)this->_StoreSize) : (Tchar*)std::wmemrchr((const wchar_t*)(fChPos + 1), (wchar_t)Rhs[0], (size_t)this->_StoreSize); + if (!fChPos) + break; + } + + if (fChPos != nullptr) + return (uint32_t)(fChPos - this->_Buffer); + } + + return StringBase::InvalidPosition; +} + +template +inline constexpr uint32_t StringBase::LastIndexOf(const Tchar* Rhs, uint32_t Pos, uint32_t Count) const +{ + auto LhsSize = this->_StoreSize * sizeof(Tchar); + + size_t RhsSize = 0; + if constexpr (sizeof(Tchar) == sizeof(char)) + RhsSize = strlen(Rhs) * sizeof(Tchar); + else if constexpr (sizeof(Tchar) == sizeof(wchar_t)) + RhsSize = wcslen(Rhs) * sizeof(Tchar); + + if (RhsSize == 0 || RhsSize > LhsSize || Pos >= this->_StoreSize || RhsSize < (Count * sizeof(Tchar))) + return StringBase::InvalidPosition; + + RhsSize = (Count * sizeof(Tchar)); + + auto fChPos = (sizeof(Tchar) == sizeof(char)) ? (Tchar*)std::memrchr((void*)(this->_Buffer + Pos), (int32_t)Rhs[0], (size_t)this->_StoreSize) : (Tchar*)std::wmemrchr((const wchar_t*)(this->_Buffer + Pos), (wchar_t)Rhs[0], (size_t)this->_StoreSize); + if (fChPos != nullptr) + { + while (std::memcmp(fChPos, Rhs, RhsSize)) + { + fChPos = (sizeof(Tchar) == sizeof(char)) ? (Tchar*)std::memrchr((void*)(fChPos + 1), (int32_t)Rhs[0], (size_t)this->_StoreSize) : (Tchar*)std::wmemrchr((const wchar_t*)(fChPos + 1), (wchar_t)Rhs[0], (size_t)this->_StoreSize); + if (!fChPos) + break; + } + + if (fChPos != nullptr) + return (uint32_t)(fChPos - this->_Buffer); + } + + return StringBase::InvalidPosition; +} + +template +inline constexpr uint32_t StringBase::LastIndexOf(const StringBase& Rhs, uint32_t Pos) const noexcept +{ + auto LhsSize = this->_StoreSize * sizeof(Tchar); + auto RhsSize = Rhs._StoreSize * sizeof(Tchar); + + if (RhsSize == 0 || RhsSize > LhsSize || Pos >= this->_StoreSize) + return StringBase::InvalidPosition; + + auto fChPos = (sizeof(Tchar) == sizeof(char)) ? (Tchar*)std::memrchr((void*)(this->_Buffer + Pos), (int32_t)Rhs._Buffer[0], (size_t)this->_StoreSize) : (Tchar*)std::wmemrchr((const wchar_t*)(this->_Buffer + Pos), (wchar_t)Rhs._Buffer[0], (size_t)this->_StoreSize); + if (fChPos != nullptr) + { + while (std::memcmp(fChPos, Rhs._Buffer, RhsSize)) + { + fChPos = (sizeof(Tchar) == sizeof(char)) ? (Tchar*)std::memrchr((void*)(fChPos + 1), (int32_t)Rhs._Buffer[0], (size_t)this->_StoreSize) : (Tchar*)std::wmemrchr((const wchar_t*)(fChPos + 1), (wchar_t)Rhs._Buffer[0], (size_t)this->_StoreSize); + if (!fChPos) + break; + } + + if (fChPos != nullptr) + return (uint32_t)(fChPos - this->_Buffer); + } + + return StringBase::InvalidPosition; +} + +template +inline constexpr uint32_t StringBase::LastIndexOf(const StringBase& Rhs, uint32_t Pos, uint32_t Count) const noexcept +{ + auto LhsSize = this->_StoreSize * sizeof(Tchar); + auto RhsSize = Rhs._StoreSize * sizeof(Tchar); + + if (RhsSize == 0 || RhsSize > LhsSize || Pos >= this->_StoreSize || Rhs._StoreSize < Count) + return StringBase::InvalidPosition; + + RhsSize = (Count * sizeof(Tchar)); + + auto fChPos = (sizeof(Tchar) == sizeof(char)) ? (Tchar*)std::memrchr((void*)(this->_Buffer + Pos), (int32_t)Rhs._Buffer[0], (size_t)this->_StoreSize) : (Tchar*)std::wmemrchr((const wchar_t*)(this->_Buffer + Pos), (wchar_t)Rhs._Buffer[0], (size_t)this->_StoreSize); + if (fChPos != nullptr) + { + while (std::memcmp(fChPos, Rhs._Buffer, RhsSize)) + { + fChPos = (sizeof(Tchar) == sizeof(char)) ? (Tchar*)std::memrchr((void*)(fChPos + 1), (int32_t)Rhs._Buffer[0], (size_t)this->_StoreSize) : (Tchar*)std::wmemrchr((const wchar_t*)(fChPos + 1), (wchar_t)Rhs._Buffer[0], (size_t)this->_StoreSize); + if (!fChPos) + break; + } + + if (fChPos != nullptr) + return (uint32_t)(fChPos - this->_Buffer); + } + + return StringBase::InvalidPosition; +} + +template +inline constexpr uint32_t StringBase::LastIndexOf(std::basic_string_view Rhs, uint32_t Pos) const noexcept +{ + auto LhsSize = this->_StoreSize * sizeof(Tchar); + auto RhsSize = Rhs.size() * sizeof(Tchar); + + if (RhsSize == 0 || RhsSize > LhsSize || Pos >= this->_StoreSize) + return StringBase::InvalidPosition; + + auto fChPos = (sizeof(Tchar) == sizeof(char)) ? (Tchar*)std::memrchr((void*)(this->_Buffer + Pos), (int32_t)Rhs[0], (size_t)this->_StoreSize) : (Tchar*)std::wmemrchr((const wchar_t*)(this->_Buffer + Pos), (wchar_t)Rhs[0], (size_t)this->_StoreSize); + if (fChPos != nullptr) + { + while (std::memcmp(fChPos, Rhs.data(), RhsSize)) + { + fChPos = (sizeof(Tchar) == sizeof(char)) ? (Tchar*)std::memrchr((void*)(fChPos + 1), (int32_t)Rhs[0], (size_t)this->_StoreSize) : (Tchar*)std::wmemrchr((const wchar_t*)(fChPos + 1), (wchar_t)Rhs[0], (size_t)this->_StoreSize); + if (!fChPos) + break; + } + + if (fChPos != nullptr) + return (uint32_t)(fChPos - this->_Buffer); + } + + return StringBase::InvalidPosition; +} + +template +inline constexpr uint32_t StringBase::LastIndexOf(std::basic_string_view Rhs, uint32_t Pos, uint32_t Count) const noexcept +{ + auto LhsSize = this->_StoreSize * sizeof(Tchar); + auto RhsSize = Rhs.size() * sizeof(Tchar); + + if (RhsSize == 0 || RhsSize > LhsSize || Pos >= this->_StoreSize || Rhs.size() < Count) + return StringBase::InvalidPosition; + + RhsSize = (Count * sizeof(Tchar)); + + auto fChPos = (sizeof(Tchar) == sizeof(char)) ? (Tchar*)std::memrchr((void*)(this->_Buffer + Pos), (int32_t)Rhs[0], (size_t)this->_StoreSize) : (Tchar*)std::wmemrchr((const wchar_t*)(this->_Buffer + Pos), (wchar_t)Rhs[0], (size_t)this->_StoreSize); + if (fChPos != nullptr) + { + while (std::memcmp(fChPos, Rhs.data(), RhsSize)) + { + fChPos = (sizeof(Tchar) == sizeof(char)) ? (Tchar*)std::memrchr((void*)(fChPos + 1), (int32_t)Rhs[0], (size_t)this->_StoreSize) : (Tchar*)std::wmemrchr((const wchar_t*)(fChPos + 1), (wchar_t)Rhs[0], (size_t)this->_StoreSize); + if (!fChPos) + break; + } + + if (fChPos != nullptr) + return (uint32_t)(fChPos - this->_Buffer); + } + + return StringBase::InvalidPosition; +} + +template +inline constexpr StringBase StringBase::ToLower() const +{ + auto Result = StringBase(this->_Buffer, this->_StoreSize); + + std::transform(Result._Buffer, Result._Buffer + Result._StoreSize, Result._Buffer, (sizeof(Tchar) == sizeof(char)) ? ::tolower : (int(__cdecl*)(int))::towlower); + + return std::move(Result); +} + +template +inline constexpr StringBase StringBase::ToUpper() const +{ + auto Result = StringBase(this->_Buffer, this->_StoreSize); + + std::transform(Result._Buffer, Result._Buffer + Result._StoreSize, Result._Buffer, (sizeof(Tchar) == sizeof(char)) ? ::toupper : (int(__cdecl*)(int))::towupper); + + return std::move(Result); +} + +template +inline constexpr StringBase StringBase::Replace(const Tchar Old, const Tchar New) const +{ + auto Result = StringBase(this->_Buffer, this->_StoreSize); + + for (uint32_t i = 0; i < this->_StoreSize; i++) + { + if (Result[i] == Old) + Result[i] = New; + } + + return std::move(Result); +} + +template +inline constexpr StringBase StringBase::Replace(const Tchar* Old, const Tchar* New) const +{ + uint32_t CurrentIndex = 0, LocatedPosition = 0; + + uint32_t LhsSize = 0; + if constexpr (sizeof(Tchar) == sizeof(char)) + LhsSize = (uint32_t)strlen(Old); + else if constexpr (sizeof(Tchar) == sizeof(wchar_t)) + LhsSize = (uint32_t)wcslen(Old); + + auto Result = StringBase(); + + // Optimized for large strings and lots of occurences + while ((LocatedPosition = this->IndexOf(Old, CurrentIndex)) != StringBase::InvalidPosition) + { + Result += this->Substring(CurrentIndex, LocatedPosition - CurrentIndex); + Result += New; + + // Advance past the size of old and the position + CurrentIndex = LocatedPosition + LhsSize; + } + + if (CurrentIndex != this->_StoreSize) + Result += this->Substring(CurrentIndex, this->_StoreSize - CurrentIndex); + + return std::move(Result); +} + +template +inline constexpr StringBase StringBase::Replace(const StringBase& Old, const StringBase& New) const +{ + uint32_t CurrentIndex = 0, LocatedPosition = 0; + uint32_t LhsSize = Old._StoreSize; + + auto Result = StringBase(); + + // Optimized for large strings and lots of occurences + while ((LocatedPosition = this->IndexOf(Old, CurrentIndex)) != StringBase::InvalidPosition) + { + Result += this->Substring(CurrentIndex, LocatedPosition - CurrentIndex); + Result += New; + + // Advance past the size of old and the position + CurrentIndex = LocatedPosition + LhsSize; + } + + if (CurrentIndex != this->_StoreSize) + Result += this->Substring(CurrentIndex, this->_StoreSize - CurrentIndex); + + return std::move(Result); +} + +template +inline constexpr StringBase StringBase::Replace(std::basic_string_view Old, std::basic_string_view New) const +{ + uint32_t CurrentIndex = 0, LocatedPosition = 0; + uint32_t LhsSize = (uint32_t)Old.size(); + + auto Result = StringBase(); + + // Optimized for large strings and lots of occurences + while ((LocatedPosition = this->IndexOf(Old, CurrentIndex)) != StringBase::InvalidPosition) + { + Result += this->Substring(CurrentIndex, LocatedPosition - CurrentIndex); + Result += New; + + // Advance past the size of old and the position + CurrentIndex = LocatedPosition + LhsSize; + } + + if (CurrentIndex != this->_StoreSize) + Result += this->Substring(CurrentIndex, this->_StoreSize - CurrentIndex); + + return std::move(Result); +} + +template +inline constexpr bool StringBase::StartsWith(const Tchar* Rhs) const +{ + auto LhsSize = this->_StoreSize * sizeof(Tchar); + + uint32_t RhsSize = 0; + if constexpr (sizeof(Tchar) == sizeof(char)) + RhsSize = (uint32_t)strlen(Rhs) * sizeof(Tchar); + else if constexpr (sizeof(Tchar) == sizeof(wchar_t)) + RhsSize = (uint32_t)wcslen(Rhs) * sizeof(Tchar); + + if (RhsSize > LhsSize || RhsSize == 0) + return false; + + return (std::memcmp(this->_Buffer, Rhs, RhsSize) == 0); +} + +template +inline constexpr bool StringBase::StartsWith(const StringBase& Rhs) const +{ + auto LhsSize = this->_StoreSize * sizeof(Tchar); + auto RhsSize = Rhs._StoreSize * sizeof(Tchar); + + if (RhsSize > LhsSize || RhsSize == 0) + return false; + + return (std::memcmp(this->_Buffer, Rhs._Buffer, RhsSize) == 0); +} + +template +inline constexpr bool StringBase::StartsWith(std::basic_string_view Rhs) const +{ + auto LhsSize = this->_StoreSize * sizeof(Tchar); + auto RhsSize = Rhs.size() * sizeof(Tchar); + + if (RhsSize > LhsSize || RhsSize == 0) + return false; + + return (std::memcmp(this->_Buffer, Rhs.data(), RhsSize) == 0); +} + +template +inline constexpr bool StringBase::EndsWith(const Tchar* Rhs) const +{ + auto LhsSize = this->_StoreSize * sizeof(Tchar); + + uint32_t RhsSize = 0; + if constexpr (sizeof(Tchar) == sizeof(char)) + RhsSize = (uint32_t)strlen(Rhs) * sizeof(Tchar); + else if constexpr (sizeof(Tchar) == sizeof(wchar_t)) + RhsSize = (uint32_t)wcslen(Rhs) * sizeof(Tchar); + + if (RhsSize > LhsSize || RhsSize == 0) + return false; + + return (std::memcmp((char*)this->_Buffer + (LhsSize - RhsSize), Rhs, RhsSize) == 0); +} + +template +inline constexpr bool StringBase::EndsWith(const StringBase& Rhs) const +{ + auto LhsSize = this->_StoreSize * sizeof(Tchar); + auto RhsSize = Rhs._StoreSize * sizeof(Tchar); + + if (RhsSize > LhsSize || RhsSize == 0) + return false; + + return (std::memcmp((char*)this->_Buffer + (LhsSize - RhsSize), Rhs._Buffer, RhsSize) == 0); +} + +template +inline constexpr bool StringBase::EndsWith(std::basic_string_view Rhs) const +{ + auto LhsSize = this->_StoreSize * sizeof(Tchar); + auto RhsSize = Rhs.size() * sizeof(Tchar); + + if (RhsSize > LhsSize || RhsSize == 0) + return false; + + return (std::memcmp((char*)this->_Buffer + (LhsSize - RhsSize), Rhs.data(), RhsSize) == 0); +} + +template +inline constexpr bool StringBase::Contains(const Tchar* Rhs) const +{ + return (this->IndexOf(Rhs) != StringBase::InvalidPosition); +} + +template +inline constexpr bool StringBase::Contains(const StringBase& Rhs) const +{ + return (this->IndexOf(Rhs) != StringBase::InvalidPosition); +} + +template +inline constexpr bool StringBase::Contains(std::basic_string_view Rhs) const +{ + return (this->IndexOf(Rhs) != StringBase::InvalidPosition); +} + +template +inline constexpr StringBase StringBase::Substring(uint32_t StartIndex) const +{ + return this->Substring(StartIndex, this->_StoreSize - StartIndex); +} + +template +inline constexpr StringBase StringBase::Substring(uint32_t StartIndex, uint32_t Length) const +{ + if (Length > 0 && StartIndex < this->_StoreSize && (StartIndex + Length) <= this->_StoreSize) + { + auto Result = StringBase(Length); + + std::memcpy(Result._Buffer, this->_Buffer + StartIndex, Length * sizeof(Tchar)); + + return Result; + } + + return StringBase(); +} + +template +inline constexpr void StringBase::Append(Tchar Rhs) +{ + auto nPos = this->_StoreSize; + this->EnsureCapacity(nPos + 1); + this->_Buffer[nPos] = Rhs; +} + +template +inline constexpr void StringBase::Append(const Tchar* Rhs) +{ + size_t vLen = 0; + if constexpr (sizeof(Tchar) == sizeof(char)) + vLen = strlen(Rhs); + else if constexpr (sizeof(Tchar) == sizeof(wchar_t)) + vLen = wcslen(Rhs); + + auto cPosition = this->_StoreSize; + this->EnsureCapacity((uint32_t)vLen + this->_StoreSize); + + std::memcpy(this->_Buffer + cPosition, Rhs, vLen * sizeof(Tchar)); +} + +template +inline constexpr void StringBase::Append(Tchar* Rhs, uint32_t Count) +{ + auto cPosition = this->_StoreSize; + this->EnsureCapacity((uint32_t)Count + this->_StoreSize); + + std::memcpy(this->_Buffer + cPosition, Rhs, Count * sizeof(Tchar)); +} + +template +inline constexpr void StringBase::Append(const StringBase& Rhs) +{ + auto vLen = Rhs.Length(); + auto cPosition = this->_StoreSize; + this->EnsureCapacity((uint32_t)vLen + this->_StoreSize); + + std::memcpy(this->_Buffer + cPosition, Rhs._Buffer, vLen * sizeof(Tchar)); +} + +template +inline constexpr StringBase::operator Tchar*(void) const +{ + return this->_Buffer; +} + +template +inline constexpr StringBase::operator const Tchar*(void) const +{ + return (const Tchar*)this->_Buffer; +} + +template +inline constexpr StringBase::operator std::basic_string_view(void) const +{ + return std::basic_string_view(this->_Buffer, this->_StoreSize); +} + +template +inline constexpr Tchar& StringBase::operator[](size_t Index) +{ + return this->_Buffer[Index]; +} + +template +inline constexpr Tchar& StringBase::operator[](size_t Index) const +{ + return this->_Buffer[Index]; +} + +template +inline constexpr StringBase& StringBase::operator+=(const Tchar* Rhs) +{ + size_t vLen = 0; + if constexpr (sizeof(Tchar) == sizeof(char)) + vLen = strlen(Rhs); + else if constexpr (sizeof(Tchar) == sizeof(wchar_t)) + vLen = wcslen(Rhs); + + auto cPosition = this->_StoreSize; + this->EnsureCapacity((uint32_t)vLen + this->_StoreSize); + + std::memcpy(this->_Buffer + cPosition, Rhs, vLen * sizeof(Tchar)); + + return *this; +} + +template +inline constexpr Tchar * StringBase::begin() const noexcept +{ + return this->_Buffer; +} + +template +inline constexpr Tchar * StringBase::end() const noexcept +{ + return (this->_Buffer + this->_StoreSize); +} + +template +inline constexpr StringBase& StringBase::operator+=(const Tchar Rhs) +{ + auto nPos = this->_StoreSize; + this->EnsureCapacity(nPos + 1); + this->_Buffer[nPos] = Rhs; + + return *this; +} + +template +inline constexpr StringBase& StringBase::operator+=(const StringBase& Rhs) +{ + size_t vLen = Rhs._StoreSize; + + auto cPosition = this->_StoreSize; + this->EnsureCapacity((uint32_t)vLen + this->_StoreSize); + + std::memcpy(this->_Buffer + cPosition, Rhs._Buffer, vLen * sizeof(Tchar)); + + return *this; +} + +template +inline constexpr StringBase& StringBase::operator+=(std::basic_string_view Rhs) +{ + size_t vLen = Rhs.size(); + + auto cPosition = this->_StoreSize; + this->EnsureCapacity((uint32_t)vLen + this->_StoreSize); + + std::memcpy(this->_Buffer + cPosition, Rhs.data(), vLen * sizeof(Tchar)); + + return *this; +} + +template +inline constexpr StringBase& StringBase::operator+=(ImmutableStringBase Rhs) +{ + size_t vLen = Rhs.Length(); + + auto cPosition = this->_StoreSize; + this->EnsureCapacity((uint32_t)vLen + this->_StoreSize); + + std::memcpy(this->_Buffer + cPosition, (Tchar*)Rhs, vLen * sizeof(Tchar)); + + return *this; +} + +template +inline constexpr StringBase& StringBase::operator=(const Tchar* Rhs) +{ + if (this->_Buffer) + delete[] this->_Buffer; + this->_Buffer = nullptr; + this->_BufferSize = 0; + + size_t vLen = 0; + if constexpr (sizeof(Tchar) == sizeof(char)) + vLen = strlen(Rhs); + else if constexpr (sizeof(Tchar) == sizeof(wchar_t)) + vLen = wcslen(Rhs); + + this->EnsureCapacity((uint32_t)vLen); + + std::memcpy(this->_Buffer, Rhs, vLen * sizeof(Tchar)); + + return *this; +} + +template +inline constexpr StringBase& StringBase::operator=(const StringBase& Rhs) +{ + if (this->_Buffer) + delete[] this->_Buffer; + this->_Buffer = nullptr; + this->_BufferSize = 0; + + auto vLen = Rhs._StoreSize; + this->EnsureCapacity((uint32_t)vLen); + + std::memcpy(this->_Buffer, Rhs._Buffer, vLen * sizeof(Tchar)); + + return *this; +} + +template +inline constexpr StringBase& StringBase::operator=(std::basic_string_view Rhs) +{ + if (this->_Buffer) + delete[] this->_Buffer; + this->_Buffer = nullptr; + this->_BufferSize = 0; + + auto vLen = Rhs.size(); + this->EnsureCapacity((uint32_t)vLen); + + std::memcpy(this->_Buffer, Rhs.data(), vLen * sizeof(Tchar)); + + return *this; +} + +template +inline constexpr StringBase& StringBase::operator=(ImmutableStringBase Rhs) +{ + if (this->_Buffer) + delete[] this->_Buffer; + this->_Buffer = nullptr; + this->_BufferSize = 0; + + auto vLen = Rhs.Length(); + this->EnsureCapacity((uint32_t)vLen); + + std::memcpy(this->_Buffer, (Tchar*)Rhs, vLen * sizeof(Tchar)); + + return *this; +} + +template +inline constexpr bool StringBase::operator==(const Tchar* Rhs) const +{ + auto LhsSize = this->_StoreSize * sizeof(Tchar); + + uint32_t RhsSize = 0; + if constexpr (sizeof(Tchar) == sizeof(char)) + RhsSize = (uint32_t)strlen(Rhs) * sizeof(Tchar); + else if constexpr (sizeof(Tchar) == sizeof(wchar_t)) + RhsSize = (uint32_t)wcslen(Rhs) * sizeof(Tchar); + + if (LhsSize != RhsSize) + return false; + + return (std::memcmp(this->_Buffer, Rhs, RhsSize) == 0); +} + +template +inline constexpr bool StringBase::operator==(const StringBase& Rhs) const +{ + auto LhsSize = this->_StoreSize * sizeof(Tchar); + auto RhsSize = Rhs._StoreSize * sizeof(Tchar); + + if (LhsSize != RhsSize) + return false; + + return (std::memcmp(this->_Buffer, Rhs._Buffer, RhsSize) == 0); +} + +template +inline constexpr bool StringBase::operator==(std::basic_string_view Rhs) const +{ + auto LhsSize = this->_StoreSize * sizeof(Tchar); + auto RhsSize = Rhs.size() * sizeof(Tchar); + + if (LhsSize != RhsSize) + return false; + + return (std::memcmp(this->_Buffer, Rhs.data(), RhsSize) == 0); +} + +template +inline constexpr bool StringBase::operator!=(const Tchar* Rhs) const +{ + return !(*this == Rhs); +} + +template +inline constexpr bool StringBase::operator!=(const StringBase& Rhs) const +{ + return !(*this == Rhs); +} + +template +inline constexpr bool StringBase::operator!=(std::basic_string_view Rhs) const +{ + return !(*this == Rhs); +} + +template +inline constexpr bool StringBase::IsNullOrEmpty(const StringBase& Rhs) +{ + return (Rhs._Buffer == nullptr || Rhs._StoreSize == 0); +} + +template +inline constexpr bool StringBase::IsNullOrWhiteSpace(const StringBase& Rhs) +{ + if (Rhs._Buffer == nullptr) + return true; + + for (uint32_t i = 0; i < Rhs._StoreSize; i++) + { + if constexpr (sizeof(Tchar) == sizeof(char)) + { + if (!::isspace(Rhs._Buffer[i])) + return false; + } + else if constexpr (sizeof(Tchar) == sizeof(wchar_t)) + { + if (!::iswspace(Rhs._Buffer[i])) + return false; + } + } + + return true; +} + +template +inline constexpr StringBase StringBase::Format(const Tchar* Format, ...) +{ + va_list vArgs; + va_start(vArgs, Format); + +#pragma warning(suppress: 4996) + auto BufferSize = (sizeof(Tchar) == sizeof(char)) ? vsnprintf(nullptr, 0, Format, vArgs) : _vsnwprintf(nullptr, 0, (const wchar_t*)Format, vArgs); + auto Result = StringBase((uint32_t)BufferSize); + + if constexpr (sizeof(Tchar) == sizeof(char)) + vsnprintf(Result._Buffer, BufferSize + 1, Format, vArgs); + else if constexpr (sizeof(Tchar) == sizeof(wchar_t)) + _vsnwprintf(Result._Buffer, BufferSize + 1, (const wchar_t*)Format, vArgs); + + va_end(vArgs); + + return std::move(Result); +} + +// this is for a specific use case. make sure that va_start and va_end are called externally when using this +template +inline constexpr StringBase StringBase::Format(const Tchar* Format, va_list vArgs) +{ +#pragma warning(suppress: 4996) + auto BufferSize = (sizeof(Tchar) == sizeof(char)) ? vsnprintf(nullptr, 0, Format, vArgs) : _vsnwprintf(nullptr, 0, (const wchar_t*)Format, vArgs); + auto Result = StringBase((uint32_t)BufferSize); + + if constexpr (sizeof(Tchar) == sizeof(char)) + vsnprintf(Result._Buffer, BufferSize + 1, Format, vArgs); + else if constexpr (sizeof(Tchar) == sizeof(wchar_t)) + _vsnwprintf(Result._Buffer, BufferSize + 1, (const wchar_t*)Format, vArgs); + + return std::move(Result); +} + +template +constexpr inline void StringBase::EnsureCapacity(uint32_t Capacity) +{ + // Ensure that we have a proper buffer size for the string here, this is in units, NOT bytes... + // All StringBase classes are null-terminated, so we must make sure we set this up properly... + // Check to ensure we aren't wasting our time first... + if (Capacity < this->_BufferSize) + { + this->_StoreSize = Capacity; + return; + } + + auto nCapacity = Capacity + 1; + if (nCapacity < 16) + nCapacity = 17; + + if (nCapacity < (this->_BufferSize + (this->_BufferSize / 2)) + 1) + nCapacity = (this->_BufferSize + (this->_BufferSize / 2)) + 1; + + auto nBuffer = new Tchar[nCapacity](); + + if (this->_Buffer) + { + std::memcpy(nBuffer, this->_Buffer, this->_BufferSize * sizeof(Tchar)); + delete[] this->_Buffer; + } + + this->_Buffer = nBuffer; + + this->_BufferSize = nCapacity - 1; + this->_StoreSize = Capacity; +} + +// +// Predefiend string types +// + +using string = StringBase; +using String = StringBase; +using wstring = StringBase; +using WString = StringBase; \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Task.h b/r5dev/thirdparty/cppnet/cppkore/Task.h new file mode 100644 index 00000000..2b2b965b --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Task.h @@ -0,0 +1,38 @@ +#pragma once + +#include "Thread.h" +#include "ThreadStart.h" + +namespace Threading +{ + class Task + { + public: + // Starts the specified action on a new thread + inline static void Run(ThreadStart Action) + { + Thread(Action).Start(); + } + // Starts the specified action on a new thread with the given object + inline static void Run(ParameterizedThreadStart Action, void* Object) + { + Thread(Action).Start(Object); + } + // Starts the specified action on a new thread and waits for it to exit + inline static void RunAwait(ThreadStart Action) + { + auto Runner = Thread(Action); + + Runner.Start(); + Runner.Join(); + } + // Starts the specified action on a new thread with the given object and waits for it to exit + inline static void RunAwait(ParameterizedThreadStart Action, void* Object) + { + auto Runner = Thread(Action); + + Runner.Start(Object); + Runner.Join(); + } + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/TextBox.cpp b/r5dev/thirdparty/cppnet/cppkore/TextBox.cpp new file mode 100644 index 00000000..edcc4be8 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/TextBox.cpp @@ -0,0 +1,339 @@ +#include "stdafx.h" +#include "TextBox.h" + +namespace Forms +{ + TextBox::TextBox() + : TextBoxBase(), _AcceptsReturn(false), _PasswordChar('\0'), _UseSystemPasswordChar(false), _CharacterCasing(CharacterCasing::Normal), _Scrollbars(ScrollBars::None), _TextAlign(HorizontalAlignment::Left), _SelectionSet(false), _SizeRectDirty(true), _IsCalcRects(false), _NCRectTop{}, _NCRectBottom{}, _NCRectLeft{}, _NCRectRight{} + { + // We are a textbox control + this->_RTTI = ControlTypes::TextBox; + } + + bool TextBox::AcceptsReturn() + { + return this->_AcceptsReturn; + } + + void TextBox::AcceptsReturn(bool Value) + { + this->_AcceptsReturn = Value; + } + + CharacterCasing TextBox::GetCharacterCasing() + { + return this->_CharacterCasing; + } + + void TextBox::SetCharacterCasing(CharacterCasing Value) + { + if (_CharacterCasing != Value) + { + _CharacterCasing = Value; + UpdateStyles(); + } + } + + bool TextBox::PasswordProtect() + { + return (_PasswordChar != '\0'); + } + + char TextBox::PasswordChar() + { + if (GetState(ControlStates::StateCreated)) + return (char)SendMessageA(this->_Handle, EM_GETPASSWORDCHAR, NULL, NULL); + + return this->_PasswordChar; + } + + void TextBox::SetPasswordChar(char Value) + { + _PasswordChar = Value; + + if (!_UseSystemPasswordChar && GetState(ControlStates::StateCreated) && PasswordChar() != Value) + { + // Set the password mode + SendMessageA(this->_Handle, EM_SETPASSWORDCHAR, Value, NULL); + Invalidate(); + } + } + + ScrollBars TextBox::GetScrollBars() + { + return this->_Scrollbars; + } + + void TextBox::SetScrollBars(ScrollBars Value) + { + if (_Scrollbars != Value) + { + _Scrollbars = Value; + UpdateStyles(); + } + } + + void TextBox::SetText(const string& Value) + { + TextBoxBase::SetText(Value); + _SelectionSet = false; + } + + HorizontalAlignment TextBox::TextAlign() + { + return this->_TextAlign; + } + + void TextBox::SetTextAlign(HorizontalAlignment Value) + { + if (_TextAlign != Value) + { + _TextAlign = Value; + UpdateStyles(); + } + } + + bool TextBox::UseSystemPasswordChar() + { + return this->_UseSystemPasswordChar; + } + + void TextBox::SetUseSystemPasswordChar(bool Value) + { + if (_UseSystemPasswordChar != Value) + { + _UseSystemPasswordChar = Value; + UpdateStyles(); + } + } + + void TextBox::OnSizeChanged() + { + if (!GetFlag(TextBoxFlags::FlagMultiline) && !_IsCalcRects) + { + _SizeRectDirty = true; + CalculateSizeRects(); + } + + // We must call the base event last + TextBoxBase::OnSizeChanged(); + } + + void TextBox::OnHandleCreated() + { + TextBoxBase::OnHandleCreated(); + + if (_PasswordChar != '\0' && !_UseSystemPasswordChar) + SendMessageA(this->_Handle, EM_SETPASSWORDCHAR, _PasswordChar, NULL); + } + + void TextBox::OnGotFocus() + { + TextBoxBase::OnGotFocus(); + + if (!_SelectionSet) + { + // We get one shot at selecting when we first get focus. If we don't + // do it, we still want to act like the selection was set. + _SelectionSet = true; + + // If the user didn't provide a selection, force one in. + if (SelectionLength() == 0 && Control::GetMouseButtons() == MouseButtons::None) + SelectAll(); + } + } + + void TextBox::WndProc(Message& Msg) + { + switch (Msg.Msg) + { + case WM_NCPAINT: + WmNcPaint(Msg); + break; + case WM_NCCALCSIZE: + if (!GetFlag(TextBoxFlags::FlagMultiline)) + WmNcCalcSize(Msg); + else + TextBoxBase::WndProc(Msg); + break; + default: + TextBoxBase::WndProc(Msg); + break; + } + } + + CreateParams TextBox::GetCreateParams() + { + auto Cp = TextBoxBase::GetCreateParams(); + + switch (_CharacterCasing) + { + case CharacterCasing::Lower: + Cp.Style |= ES_LOWERCASE; + break; + case CharacterCasing::Upper: + Cp.Style |= ES_UPPERCASE; + break; + } + + Cp.ExStyle &= ~WS_EX_RIGHT; + switch (_TextAlign) + { + case HorizontalAlignment::Left: + Cp.Style |= ES_LEFT; + break; + case HorizontalAlignment::Center: + Cp.Style |= ES_CENTER; + break; + case HorizontalAlignment::Right: + Cp.Style |= ES_RIGHT; + break; + } + + if (Multiline()) + { + if (((int)_Scrollbars & (int)ScrollBars::Horizontal) == (int)ScrollBars::Horizontal && _TextAlign == HorizontalAlignment::Left && !WordWrap()) + Cp.Style |= WS_HSCROLL; + + if (((int)_Scrollbars & (int)ScrollBars::Vertical) == (int)ScrollBars::Vertical) + Cp.Style |= WS_VSCROLL; + } + + if (_UseSystemPasswordChar) + Cp.Style |= ES_PASSWORD; + + return Cp; + } + + void TextBox::WmNcCalcSize(Message& Msg) + { + if (Msg.WParam == 0) + { + TextBoxBase::WndProc(Msg); + return; + } + + RECT RectWnd, RectClient, RectText{}; + GetClientRect(this->_Handle, &RectClient); + GetWindowRect(this->_Handle, &RectWnd); + + auto Font = this->GetFont(); + auto DC = GetDC(this->_Handle); + + auto pOld = SelectObject(DC, Font->GetFontHandle()); + DrawTextA(DC, "Ky", 2, &RectText, DT_CALCRECT | DT_LEFT); + SelectObject(DC, pOld); + + ReleaseDC(this->_Handle, DC); + MapWindowPoints(this->_Handle, NULL, (LPPOINT)&RectClient, 2); + + UINT uiVClientHeight = RectText.bottom - RectText.top; + + auto lpNCSP = (NCCALCSIZE_PARAMS FAR*)Msg.LParam; + + UINT uiCenterOffset = ((RectClient.bottom - RectClient.top) - uiVClientHeight) / 2; + UINT uiCY = ((RectWnd.bottom - RectWnd.top) - (RectClient.bottom - RectClient.top)) / 2; + UINT uiCX = ((RectWnd.right - RectWnd.left) - (RectClient.right - RectClient.left)) / 2; + + // Handle special case where RectClient == RectWnd + if (this->GetBorderStyle() == BorderStyle::None) + { + uiCY = 3; + uiCX = 3; + uiCenterOffset -= 1; + } + + // A shift to adjust for the off by 1 pixel + uiCenterOffset += 1; + + OffsetRect(&RectWnd, -RectWnd.left, -RectWnd.top); + + // Handle special case where RectClient == RectWnd + if (this->GetBorderStyle() == BorderStyle::None) + { + _NCRectTop.top = 1; + _NCRectTop.left = 1; + _NCRectTop.right = RectWnd.right - 1; + _NCRectTop.bottom = uiCenterOffset; + + _NCRectBottom.left = 1; + _NCRectBottom.top = uiCenterOffset + uiVClientHeight; + _NCRectBottom.right = RectWnd.right - 1; + _NCRectBottom.bottom = RectWnd.bottom - 1; + + _NCRectLeft = _NCRectTop; + _NCRectLeft.right = _NCRectLeft.left + 2; + _NCRectLeft.bottom = _NCRectBottom.bottom; + + _NCRectRight = _NCRectTop; + _NCRectRight.left = (_NCRectRight.right - 2); + _NCRectRight.bottom = _NCRectBottom.bottom; + } + else + { + _NCRectTop = RectWnd; + + _NCRectTop.left += uiCX; + _NCRectTop.top += uiCY; + _NCRectTop.right -= uiCX; + _NCRectTop.bottom -= (uiCenterOffset + uiVClientHeight + uiCY); + + _NCRectBottom = RectWnd; + + _NCRectBottom.left += uiCX; + _NCRectBottom.top += (uiCenterOffset + uiVClientHeight + uiCY); + _NCRectBottom.right -= uiCX; + _NCRectBottom.bottom -= uiCY; + + _NCRectLeft = _NCRectTop; + _NCRectLeft.left -= 1; + _NCRectLeft.right = _NCRectLeft.left + 1; + _NCRectLeft.bottom = _NCRectBottom.bottom; + + _NCRectRight = _NCRectTop; + _NCRectRight.left = (_NCRectRight.right - 1); + _NCRectRight.right += 1; + _NCRectRight.bottom = _NCRectBottom.bottom; + } + + // Set the resulting client size + lpNCSP->rgrc[0].top += uiCenterOffset; + lpNCSP->rgrc[0].bottom -= uiCenterOffset; + lpNCSP->rgrc[0].left += uiCX; + lpNCSP->rgrc[0].right -= uiCY; + + // They aren't dirty after this routine + _SizeRectDirty = false; + } + + void TextBox::WmNcPaint(Message& Msg) + { + if (!GetFlag(TextBoxFlags::FlagMultiline)) + { + // Check if we need to recalculate the size rects + if (_SizeRectDirty) + CalculateSizeRects(); + + // Paint the missing rects + auto DC = GetWindowDC(this->_Handle); + auto Brush = (HBRUSH)this->BackColorBrush(); + + FillRect(DC, &_NCRectLeft, Brush); + FillRect(DC, &_NCRectRight, Brush); + FillRect(DC, &_NCRectTop, Brush); + FillRect(DC, &_NCRectBottom, Brush); + + ReleaseDC(this->_Handle, DC); + } + + // Ensure default action is taken, WmNcPaint won't touch outside the NC rect... + TextBoxBase::WndProc(Msg); + } + + void TextBox::CalculateSizeRects() + { + _IsCalcRects = true; + SetWindowPos(this->_Handle, NULL, 0, 0, 0, 0, SWP_NOOWNERZORDER | SWP_NOSIZE | SWP_NOMOVE | SWP_FRAMECHANGED); + _IsCalcRects = false; + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/TextBox.h b/r5dev/thirdparty/cppnet/cppkore/TextBox.h new file mode 100644 index 00000000..4ee3b1a2 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/TextBox.h @@ -0,0 +1,102 @@ +#pragma once + +#include +#include "Control.h" +#include "TextBoxBase.h" +#include "ScrollBars.h" +#include "CharacterCasing.h" +#include "HorizontalAlignment.h" + +namespace Forms +{ + // Represents a Windows text box control. + class TextBox : public TextBoxBase + { + public: + TextBox(); + virtual ~TextBox() = default; + + // Gets a value indicating whether pressing ENTER + // in a multiline TextBox control creates a new line of text + // in the control or activates the default button for the form. + bool AcceptsReturn(); + // Sets a value indicating whether pressing ENTER + // in a multiline TextBox control creates a new line of text + // in the control or activates the default button for the form. + void AcceptsReturn(bool Value); + + // Gets whether the TextBox control + // modifies the case of characters as they are typed. + CharacterCasing GetCharacterCasing(); + // Sets whether the TextBox control + // modifies the case of characters as they are typed. + void SetCharacterCasing(CharacterCasing Value); + + // Determines if the control is in password protect mode. + virtual bool PasswordProtect(); + + // Gets the character used to mask characters in a single-line text box. + char PasswordChar(); + // Sets the character used to mask characters in a single-line text box. + void SetPasswordChar(char Value); + + // Gets which scroll bars should + // appear in a multiline TextBox control. + ScrollBars GetScrollBars(); + // Sets which scroll bars should + // appear in a multiline TextBox control. + void SetScrollBars(ScrollBars Value); + + // Sets the current text in the text box. + virtual void SetText(const string& Value); + + // Gets how text is aligned in a TextBox control. + HorizontalAlignment TextAlign(); + // Sets how text is aligned in a TextBox control. + void SetTextAlign(HorizontalAlignment Value); + + // Gets if the text in the edit control should appear as + // the default password character. + bool UseSystemPasswordChar(); + // Sets if the text in the edit control should appear as + // the default password character. + void SetUseSystemPasswordChar(bool Value); + + // We must define base events here + virtual void OnSizeChanged(); + virtual void OnHandleCreated(); + virtual void OnGotFocus(); + + // The standard windows message pump for this control. + virtual void WndProc(Message& Msg); + + protected: + // Get custom control creation parameters for this instance. + virtual CreateParams GetCreateParams(); + + private: + // Internal cached flags + bool _AcceptsReturn; + char _PasswordChar; + bool _UseSystemPasswordChar; + CharacterCasing _CharacterCasing; + ScrollBars _Scrollbars; + HorizontalAlignment _TextAlign; + bool _SelectionSet; + + // Used for vertical centering of text in non-multiline mode + RECT _NCRectTop; + RECT _NCRectBottom; + RECT _NCRectLeft; + RECT _NCRectRight; + bool _SizeRectDirty; + bool _IsCalcRects; + + // We must define each window message handler here... + void WmNcCalcSize(Message& Msg); + void WmNcPaint(Message& Msg); + + // Internal routine to calculate size rects for the control + void CalculateSizeRects(); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/TextBoxBase.cpp b/r5dev/thirdparty/cppnet/cppkore/TextBoxBase.cpp new file mode 100644 index 00000000..82101837 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/TextBoxBase.cpp @@ -0,0 +1,659 @@ +#include "stdafx.h" +#include "TextBoxBase.h" + +namespace Forms +{ + TextBoxBase::TextBoxBase() + : Control(), _Flags((TextBoxFlags)0), _BorderStyle(BorderStyle::Fixed3D), _MaxLength(32767), _SelectionStart(0), _SelectionLength(0), _DoubleClickFired(false) + { + SetFlag(TextBoxFlags::FlagAutoSize | TextBoxFlags::FlagHideSelection | TextBoxFlags::FlagWordWrap | TextBoxFlags::FlagShortcutsEnabled, true); + // TODO: Re-evaluate after setting auto-size flag properly... SetStyle(ControlStyles::FixedHeight, GetFlag(TextBoxFlags::FlagAutoSize)); + SetStyle(ControlStyles::StandardClick | + ControlStyles::StandardDoubleClick | + ControlStyles::UseTextForAccessibility | + ControlStyles::UserPaint, false); + + // Default back color for text based controls + _BackColor = { 255, 255, 255 }; + } + + void TextBoxBase::OnMouseUp(const std::unique_ptr& EventArgs) + { + auto Pt = this->PointToScreen({ EventArgs->X, EventArgs->Y }); + + if (EventArgs->Button == MouseButtons::Left) + { + if (WindowFromPoint({ Pt.X, Pt.Y }) == this->_Handle) + { + if (!this->_DoubleClickFired) + { + OnClick(); + OnMouseClick(EventArgs); + } + else + { + this->_DoubleClickFired = false; + OnDoubleClick(); + OnMouseDoubleClick(EventArgs); + } + } + + this->_DoubleClickFired = false; + } + + Control::OnMouseUp(EventArgs); + } + + void TextBoxBase::OnHideSelectionChanged() + { + HideSelectionChanged.RaiseEvent(this); + } + + void TextBoxBase::OnModifiedChanged() + { + ModifiedChanged.RaiseEvent(this); + } + + void TextBoxBase::OnMultilineChanged() + { + MultilineChanged.RaiseEvent(this); + } + + void TextBoxBase::OnReadOnlyChanged() + { + ReadOnlyChanged.RaiseEvent(this); + } + + void TextBoxBase::OnAcceptsTabChanged() + { + AcceptsTabChanged.RaiseEvent(this); + } + + void TextBoxBase::OnHandleCreated() + { + Control::OnHandleCreated(); + + if (GetFlag(TextBoxFlags::FlagSetSelectionOnHandleCreated)) + { + Select(this->_SelectionStart, this->_SelectionLength); + SetFlag(TextBoxFlags::FlagScrollToCaretOnHandleCreated, false); + } + + this->UpdateMaxLength(); + + if (GetFlag(TextBoxFlags::FlagModified)) + SendMessageA(this->_Handle, EM_SETMODIFY, 1, NULL); + + if (GetFlag(TextBoxFlags::FlagScrollToCaretOnHandleCreated)) + { + ScrollToCaret(); + SetFlag(TextBoxFlags::FlagScrollToCaretOnHandleCreated, false); + } + } + + void TextBoxBase::OnHandleDestroyed() + { + SetFlag(TextBoxFlags::FlagModified, this->Modified()); + SetFlag(TextBoxFlags::FlagSetSelectionOnHandleCreated, true); + GetSelectionStartAndLength(this->_SelectionStart, this->_SelectionLength); + + // Call the base event last + Control::OnHandleDestroyed(); + } + + BorderStyle TextBoxBase::GetBorderStyle() + { + return this->_BorderStyle; + } + + void TextBoxBase::SetBorderStyle(BorderStyle Value) + { + this->_BorderStyle = Value; + + Invalidate(); + UpdateStyles(); + } + + bool TextBoxBase::AcceptsTab() + { + return GetFlag(TextBoxFlags::FlagAcceptsTab); + } + + void TextBoxBase::SetAcceptsTab(bool Value) + { + if (GetFlag(TextBoxFlags::FlagAcceptsTab) != Value) + { + SetFlag(TextBoxFlags::FlagAcceptsTab, Value); + OnAcceptsTabChanged(); + } + } + + bool TextBoxBase::CanUndo() + { + return (SendMessageA(this->_Handle, EM_CANUNDO, NULL, NULL) == 0); + } + + bool TextBoxBase::HideSelection() + { + return GetFlag(TextBoxFlags::FlagHideSelection); + } + + void TextBoxBase::SetHideSelection(bool Value) + { + if (GetFlag(TextBoxFlags::FlagHideSelection) != Value) + { + SetFlag(TextBoxFlags::FlagHideSelection, Value); + + Invalidate(); + UpdateStyles(); + + OnHideSelectionChanged(); + } + } + + List TextBoxBase::Lines() + { + List Result; + + auto Buffer = this->Text(); + uint32_t LineStart = 0; + + while (LineStart < Buffer.Length()) + { + uint32_t LineEnd = LineStart; + for (; LineEnd < Buffer.Length(); LineEnd++) + { + char c = Buffer[LineEnd]; + if (c == '\r' || c == '\n') + break; + } + + Result.EmplaceBack(Buffer.Substring(LineStart, LineEnd - LineStart)); + + // Treat "\r", "\r\n", and "\n" as new lines + if (LineEnd < Buffer.Length() && Buffer[LineEnd] == '\r') + LineEnd++; + if (LineEnd < Buffer.Length() && Buffer[LineEnd] == '\n') + LineEnd++; + + LineStart = LineEnd; + } + + if (Buffer.Length() > 0 && (Buffer[Buffer.Length() - 1] == '\r' || Buffer[Buffer.Length() - 1] == '\n')) + Result.EmplaceBack(""); + + return Result; + } + + void TextBoxBase::SetLines(const List& Value) + { + string Result = ""; + + for (auto& Line : Value) + { + Result.Append(Line); + Result.Append((char*)"\r\n"); + } + + this->SetText(Result); + } + + uint32_t TextBoxBase::MaxLength() + { + return this->_MaxLength; + } + + void TextBoxBase::SetMaxLength(uint32_t Value) + { + if (this->_MaxLength != Value) + { + this->_MaxLength = Value; + UpdateMaxLength(); + } + } + + string TextBoxBase::Text() + { + return Control::Text(); + } + + void TextBoxBase::SetText(const string& Value) + { + if (Value != Control::Text()) + { + Control::SetText(Value); + + if (GetState(ControlStates::StateCreated)) + SendMessageA(this->_Handle, EM_SETMODIFY, 0, NULL); + } + } + + uint32_t TextBoxBase::TextLength() + { + if (GetState(ControlStates::StateCreated)) + return (uint32_t)GetWindowTextLengthA(this->_Handle); + + return Text().Length(); + } + + bool TextBoxBase::WordWrap() + { + return GetFlag(TextBoxFlags::FlagWordWrap); + } + + void TextBoxBase::SetWordWrap(bool Value) + { + if (WordWrap() != Value) + { + SetFlag(TextBoxFlags::FlagWordWrap, Value); + UpdateStyles(); + } + } + + void TextBoxBase::AppendText(const string& Text) + { + int32_t SelStart, SelLength; + GetSelectionStartAndLength(SelStart, SelLength); + + int32_t EndOfText = this->GetEndPosition(); + + SelectInternal(EndOfText, EndOfText, EndOfText); + SetSelectedText(Text); + + if (this->_Width == 0 || this->_Height == 0) + Select(SelStart, SelLength); + } + + void TextBoxBase::Clear() + { + this->SetText(""); + } + + void TextBoxBase::ClearUndo() + { + if (GetState(ControlStates::StateCreated)) + SendMessageA(this->_Handle, EM_EMPTYUNDOBUFFER, 0, 0); + } + + void TextBoxBase::Copy() + { + SendMessageA(this->_Handle, WM_COPY, NULL, NULL); + } + + void TextBoxBase::Cut() + { + SendMessageA(this->_Handle, WM_CUT, NULL, NULL); + } + + void TextBoxBase::Paste() + { + SendMessageA(this->_Handle, WM_PASTE, NULL, NULL); + } + + void TextBoxBase::Undo() + { + SendMessageA(this->_Handle, EM_UNDO, NULL, NULL); + } + + void TextBoxBase::Select(int32_t Start, int32_t Length) + { + int TextLen = this->TextLength(); + + if (Start > TextLen) + { + // Convert to negative length if we're at the end... + int64_t LongLength = min(0, (int64_t)Length + Start - TextLen); + + if (LongLength < INT_MIN) + Length = INT_MIN; + else + Length = (int32_t)LongLength; + + Start = TextLen; + } + + SelectInternal(Start, Length, TextLen); + } + + void TextBoxBase::SelectAll() + { + auto Len = this->TextLength(); + SelectInternal(0, Len, Len); + } + + void TextBoxBase::DeselectAll() + { + this->SetSelectionLength(0); + } + + void TextBoxBase::ScrollToCaret() + { + if (GetState(ControlStates::StateCreated)) + SendMessageA(this->_Handle, EM_SCROLLCARET, NULL, NULL); + else + SetFlag(TextBoxFlags::FlagScrollToCaretOnHandleCreated, true); + } + + CreateParams TextBoxBase::GetCreateParams() + { + auto Cp = Control::GetCreateParams(); + Cp.ClassName = "EDIT"; + Cp.Style |= ES_AUTOHSCROLL | ES_AUTOVSCROLL; + + if (!GetFlag(TextBoxFlags::FlagHideSelection)) + Cp.Style |= ES_NOHIDESEL; + if (GetFlag(TextBoxFlags::FlagReadOnly)) + Cp.Style |= ES_READONLY; + + Cp.ExStyle &= (~WS_EX_CLIENTEDGE); + Cp.Style &= (~WS_BORDER); + + switch (this->_BorderStyle) + { + case BorderStyle::Fixed3D: + Cp.ExStyle |= WS_EX_CLIENTEDGE; + break; + case BorderStyle::FixedSingle: + Cp.Style |= WS_BORDER; + break; + } + + if (GetFlag(TextBoxFlags::FlagMultiline)) + { + Cp.Style |= ES_MULTILINE; + + if (GetFlag(TextBoxFlags::FlagWordWrap)) + Cp.Style &= ~ES_AUTOHSCROLL; + } + + return Cp; + } + + void TextBoxBase::SetWindowText(const string& Value) + { + // Override to prevent double OnTextChanged events + if (this->WindowText() != Value) + { + SetFlag(TextBoxFlags::FlagCodeUpdateText, true); + Control::SetWindowText(Value); + SetFlag(TextBoxFlags::FlagCodeUpdateText, false); + } + } + + bool TextBoxBase::CanRaiseTextChangedEvent() + { + return true; + } + + void TextBoxBase::UpdateMaxLength() + { + if (GetState(ControlStates::StateCreated)) + SendMessageA(this->_Handle, EM_LIMITTEXT, (WPARAM)this->_MaxLength, NULL); + } + + void TextBoxBase::SetSelectedTextInternal(const string& Text, bool ClearUndo) + { + SendMessageA(this->_Handle, EM_LIMITTEXT, 0, 0); + + if (ClearUndo) + { + SendMessageA(this->_Handle, EM_REPLACESEL, 0, (LPARAM)(char*)Text); + SendMessageA(this->_Handle, EM_SETMODIFY, 0, 0); + this->ClearUndo(); + } + else + SendMessageA(this->_Handle, EM_REPLACESEL, -1, (LPARAM)(char*)Text); + + SendMessageA(this->_Handle, EM_LIMITTEXT, this->_MaxLength, NULL); + } + + void TextBoxBase::SelectInternal(int32_t Start, int32_t Length, int32_t TextLen) + { + if (GetState(ControlStates::StateCreated)) + { + int32_t St, Ed; + AdjustSelectionStartAndEnd(Start, Length, St, Ed, TextLen); + + SendMessageA(this->_Handle, EM_SETSEL, (WPARAM)St, (LPARAM)Ed); + } + else + { + this->_SelectionStart = Start; + this->_SelectionLength = Length; + SetFlag(TextBoxFlags::FlagSetSelectionOnHandleCreated, true); + } + } + + int32_t TextBoxBase::GetEndPosition() + { + return GetState(ControlStates::StateCreated) ? TextLength() + 1 : TextLength(); + } + + void TextBoxBase::GetSelectionStartAndLength(int32_t& Start, int32_t& Length) + { + int32_t End = 0; + + if (!GetState(ControlStates::StateCreated)) + { + AdjustSelectionStartAndEnd(this->_SelectionStart, this->_SelectionLength, Start, End, -1); + Length = End - Start; + } + else + { + Start = 0; + SendMessageA(this->_Handle, EM_GETSEL, (WPARAM)&Start, (LPARAM)&End); + + Start = (int32_t)max(0, Start); + End = (int32_t)max(0, End); + + Length = End - Start; + } + } + + void TextBoxBase::AdjustSelectionStartAndEnd(int32_t SelStart, int32_t SelLength, int32_t& Start, int32_t& End, int32_t TextLen) + { + Start = SelStart; + End = 0; + + if (Start <= -1) + Start = -1; + else + { + int32_t TextLength; + + if (TextLen >= 0) + TextLength = TextLen; + else + TextLength = this->TextLength(); + + if (Start > TextLength) + Start = TextLength; + + // Easy check for overflow when we add them + if ((int64_t)((int64_t)Start + (int64_t)SelLength) > INT_MAX) + End = Start > 0 ? INT_MAX : INT_MIN; + else + End = Start + SelLength; + + // End must always be positive and less than total + if (End < 0) + End = 0; + else if (End > TextLength) + End = TextLength; + } + } + + bool TextBoxBase::Modified() + { + if (GetState(ControlStates::StateCreated)) + { + auto CurState = (0 != (int)(long)SendMessageA(this->_Handle, EM_GETMODIFY, NULL, NULL)); + + if (GetFlag(TextBoxFlags::FlagModified) != CurState) + { + SetFlag(TextBoxFlags::FlagModified, CurState); + OnModifiedChanged(); + } + + return CurState; + } + + return GetFlag(TextBoxFlags::FlagModified); + } + + void TextBoxBase::SetModified(bool Value) + { + if (Modified() != Value) + { + if (GetState(ControlStates::StateCreated)) + SendMessageA(this->_Handle, EM_SETMODIFY, Value ? 1 : 0, NULL); + + SetFlag(TextBoxFlags::FlagModified, Value); + OnModifiedChanged(); + } + } + + bool TextBoxBase::Multiline() + { + return GetFlag(TextBoxFlags::FlagMultiline); + } + + void TextBoxBase::SetMultiline(bool Value) + { + if (GetFlag(TextBoxFlags::FlagMultiline) != Value) + { + SetFlag(TextBoxFlags::FlagMultiline, Value); + + UpdateStyles(); + OnMultilineChanged(); + } + } + + bool TextBoxBase::PasswordProtect() + { + return false; + } + + bool TextBoxBase::ReadOnly() + { + return GetFlag(TextBoxFlags::FlagReadOnly); + } + + void TextBoxBase::SetReadOnly(bool Value) + { + if (GetFlag(TextBoxFlags::FlagReadOnly) != Value) + { + SetFlag(TextBoxFlags::FlagReadOnly, Value); + + if (GetState(ControlStates::StateCreated)) + SendMessageA(this->_Handle, EM_SETREADONLY, Value ? -1 : 0, NULL); + + OnReadOnlyChanged(); + } + } + + string TextBoxBase::SelectedText() + { + int32_t SelStart, SelLength; + GetSelectionStartAndLength(SelStart, SelLength); + + return Text().Substring(SelStart, SelLength); + } + + void TextBoxBase::SetSelectedText(const string& Value) + { + SetSelectedTextInternal(Value, true); + } + + int32_t TextBoxBase::SelectionLength() + { + int32_t Length, Junk; + GetSelectionStartAndLength(Junk, Length); + + return Length; + } + + void TextBoxBase::SetSelectionLength(int32_t Value) + { + int32_t SelStart, SelLength; + GetSelectionStartAndLength(SelStart, SelLength); + + if (Value != SelLength) + Select(SelStart, Value); + } + + int32_t TextBoxBase::SelectionStart() + { + int32_t Start, Junk; + GetSelectionStartAndLength(Start, Junk); + + return Start; + } + + void TextBoxBase::SetSelectionStart(int32_t Value) + { + Select(Value, this->SelectionLength()); + } + + bool TextBoxBase::GetFlag(TextBoxFlags Flag) + { + return ((int)this->_Flags & (int)Flag) == (int)Flag; + } + + void TextBoxBase::SetFlag(TextBoxFlags Flags, bool Value) + { + this->_Flags = Value ? (TextBoxFlags)((int)this->_Flags | (int)Flags) : (TextBoxFlags)((int)this->_Flags & ~(int)Flags); + } + + void TextBoxBase::WmReflectCommand(Message& Msg) + { + if (!GetFlag(TextBoxFlags::FlagCodeUpdateText)) + { + if (HIWORD(Msg.WParam) == EN_CHANGE && CanRaiseTextChangedEvent()) + OnTextChanged(); + else if (HIWORD(Msg.WParam) == EN_UPDATE) + Modified(); + } + } + + void TextBoxBase::WmGetDlgCode(Message& Msg) + { + Control::WndProc(Msg); + + if (this->AcceptsTab()) + Msg.Result = (uintptr_t)((int)Msg.Result | DLGC_WANTTAB); + else + Msg.Result = (uintptr_t)((int)Msg.Result & ~(DLGC_WANTTAB | DLGC_WANTALLKEYS)); + } + + void TextBoxBase::WmSetFont(Message& Msg) + { + Control::WndProc(Msg); + + if (!GetFlag(TextBoxFlags::FlagMultiline)) + SendMessageA(this->_Handle, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, 0); + } + + void TextBoxBase::WndProc(Message& Msg) + { + switch (Msg.Msg) + { + case WM_LBUTTONDBLCLK: + _DoubleClickFired = true; + Control::WndProc(Msg); + break; + case WM_REFLECT: + WmReflectCommand(Msg); + break; + case WM_GETDLGCODE: + WmGetDlgCode(Msg); + break; + case WM_SETFONT: + WmSetFont(Msg); + break; + default: + Control::WndProc(Msg); + break; + } + } +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/TextBoxBase.h b/r5dev/thirdparty/cppnet/cppkore/TextBoxBase.h new file mode 100644 index 00000000..e50a14fd --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/TextBoxBase.h @@ -0,0 +1,202 @@ +#pragma once +#pragma once + +#include +#include "StringBase.h" +#include "ListBase.h" +#include "Control.h" +#include "FlatStyle.h" +#include "BorderStyle.h" +#include "TextBoxFlags.h" +#include "ContentAlignment.h" + +namespace Forms +{ + // Implements the basic functionality required by text controls. + class TextBoxBase : public Control + { + public: + virtual ~TextBoxBase() = default; + + // Gets the border style appearence of the text box control. + BorderStyle GetBorderStyle(); + // Sets the border style appearence of the text box control. + void SetBorderStyle(BorderStyle Value); + + // Gets a value indicating whether pressing the TAB key + // in a multiline text box control types + // a TAB character in the control instead of moving the focus to the next control + // in the tab order. + bool AcceptsTab(); + // Sets a value indicating whether pressing the TAB key + // in a multiline text box control types + // a TAB character in the control instead of moving the focus to the next control + // in the tab order. + void SetAcceptsTab(bool Value); + + // Gets a value indicating whether the user can undo the previous operation in a text box control. + bool CanUndo(); + + // Gets a value indicating whether the selected + // text in the text box control remains highlighted when the control loses focus. + bool HideSelection(); + // Sets a value indicating whether the selected + // text in the text box control remains highlighted when the control loses focus. + void SetHideSelection(bool Value); + + // Gets the lines of text in an text box control. + List Lines(); + // Sets the lines of text in an text box control. + void SetLines(const List& Value); + + // Gets the maximum number of characters the user can type into the text box control. + virtual uint32_t MaxLength(); + // Sets the maximum number of characters the user can type into the text box control. + virtual void SetMaxLength(uint32_t Value); + + // Gets a value that indicates that the text box control has been modified by the user since + // the control was created or its contents were last set. + bool Modified(); + // Sets a value that indicates that the text box control has been modified by the user since + // the control was created or its contents were last set. + void SetModified(bool Value); + + // Gets a value indicating whether this is a multiline text box control. + virtual bool Multiline(); + // Sets a value indicating whether this is a multiline text box control. + virtual void SetMultiline(bool Value); + + // Determines if the control is in password protect mode. + virtual bool PasswordProtect(); + + // Gets a value indicating whether text in the text box is read-only. + bool ReadOnly(); + // Sets a value indicating whether text in the text box is read-only. + void SetReadOnly(bool Value); + + // Gets the currently selected text in the control. + virtual string SelectedText(); + // Sets the currently selected text in the control. + virtual void SetSelectedText(const string& Value); + + // Gets the number of characters selected in the text box. + virtual int32_t SelectionLength(); + // Sets the number of characters selected in the text box. + virtual void SetSelectionLength(int32_t Value); + + // Gets the starting point of text selected in the text box. + int32_t SelectionStart(); + // Sets the starting point of text selected in the text box. + void SetSelectionStart(int32_t Value); + + // Gets the current text in the text box. + virtual string Text(); + // Sets the current text in the text box. + virtual void SetText(const string& Value); + + // Gets the length of the text in the control. + virtual uint32_t TextLength(); + + // Gets a value indicating whether a text box will wrap it's contents. + bool WordWrap(); + // Sets a value indicating whether a text box will wrap it's contents. + void SetWordWrap(bool Value); + + // Append text to the current text of the text box. + void AppendText(const string& Text); + + // Clears all the text from the text box control. + void Clear(); + // Clears information about the most recent operation + // from the undo buffer of the text box. + void ClearUndo(); + + // Copies the current selection in the text box to the Clipboard. + void Copy(); + // Moves the current selection in the text box to the Clipboard. + void Cut(); + // Replaces the current selection in the text box with the contents of the Clipboard. + void Paste(); + // Undoes the last edit operation in the text box. + void Undo(); + + // Selects a range of text in the text box. + void Select(int32_t Start, int32_t Length); + // Selects all text in the text box. + void SelectAll(); + // Sets the SelectionLength to 0. + void DeselectAll(); + + // Ensures that the caret is visible in the text box window. + void ScrollToCaret(); + + // We must define control event bases here + virtual void OnMouseUp(const std::unique_ptr& EventArgs); + virtual void OnHideSelectionChanged(); + virtual void OnModifiedChanged(); + virtual void OnMultilineChanged(); + virtual void OnReadOnlyChanged(); + virtual void OnAcceptsTabChanged(); + virtual void OnHandleCreated(); + virtual void OnHandleDestroyed(); + + // We must define event handlers here + EventBase HideSelectionChanged; + EventBase ModifiedChanged; + EventBase MultilineChanged; + EventBase ReadOnlyChanged; + EventBase AcceptsTabChanged; + + // The standard windows message pump for this control. + virtual void WndProc(Message& Msg); + + protected: + TextBoxBase(); + + // Get custom control creation parameters for this instance. + virtual CreateParams GetCreateParams(); + + // Sets the current text of the Window + virtual void SetWindowText(const string& Value); + + // Whether or not this control can raise the text changed event. + virtual bool CanRaiseTextChangedEvent(); + // Updates the controls max length property. + virtual void UpdateMaxLength(); + // Internal routine to set the selected text. + virtual void SetSelectedTextInternal(const string& Text, bool ClearUndo); + // Internal routine to perform actual selection. + virtual void SelectInternal(int32_t Start, int32_t Length, int32_t TextLen); + + // Returns the end position (One past the last char). + int32_t GetEndPosition(); + + // Calculates the start and length of the selection. + void GetSelectionStartAndLength(int32_t& Start, int32_t& Length); + // Calculates the proper start and end of the selection. + void AdjustSelectionStartAndEnd(int32_t SelStart, int32_t SelLength, int32_t& Start, int32_t& End, int32_t TextLen); + + // Gets edit specific flags + bool GetFlag(TextBoxFlags Flag); + // Sets edit specific flags + void SetFlag(TextBoxFlags Flags, bool Value); + + // Control specific flags + TextBoxFlags _Flags; + // Controls the style of the control border + BorderStyle _BorderStyle; + // The maximum length in characters + uint32_t _MaxLength; + + // Used to set the selection before the control is initialized + int32_t _SelectionStart; + int32_t _SelectionLength; + bool _DoubleClickFired; + + private: + // We must define each window message handler here... + void WmReflectCommand(Message& Msg); + void WmGetDlgCode(Message& Msg); + void WmSetFont(Message& Msg); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/TextBoxFlags.h b/r5dev/thirdparty/cppnet/cppkore/TextBoxFlags.h new file mode 100644 index 00000000..f5604422 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/TextBoxFlags.h @@ -0,0 +1,32 @@ +#pragma once + +#include +#include + +namespace Forms +{ + // This enumeration represents the TextBoxBase flags... + enum class TextBoxFlags + { + FlagAutoSize = 0x00000001, + FlagHideSelection = 0x00000002, + FlagMultiline = 0x00000004, + FlagModified = 0x00000010, + FlagReadOnly = 0x00000020, + FlagAcceptsTab = 0x00000040, + FlagWordWrap = 0x00000080, + FlagCreatingHandle = 0x00000100, + FlagCodeUpdateText = 0x00000200, + FlagShortcutsEnabled = 0x00000400, + FlagScrollToCaretOnHandleCreated = 0x00000800, + FlagSetSelectionOnHandleCreated = 0x00001000, + }; + + // + // Allow bitwise operations on this enumeration + // + constexpr TextBoxFlags operator|(TextBoxFlags Lhs, TextBoxFlags Rhs) + { + return static_cast(static_cast::type>(Lhs) | static_cast::type>(Rhs)); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/TextFormatFlags.h b/r5dev/thirdparty/cppnet/cppkore/TextFormatFlags.h new file mode 100644 index 00000000..486a547f --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/TextFormatFlags.h @@ -0,0 +1,48 @@ +#pragma once + +#include +#include + +namespace Drawing +{ + // Defines options for drawing/measuring text in TextRenderer. + enum class TextFormatFlags : uint32_t + { + Bottom = DT_BOTTOM, + EndEllipsis = DT_END_ELLIPSIS, + ExpandTabs = DT_EXPANDTABS, + ExternalLeading = DT_EXTERNALLEADING, + Default = DT_TOP | DT_LEFT, + HidePrefix = DT_HIDEPREFIX, + HorizontalCenter = DT_CENTER, + Internal = DT_INTERNAL, + Left = DT_LEFT, + ModifyString = DT_MODIFYSTRING, + NoClipping = DT_NOCLIP, + NoPrefix = DT_NOPREFIX, + NoFullWidthCharacterBreak = DT_NOFULLWIDTHCHARBREAK, + PathEllipsis = DT_PATH_ELLIPSIS, + PrefixOnly = DT_PREFIXONLY, + Right = DT_RIGHT, + RightToLeft = DT_RTLREADING, + SingleLine = DT_SINGLELINE, + TextBoxControl = DT_EDITCONTROL, + Top = DT_TOP, + VerticalCenter = DT_VCENTER, + WordBreak = DT_WORDBREAK, + WordEllipsis = DT_WORD_ELLIPSIS, + }; + + // + // Allow bitwise operations on this enumeration + // + constexpr TextFormatFlags operator|(TextFormatFlags Lhs, TextFormatFlags Rhs) + { + return static_cast(static_cast::type>(Lhs) | static_cast::type>(Rhs)); + }; + constexpr TextFormatFlags& operator|=(TextFormatFlags& Lhs, const TextFormatFlags& Rhs) + { + Lhs = static_cast(static_cast::type>(Lhs) | static_cast::type>(Rhs)); + return Lhs; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/TextReader.cpp b/r5dev/thirdparty/cppnet/cppkore/TextReader.cpp new file mode 100644 index 00000000..1f41d178 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/TextReader.cpp @@ -0,0 +1,58 @@ +#include "stdafx.h" +#include "TextReader.h" + +namespace IO +{ + int32_t TextReader::Read(char* Buffer, uint32_t Index, uint32_t Count) + { + uint32_t n = 0; + + do + { + auto Ch = Read(); + if (Ch == -1) + break; + + Buffer[Index + n++] = (char)Ch; + + } while (n < Count); + + return n; + } + + string TextReader::ReadToEnd() + { + char Buffer[4097]{}; + uint32_t Length = 0; + auto Result = string(); + + while ((Length = Read(Buffer, 0, 4096)) != 0) + Result.Append(Buffer, Length); + + return std::move(Result); + } + + string TextReader::ReadLine() + { + auto Result = string(); + + while (true) + { + auto Ch = Read(); + if (Ch == -1) + break; + + if (Ch == '\r' || Ch == '\n') + { + if (Ch == '\r' && Peek() == '\n') + Read(); + + return Result; + } + + Result.Append((char)Ch); + } + + return std::move(Result); + } +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/TextReader.h b/r5dev/thirdparty/cppnet/cppkore/TextReader.h new file mode 100644 index 00000000..c21c836d --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/TextReader.h @@ -0,0 +1,30 @@ +#pragma once + +#include +#include "IOError.h" +#include "StringBase.h" + +namespace IO +{ + class TextReader + { + public: + // Abstract Dtor + virtual ~TextReader() = default; + + // Abstract functions + virtual void Close() = 0; + virtual int32_t Peek() = 0; + virtual int32_t Read() = 0; + // Reads a block of characters. This method will read up to + // count characters from this TextReader. + virtual int32_t Read(char* Buffer, uint32_t Index, uint32_t Count); + // Reads all characters from the current position to the end of the + // TextReader, and returns them as one string. + virtual string ReadToEnd(); + // Reads a line. A line is defined as a sequence of characters followed by + // a carriage return ('\r'), a line feed ('\n'), or a carriage return + // immediately followed by a line feed. + virtual string ReadLine(); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/TextRenderer.cpp b/r5dev/thirdparty/cppnet/cppkore/TextRenderer.cpp new file mode 100644 index 00000000..66b29454 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/TextRenderer.cpp @@ -0,0 +1,32 @@ +#include "stdafx.h" +#include "TextRenderer.h" + +namespace Drawing +{ + void TextRenderer::DrawText(HDC hDC, const string& Text, Font& Font, Rectangle Bounds, Color ForeColor, TextFormatFlags Flags) + { + SelectObject(hDC, Font.GetFontHandle()); + SetBkMode(hDC, TRANSPARENT); // Default text rendering doesn't have a background. + // just draw text. + + SetTextColor(hDC, ForeColor.ToCOLORREF()); + + RECT RcDraw{}; + RcDraw.top = Bounds.Y; + RcDraw.left = Bounds.X; + RcDraw.right = Bounds.X + Bounds.Width; + RcDraw.bottom = Bounds.Y + Bounds.Height; + + DRAWTEXTPARAMS Params{}; + Params.cbSize = sizeof(Params); + + DrawTextExA(hDC, (LPSTR)Text.ToCString(), Text.Length(), &RcDraw, (UINT)Flags, &Params); + } + + void TextRenderer::DrawText(std::unique_ptr& Graphics, const string& Text, Font& Font, Rectangle Bounds, Color ForeColor, TextFormatFlags Flags) + { + auto hDC = Graphics->GetHDC(); + DrawText(hDC, Text, Font, Bounds, ForeColor, Flags); + Graphics->ReleaseHDC(hDC); + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/TextRenderer.h b/r5dev/thirdparty/cppnet/cppkore/TextRenderer.h new file mode 100644 index 00000000..d2ea08bd --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/TextRenderer.h @@ -0,0 +1,26 @@ +#pragma once + +#include +#include "DrawingBase.h" +#include "Font.h" +#include "StringBase.h" +#include "TextFormatFlags.h" + +#undef DrawText + +namespace Drawing +{ + // Provides methods for rendering text using GDI. + class TextRenderer + { + TextRenderer() = delete; + ~TextRenderer() = delete; + + public: + + // Draws the specified text at the specified bounds using the provided color and format flags. + static void DrawText(HDC hDC, const string& Text, Font& Font, Rectangle Bounds, Color ForeColor, TextFormatFlags Flags = TextFormatFlags::Default); + // Draws the specified text at the specified bounds using the provided color and format flags. + static void DrawText(std::unique_ptr& Graphics, const string& Text, Font& Font, Rectangle Bounds, Color ForeColor, TextFormatFlags Flags = TextFormatFlags::Default); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/TextWriter.cpp b/r5dev/thirdparty/cppnet/cppkore/TextWriter.cpp new file mode 100644 index 00000000..5e180c9c --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/TextWriter.cpp @@ -0,0 +1,22 @@ +#include "stdafx.h" +#include "TextWriter.h" + +namespace IO +{ + void TextWriter::WriteLine() + { + Write(&TextWriter::NewLine[0], 0, 2); + } + + void TextWriter::WriteLine(const char Value) + { + Write(Value); + WriteLine(); + } + + void TextWriter::WriteLine(const char* Buffer, uint32_t Index, uint32_t Count) + { + Write(Buffer, Index, Count); + WriteLine(); + } +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/TextWriter.h b/r5dev/thirdparty/cppnet/cppkore/TextWriter.h new file mode 100644 index 00000000..94d5a348 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/TextWriter.h @@ -0,0 +1,32 @@ +#pragma once + +#include +#include "IOError.h" +#include "StringBase.h" + +namespace IO +{ + class TextWriter + { + public: + // Abstract Dtor + virtual ~TextWriter() = default; + + // Abstract functions + virtual void Close() = 0; + virtual void Flush() = 0; + virtual void Write(const char Value) = 0; + virtual void Write(const char* Buffer, uint32_t Index, uint32_t Count) = 0; + // Ends the current line + virtual void WriteLine(); + // Writes a character then ends the line + virtual void WriteLine(const char Value); + // Writes a character array to the stream then ends the line + virtual void WriteLine(const char* Buffer, uint32_t Index, uint32_t Count); + + private: + + // The internal newline sequence + constexpr static char NewLine[] = { '\r', '\n' }; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Texture.cpp b/r5dev/thirdparty/cppnet/cppkore/Texture.cpp new file mode 100644 index 00000000..5c5f7405 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Texture.cpp @@ -0,0 +1,702 @@ +#include "stdafx.h" +#include "Texture.h" +#include "DDS.h" +#include "MathHelper.h" +#include + +#include "..\cppkore_incl\DirectXTex\DirectXTex.h" + +#if _WIN64 +#if _DEBUG +#pragma comment(lib, "..\\cppkore_libs\\DirectXTex\\DirectXTex_x64d.lib") +#else +#pragma comment(lib, "..\\cppkore_libs\\DirectXTex\\DirectXTex_x64r.lib") +#endif +#else +#error DirectXTex doesn't support non x64 builds yet +#endif + +#define InternalScratchImage ((DirectX::ScratchImage*)this->DirectXImage) + +namespace Assets +{ + Texture::Texture(void* ScratchImage) + : DirectXImage(ScratchImage) + { + } + + Texture::Texture(uint32_t Width, uint32_t Height) + : Texture(Width, Height, DXGI_FORMAT::DXGI_FORMAT_R8G8B8A8_UNORM) + { + } + + Texture::Texture(uint32_t Width, uint32_t Height, DXGI_FORMAT Format) + : DirectXImage(nullptr) + { + this->DirectXImage = new DirectX::ScratchImage(); + + DirectX::TexMetadata Data{}; + Data.width = Width; + Data.height = Height; + Data.depth = 1; + Data.arraySize = 1; + Data.mipLevels = 1; + Data.dimension = DirectX::TEX_DIMENSION::TEX_DIMENSION_TEXTURE2D; + Data.format = Format; + InternalScratchImage->Initialize(Data); + } + + Texture::~Texture() + { + if (DirectXImage) + delete InternalScratchImage; + DirectXImage = nullptr; + } + + Texture::Texture(Texture&& Rhs) noexcept + { + this->DirectXImage = Rhs.DirectXImage; + Rhs.DirectXImage = nullptr; + } + + const uint32_t Texture::Width() const + { + return (uint32_t)InternalScratchImage->GetMetadata().width; + } + + const uint32_t Texture::Height() const + { + return (uint32_t)InternalScratchImage->GetMetadata().height; + } + + const uint32_t Texture::Pitch() const + { + return (uint32_t)InternalScratchImage->GetImages()->rowPitch; + } + + const uint32_t Texture::MipCount() const + { + return (uint32_t)InternalScratchImage->GetMetadata().mipLevels; + } + + const uint32_t Texture::BlockSize() const + { + return (uint32_t)InternalScratchImage->GetPixelsSize(); + } + + uint8_t* Texture::GetPixels() + { + return InternalScratchImage->GetImages()->pixels; + } + + const uint8_t* Texture::GetPixels() const + { + return InternalScratchImage->GetImages()->pixels; + } + + const DXGI_FORMAT Texture::Format() const + { + return InternalScratchImage->GetMetadata().format; + } + + const uint8_t Texture::GetBpp() const + { + DXGI_FORMAT format = this->Format(); + return DirectX::BitsPerPixel(format); + } + + const uint8_t Texture::Pixbl() const + { + uint32_t format = this->Format(); + + if ((format >= 70 && format <= 84) || format >= 94 && format <= 99) + return 4; + return 1; + } + + // this function assumes that both of the textures are in the same format + void Texture::CopyTextureSlice(std::unique_ptr& SourceTexture, DirectX::Rect srcRect, uint32_t x, uint32_t y) + { + DirectX::CopyRectangle(*((DirectX::ScratchImage*)SourceTexture->DirectXImage)->GetImage(0, 0, 0), srcRect, *InternalScratchImage->GetImage(0, 0, 0), DirectX::TEX_FILTER_DEFAULT, x, y); + } + + void Texture::ConvertToFormat(DXGI_FORMAT Format) + { + if (InternalScratchImage->GetMetadata().format == Format) + return; + + // If we need to decompress, and our target is not compressed, we can skip a loop here by directly going to the target + DXGI_FORMAT DecompressFmt = DXGI_FORMAT::DXGI_FORMAT_UNKNOWN; + if (!DirectX::IsCompressed(Format)) + DecompressFmt = Format; + + // First, check if we are currently compressed... + if (DirectX::IsCompressed(InternalScratchImage->GetMetadata().format)) + { + auto TemporaryImage = std::make_unique(); + auto Result = DirectX::Decompress(InternalScratchImage->GetImages(), InternalScratchImage->GetImageCount(), InternalScratchImage->GetMetadata(), DecompressFmt, *TemporaryImage); + + if (SUCCEEDED(Result)) + { + delete InternalScratchImage; + DirectXImage = TemporaryImage.release(); + } + else + { + throw std::exception("Failed to decompress the image format"); + } + } + + // If the target is compressed, compress the new data + if (DirectX::IsCompressed(Format)) + { + auto TemporaryImage = std::make_unique(); + auto Result = DirectX::Compress(InternalScratchImage->GetImages(), InternalScratchImage->GetImageCount(), InternalScratchImage->GetMetadata(), Format, DirectX::TEX_COMPRESS_FLAGS::TEX_COMPRESS_DEFAULT, DirectX::TEX_THRESHOLD_DEFAULT, *TemporaryImage); + + if (SUCCEEDED(Result)) + { + delete InternalScratchImage; + DirectXImage = TemporaryImage.release(); + } + else + { + throw std::exception("Failed to compress the image format"); + } + } + else if (InternalScratchImage->GetMetadata().format != Format) + { + auto TemporaryImage = std::make_unique(); + auto Result = DirectX::Convert(InternalScratchImage->GetImages(), InternalScratchImage->GetImageCount(), InternalScratchImage->GetMetadata(), Format, DirectX::TEX_FILTER_FLAGS::TEX_FILTER_DEFAULT, DirectX::TEX_THRESHOLD_DEFAULT, *TemporaryImage); + + if (SUCCEEDED(Result)) + { + delete InternalScratchImage; + DirectXImage = TemporaryImage.release(); + } + else + { + throw std::exception("Failed to convert the image format"); + } + } + } + + void Texture::Transcode(TranscodeType Type) + { + // Depending on the transcode type, we need to ensure a format... + switch (Type) + { + case TranscodeType::NormalMapBC5: + this->Transcoder_NormalMapBC5(); + break; + case TranscodeType::NormalMapBC5OpenGl: + this->Transcoder_NormalMapBC5OpenGl(); + break; + } + } + + void Texture::Save(const string& File) + { + if (File.EndsWith(".dds")) + this->Save(File, SaveFileType::Dds); + else if (File.EndsWith(".tga")) + this->Save(File, SaveFileType::Tga); + else if (File.EndsWith(".tiff")) + this->Save(File, SaveFileType::Tiff); + else if (File.EndsWith(".hdr")) + this->Save(File, SaveFileType::Hdr); + else if (File.EndsWith(".png")) + this->Save(File, SaveFileType::Png); + else if (File.EndsWith(".bmp")) + this->Save(File, SaveFileType::Bmp); + else if (File.EndsWith(".jpg")) + this->Save(File, SaveFileType::Jpeg); + else if (File.EndsWith(".jxr")) + this->Save(File, SaveFileType::Jxr); + else if (File.EndsWith(".gif")) + this->Save(File, SaveFileType::Gif); + else + throw std::exception("Unknown image file extension"); + } + + void Texture::Save(const string& File, SaveFileType Type) + { + this->EnsureFormatForType(Type); + HRESULT SaveResult = 0; + + auto OutputWide = File.ToWString(); + + switch (Type) + { + case SaveFileType::Dds: + SaveResult = DirectX::SaveToDDSFile(InternalScratchImage->GetImages(), InternalScratchImage->GetImageCount(), InternalScratchImage->GetMetadata(), DirectX::DDS_FLAGS::DDS_FLAGS_NONE, (const wchar_t*)OutputWide); + break; + case SaveFileType::Tga: + SaveResult = DirectX::SaveToTGAFile(*InternalScratchImage->GetImages(), (const wchar_t*)OutputWide); + break; + case SaveFileType::Hdr: + SaveResult = DirectX::SaveToHDRFile(*InternalScratchImage->GetImages(), (const wchar_t*)OutputWide); + break; + default: + { + // This handles all WIC-Codec based formats + auto Wc = DirectX::GetWICCodec(DirectX::WICCodecs::WIC_CODEC_BMP); + std::function PropertyWriter = nullptr; + + switch (Type) + { + case SaveFileType::Gif: + Wc = DirectX::GetWICCodec(DirectX::WICCodecs::WIC_CODEC_GIF); + break; + case SaveFileType::Jpeg: + Wc = DirectX::GetWICCodec(DirectX::WICCodecs::WIC_CODEC_JPEG); + PropertyWriter = [](IPropertyBag2* props) + { + PROPBAG2 options{}; + VARIANT varValues{}; + options.pstrName = (LPOLESTR)L"ImageQuality"; + varValues.vt = VT_R4; + varValues.fltVal = 1.f; + + (void)props->Write(1, &options, &varValues); + }; + break; + case SaveFileType::Jxr: + Wc = DirectX::GetWICCodec(DirectX::WICCodecs::WIC_CODEC_WMP); + break; + case SaveFileType::Png: + Wc = DirectX::GetWICCodec(DirectX::WICCodecs::WIC_CODEC_PNG); + break; + case SaveFileType::Tiff: + Wc = DirectX::GetWICCodec(DirectX::WICCodecs::WIC_CODEC_TIFF); + PropertyWriter = [](IPropertyBag2* props) + { + PROPBAG2 options{}; + VARIANT varValues{}; + options.pstrName = (LPOLESTR)L"TiffCompressionMethod"; + varValues.vt = VT_UI1; + varValues.bVal = WICTiffCompressionOption::WICTiffCompressionDontCare; + + (void)props->Write(1, &options, &varValues); + }; + break; + } + + SaveResult = DirectX::SaveToWICFile(*InternalScratchImage->GetImages(), DirectX::WIC_FLAGS::WIC_FLAGS_FORCE_SRGB, Wc, (const wchar_t*)OutputWide, nullptr, PropertyWriter); + } + break; + } + + if (FAILED(SaveResult)) + throw std::exception("An error occured while saving the image"); + } + + void Texture::Save(IO::Stream& Stream, SaveFileType Type) + { + this->EnsureFormatForType(Type); + DirectX::Blob TemporaryBuffer; + + SaveToMemoryBlob(&TemporaryBuffer, Type); + + Stream.Write((uint8_t*)TemporaryBuffer.GetBufferPointer(), 0, (uint64_t)TemporaryBuffer.GetBufferSize()); + } + + void Texture::Save(uint8_t* Buffer, uint64_t BufferLength, SaveFileType Type) + { + this->EnsureFormatForType(Type); + DirectX::Blob TemporaryBuffer; + + SaveToMemoryBlob(&TemporaryBuffer, Type); + + std::memcpy(Buffer, TemporaryBuffer.GetBufferPointer(), min(TemporaryBuffer.GetBufferSize(), BufferLength)); + } + + Texture Texture::FromFile(const string& File) + { + Texture Result; + DirectX::TexMetadata MetaData; + HRESULT LoadResult = 0; + + Result.DirectXImage = new DirectX::ScratchImage(); + + auto WidePath = File.ToWString(); + if (File.EndsWith(".dds")) + LoadResult = DirectX::LoadFromDDSFile((const wchar_t*)WidePath, DirectX::DDS_FLAGS::DDS_FLAGS_NONE, &MetaData, *(DirectX::ScratchImage*)Result.DirectXImage); + else if (File.EndsWith(".tga")) + LoadResult = DirectX::LoadFromTGAFile((const wchar_t*)WidePath, &MetaData, *(DirectX::ScratchImage*)Result.DirectXImage); + else if (File.EndsWith(".hdr")) + LoadResult = DirectX::LoadFromHDRFile((const wchar_t*)WidePath, &MetaData, *(DirectX::ScratchImage*)Result.DirectXImage); + else + LoadResult = DirectX::LoadFromWICFile((const wchar_t*)WidePath, DirectX::WIC_FLAGS::WIC_FLAGS_NONE, &MetaData, *(DirectX::ScratchImage*)Result.DirectXImage); + + if (FAILED(LoadResult)) + { + delete (DirectX::ScratchImage*)Result.DirectXImage; + Result.DirectXImage = nullptr; + + throw std::exception("An error occured loading the image"); + } + + return std::move(Result); + } + + Texture Texture::FromFile(const string& File, TextureType Type) + { + Texture Result; + DirectX::TexMetadata MetaData; + HRESULT LoadResult = 0; + + Result.DirectXImage = new DirectX::ScratchImage(); + + auto WidePath = File.ToWString(); + switch (Type) + { + case TextureType::DDS: + LoadResult = DirectX::LoadFromDDSFile((const wchar_t*)WidePath, DirectX::DDS_FLAGS::DDS_FLAGS_NONE, &MetaData, *(DirectX::ScratchImage*)Result.DirectXImage); + break; + case TextureType::TGA: + LoadResult = DirectX::LoadFromTGAFile((const wchar_t*)WidePath, &MetaData, *(DirectX::ScratchImage*)Result.DirectXImage); + break; + case TextureType::HDR: + LoadResult = DirectX::LoadFromHDRFile((const wchar_t*)WidePath, &MetaData, *(DirectX::ScratchImage*)Result.DirectXImage); + break; + case TextureType::WIC: + LoadResult = DirectX::LoadFromWICFile((const wchar_t*)WidePath, DirectX::WIC_FLAGS::WIC_FLAGS_NONE, &MetaData, *(DirectX::ScratchImage*)Result.DirectXImage); + break; + } + + if (FAILED(LoadResult)) + { + delete (DirectX::ScratchImage*)Result.DirectXImage; + Result.DirectXImage = nullptr; + + throw std::exception("An error occured loading the image"); + } + + return std::move(Result); + } + + Texture Texture::FromStream(IO::Stream& Stream, TextureType Type) + { + Texture Result; + DirectX::TexMetadata MetaData; + HRESULT LoadResult = 0; + + Result.DirectXImage = new DirectX::ScratchImage(); + + auto ScratchBuffer = std::make_unique(Stream.GetLength()); + Stream.Read(ScratchBuffer.get(), 0, Stream.GetLength()); + + switch (Type) + { + case TextureType::DDS: + LoadResult = DirectX::LoadFromDDSMemory(ScratchBuffer.get(), Stream.GetLength(), DirectX::DDS_FLAGS::DDS_FLAGS_NONE, &MetaData, *(DirectX::ScratchImage*)Result.DirectXImage); + break; + case TextureType::TGA: + LoadResult = DirectX::LoadFromTGAMemory(ScratchBuffer.get(), Stream.GetLength(), &MetaData, *(DirectX::ScratchImage*)Result.DirectXImage); + break; + case TextureType::HDR: + LoadResult = DirectX::LoadFromHDRMemory(ScratchBuffer.get(), Stream.GetLength(), &MetaData, *(DirectX::ScratchImage*)Result.DirectXImage); + break; + case TextureType::WIC: + LoadResult = DirectX::LoadFromWICMemory(ScratchBuffer.get(), Stream.GetLength(), DirectX::WIC_FLAGS::WIC_FLAGS_NONE, &MetaData, *(DirectX::ScratchImage*)Result.DirectXImage); + break; + } + + if (FAILED(LoadResult)) + { + delete (DirectX::ScratchImage*)Result.DirectXImage; + Result.DirectXImage = nullptr; + + throw std::exception("An error occured loading the image"); + } + + return std::move(Result); + } + + Texture Texture::FromBuffer(uint8_t* Buffer, uint64_t BufferLength, TextureType Type) + { + Texture Result; + DirectX::TexMetadata MetaData; + HRESULT LoadResult = 0; + + Result.DirectXImage = new DirectX::ScratchImage(); + + switch (Type) + { + case TextureType::DDS: + LoadResult = DirectX::LoadFromDDSMemory(Buffer, BufferLength, DirectX::DDS_FLAGS::DDS_FLAGS_NONE, &MetaData, *(DirectX::ScratchImage*)Result.DirectXImage); + break; + case TextureType::TGA: + LoadResult = DirectX::LoadFromTGAMemory(Buffer, BufferLength, &MetaData, *(DirectX::ScratchImage*)Result.DirectXImage); + break; + case TextureType::HDR: + LoadResult = DirectX::LoadFromHDRMemory(Buffer, BufferLength, &MetaData, *(DirectX::ScratchImage*)Result.DirectXImage); + break; + case TextureType::WIC: + LoadResult = DirectX::LoadFromWICMemory(Buffer, BufferLength, DirectX::WIC_FLAGS::WIC_FLAGS_NONE, &MetaData, *(DirectX::ScratchImage*)Result.DirectXImage); + break; + } + + if (FAILED(LoadResult)) + { + delete (DirectX::ScratchImage*)Result.DirectXImage; + Result.DirectXImage = nullptr; + + throw std::exception("An error occured loading the image"); + } + + return std::move(Result); + } + + Texture Texture::FromRawBlock(uint8_t* Buffer, uint64_t BufferLength, uint32_t Width, uint32_t Height, DXGI_FORMAT Format) + { + DDSFormat BlockFormat{}; + BlockFormat.Format = Format; + + auto ExpectedBlockSize = Assets::DDS::CalculateBlockSize(Width, Height, BlockFormat); + + if (BufferLength < ExpectedBlockSize) + throw std::exception("Invalid buffer length specified"); + + auto Result = Texture(Width, Height, Format); + + std::memcpy(((DirectX::ScratchImage*)Result.DirectXImage)->GetImages()->pixels, Buffer, ExpectedBlockSize); + + return std::move(Result); + } + + int Texture::Morton(uint32_t i, uint32_t sx, uint32_t sy) + { + int v0 = 1; + int v1 = 1; + int v2 = i; + int v3 = sx; + int v4 = sy; + int v5 = 0; + int v6 = 0; + while (v3 > 1 || v4 > 1) + { + if (v3 > 1) + { + v5 += v1 * (v2 & 1); + v2 >>= 1; + v1 *= 2; + v3 >>= 1; + } + if (v4 > 1) + { + v6 += v0 * (v2 & 1); + v2 >>= 1; + v0 *= 2; + v4 >>= 1; + } + } + return v6 * sx + v5; + } + + + Texture::Texture() + : DirectXImage(nullptr) + { + } + + void Texture::EnsureFormatForType(SaveFileType Type) + { + switch (Type) + { + // These formats require a 32bpp, so B8G8R8A8_UNORM - like format to encode (Only transcode if not 32bpp) + case SaveFileType::Png: + case SaveFileType::Bmp: + case SaveFileType::Jpeg: + case SaveFileType::Tiff: + case SaveFileType::Gif: + case SaveFileType::Jxr: + case SaveFileType::Tga: + if (!IsValid32bppFormat(InternalScratchImage->GetMetadata().format)) + this->ConvertToFormat(DXGI_FORMAT::DXGI_FORMAT_B8G8R8A8_UNORM); + break; + // This format requires either R32G32B32A32_FLOAT or R32G32B32_FLOAT + case SaveFileType::Hdr: + this->ConvertToFormat(DXGI_FORMAT::DXGI_FORMAT_R32G32B32A32_FLOAT); + break; + } + } + + void Texture::SaveToMemoryBlob(void* Blob, SaveFileType Type) + { + HRESULT SaveResult = 0; + + switch (Type) + { + case SaveFileType::Dds: + SaveResult = DirectX::SaveToDDSMemory(InternalScratchImage->GetImages(), InternalScratchImage->GetImageCount(), InternalScratchImage->GetMetadata(), DirectX::DDS_FLAGS::DDS_FLAGS_NONE, *(DirectX::Blob*)Blob); + break; + case SaveFileType::Tga: + SaveResult = DirectX::SaveToTGAMemory(*InternalScratchImage->GetImages(), *(DirectX::Blob*)Blob); + break; + case SaveFileType::Hdr: + SaveResult = DirectX::SaveToHDRMemory(*InternalScratchImage->GetImages(), *(DirectX::Blob*)Blob); + break; + default: + { + // This handles all WIC-Codec based formats + auto Wc = DirectX::GetWICCodec(DirectX::WICCodecs::WIC_CODEC_BMP); + std::function PropertyWriter = nullptr; + + switch (Type) + { + case SaveFileType::Gif: + Wc = DirectX::GetWICCodec(DirectX::WICCodecs::WIC_CODEC_GIF); + break; + case SaveFileType::Jpeg: + Wc = DirectX::GetWICCodec(DirectX::WICCodecs::WIC_CODEC_JPEG); + PropertyWriter = [](IPropertyBag2 * props) + { + PROPBAG2 options{}; + VARIANT varValues{}; + options.pstrName = (LPOLESTR)L"ImageQuality"; + varValues.vt = VT_R4; + varValues.fltVal = 1.f; + + (void)props->Write(1, &options, &varValues); + }; + break; + case SaveFileType::Jxr: + Wc = DirectX::GetWICCodec(DirectX::WICCodecs::WIC_CODEC_WMP); + break; + case SaveFileType::Png: + Wc = DirectX::GetWICCodec(DirectX::WICCodecs::WIC_CODEC_PNG); + break; + case SaveFileType::Tiff: + Wc = DirectX::GetWICCodec(DirectX::WICCodecs::WIC_CODEC_TIFF); + PropertyWriter = [](IPropertyBag2 * props) + { + PROPBAG2 options{}; + VARIANT varValues{}; + options.pstrName = (LPOLESTR)L"TiffCompressionMethod"; + varValues.vt = VT_UI1; + varValues.bVal = WICTiffCompressionOption::WICTiffCompressionDontCare; + + (void)props->Write(1, &options, &varValues); + }; + break; + } + + SaveResult = DirectX::SaveToWICMemory(*InternalScratchImage->GetImages(), DirectX::WIC_FLAGS::WIC_FLAGS_NONE, Wc, *(DirectX::Blob*)Blob, nullptr, PropertyWriter); + } + break; + } + + if (FAILED(SaveResult)) + throw std::exception("An error occured while saving the image"); + } + + void Texture::Transcoder_NormalMapBC5() + { + // Ensure R8G8B8A8 value and ordering... + if (this->Format() != DXGI_FORMAT::DXGI_FORMAT_R8G8B8A8_UNORM) + this->ConvertToFormat(DXGI_FORMAT::DXGI_FORMAT_R8G8B8A8_UNORM); + + // Create a temporary image + auto TemporaryResult = std::make_unique(); + auto CurrentResult = (DirectX::ScratchImage*)this->DirectXImage; + + auto TranscodeResult = DirectX::TransformImage(CurrentResult->GetImages(), CurrentResult->GetImageCount(), CurrentResult->GetMetadata(), + [](DirectX::XMVECTOR* OutPixels, const DirectX::XMVECTOR* InPixels, size_t Width, size_t Slice) + { + for (size_t i = 0; i < Width; i++) + { + auto Scanline = InPixels[i]; + + auto Red = DirectX::XMVectorGetX(Scanline); + auto Green = DirectX::XMVectorGetY(Scanline); + + // Calculate the blue channel + float NormalX = 2 * Red - 1; + float NormalY = 2 * Green - 1; + float NormalZ = 0.0f; + + // Check if we can average it + if (1 - NormalX * NormalX - NormalY * NormalY > 0) + { + NormalZ = std::sqrtf(1 - NormalX * NormalX - NormalY * NormalY); + } + + // Calculate the final blue value and clamp it between 0 and 1 + float ResultBlueVal = Math::MathHelper::Clamp(((NormalZ + 1) / 2.0f), 0, 1.0); + + OutPixels[i] = DirectX::XMVectorSetZ(Scanline, ResultBlueVal); + } + }, *TemporaryResult); + + // If it succeeds, we must then + if (SUCCEEDED(TranscodeResult)) + { + delete (DirectX::ScratchImage*)this->DirectXImage; + this->DirectXImage = TemporaryResult.release(); + } + } + + void Texture::Transcoder_NormalMapBC5OpenGl() + { + // Ensure R8G8B8A8 value and ordering... + if (this->Format() != DXGI_FORMAT::DXGI_FORMAT_R8G8B8A8_UNORM) + this->ConvertToFormat(DXGI_FORMAT::DXGI_FORMAT_R8G8B8A8_UNORM); + + // Create a temporary image + auto TemporaryResult = std::make_unique(); + auto CurrentResult = (DirectX::ScratchImage*)this->DirectXImage; + + auto TranscodeResult = DirectX::TransformImage(CurrentResult->GetImages(), CurrentResult->GetImageCount(), CurrentResult->GetMetadata(), + [](DirectX::XMVECTOR* OutPixels, const DirectX::XMVECTOR* InPixels, size_t Width, size_t Slice) + { + for (size_t i = 0; i < Width; i++) + { + auto Scanline = InPixels[i]; + + auto Red = DirectX::XMVectorGetX(Scanline); + auto Green = DirectX::XMVectorGetY(Scanline); + + // Invert G (Y) to match DirectX + Green = 1.0f - Green; + Scanline = DirectX::XMVectorSetY(Scanline, Green); + + // Calculate the blue channel + float NormalX = 2 * Red - 1; + float NormalY = 2 * Green - 1; + float NormalZ = 0.0f; + + // Check if we can average it + if (1 - NormalX * NormalX - NormalY * NormalY > 0) + { + NormalZ = std::sqrtf(1 - NormalX * NormalX - NormalY * NormalY); + } + + // Calculate the final blue value and clamp it between 0 and 1 + float ResultBlueVal = Math::MathHelper::Clamp(((NormalZ + 1) / 2.0f), 0, 1.0); + + OutPixels[i] = DirectX::XMVectorSetZ(Scanline, ResultBlueVal); + } + }, *TemporaryResult); + + // If it succeeds, we must then + if (SUCCEEDED(TranscodeResult)) + { + delete (DirectX::ScratchImage*)this->DirectXImage; + this->DirectXImage = TemporaryResult.release(); + } + } + + bool Texture::IsValid32bppFormat(DXGI_FORMAT Format) + { + switch (Format) + { + case DXGI_FORMAT::DXGI_FORMAT_R8G8B8A8_UNORM: + case DXGI_FORMAT::DXGI_FORMAT_B8G8R8A8_UNORM: + case DXGI_FORMAT::DXGI_FORMAT_B8G8R8X8_UNORM: + return true; + default: + return false; + } + } +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Texture.h b/r5dev/thirdparty/cppnet/cppkore/Texture.h new file mode 100644 index 00000000..c08df07f --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Texture.h @@ -0,0 +1,178 @@ +#pragma once + +#include +#include +#include +#include "StringBase.h" +#include "ImmutableStringBase.h" +#include "Stream.h" +#include "..\cppkore_incl\DirectXTex\DirectXTex.h" + +namespace Assets +{ + // Represents the possible supported texture containers + enum class TextureType + { + // Specifies that the type of texture is a DDS container + DDS, + // Specifies that the type of texture is a TGA container + TGA, + // Specifies that the type of texture is a HDR container + HDR, + // Specifies that the type of texture is a WIC format container + WIC + }; + + // Represents the possible supported save file types + enum class SaveFileType + { + // Specifies the dds image format. + Dds, + // Specifies the tga image format. + Tga, + // Specifies the tiff image format. + Tiff, + // Specifies the hdr image format. + Hdr, + // Specifies the png image format. + Png, + // Specifies the bmp image format. + Bmp, + // Specifies the jpeg image format. + Jpeg, + // Specifies the jxr image format. + Jxr, + // Specifies the gif image format. + Gif + }; + + // Represents the possible transcode step stages + enum class TranscodeType + { + // Calculates the missing 'Z' (B) channel of the image for a normal map + NormalMapBC5, + // Calculates the missing 'Z' (B) channel of the image for a normal map (And inverts 'Y' (G)) + NormalMapBC5OpenGl, + }; + + // Represents a texture asset (Image) and provides support for loading and saving images + class Texture + { + public: + // Creates a texture from an existing scratch image + Texture(void* ScratchImage); + // Creates a new 2D texture with the specified width and height + Texture(uint32_t Width, uint32_t Height); + // Creates a new 2D texture with the specified width, height, and format + Texture(uint32_t Width, uint32_t Height, DXGI_FORMAT Format); + + // Cleans up all texture resources + ~Texture(); + + // Disable copying, enable move semantics + Texture(const Texture& Rhs) = delete; + Texture(Texture&& Rhs) noexcept; + + // Gets the width of this image + const uint32_t Width() const; + // Gets the height of this image + const uint32_t Height() const; + // Gets the pitch of this image + const uint32_t Pitch() const; + + // Gets the mip count of this image + const uint32_t MipCount() const; + // Gets the block size of this image + const uint32_t BlockSize() const; + + // Gets a pointer to the pixel buffer of this texture (Image[0]) + uint8_t* GetPixels(); + // Gets a pointer to the pixel buffer of this texture (Image[0]) + const uint8_t* GetPixels() const; + + // Gets the format of the image data + const DXGI_FORMAT Format() const; + + // Get the number of bits per pixel + const uint8_t GetBpp() const; + + // idrk + const uint8_t Pixbl() const; + + void CopyTextureSlice(std::unique_ptr& SourceTexture, DirectX::Rect srcRect, uint32_t x, uint32_t y); + + // Sets the format of the image data (Converted on call) + void ConvertToFormat(DXGI_FORMAT Format); + // Transcodes the image using a transcoder +; void Transcode(TranscodeType Type); + + // Saves the texture to the specified file path + void Save(const string& File); + // Saves the texture to the specified path with the specified file type + void Save(const string& File, SaveFileType Type); + // Saves the texture to the specified stream + void Save(IO::Stream& Stream, SaveFileType Type = SaveFileType::Dds); + // Saves the texture to the specified buffer + void Save(uint8_t* Buffer, uint64_t BufferLength, SaveFileType Type = SaveFileType::Dds); + + // Loads a texture from the specified file path + static Texture FromFile(const string& File); + // Loads a texture from the specified file path with the specified type + static Texture FromFile(const string& File, TextureType Type); + // Loads a texture from the specified stream + static Texture FromStream(IO::Stream& Stream, TextureType Type = TextureType::DDS); + // Loads a texture from the specified buffer + static Texture FromBuffer(uint8_t* Buffer, uint64_t BufferLength, TextureType Type = TextureType::DDS); + + // Loads a texture from the specified raw block data + static Texture FromRawBlock(uint8_t* Buffer, uint64_t BufferLength, uint32_t Width, uint32_t Height, DXGI_FORMAT Format); + + static int Morton(uint32_t i, uint32_t sx, uint32_t sy); + + // Returns the file extension for the given type + constexpr static imstring GetExtensionForType(const SaveFileType Type) + { + switch (Type) + { + case SaveFileType::Tga: + return ".tga"; + case SaveFileType::Tiff: + return ".tiff"; + case SaveFileType::Hdr: + return ".hdr"; + case SaveFileType::Png: + return ".png"; + case SaveFileType::Bmp: + return ".bmp"; + case SaveFileType::Jpeg: + return ".jpg"; + case SaveFileType::Jxr: + return ".jxr"; + case SaveFileType::Gif: + return ".gif"; + } + + return ".dds"; + } + + protected: + // Used for specific load routines + Texture(); + + private: + // Internal image data, managed by DirectXTex + void* DirectXImage; + + // Internal routine to ensure the proper DXGI_FORMAT for the specified type + void EnsureFormatForType(SaveFileType Type); + // Internal routine to save to a blob type + void SaveToMemoryBlob(void* Blob, SaveFileType Type); + + // A list of transcoder implementations + void Transcoder_NormalMapBC5(); + void Transcoder_NormalMapBC5OpenGl(); + + // Internal routine to ensure that a 32bpp DXGI_FORMAT is selected + static bool IsValid32bppFormat(DXGI_FORMAT Format); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/TextureGPUDecoder.cpp b/r5dev/thirdparty/cppnet/cppkore/TextureGPUDecoder.cpp new file mode 100644 index 00000000..2cf33b43 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/TextureGPUDecoder.cpp @@ -0,0 +1,359 @@ +#include "stdafx.h" +#include "TextureGPUDecoder.h" + +#include "..\cppkore_incl\DirectXTex\DirectXTex.h" + +#if _WIN64 +#if _DEBUG +#pragma comment(lib, "..\\cppkore_libs\\DirectXTex\\DirectXTex_x64d.lib") +#else +#pragma comment(lib, "..\\cppkore_libs\\DirectXTex\\DirectXTex_x64r.lib") +#endif +#else +#error DirectXTex doesn't support non x64 builds yet +#endif + +#pragma comment (lib, "d3d11.lib") + +namespace Assets +{ + constexpr const uint8_t VertexShader[756] = + { + 0x44, 0x58, 0x42, 0x43, 0x53, 0xDB, 0xC8, 0x4A, 0xBF, 0xED, 0x5D, 0x97, + 0x64, 0x25, 0x37, 0xF6, 0x62, 0x2A, 0x0D, 0x99, 0x01, 0x00, 0x00, 0x00, + 0xF4, 0x02, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, + 0xA0, 0x00, 0x00, 0x00, 0xD4, 0x00, 0x00, 0x00, 0x2C, 0x01, 0x00, 0x00, + 0x58, 0x02, 0x00, 0x00, 0x52, 0x44, 0x45, 0x46, 0x64, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3C, 0x00, 0x00, 0x00, 0x00, 0x05, 0xFE, 0xFF, 0x00, 0x01, 0x00, 0x00, + 0x3C, 0x00, 0x00, 0x00, 0x52, 0x44, 0x31, 0x31, 0x3C, 0x00, 0x00, 0x00, + 0x18, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, + 0x24, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66, 0x74, 0x20, 0x28, 0x52, + 0x29, 0x20, 0x48, 0x4C, 0x53, 0x4C, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, + 0x72, 0x20, 0x43, 0x6F, 0x6D, 0x70, 0x69, 0x6C, 0x65, 0x72, 0x20, 0x31, + 0x30, 0x2E, 0x31, 0x00, 0x49, 0x53, 0x47, 0x4E, 0x2C, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x53, 0x56, 0x5F, 0x56, + 0x45, 0x52, 0x54, 0x45, 0x58, 0x49, 0x44, 0x00, 0x4F, 0x53, 0x47, 0x4E, + 0x50, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, + 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, + 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x0C, 0x00, 0x00, + 0x53, 0x56, 0x5F, 0x50, 0x4F, 0x53, 0x49, 0x54, 0x49, 0x4F, 0x4E, 0x00, + 0x54, 0x45, 0x58, 0x43, 0x4F, 0x4F, 0x52, 0x44, 0x00, 0xAB, 0xAB, 0xAB, + 0x53, 0x48, 0x45, 0x58, 0x24, 0x01, 0x00, 0x00, 0x50, 0x00, 0x01, 0x00, + 0x49, 0x00, 0x00, 0x00, 0x6A, 0x08, 0x00, 0x01, 0x60, 0x00, 0x00, 0x04, + 0x12, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x67, 0x00, 0x00, 0x04, 0xF2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0x32, 0x20, 0x10, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, + 0x36, 0x00, 0x00, 0x08, 0xC2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3F, 0x01, 0x00, 0x00, 0x07, + 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x10, 0x10, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x55, 0x00, 0x00, 0x07, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0A, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x05, 0x32, 0x00, 0x10, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x86, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x0A, 0xC2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x06, 0x04, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBF, + 0x00, 0x00, 0x00, 0xBF, 0x36, 0x00, 0x00, 0x05, 0x32, 0x20, 0x10, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x07, 0x12, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x2A, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x00, 0x10, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x22, 0x20, 0x10, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x3A, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x3E, 0x00, 0x00, 0x01, + 0x53, 0x54, 0x41, 0x54, 0x94, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }; + + constexpr const uint8_t PixelShader[668] = + { + 0x44, 0x58, 0x42, 0x43, 0x98, 0x97, 0x06, 0x35, 0x64, 0x9D, 0x54, 0x37, + 0xA3, 0xE5, 0x60, 0x58, 0x51, 0x54, 0x64, 0x6C, 0x01, 0x00, 0x00, 0x00, + 0x9C, 0x02, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, + 0xFC, 0x00, 0x00, 0x00, 0x54, 0x01, 0x00, 0x00, 0x88, 0x01, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x52, 0x44, 0x45, 0x46, 0xC0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x3C, 0x00, 0x00, 0x00, 0x00, 0x05, 0xFF, 0xFF, 0x00, 0x01, 0x00, 0x00, + 0x96, 0x00, 0x00, 0x00, 0x52, 0x44, 0x31, 0x31, 0x3C, 0x00, 0x00, 0x00, + 0x18, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, + 0x24, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x7C, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x89, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x0D, 0x00, 0x00, 0x00, 0x49, 0x6E, 0x70, 0x75, 0x74, 0x53, 0x61, 0x6D, + 0x70, 0x6C, 0x65, 0x72, 0x00, 0x49, 0x6E, 0x70, 0x75, 0x74, 0x54, 0x65, + 0x78, 0x74, 0x75, 0x72, 0x65, 0x00, 0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, + 0x6F, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4C, 0x53, 0x4C, + 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6F, 0x6D, 0x70, + 0x69, 0x6C, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2E, 0x31, 0x00, 0xAB, 0xAB, + 0x49, 0x53, 0x47, 0x4E, 0x50, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0F, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x03, 0x03, 0x00, 0x00, 0x53, 0x56, 0x5F, 0x50, 0x4F, 0x53, 0x49, 0x54, + 0x49, 0x4F, 0x4E, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4F, 0x4F, 0x52, 0x44, + 0x00, 0xAB, 0xAB, 0xAB, 0x4F, 0x53, 0x47, 0x4E, 0x2C, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5F, 0x54, + 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xAB, 0xAB, 0x53, 0x48, 0x45, 0x58, + 0x70, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, + 0x6A, 0x08, 0x00, 0x01, 0x5A, 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x58, 0x18, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, + 0x32, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, + 0xF2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x8B, + 0xC2, 0x00, 0x00, 0x80, 0x43, 0x55, 0x15, 0x00, 0xF2, 0x20, 0x10, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x46, 0x7E, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x01, 0x53, 0x54, 0x41, 0x54, + 0x94, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }; + + constexpr DXGI_FORMAT DefaultDecompress(DXGI_FORMAT format) + { + switch (format) + { + case DXGI_FORMAT_BC1_TYPELESS: + case DXGI_FORMAT_BC1_UNORM: + case DXGI_FORMAT_BC2_TYPELESS: + case DXGI_FORMAT_BC2_UNORM: + case DXGI_FORMAT_BC3_TYPELESS: + case DXGI_FORMAT_BC3_UNORM: + case DXGI_FORMAT_BC7_TYPELESS: + case DXGI_FORMAT_BC7_UNORM: + return DXGI_FORMAT_R8G8B8A8_UNORM; + + case DXGI_FORMAT_BC1_UNORM_SRGB: + case DXGI_FORMAT_BC2_UNORM_SRGB: + case DXGI_FORMAT_BC3_UNORM_SRGB: + case DXGI_FORMAT_BC7_UNORM_SRGB: + return DXGI_FORMAT_R8G8B8A8_UNORM_SRGB; + + case DXGI_FORMAT_BC4_TYPELESS: + case DXGI_FORMAT_BC4_UNORM: + return DXGI_FORMAT_R8_UNORM; + + case DXGI_FORMAT_BC4_SNORM: + return DXGI_FORMAT_R8_SNORM; + + case DXGI_FORMAT_BC5_TYPELESS: + case DXGI_FORMAT_BC5_UNORM: + return DXGI_FORMAT_R8G8_UNORM; + + case DXGI_FORMAT_BC5_SNORM: + return DXGI_FORMAT_R8G8_SNORM; + + case DXGI_FORMAT_BC6H_TYPELESS: + case DXGI_FORMAT_BC6H_UF16: + case DXGI_FORMAT_BC6H_SF16: + // We could use DXGI_FORMAT_R32G32B32_FLOAT here since BC6H is always Alpha 1.0, + // but this format is more supported by viewers + return DXGI_FORMAT_R32G32B32A32_FLOAT; + + default: + return DXGI_FORMAT_UNKNOWN; + } + } + + TextureGPUDecoder::TextureGPUDecoder() + : _Device(nullptr), _DeviceContext(nullptr), _VertexShader(nullptr), _PixelShader(nullptr), _Sampler(nullptr), _Supported(true) + { + } + + TextureGPUDecoder::~TextureGPUDecoder() + { + this->Shutdown(); + } + + bool TextureGPUDecoder::Initialize() + { + if (_Device != nullptr) + return true; + if (!_Supported) + return false; + + if (FAILED(D3D11CreateDevice(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, NULL, NULL, NULL, D3D11_SDK_VERSION, &_Device, NULL, &_DeviceContext))) + { + _Supported = false; + return false; + } + + if (FAILED(this->_Device->CreateVertexShader(VertexShader, sizeof(VertexShader), nullptr, &_VertexShader))) + { + this->Shutdown(); + return false; + } + + if (FAILED(this->_Device->CreatePixelShader(PixelShader, sizeof(PixelShader), nullptr, &_PixelShader))) + { + this->Shutdown(); + return false; + } + + CD3D11_SAMPLER_DESC SampDesc(D3D11_DEFAULT); + + if (FAILED(this->_Device->CreateSamplerState(&SampDesc, &_Sampler))) + { + this->Shutdown(); + return false; + } + + return true; + } + + HRESULT TextureGPUDecoder::Decompress(const DirectX::Image* cImages, size_t nimages, const DirectX::TexMetadata& metadata, DXGI_FORMAT format, DirectX::ScratchImage& images) + { + if (_Device == nullptr) + return ERROR_DEVICE_UNREACHABLE; + + D3D11_VIEWPORT Viewport{}; + Viewport.Width = (float)metadata.width; + Viewport.Height = (float)metadata.height; + + this->_DeviceContext->RSSetViewports(1, &Viewport); + + ID3D11Texture2D* DestinationTexture; + ID3D11RenderTargetView* DestinationRenderTarget; + + ID3D11Texture2D* SourceTexture; + ID3D11ShaderResourceView* SourceShaderResource; + + ID3D11Texture2D* CopyTexture; + + if (format == DXGI_FORMAT::DXGI_FORMAT_UNKNOWN) + format = DefaultDecompress(format); + + D3D11_TEXTURE2D_DESC DestinationDesc{}; + DestinationDesc.Width = (UINT)metadata.width; + DestinationDesc.Height = (UINT)metadata.height; + DestinationDesc.MipLevels = 1; // TODO: We don't care about mips, so leave it? + DestinationDesc.ArraySize = 1; // TODO: Set array size... + DestinationDesc.SampleDesc.Count = 1; + DestinationDesc.BindFlags = D3D11_BIND_FLAG::D3D11_BIND_RENDER_TARGET; + DestinationDesc.Format = format; + DestinationDesc.Usage = D3D11_USAGE::D3D11_USAGE_DEFAULT; + + this->_Device->CreateTexture2D(&DestinationDesc, nullptr, &DestinationTexture); + + DestinationDesc.BindFlags = 0; + DestinationDesc.Usage = D3D11_USAGE::D3D11_USAGE_STAGING; + DestinationDesc.CPUAccessFlags = D3D11_CPU_ACCESS_FLAG::D3D11_CPU_ACCESS_READ; + + this->_Device->CreateTexture2D(&DestinationDesc, nullptr, &CopyTexture); + + D3D11_RENDER_TARGET_VIEW_DESC RenderDesc{}; + RenderDesc.Format = DestinationDesc.Format; + RenderDesc.ViewDimension = D3D11_RTV_DIMENSION::D3D11_RTV_DIMENSION_TEXTURE2D; + + this->_Device->CreateRenderTargetView(DestinationTexture, &RenderDesc, &DestinationRenderTarget); + + D3D11_TEXTURE2D_DESC SourceDesc{}; + SourceDesc.Width = (UINT)metadata.width; + SourceDesc.Height = (UINT)metadata.height; + SourceDesc.MipLevels = 1; // TODO: We don't care about mips, so leave it? + SourceDesc.ArraySize = 1; // TODO: Set array size... + SourceDesc.SampleDesc.Count = 1; + SourceDesc.BindFlags = D3D11_BIND_FLAG::D3D11_BIND_SHADER_RESOURCE; + SourceDesc.Format = metadata.format; + SourceDesc.Usage = D3D11_USAGE::D3D11_USAGE_IMMUTABLE; + + D3D11_SUBRESOURCE_DATA SourceData{}; + SourceData.pSysMem = cImages->pixels; + SourceData.SysMemPitch = (UINT)cImages->rowPitch; + + this->_Device->CreateTexture2D(&SourceDesc, &SourceData, &SourceTexture); + + D3D11_SHADER_RESOURCE_VIEW_DESC SourceShaderDesc{}; + SourceShaderDesc.Format = SourceDesc.Format; + SourceShaderDesc.ViewDimension = D3D_SRV_DIMENSION::D3D11_SRV_DIMENSION_TEXTURE2D; + SourceShaderDesc.Texture2D.MipLevels = 1; + + this->_Device->CreateShaderResourceView(SourceTexture, &SourceShaderDesc, &SourceShaderResource); + + this->_DeviceContext->OMSetRenderTargets(1, &DestinationRenderTarget, nullptr); + this->_DeviceContext->IASetPrimitiveTopology(D3D_PRIMITIVE_TOPOLOGY::D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP); + this->_DeviceContext->VSSetShader(this->_VertexShader, nullptr, 0); + this->_DeviceContext->PSSetShader(this->_PixelShader, nullptr, 0); + this->_DeviceContext->PSSetSamplers(0, 1, &this->_Sampler); + this->_DeviceContext->PSSetShaderResources(0, 1, &SourceShaderResource); + this->_DeviceContext->Draw(4, 0); + this->_DeviceContext->Flush(); + + this->_DeviceContext->CopyResource(CopyTexture, DestinationTexture); + + D3D11_MAPPED_SUBRESOURCE MappedResource{}; + + this->_DeviceContext->Map(CopyTexture, 0, D3D11_MAP::D3D11_MAP_READ, 0, &MappedResource); + + images.Initialize2D(format, metadata.width, metadata.height, 1, 1); + std::memcpy(images.GetPixels(), MappedResource.pData, images.GetPixelsSize()); + + this->_DeviceContext->Unmap(CopyTexture, 0); + + SourceShaderResource->Release(); + SourceTexture->Release(); + DestinationRenderTarget->Release(); + CopyTexture->Release(); + DestinationTexture->Release(); + + this->_DeviceContext->ClearState(); + this->_DeviceContext->Flush(); + + return S_OK; + } + + void TextureGPUDecoder::Shutdown() + { + if (_VertexShader != nullptr) + _VertexShader->Release(); + if (_PixelShader != nullptr) + _PixelShader->Release(); + if (_Sampler != nullptr) + _Sampler->Release(); + if (_DeviceContext != nullptr) + _DeviceContext->Release(); + if (_Device != nullptr) + _Device->Release(); + + _Device = nullptr; + _DeviceContext = nullptr; + _VertexShader = nullptr; + _PixelShader = nullptr; + _Sampler = nullptr; + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/TextureGPUDecoder.h b/r5dev/thirdparty/cppnet/cppkore/TextureGPUDecoder.h new file mode 100644 index 00000000..8b9081ba --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/TextureGPUDecoder.h @@ -0,0 +1,40 @@ +#pragma once + +#include +#include + +#include "..\cppkore_incl\DirectXTex\DirectXTex.h" + +namespace Assets +{ + // Represents a GPU based BCn decoder for texture assets + class TextureGPUDecoder + { + public: + TextureGPUDecoder(); + ~TextureGPUDecoder(); + + // Initializes the GPU engine, and returns true if successful + bool Initialize(); + // Decompresses the input images to the resulting scratch image, API matches DirectXTex + HRESULT Decompress(const DirectX::Image* cImages, size_t nimages, const DirectX::TexMetadata& metadata, DXGI_FORMAT format, DirectX::ScratchImage& images); + + private: + // Internal cached device objects + ID3D11Device* _Device; + ID3D11DeviceContext* _DeviceContext; + + // Internal cached shaders + ID3D11VertexShader* _VertexShader; + ID3D11PixelShader* _PixelShader; + + // Internal sampler + ID3D11SamplerState* _Sampler; + + // If we are supported or not + bool _Supported; + + // Releases all resources + void Shutdown(); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Thread.cpp b/r5dev/thirdparty/cppnet/cppkore/Thread.cpp new file mode 100644 index 00000000..354f09d3 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Thread.cpp @@ -0,0 +1,80 @@ +#include "stdafx.h" +#include "Thread.h" + +namespace Threading +{ + Thread::Thread() + : _Handle(NULL), _Param(nullptr), _Start(nullptr), _ParamStart(nullptr), _DisposeWait(false) + { + } + + Thread::Thread(ThreadStart Start) + : _Handle(NULL), _Param(nullptr), _Start(Start), _ParamStart(nullptr), _DisposeWait(false) + { + } + + Thread::Thread(ParameterizedThreadStart Start) + : _Handle(NULL), _Param(nullptr), _ParamStart(Start), _Start(nullptr), _DisposeWait(false) + { + } + + Thread::~Thread() + { + while (_DisposeWait) Sleep(1); + + if (this->_Handle) + CloseHandle(this->_Handle); + this->_Handle = NULL; + } + + void Thread::Start() + { + if (this->_Handle != NULL) + return; // Already started + + this->_DisposeWait = true; + this->_Handle = CreateThread(NULL, 0, Thread::FunctionTrampoline, this, 0, NULL); + } + + void Thread::Start(void* Object) + { + if (this->_Handle != NULL) + return; // Already started + + this->_DisposeWait = true; + this->_Param = Object; + this->_Handle = CreateThread(NULL, 0, Thread::FunctionTrampoline, this, 0, NULL); + } + + void Thread::Suspend() + { + if (this->_Handle == NULL) + return; + + SuspendThread(this->_Handle); + } + + void Thread::Resume() + { + if (this->_Handle == NULL) + return; + + ResumeThread(this->_Handle); + } + + void Thread::Abort() + { + if (this->_Handle == NULL) + return; + + TerminateThread(this->_Handle, 0); + } + + void Thread::Join() + { + if (this->_Handle == NULL) + return; + + WaitForSingleObject(this->_Handle, INFINITE); + } +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Thread.h b/r5dev/thirdparty/cppnet/cppkore/Thread.h new file mode 100644 index 00000000..987334b2 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Thread.h @@ -0,0 +1,63 @@ +#pragma once + +#include +#include +#include +#include "ThreadStart.h" + +namespace Threading +{ + class Thread + { + public: + Thread(); + Thread(ThreadStart Start); + Thread(ParameterizedThreadStart Start); + + ~Thread(); + + // Starts the threads execution + void Start(); + // Starts the threads execution with the given argument + void Start(void* Object); + // Suspend the current threads execution if it's running + void Suspend(); + // Resumt the current threads if it's suspended + void Resume(); + // Attempt to cancel the threads execution + void Abort(); + // Wait for the thread to finish execution + void Join(); + + private: + // Cached thread flags + HANDLE _Handle; + std::function _Start; + std::function _ParamStart; + void* _Param; + + // When we can dispose + volatile bool _DisposeWait; + + // Internal trampoline designed to automatically wrap the function + inline static DWORD WINAPI FunctionTrampoline(LPVOID lpParam); + }; + + inline DWORD WINAPI Thread::FunctionTrampoline(LPVOID lpParam) + { + auto thisState = (Thread*)lpParam; + + auto ParamStart = thisState->_ParamStart; + auto Param = thisState->_Param; + auto Start = thisState->_Start; + + thisState->_DisposeWait = false; + + if (ParamStart != nullptr) + ParamStart(Param); + else + Start(); + + return 0; + } +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/ThreadStart.h b/r5dev/thirdparty/cppnet/cppkore/ThreadStart.h new file mode 100644 index 00000000..9cc031c4 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ThreadStart.h @@ -0,0 +1,6 @@ +#pragma once + +#include + +typedef std::function ThreadStart; +typedef std::function ParameterizedThreadStart; \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/ToolTip.cpp b/r5dev/thirdparty/cppnet/cppkore/ToolTip.cpp new file mode 100644 index 00000000..fbcaf15a --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ToolTip.cpp @@ -0,0 +1,777 @@ +#include "stdafx.h" +#include "ToolTip.h" + +namespace Forms +{ + ToolTip::ToolTip() + : Control(), _Flags(0x33), _ToolTipIcon(ToolTipIcon::None), _DelayTimes{} + { +#if 0 + // This is used to debug the tooltip state flags, we use the magic number 0x33 right now... + _Flags.set(0, true); // Active + _Flags.set(1, true); // Auto + _Flags.set(2, false); // ShowAlways + _Flags.set(3, false); // StripAmpersands + _Flags.set(4, true); // UseAnimation + _Flags.set(5, true); // UseFading + _Flags.set(6, false); // OwnerDraw + _Flags.set(7, false); // IsBalloon + _Flags.set(8, false); // TrackPosition + _Flags.set(9, false); // Cancelled +#endif + + // Set the automatic time default + _DelayTimes[TTDT_AUTOMATIC] = DEFAULT_DELAY; + // Adjust the base times from auto + AdjustBaseFromAuto(); + + // Default tooltip background and foreground + this->SetBackColor(Drawing::GetSystemColor(Drawing::SystemColors::Info)); + this->SetForeColor(Drawing::GetSystemColor(Drawing::SystemColors::InfoText)); + + // We are a tooltip control + this->_RTTI = ControlTypes::ToolTip; + } + + void ToolTip::CreateControl(Control* Parent) + { + INITCOMMONCONTROLSEX iCC{}; + iCC.dwSize = sizeof(iCC); + iCC.dwICC = ICC_TAB_CLASSES; + + InitCommonControlsEx(&iCC); + + Control::CreateControl(Parent); + } + + bool ToolTip::Active() + { + return this->_Flags[0]; + } + + void ToolTip::SetActive(bool Value) + { + if (Active() != Value) + { + this->_Flags[0] = Value; + + if (GetState(ControlStates::StateCreated)) + SendMessageA(this->_Handle, TTM_ACTIVATE, (Value) ? 1 : 0, NULL); + } + } + + uint32_t ToolTip::AutomaticDelay() + { + return _DelayTimes[TTDT_AUTOMATIC]; + } + + void ToolTip::SetAutomaticDelay(uint32_t Value) + { + SetDelayTime(TTDT_AUTOMATIC, Value); + } + + uint32_t ToolTip::AutoPopDelay() + { + return _DelayTimes[TTDT_AUTOPOP]; + } + + void ToolTip::SetAutoPopDelay(uint32_t Value) + { + SetDelayTime(TTDT_AUTOPOP, Value); + } + + bool ToolTip::IsBalloon() + { + return this->_Flags[7]; + } + + void ToolTip::SetIsBalloon(bool Value) + { + if (this->_Flags[7] != Value) + { + this->_Flags[7] = Value; + UpdateStyles(); + } + } + + uint32_t ToolTip::InitialDelay() + { + return _DelayTimes[TTDT_INITIAL]; + } + + void ToolTip::SetInitialDelay(uint32_t Value) + { + SetDelayTime(TTDT_INITIAL, Value); + } + + bool ToolTip::OwnerDraw() + { + return this->_Flags[6]; + } + + void ToolTip::SetOwnerDraw(bool Value) + { + this->_Flags[6] = Value; + } + + uint32_t ToolTip::ReshowDelay() + { + return _DelayTimes[TTDT_RESHOW]; + } + + void ToolTip::SetReshowDelay(uint32_t Value) + { + SetDelayTime(TTDT_RESHOW, Value); + } + + bool ToolTip::ShowAlways() + { + return this->_Flags[2]; + } + + void ToolTip::SetShowAlways(bool Value) + { + if (this->_Flags[2] != Value) + { + this->_Flags[2] = Value; + UpdateStyles(); + } + } + + bool ToolTip::StripAmpersands() + { + return this->_Flags[3]; + } + + void ToolTip::SetStripAmpersands(bool Value) + { + if (this->_Flags[3] != Value) + { + this->_Flags[3] = Value; + UpdateStyles(); + } + } + + ToolTipIcon ToolTip::GetToolTipIcon() + { + return this->_ToolTipIcon; + } + + void ToolTip::SetToolTipIcon(ToolTipIcon Value) + { + if (_ToolTipIcon != Value) + { + _ToolTipIcon = Value; + + if (GetState(ControlStates::StateCreated)) + { + string Title = !string::IsNullOrEmpty(_ToolTipTitle) ? _ToolTipTitle : string(" "); + + SendMessageA(this->_Handle, TTM_SETTITLEA, (WPARAM)Value, (LPARAM)(char*)Title); + SendMessageA(this->_Handle, TTM_UPDATE, NULL, NULL); + } + } + } + + string ToolTip::ToolTipTitle() + { + return this->_ToolTipTitle; + } + + void ToolTip::SetToolTipTitle(const string& Value) + { + if (_ToolTipTitle != Value) + { + _ToolTipTitle = Value; + + if (GetState(ControlStates::StateCreated)) + { + SendMessageA(this->_Handle, TTM_SETTITLEA, (WPARAM)_ToolTipIcon, (LPARAM)(char*)_ToolTipTitle); + SendMessageA(this->_Handle, TTM_UPDATE, NULL, NULL); + } + } + } + + bool ToolTip::UseAnimation() + { + return this->_Flags[4]; + } + + void ToolTip::SetUseAnimation(bool Value) + { + if (this->_Flags[4] != Value) + { + this->_Flags[4] = Value; + UpdateStyles(); + } + } + + bool ToolTip::UseFading() + { + return this->_Flags[5]; + } + + void ToolTip::SetUseFading(bool Value) + { + if (this->_Flags[5] != Value) + { + this->_Flags[5] = Value; + UpdateStyles(); + } + } + + void ToolTip::SetToolTip(Control* Ctrl, const string& Caption) + { + if (Ctrl->GetState(ControlStates::StateCreated)) + { + // Check if we already setup the control... + if (this->_ControlCache.ContainsKey((uintptr_t)Ctrl)) + { + TOOLINFOA Ti{}; + Ti.cbSize = sizeof(Ti); + Ti.hwnd = Ctrl->GetHandle(); + Ti.uFlags = TTF_IDISHWND | TTF_TRANSPARENT | TTF_SUBCLASS; + Ti.uId = (UINT_PTR)Ctrl->GetHandle(); + Ti.lpszText = (char*)Caption; + + SendMessageA(this->_Handle, TTM_UPDATETIPTEXTA, NULL, (LPARAM)&Ti); + + auto Ptr = (uintptr_t)Ctrl; + this->_ControlCache[Ptr] = Caption; + + return; + } + + // Add the item to the control cache + this->_ControlCache.Add((uintptr_t)Ctrl, Caption); + // Register the tooltip handler + this->RegisterTooltip(Ctrl); + + // Hook if control gets deleted + Ctrl->HandleDestroyed += &ToolTip::ControlHandleDestroyed; + } + else + { + // Add the item and wait for creation + this->_ControlCache.Add((uintptr_t)Ctrl, Caption); + Ctrl->HandleCreated += &ToolTip::ControlHandleCreated; + } + } + + void ToolTip::OnHandleCreated() + { + Control::OnHandleCreated(); + + if (OwnerDraw()) + { + auto Style = (int)GetWindowLong(this->_Handle, GWL_STYLE); + Style &= WS_BORDER; + SetWindowLong(this->_Handle, GWL_STYLE, Style); + } + + SendMessageA(this->_Handle, TTM_SETMAXTIPWIDTH, NULL, GetSystemMetrics(SM_CXMAXTRACK)); + + if (this->_Flags[1]) + { + SetDelayTime(TTDT_AUTOMATIC, _DelayTimes[TTDT_AUTOMATIC]); + _DelayTimes[TTDT_AUTOPOP] = GetDelayTime(TTDT_AUTOPOP); + _DelayTimes[TTDT_INITIAL] = GetDelayTime(TTDT_INITIAL); + _DelayTimes[TTDT_RESHOW] = GetDelayTime(TTDT_RESHOW); + } + else + { + for (int32_t i = 0; i < 4; i++) + { + if (_DelayTimes[i] > 1) + SetDelayTime(i, _DelayTimes[i]); + } + } + + SendMessageA(this->_Handle, TTM_ACTIVATE, (Active() == true) ? 1 : 0, NULL); + + SendMessageA(this->_Handle, TTM_SETTIPBKCOLOR, Drawing::ColorToWin32(this->BackColor()), NULL); + SendMessageA(this->_Handle, TTM_SETTIPTEXTCOLOR, Drawing::ColorToWin32(this->ForeColor()), NULL); + + if ((int)_ToolTipIcon > 0 || !string::IsNullOrEmpty(_ToolTipTitle)) + { + string Title = !string::IsNullOrEmpty(_ToolTipTitle) ? _ToolTipTitle : string(" "); + SendMessageA(this->_Handle, TTM_SETTITLEA, (WPARAM)_ToolTipIcon, (LPARAM)(char*)Title); + } + } + + void ToolTip::OnBackColorChanged() + { + if (GetState(ControlStates::StateCreated)) + SendMessageA(this->_Handle, TTM_SETTIPBKCOLOR, Drawing::ColorToWin32(this->BackColor()), NULL); + + Control::OnBackColorChanged(); + } + + void ToolTip::OnForeColorChanged() + { + if (GetState(ControlStates::StateCreated)) + SendMessageA(this->_Handle, TTM_SETTIPTEXTCOLOR, Drawing::ColorToWin32(this->ForeColor()), NULL); + + Control::OnForeColorChanged(); + } + + void ToolTip::OnPopup(const std::unique_ptr& EventArgs) + { + Popup.RaiseEvent(EventArgs, this); + } + + void ToolTip::OnDraw(const std::unique_ptr& EventArgs) + { + Draw.RaiseEvent(EventArgs, this); + } + + void ToolTip::RemoveAll() + { + for (auto& Kvp : this->_ControlCache) + { + auto Ctrl = (Control*)Kvp.Key(); + + if (GetState(ControlStates::StateCreated) && Ctrl->GetState(ControlStates::StateCreated)) + { + TOOLINFOA Ti{}; + Ti.cbSize = sizeof(Ti); + Ti.hwnd = Ctrl->GetHandle(); + Ti.uFlags = TTF_IDISHWND | TTF_TRANSPARENT | TTF_SUBCLASS; + Ti.uId = (UINT_PTR)Ctrl->GetHandle(); + + SendMessageA(this->_Handle, TTM_DELTOOLA, NULL, (LPARAM)& Ti); + } + } + + this->_ControlCache.Clear(); + } + + void ToolTip::Remove(Control* Ctrl) + { + if (GetState(ControlStates::StateCreated) && Ctrl->GetState(ControlStates::StateCreated)) + { + TOOLINFOA Ti{}; + Ti.cbSize = sizeof(Ti); + Ti.hwnd = Ctrl->GetHandle(); + Ti.uFlags = TTF_IDISHWND | TTF_TRANSPARENT | TTF_SUBCLASS; + Ti.uId = (UINT_PTR)Ctrl->GetHandle(); + + SendMessageA(this->_Handle, TTM_DELTOOLA, NULL, (LPARAM)&Ti); + } + + this->_ControlCache.Remove((uintptr_t)Ctrl); + } + + void ToolTip::WndProc(Message& Msg) + { + switch (Msg.Msg) + { + case WM_REFLECT + WM_NOTIFY: + { + NMHDR* nMHDR = (NMHDR*)Msg.LParam; + if (nMHDR->code == TTN_SHOW && !this->_Flags[8]) + { + WmShow(); + } + else if (nMHDR->code == TTN_POP) + { + WmPop(); + DefWndProc(Msg); + } + } + break; + case WM_WINDOWPOSCHANGING: + DefWndProc(Msg); + break; + case WM_WINDOWPOSCHANGED: + if (!WmWindowPosChanged()) + DefWndProc(Msg); + break; + case WM_MOVE: + WmMove(); + break; + case TTM_WINDOWFROMPOINT: + WmWindowFromPoint(Msg); + break; + case WM_PRINTCLIENT: + case WM_PAINT: + if (OwnerDraw() && !IsBalloon() && !this->_Flags[8]) + { + PAINTSTRUCT Ps{}; + auto Dc = BeginPaint(this->_Handle, &Ps); + + Drawing::Rectangle Bounds(Ps.rcPaint.left, Ps.rcPaint.top, Ps.rcPaint.right - Ps.rcPaint.left, Ps.rcPaint.bottom - Ps.rcPaint.top); + + if (Bounds.IsEmptyArea()) + { + EndPaint(this->_Handle, &Ps); + return; + } + + TOOLINFOA Ti{}; + Ti.cbSize = sizeof(Ti); + + auto Result = (int32_t)SendMessageA(this->_Handle, TTM_GETCURRENTTOOLA, NULL, (LPARAM)&Ti); + + if (Result != 0) + { + auto Font = this->GetFont(); + auto Ctrl = Control::FromHandle(Ti.hwnd); + auto CtrlPtr = (uintptr_t)Ctrl; + + auto& Value = this->_ControlCache[CtrlPtr]; + + OnDraw(std::make_unique(Dc, Ctrl, Ctrl, Bounds, Value, BackColor(), ForeColor(), Font)); + } + + EndPaint(this->_Handle, &Ps); + } + else + { + DefWndProc(Msg); + } + break; + default: + DefWndProc(Msg); + break; + } + } + + CreateParams ToolTip::GetCreateParams() + { + CreateParams Cp{}; + Cp.ClassName = "tooltips_class32"; + + if (ShowAlways()) + Cp.Style = TTS_ALWAYSTIP; + if (IsBalloon()) + Cp.Style |= TTS_BALLOON; + if (!StripAmpersands()) + Cp.Style |= TTS_NOPREFIX; + if (!UseAnimation()) + Cp.Style |= TTS_NOANIMATE; + if (!UseFading()) + Cp.Style |= TTS_NOFADE; + + return Cp; + } + + void ToolTip::RegisterTooltip(Control* Ctrl) + { + auto Ptr = (uintptr_t)Ctrl; + auto Value = this->_ControlCache[Ptr]; + + TOOLINFOA Ti{}; + Ti.cbSize = sizeof(Ti); + Ti.hwnd = Ctrl->GetHandle(); + Ti.uFlags = TTF_IDISHWND | TTF_TRANSPARENT | TTF_SUBCLASS; + Ti.uId = (UINT_PTR)Ctrl->GetHandle(); + Ti.lpszText = (char*)Value; + + SendMessageA(this->_Handle, TTM_ADDTOOLA, NULL, (LPARAM)&Ti); + + Ctrl->HandleDestroyed += &ToolTip::ControlHandleDestroyed; + } + + void ToolTip::ControlHandleCreated(Control* Sender) + { + Sender->HandleCreated -= &ToolTip::ControlHandleCreated; + + // The tooltip should be a child of the form of the sender + auto FormOwner = Sender->FindForm(); + if (FormOwner == nullptr) + return; + + auto& ControlList = *FormOwner->Controls().get(); + + for (auto& Control : ControlList) + { + if (Control.GetType() == ControlTypes::ToolTip) + { + auto Tt = (ToolTip*)&Control; + + if (Tt->_ControlCache.ContainsKey((uintptr_t)Sender)) + { + Tt->RegisterTooltip(Sender); + break; + } + } + } + } + + void ToolTip::ControlHandleDestroyed(Control* Sender) + { + Sender->HandleDestroyed -= &ToolTip::ControlHandleDestroyed; + + // The tooltip should be a child of the form of the sender + auto FormOwner = Sender->FindForm(); + if (FormOwner == nullptr || FormOwner->GetState(ControlStates::StateDisposed)) + return; + + auto& ControlList = *FormOwner->Controls().get(); + + for (auto& Control : ControlList) + { + if (Control.GetType() == ControlTypes::ToolTip) + { + auto Tt = (ToolTip*)&Control; + + if (Tt->GetState(ControlStates::StateCreated) && Tt->_ControlCache.ContainsKey((uintptr_t)Sender)) + { + Tt->Remove(Sender); + break; + } + } + } + } + + void ToolTip::WmShow() + { + RECT R{}; + GetWindowRect(this->_Handle, &R); + + TOOLINFOA Ti{}; + Ti.cbSize = sizeof(Ti); + + auto Result = (int32_t)SendMessageA(this->_Handle, TTM_GETCURRENTTOOLA, NULL, (LPARAM)&Ti); + + if (Result != NULL) + { + Drawing::Rectangle Rc(R.left, R.top, R.right - R.left, R.bottom - R.top); + Drawing::Size CurrentToolTipSize; + + Rc.GetSize(&CurrentToolTipSize); + + auto Ctrl = Control::FromHandle(Ti.hwnd); + + if (Ctrl == nullptr) + return; + + auto EventArgs = std::make_unique(Ctrl, Ctrl, IsBalloon(), CurrentToolTipSize); + OnPopup(EventArgs); + + GetWindowRect(this->_Handle, &R); + if (EventArgs->ToolTipSize.Equals(CurrentToolTipSize)) + Rc.GetSize(&CurrentToolTipSize); + else + CurrentToolTipSize = EventArgs->ToolTipSize; + + if (IsBalloon()) + { + SendMessageA(this->_Handle, TTM_ADJUSTRECT, (WPARAM)1, (LPARAM)&R); + + if ((R.bottom - R.top) > CurrentToolTipSize.Height) + CurrentToolTipSize.Height = (R.bottom - R.top); + } + + if (!CurrentToolTipSize.Equals(Drawing::Size(R.right - R.left, R.bottom - R.top))) + { + auto CursorPos = Control::GetMousePosition(); + HMONITOR MonHandle = MonitorFromPoint({ CursorPos.X, CursorPos.Y }, MONITOR_DEFAULTTONEAREST); + + if (MonHandle != nullptr) + { + MONITORINFO Info; + Info.cbSize = sizeof(Info); + GetMonitorInfo(MonHandle, &Info); + + int32_t MaxWidth = 0; + + if (IsBalloon()) + MaxWidth = min(CurrentToolTipSize.Width - 2 * (int32_t)XBALLOONOFFSET, (Info.rcWork.right - Info.rcWork.left)); + else + MaxWidth = min(CurrentToolTipSize.Width, (Info.rcWork.right - Info.rcWork.left)); + + SendMessageA(this->_Handle, TTM_SETMAXTIPWIDTH, NULL, (LPARAM)MaxWidth); + } + } + + if (EventArgs->Cancel) + { + this->_Flags[9] = true; + SetWindowPos(this->_Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOOWNERZORDER); + } + else + { + this->_Flags[9] = false; + SetWindowPos(this->_Handle, HWND_TOPMOST, R.left, R.top, CurrentToolTipSize.Width, CurrentToolTipSize.Height, SWP_NOACTIVATE | SWP_NOOWNERZORDER); + } + } + } + + void ToolTip::WmPop() + { + TOOLINFOA Ti{}; + Ti.cbSize = sizeof(Ti); + + auto Result = (int32_t)SendMessageA(this->_Handle, TTM_GETCURRENTTOOLA, NULL, (LPARAM)&Ti); + + if (Result != 0) + { + auto Ctrl = Control::FromHandle(Ti.hwnd); + if (Ctrl == nullptr) + return; + + // This should only happen on Type::Auto / Type::SemiAbsolute + + auto CursorPos = Control::GetMousePosition(); + HMONITOR MonHandle = MonitorFromPoint({ CursorPos.X, CursorPos.Y }, MONITOR_DEFAULTTONEAREST); + + if (MonHandle != nullptr) + { + MONITORINFO Info; + Info.cbSize = sizeof(Info); + GetMonitorInfo(MonHandle, &Info); + + SendMessageA(this->_Handle, TTM_SETMAXTIPWIDTH, NULL, (Info.rcWork.right - Info.rcWork.left)); + } + + // TODO: If we support single-shot tooltips, remove them here... + } + } + + void ToolTip::WmMove() + { + RECT R{}; + GetWindowRect(this->_Handle, &R); + + TOOLINFOA Ti{}; + Ti.cbSize = sizeof(Ti); + + auto Result = (int32_t)SendMessageA(this->_Handle, TTM_GETCURRENTTOOLA, NULL, (LPARAM)&Ti); + + if (Result != 0) + { + auto Win = Control::FromHandle(Ti.hwnd); + + if (Win == nullptr) + return; + + // TODO: If Info != Point::Empty: + // TODO: Reposition the control... + } + } + + bool ToolTip::WmWindowPosChanged() + { + if (this->_Flags[9]) + { + SendMessageA(this->_Handle, SW_HIDE, NULL, NULL); + return true; + } + + return false; + } + + void ToolTip::WmWindowFromPoint(Message& Msg) + { + POINT* Pt = (POINT*)Msg.LParam; + Drawing::Point ScreenCoords(Pt->x, Pt->y); + bool Result = false; + Msg.Result = GetWindowFromPoint(ScreenCoords, Result); + } + + void ToolTip::AdjustBaseFromAuto() + { + _DelayTimes[TTDT_RESHOW] = _DelayTimes[TTDT_AUTOMATIC] / RESHOW_RATIO; + _DelayTimes[TTDT_AUTOPOP] = _DelayTimes[TTDT_AUTOMATIC] / AUTOPOP_RATIO; + _DelayTimes[TTDT_INITIAL] = _DelayTimes[TTDT_AUTOMATIC]; + } + + void ToolTip::SetDelayTime(uint32_t Type, uint32_t Time) + { + if (Type == TTDT_AUTOMATIC) + this->_Flags[1] = true; + else + this->_Flags[1] = false; + + _DelayTimes[Type] = Time; + + if (GetState(ControlStates::StateCreated) && Time >= 0) + { + SendMessageA(this->_Handle, TTM_SETDELAYTIME, (WPARAM)Type, (LPARAM)Time); + + if (this->_Flags[1]) + { + _DelayTimes[TTDT_AUTOPOP] = GetDelayTime(TTDT_AUTOPOP); + _DelayTimes[TTDT_INITIAL] = GetDelayTime(TTDT_INITIAL); + _DelayTimes[TTDT_RESHOW] = GetDelayTime(TTDT_RESHOW); + } + } + else if (this->_Flags[1]) + { + AdjustBaseFromAuto(); + } + } + + uint32_t ToolTip::GetDelayTime(uint32_t Type) + { + if (GetState(ControlStates::StateCreated)) + return (uint32_t)SendMessageA(this->_Handle, TTM_GETDELAYTIME, (WPARAM)Type, NULL); + else + return _DelayTimes[Type]; + } + + uintptr_t ToolTip::GetWindowFromPoint(Drawing::Point ScreenCoords, bool& Success) + { + HWND BaseHwnd = NULL; + Control* BaseVar = this->FindForm(); + + if (BaseVar != nullptr) + BaseHwnd = BaseVar->GetHandle(); + + HWND hWnd = NULL; + bool FinalMatch = false; + + while (!FinalMatch) + { + auto Pt = ScreenCoords; + if (BaseVar != nullptr) + Pt = BaseVar->PointToClient(ScreenCoords); + + auto Found = ChildWindowFromPointEx(BaseHwnd, { Pt.X, Pt.Y }, CWP_SKIPINVISIBLE); + + if (Found == BaseHwnd) + { + hWnd = Found; + FinalMatch = true; + } + else if (Found == NULL) + { + FinalMatch = true; + } + else + { + BaseVar = Control::FromHandle(Found); + if (BaseVar == nullptr) + { + BaseVar = Control::FromChildHandle(Found); + if (BaseVar != nullptr) + hWnd = BaseVar->GetHandle(); + + FinalMatch = true; + } + else + BaseHwnd = BaseVar->GetHandle(); + } + } + + if (hWnd != NULL) + { + auto Ctrl = Control::FromHandle(hWnd); + if (Ctrl != nullptr) + { + Control* Current = Ctrl; + while (Current != nullptr && Current->Visible()) + Current = Current->Parent(); + + if (Current != nullptr) + hWnd = NULL; + + Success = true; + } + } + + return (uintptr_t)hWnd; + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/ToolTip.h b/r5dev/thirdparty/cppnet/cppkore/ToolTip.h new file mode 100644 index 00000000..d0b6e344 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ToolTip.h @@ -0,0 +1,157 @@ +#pragma once + +#include +#include +#include "Control.h" +#include "ToolTipIcon.h" +#include "DictionaryBase.h" +#include "PopupEventArgs.h" +#include "DrawToolTipEventArgs.h" + +namespace Forms +{ + // Provides a small pop-up window containing a line of text + // that describes the purpose of a tool or control. + class ToolTip : public Control + { + public: + ToolTip(); + virtual ~ToolTip() = default; + + // Creates a new instance of the specified control with the given parent. + virtual void CreateControl(Control* Parent = nullptr); + + // Gets a value indicating whether the Tooltip control is currently active. + bool Active(); + // Sets a value indicating whether the Tooltip control is currently active. + void SetActive(bool Value); + + // The time (in milliseconds) that passes before the tooltip appears. + uint32_t AutomaticDelay(); + // The time (in milliseconds) that passes before the tooltip appears. + void SetAutomaticDelay(uint32_t Value); + + // The initial delay for the tooltip control. + uint32_t AutoPopDelay(); + // The initial delay for the tooltip control. + void SetAutoPopDelay(uint32_t Value); + + // Gets is balloon for the tooltip control. + bool IsBalloon(); + // Sets is balloon for the tooltip control. + void SetIsBalloon(bool Value); + + // The initial delay for the tooltip control. + uint32_t InitialDelay(); + // The initial delay for the tooltip control. + void SetInitialDelay(uint32_t Value); + + // Indicates whether the tooltip will be drawn by the system or the user. + bool OwnerDraw(); + // Indicates whether the tooltip will be drawn by the system or the user. + void SetOwnerDraw(bool Value); + + // The length of time (in milliseconds) that the tooltip takes to reshow. + uint32_t ReshowDelay(); + // The length of time (in milliseconds) that the tooltip takes to reshow. + void SetReshowDelay(uint32_t Value); + + // Gets or sets a value indicating whether the tooltip appears when the parent is inactive. + bool ShowAlways(); + // Gets or sets a value indicating whether the tooltip appears when the parent is inactive. + void SetShowAlways(bool Value); + + // When set to true, any ampersands in the text property are not displayed. + bool StripAmpersands(); + // When set to true, any ampersands in the text property are not displayed. + void SetStripAmpersands(bool Value); + + // Gets or sets an Icon on the tooltip. + ToolTipIcon GetToolTipIcon(); + // Gets or sets an Icon on the tooltip. + void SetToolTipIcon(ToolTipIcon Value); + + // Gets or sets the title of the tooltip. + string ToolTipTitle(); + // Gets or sets the title of the tooltip. + void SetToolTipTitle(const string& Value); + + // When set to true, animations are used when tooltip is shown or hidden. + bool UseAnimation(); + // When set to true, animations are used when tooltip is shown or hidden. + void SetUseAnimation(bool Value); + + // When set to true, a fade effect is used when tooltips are shown or hidden. + bool UseFading(); + // When set to true, a fade effect is used when tooltips are shown or hidden. + void SetUseFading(bool Value); + + // Associates tooltip text with the specified control. + void SetToolTip(Control* Ctrl, const string& Caption); + + // Removes all tooltips from the currently setup controls. + void RemoveAll(); + // Removes a tooltip from the specified control. + void Remove(Control* Ctrl); + + // We must define control event bases here + virtual void OnHandleCreated(); + virtual void OnBackColorChanged(); + virtual void OnForeColorChanged(); + virtual void OnPopup(const std::unique_ptr& EventArgs); + virtual void OnDraw(const std::unique_ptr& EventArgs); + + // We must define event handlers here + EventBase&, Control*)> Popup; + EventBase&, Control*)> Draw; + + // Override WndProc for specific button messages. + virtual void WndProc(Message& Msg); + + protected: + // Get custom control creation parameters for this instance. + virtual CreateParams GetCreateParams(); + + // Registers all tooltip information. + void RegisterTooltip(Control* Ctrl); + + private: + // Internal cached flags + std::bitset<10> _Flags; + uint32_t _DelayTimes[4]; + ToolTipIcon _ToolTipIcon; + string _ToolTipTitle; + + // Internal cache dictionary + Dictionary _ControlCache; + + // We must define each window message handler here... + void WmShow(); + void WmPop(); + void WmMove(); + bool WmWindowPosChanged(); + void WmWindowFromPoint(Message& Msg); + + // Adjusts the other delay values based on the automatic value. + void AdjustBaseFromAuto(); + // Sets the delay time based on the TTDT values. + void SetDelayTime(uint32_t Type, uint32_t Time); + // Gets the delay time based on the TTDT values. + uint32_t GetDelayTime(uint32_t Type); + + // Returns the HWND of the window that is at the specified point. + uintptr_t GetWindowFromPoint(Drawing::Point ScreenCoords, bool& Success); + + // Internal routines to aid in the tracking of control creation. + static void ControlHandleCreated(Control* Sender); + static void ControlHandleDestroyed(Control* Sender); + + // Internal cached constants + constexpr static uint32_t DEFAULT_DELAY = 500; + constexpr static uint32_t RESHOW_RATIO = 5; + constexpr static uint32_t AUTOPOP_RATIO = 10; + + constexpr static uint32_t XBALLOONOFFSET = 10; + constexpr static uint32_t YBALLOONOFFSET = 8; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/ToolTipIcon.h b/r5dev/thirdparty/cppnet/cppkore/ToolTipIcon.h new file mode 100644 index 00000000..0f3dbbce --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ToolTipIcon.h @@ -0,0 +1,19 @@ +#pragma once + +#include + +namespace Forms +{ + // This enumeration represents the possible tool tip icons. + enum class ToolTipIcon + { + // No Icon. + None = 0, + // A Information Icon. + Info = 1, + // A Warning Icon. + Warning = 2, + // A Error Icon. + Error = 3 + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/UIXButton.cpp b/r5dev/thirdparty/cppnet/cppkore/UIXButton.cpp new file mode 100644 index 00000000..35f84de9 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/UIXButton.cpp @@ -0,0 +1,31 @@ +#include "stdafx.h" +#include "UIXButton.h" +#include "UIXTheme.h" + +namespace UIX +{ + UIXButton::UIXButton() + : Button() + { + SetStyle(ControlStyles::AllPaintingInWmPaint | ControlStyles::DoubleBuffer, true); + + this->SetOwnerDraw(true); + } + + void UIXButton::OnPaint(const std::unique_ptr& EventArgs) + { + auto State = UIX::UIXRenderState::Default; + auto Renderer = UIXTheme::GetRenderer(); + + if (!this->Enabled()) + State = UIX::UIXRenderState::Disabled; + else if (GetFlag(ButtonFlags::FlagMouseDown)) + State = UIX::UIXRenderState::MouseDown; + else if (GetFlag(ButtonFlags::FlagMouseOver)) + State = UIX::UIXRenderState::MouseOver; + + Renderer->RenderControlButtonBackground(EventArgs, this, State); + Renderer->RenderControlBorder(EventArgs, this, State); + Renderer->RenderControlText(EventArgs, this, State, this->ClientRectangle(), Drawing::ContentAlignment::MiddleCenter); + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/UIXButton.h b/r5dev/thirdparty/cppnet/cppkore/UIXButton.h new file mode 100644 index 00000000..bb76cae6 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/UIXButton.h @@ -0,0 +1,18 @@ +#pragma once + +#include "Button.h" + +using namespace Forms; + +namespace UIX +{ + // Represents a UIX themed button control. + class UIXButton : public Button + { + public: + UIXButton(); + + // Override the paint event to provide our custom button control. + virtual void OnPaint(const std::unique_ptr& EventArgs); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/UIXCheckBox.cpp b/r5dev/thirdparty/cppnet/cppkore/UIXCheckBox.cpp new file mode 100644 index 00000000..eb0d9b1d --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/UIXCheckBox.cpp @@ -0,0 +1,37 @@ +#include "stdafx.h" +#include "UIXCheckBox.h" +#include "UIXTheme.h" + +namespace UIX +{ + UIXCheckBox::UIXCheckBox() + : CheckBox() + { + SetStyle(ControlStyles::AllPaintingInWmPaint | ControlStyles::DoubleBuffer, true); + + this->SetOwnerDraw(true); + } + + void UIXCheckBox::OnPaint(const std::unique_ptr& EventArgs) + { + auto State = UIX::UIXRenderState::Default; + auto Renderer = UIXTheme::GetRenderer(); + + if (!this->Enabled()) + State = UIX::UIXRenderState::Disabled; + else if (this->Checked()) + State = UIX::UIXRenderState::Selected; + else if (GetFlag(Forms::ButtonFlags::FlagMouseOver)) + State = UIX::UIXRenderState::MouseOver; + + Renderer->RenderControlBackground(EventArgs, this, State); + Renderer->RenderControlCheckBoxBorder(EventArgs, this, State); + Renderer->RenderControlCheckBoxCheck(EventArgs, this, State); + + // Padding for the border + Drawing::Rectangle TextLayoutRect(this->ClientRectangle()); + TextLayoutRect.X = (this->_ClientHeight - 1) + 4; + + Renderer->RenderControlText(EventArgs, this, State, TextLayoutRect, Drawing::ContentAlignment::MiddleLeft); + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/UIXCheckBox.h b/r5dev/thirdparty/cppnet/cppkore/UIXCheckBox.h new file mode 100644 index 00000000..367408b3 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/UIXCheckBox.h @@ -0,0 +1,18 @@ +#pragma once + +#include "CheckBox.h" + +using namespace Forms; + +namespace UIX +{ + // Represents a UIX themed check box control. + class UIXCheckBox : public CheckBox + { + public: + UIXCheckBox(); + + // Override the paint even to provide our custom check box control. + virtual void OnPaint(const std::unique_ptr& EventArgs); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/UIXComboBox.cpp b/r5dev/thirdparty/cppnet/cppkore/UIXComboBox.cpp new file mode 100644 index 00000000..f13eba2a --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/UIXComboBox.cpp @@ -0,0 +1,49 @@ +#include "stdafx.h" +#include "UIXComboBox.h" +#include "UIXTheme.h" + +namespace UIX +{ + UIXComboBox::UIXComboBox() + : ComboBox(), _MouseOver(false) + { + this->SetStyle(ControlStyles::AllPaintingInWmPaint | ControlStyles::DoubleBuffer | ControlStyles::UserPaint, true); + + auto Renderer = UIXTheme::GetRenderer(); + + this->SetBackColor(Renderer->GetRenderColor(UIX::UIXRenderColor::BackgroundDefault)); + this->SetForeColor(Renderer->GetRenderColor(UIX::UIXRenderColor::TextDefault)); + } + + void UIXComboBox::OnPaint(const std::unique_ptr& EventArgs) + { + auto State = UIX::UIXRenderState::Default; + auto Renderer = UIXTheme::GetRenderer(); + + if (!this->Enabled()) + State = UIX::UIXRenderState::Disabled; + else if (_MouseOver) + State = UIX::UIXRenderState::MouseOver; + + // Padding for the border + Drawing::Rectangle TextRect(this->ClientRectangle()); + TextRect.X = 3; + + Renderer->RenderControlButtonBackground(EventArgs, this, State); + Renderer->RenderControlBorder(EventArgs, this, State); + Renderer->RenderControlText(EventArgs, this, State, TextRect, Drawing::ContentAlignment::MiddleLeft); + Renderer->RenderControlGlyph(EventArgs, this, State); + } + + void UIXComboBox::OnMouseEnter() + { + ComboBox::OnMouseEnter(); + _MouseOver = true; + } + + void UIXComboBox::OnMouseLeave() + { + ComboBox::OnMouseLeave(); + _MouseOver = false; + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/UIXComboBox.h b/r5dev/thirdparty/cppnet/cppkore/UIXComboBox.h new file mode 100644 index 00000000..7fa35dbd --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/UIXComboBox.h @@ -0,0 +1,24 @@ +#pragma once + +#include "ComboBox.h" + +using namespace Forms; + +namespace UIX +{ + // Represents a UIX themed combo box control. + class UIXComboBox : public ComboBox + { + public: + UIXComboBox(); + + // Override the paint event to provide our custom combo box control. + virtual void OnPaint(const std::unique_ptr& EventArgs); + virtual void OnMouseEnter(); + virtual void OnMouseLeave(); + + private: + // Internal cached flags + bool _MouseOver; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/UIXControls.h b/r5dev/thirdparty/cppnet/cppkore/UIXControls.h new file mode 100644 index 00000000..355ee9b0 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/UIXControls.h @@ -0,0 +1,12 @@ +#pragma once + +#include "UIXButton.h" +#include "UIXCheckBox.h" +#include "UIXComboBox.h" +#include "UIXGroupBox.h" +#include "UIXLabel.h" +#include "UIXListView.h" +#include "UIXProgressBar.h" +#include "UIXRadioButton.h" +#include "UIXTextBox.h" +#include "UIXToolTip.h" \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/UIXGroupBox.cpp b/r5dev/thirdparty/cppnet/cppkore/UIXGroupBox.cpp new file mode 100644 index 00000000..36d27d5b --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/UIXGroupBox.cpp @@ -0,0 +1,23 @@ +#include "stdafx.h" +#include "UIXGroupBox.h" +#include "UIXTheme.h" + +namespace UIX +{ + UIXGroupBox::UIXGroupBox() + : GroupBox() + { + this->SetStyle(ControlStyles::AllPaintingInWmPaint | ControlStyles::UserPaint | ControlStyles::DoubleBuffer, true); + } + + void UIXGroupBox::OnPaint(const std::unique_ptr& EventArgs) + { + auto State = UIX::UIXRenderState::Default; + auto Renderer = UIXTheme::GetRenderer(); + + if (!this->Enabled()) + State = UIX::UIXRenderState::Disabled; + + Renderer->RenderControlGroupBox(EventArgs, this, State); + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/UIXGroupBox.h b/r5dev/thirdparty/cppnet/cppkore/UIXGroupBox.h new file mode 100644 index 00000000..473dfa34 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/UIXGroupBox.h @@ -0,0 +1,18 @@ +#pragma once + +#include "GroupBox.h" + +using namespace Forms; + +namespace UIX +{ + // Represents a UIX themed group box control. + class UIXGroupBox : public GroupBox + { + public: + UIXGroupBox(); + + // Override the paint event to provide our custom group box control. + virtual void OnPaint(const std::unique_ptr& EventArgs); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/UIXLabel.cpp b/r5dev/thirdparty/cppnet/cppkore/UIXLabel.cpp new file mode 100644 index 00000000..89f7c182 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/UIXLabel.cpp @@ -0,0 +1,24 @@ +#include "stdafx.h" +#include "UIXLabel.h" +#include "UIXTheme.h" + +namespace UIX +{ + UIXLabel::UIXLabel() + : Label() + { + this->SetOwnerDraw(true); + } + + void UIXLabel::OnPaint(const std::unique_ptr& EventArgs) + { + auto State = UIX::UIXRenderState::Default; + auto Renderer = UIXTheme::GetRenderer(); + + if (!this->Enabled()) + State = UIX::UIXRenderState::Disabled; + + Renderer->RenderControlBackground(EventArgs, this, State); + Renderer->RenderControlText(EventArgs, this, State, this->ClientRectangle(), this->TextAlign()); + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/UIXLabel.h b/r5dev/thirdparty/cppnet/cppkore/UIXLabel.h new file mode 100644 index 00000000..a229da69 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/UIXLabel.h @@ -0,0 +1,18 @@ +#pragma once + +#include "Label.h" + +using namespace Forms; + +namespace UIX +{ + // Represents a UIX themed label control. + class UIXLabel : public Label + { + public: + UIXLabel(); + + // Override the paint event to provide our custom label control. + virtual void OnPaint(const std::unique_ptr& EventArgs); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/UIXListView.cpp b/r5dev/thirdparty/cppnet/cppkore/UIXListView.cpp new file mode 100644 index 00000000..f0785409 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/UIXListView.cpp @@ -0,0 +1,39 @@ +#include "stdafx.h" +#include "UIXListView.h" +#include "UIXTheme.h" + +namespace UIX +{ + UIX::UIXListView::UIXListView() + : ListView::ListView() + { + this->SetOwnerDraw(true); + this->SetDoubleBuffered(true); + this->SetBorderStyle(Forms::BorderStyle::None); + this->SetBackColor(UIXTheme::GetRenderer()->GetRenderColor(UIX::UIXRenderColor::BackgroundLight)); + } + + void UIXListView::OnHandleCreated() + { + // Initialize normally first + ListView::OnHandleCreated(); + + // Subclass the header + this->_Header = std::make_unique((HWND)SendMessageA(this->_Handle, LVM_GETHEADER, NULL, NULL), this); + } + + void UIXListView::OnDrawItem(const std::unique_ptr& EventArgs) + { + // We should do nothing here... + } + + void UIXListView::OnDrawSubItem(const std::unique_ptr& EventArgs) + { + UIXTheme::GetRenderer()->RenderControlListSubItem(EventArgs, this); + } + + void UIXListView::OnDrawColumnHeader(const std::unique_ptr& EventArgs) + { + UIXTheme::GetRenderer()->RenderControlListColumnHeader(EventArgs, this); + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/UIXListView.h b/r5dev/thirdparty/cppnet/cppkore/UIXListView.h new file mode 100644 index 00000000..903f38fa --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/UIXListView.h @@ -0,0 +1,29 @@ +#pragma once + +#include +#include "ListView.h" +#include "UIXListViewHeader.h" + +using namespace Forms; + +namespace UIX +{ + // Represents a UIX themed listview control. + class UIXListView : public ListView + { + public: + UIXListView(); + + // We must define base events here + virtual void OnHandleCreated(); + + // Implement the virtual calls to fix the layout + virtual void OnDrawItem(const std::unique_ptr& EventArgs); + virtual void OnDrawSubItem(const std::unique_ptr& EventArgs); + virtual void OnDrawColumnHeader(const std::unique_ptr& EventArgs); + + private: + // An internal instance for the header + std::unique_ptr _Header; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/UIXListViewHeader.cpp b/r5dev/thirdparty/cppnet/cppkore/UIXListViewHeader.cpp new file mode 100644 index 00000000..ef6387fb --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/UIXListViewHeader.cpp @@ -0,0 +1,70 @@ +#include "stdafx.h" +#include "Message.h" +#include "BufferedGraphics.h" +#include "UIXTheme.h" +#include "UIXListViewHeader.h" + +namespace UIX +{ + UIXListViewHeader::UIXListViewHeader(HWND Handle, Forms::ListView* Parent) + : _Handle(Handle), _Parent(Parent) + { + SetWindowSubclass(Handle, &UIXListViewHeader::InternalWndProc, NULL, (DWORD_PTR)this); + } + + void UIXListViewHeader::WndProc(Forms::Message& Msg) + { + // Used to allow for custom theming of the background of this control + switch (Msg.Msg) + { + case WM_ERASEBKGND: + Msg.Result = (intptr_t)1; + break; + case WM_PAINT: + { + // Paint the original items + DefWndProc(Msg); + + RECT rcClient{}; + RECT lastRc{}; + + // Get items + auto ItemCount = SendMessageA(this->_Handle, HDM_GETITEMCOUNT, NULL, NULL); + + // Calculate bounds of last item + GetClientRect(this->_Handle, &rcClient); + SendMessageA(this->_Handle, HDM_GETITEMRECT, (WPARAM)ItemCount - 1, (LPARAM)&lastRc); + + // We only need to render the list header if we are outside of the bounds + if (lastRc.right < rcClient.right) + { + auto Dc = GetWindowDC(this->_Handle); + { + UIXTheme::GetRenderer()->RenderControlListHeader(std::make_unique((HDC)Dc, Drawing::Rectangle(lastRc.right, 0, rcClient.right - lastRc.right, lastRc.bottom))); + } + ReleaseDC(this->_Handle, Dc); + } + } + break; + default: + DefWndProc(Msg); + break; + } + } + + void UIXListViewHeader::DefWndProc(Forms::Message& Msg) + { + // Proxy to subclassed func + Msg.Result = DefSubclassProc((HWND)Msg.HWnd, Msg.Msg, Msg.WParam, Msg.LParam); + } + + LRESULT UIXListViewHeader::InternalWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData) + { + // Fetch the class data + auto ControlMessage = Forms::Message(hWnd, Msg, wParam, lParam); + ((UIXListViewHeader*)dwRefData)->WndProc(ControlMessage); + + // Return result + return (LRESULT)ControlMessage.Result; + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/UIXListViewHeader.h b/r5dev/thirdparty/cppnet/cppkore/UIXListViewHeader.h new file mode 100644 index 00000000..9a0a505f --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/UIXListViewHeader.h @@ -0,0 +1,29 @@ +#pragma once + +#include "ListView.h" + +namespace UIX +{ + // Represents a UIX themed listview header control. + class UIXListViewHeader + { + public: + UIXListViewHeader(HWND Handle, Forms::ListView* Parent); + + // The standard windows message pump for this control. + virtual void WndProc(Forms::Message& Msg); + // Invokes the default window procedure associated with this Window. It is + // an error to call this method when the Handle property is zero. + void DefWndProc(Forms::Message& Msg); + + protected: + // The control handle + HWND _Handle; + + // The parent listview + Forms::ListView* _Parent; + + // An internal routine that is the root window message processor. + static LRESULT CALLBACK InternalWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/UIXProgressBar.cpp b/r5dev/thirdparty/cppnet/cppkore/UIXProgressBar.cpp new file mode 100644 index 00000000..aa9dc893 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/UIXProgressBar.cpp @@ -0,0 +1,26 @@ +#include "stdafx.h" +#include "UIXProgressBar.h" +#include "UIXTheme.h" +#include "TextRenderer.h" + +namespace UIX +{ + UIXProgressBar::UIXProgressBar() + : ProgressBar() + { + SetStyle(ControlStyles::AllPaintingInWmPaint | ControlStyles::UserPaint | ControlStyles::DoubleBuffer, true); + } + + void UIXProgressBar::OnPaint(const std::unique_ptr& EventArgs) + { + auto State = UIX::UIXRenderState::Default; + auto Renderer = UIXTheme::GetRenderer(); + + if (!this->Enabled()) + State = UIX::UIXRenderState::Disabled; + + Renderer->RenderControlBackground(EventArgs, this, State); + Renderer->RenderControlBorder(EventArgs, this, State); + Renderer->RenderControlProgressFill(EventArgs, this, State, this->Value()); + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/UIXProgressBar.h b/r5dev/thirdparty/cppnet/cppkore/UIXProgressBar.h new file mode 100644 index 00000000..3e8c69ea --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/UIXProgressBar.h @@ -0,0 +1,18 @@ +#pragma once + +#include "ProgressBar.h" + +using namespace Forms; + +namespace UIX +{ + // Represents a UIX themed progressbar control. + class UIXProgressBar : public ProgressBar + { + public: + UIXProgressBar(); + + // Override the paint event to provide our custom progressbar control. + virtual void OnPaint(const std::unique_ptr& EventArgs); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/UIXRadioButton.cpp b/r5dev/thirdparty/cppnet/cppkore/UIXRadioButton.cpp new file mode 100644 index 00000000..7dc2e503 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/UIXRadioButton.cpp @@ -0,0 +1,37 @@ +#include "stdafx.h" +#include "UIXRadioButton.h" +#include "UIXTheme.h" + +namespace UIX +{ + UIXRadioButton::UIXRadioButton() + : RadioButton() + { + SetStyle(ControlStyles::AllPaintingInWmPaint | ControlStyles::DoubleBuffer, true); + + this->SetOwnerDraw(true); + } + + void UIXRadioButton::OnPaint(const std::unique_ptr& EventArgs) + { + auto State = UIX::UIXRenderState::Default; + auto Renderer = UIXTheme::GetRenderer(); + + if (!this->Enabled()) + State = UIX::UIXRenderState::Disabled; + else if (this->Checked()) + State = UIX::UIXRenderState::Selected; + else if (GetFlag(Forms::ButtonFlags::FlagMouseOver)) + State = UIX::UIXRenderState::MouseOver; + + Renderer->RenderControlBackground(EventArgs, this, State); + Renderer->RenderControlRadioBorder(EventArgs, this, State); + Renderer->RenderControlRadioCheck(EventArgs, this, State); + + // Padding for the border + Drawing::Rectangle TextLayoutRect(this->ClientRectangle()); + TextLayoutRect.X = (this->_ClientHeight - 1) + 4; + + Renderer->RenderControlText(EventArgs, this, State, TextLayoutRect, Drawing::ContentAlignment::MiddleLeft); + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/UIXRadioButton.h b/r5dev/thirdparty/cppnet/cppkore/UIXRadioButton.h new file mode 100644 index 00000000..756c6b84 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/UIXRadioButton.h @@ -0,0 +1,18 @@ +#pragma once + +#include "RadioButton.h" + +using namespace Forms; + +namespace UIX +{ + // Represents a UIX themed radio button control. + class UIXRadioButton : public RadioButton + { + public: + UIXRadioButton(); + + // Override the paint event to provide our custom radio button control. + virtual void OnPaint(const std::unique_ptr& EventArgs); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/UIXRenderer.h b/r5dev/thirdparty/cppnet/cppkore/UIXRenderer.h new file mode 100644 index 00000000..462fff07 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/UIXRenderer.h @@ -0,0 +1,82 @@ +#pragma once + +#include +#include "Control.h" +#include "ContentAlignment.h" +#include "PaintEventArgs.h" +#include "BufferedGraphics.h" +#include "DrawToolTipEventArgs.h" +#include "DrawListViewColumnHeaderEventArgs.h" +#include "DrawListViewItemEventArgs.h" +#include "DrawListViewSubItemEventArgs.h" + +namespace UIX +{ + // The current control state + enum class UIXRenderState + { + // The default state, enabled control + Default, + // The disabled control state + Disabled, + // The mouse over control state + MouseOver, + // The mouse down control state + MouseDown, + // The control is selected + Selected, + }; + + // The render color types + enum class UIXRenderColor + { + TextDefault, + BackgroundDefault, + BackgroundLight, + }; + + // A class that handles rendering UIX controls via a custom theme + class UIXRenderer + { + public: + UIXRenderer() = default; + virtual ~UIXRenderer() = default; + + // + // These must be implemented by default + // + + virtual void RenderControlBorder(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIXRenderState State) const = 0; + virtual void RenderControlBackground(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIXRenderState State) const = 0; + virtual void RenderControlButtonBackground(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIXRenderState State) const = 0; + virtual void RenderControlText(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIXRenderState State, Drawing::Rectangle LayoutRect, Drawing::ContentAlignment Alignment) const = 0; + virtual void RenderControlProgressFill(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIXRenderState State, uint32_t Progress) const = 0; + virtual void RenderControlGlyph(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIXRenderState State) const = 0; + virtual void RenderControlCheckBoxBorder(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIXRenderState State) const = 0; + virtual void RenderControlCheckBoxCheck(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIXRenderState State) const = 0; + virtual void RenderControlRadioBorder(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIXRenderState State) const = 0; + virtual void RenderControlRadioCheck(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIXRenderState State) const = 0; + virtual void RenderControlGroupBox(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIXRenderState State) const = 0; + + // + // These are for ListView controls + // + + virtual void RenderControlListHeader(const std::unique_ptr& EventArgs) const = 0; + virtual void RenderControlListColumnHeader(const std::unique_ptr& EventArgs, Forms::Control* Ctrl) const = 0; + virtual void RenderControlListItem(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, Drawing::Rectangle SubItemBounds) const = 0; + virtual void RenderControlListSubItem(const std::unique_ptr& EventArgs, Forms::Control* Ctrl) const = 0; + + // + // Tooltip renderer + // + + virtual void RenderControlToolTip(const std::unique_ptr& EventArgs, Forms::Control* Ctrl) const = 0; + + // + // These handle external colors + // + + virtual Drawing::Color GetRenderColor(UIXRenderColor Color) const = 0; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/UIXTextBox.cpp b/r5dev/thirdparty/cppnet/cppkore/UIXTextBox.cpp new file mode 100644 index 00000000..d68048e8 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/UIXTextBox.cpp @@ -0,0 +1,47 @@ +#include "stdafx.h" +#include "UIXTextBox.h" +#include "UIXTheme.h" + +namespace UIX +{ + UIXTextBox::UIXTextBox() + : TextBox() + { + this->SetBorderStyle(BorderStyle::None); + + auto Renderer = UIXTheme::GetRenderer(); + + this->SetBackColor(Renderer->GetRenderColor(UIX::UIXRenderColor::BackgroundDefault)); + this->SetForeColor(Renderer->GetRenderColor(UIX::UIXRenderColor::TextDefault)); + } + + void UIXTextBox::WndProc(Message& Msg) + { + switch (Msg.Msg) + { + case WM_NCPAINT: + WmNcPaint(Msg); + break; + default: + TextBox::WndProc(Msg); + break; + } + } + + void UIXTextBox::WmNcPaint(Message& Msg) + { + // Handle base logic first + TextBox::WndProc(Msg); + + // Generate paint event args here... + HDC hDC = GetWindowDC((HWND)Msg.HWnd); + auto EventArgs = std::make_unique(hDC, this->ClientRectangle()); + auto Renderer = UIXTheme::GetRenderer(); + + // Render the border + Renderer->RenderControlBorder(EventArgs, this, UIX::UIXRenderState::Default); + + // Must release the handle here + ReleaseDC((HWND)Msg.HWnd, hDC); + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/UIXTextBox.h b/r5dev/thirdparty/cppnet/cppkore/UIXTextBox.h new file mode 100644 index 00000000..a1827143 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/UIXTextBox.h @@ -0,0 +1,23 @@ +#pragma once + +#include "TextBox.h" + +using namespace Forms; + +namespace UIX +{ + // Represents a UIX themed text box control. + class UIXTextBox : public TextBox + { + public: + UIXTextBox(); + + // The standard windows message pump for this control. + virtual void WndProc(Message& Msg); + + private: + + // We must define each window message handler here... + void WmNcPaint(Message& Msg); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/UIXTheme.cpp b/r5dev/thirdparty/cppnet/cppkore/UIXTheme.cpp new file mode 100644 index 00000000..1e516b42 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/UIXTheme.cpp @@ -0,0 +1,41 @@ +#include "stdafx.h" +#include "UIXTheme.h" +#include "MessageBox.h" + +#include "CheckBoxImage.h" + +namespace UIX +{ + // + // The theme renderer instance + // + + static UIXRenderer* _RendererInstance; + + // Whether or not we have a theme setup + static bool _ThemeInitialized = false; + + void UIXTheme::InitializeRenderer(UIXRenderer* Renderer) + { + if (_ThemeInitialized) + ShutdownRenderer(); + + _RendererInstance = Renderer; + _ThemeInitialized = true; + } + + void UIXTheme::ShutdownRenderer() + { + if (_ThemeInitialized) + { + delete _RendererInstance; + + _ThemeInitialized = false; + } + } + + UIXRenderer const* UIXTheme::GetRenderer() + { + return _RendererInstance; + } +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/UIXTheme.h b/r5dev/thirdparty/cppnet/cppkore/UIXTheme.h new file mode 100644 index 00000000..bdbee5f5 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/UIXTheme.h @@ -0,0 +1,22 @@ +#pragma once + +#include +#include "DrawingBase.h" +#include "UIXRenderer.h" + +namespace UIX +{ + // Represents a global collection of UIX theme colors, brushes, and resources. + class UIXTheme + { + public: + // Initializes a renderer for the current theme + static void InitializeRenderer(UIXRenderer* Renderer); + + // Frees the UIXTheme resources + static void ShutdownRenderer(); + + // Retrives the theme renderer instance. + static UIXRenderer const* GetRenderer(); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/UIXToolTip.cpp b/r5dev/thirdparty/cppnet/cppkore/UIXToolTip.cpp new file mode 100644 index 00000000..c335bedc --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/UIXToolTip.cpp @@ -0,0 +1,21 @@ +#include "stdafx.h" +#include "UIXToolTip.h" +#include "UIXTheme.h" + +namespace UIX +{ + UIXToolTip::UIXToolTip() + : ToolTip() + { + this->SetOwnerDraw(true); + } + + void UIXToolTip::OnDraw(const std::unique_ptr& EventArgs) + { + // Call the base event for processing + ToolTip::OnDraw(EventArgs); + + // Handle our own drawing + UIXTheme::GetRenderer()->RenderControlToolTip(EventArgs, this); + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/UIXToolTip.h b/r5dev/thirdparty/cppnet/cppkore/UIXToolTip.h new file mode 100644 index 00000000..1fbfdfe5 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/UIXToolTip.h @@ -0,0 +1,18 @@ +#pragma once + +#include "ToolTip.h" + +using namespace Forms; + +namespace UIX +{ + // Represents a UIX themed tooltip control. + class UIXToolTip : public ToolTip + { + public: + UIXToolTip(); + + // Override the draw event to provide our custom tooltip control. + virtual void OnDraw(const std::unique_ptr& EventArgs); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/UnrealEngine.cpp b/r5dev/thirdparty/cppnet/cppkore/UnrealEngine.cpp new file mode 100644 index 00000000..f88b4b61 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/UnrealEngine.cpp @@ -0,0 +1,277 @@ +#include "stdafx.h" +#include "UnrealEngine.h" + +#include "File.h" +#include "Path.h" +#include "MathHelper.h" +#include "BinaryWriter.h" + +namespace Assets::Exporters +{ +#pragma pack(push, 1) + struct ChunkHeader + { + char ChunkID[20]; + uint32_t TypeFlags; + uint32_t DataSize; + uint32_t DataCount; + + ChunkHeader(const char* ID, uint32_t DataSize, uint32_t DataCount) + : TypeFlags(0x1E83B9), DataSize(DataSize), DataCount(DataCount) + { + std::memcpy(ChunkID, ID, strlen(ID)); + } + }; + + struct MaterialHeader + { + char MaterialName[64]; + uint32_t MaterialIndex; + uint32_t PolyFlags; + uint32_t Padding[0x4]; + }; + + struct AnimInfoHeader + { + char AnimName[64]; + char Group[64]; + uint32_t BoneCount; + uint32_t RootInclude; + uint32_t CompressionFlags; + uint32_t KeyQuotum; + float KeyReduction; + float TrackTime; + float AnimationRate; + uint32_t StartBone; + uint32_t FirstRawFrame; + uint32_t RawFrameCount; + }; + + struct BoneHeader + { + char BoneName[64]; + uint32_t Flags; + uint32_t NumChildren; + uint32_t ParentIndex; + + Math::Quaternion Rotation; + Math::Vector3 Position; + + float Unused[4]; + }; + + struct BoneKey + { + Math::Vector3 Position; + Math::Quaternion Rotation; + float Time; + }; +#pragma pack(pop) + + bool UnrealEngine::ExportAnimation(const Animation& Animation, const string& Path) + { + auto Writer = IO::BinaryWriter(IO::File::Create(Path)); + + Writer.Write({ "ANIMHEAD", 0, 0 }); + + auto BoneCount = Animation.Bones.Count(); + + Writer.Write({ "BONENAMES", sizeof(BoneHeader), BoneCount }); + + uint32_t BoneIndex = 0; + for (auto& Bone : Animation.Bones) + { + BoneHeader Header{}; + std::memcpy(Header.BoneName, Bone.Name().ToCString(), Bone.Name().Length() > 64 ? 64 : Bone.Name().Length()); + + Header.Rotation = Bone.LocalRotation(); + Header.Position = Bone.LocalPosition(); + + Header.ParentIndex = (Bone.Parent() == -1) ? 0 : Bone.Parent(); + + uint32_t ChildCount = 0; + for (auto& BChild : Animation.Bones) + if (BChild.Parent() == BoneIndex) + ChildCount++; + + Header.NumChildren = ChildCount; + + Writer.Write(Header); + + BoneIndex++; + } + + Writer.Write({ "ANIMINFO", sizeof(AnimInfoHeader), 1 }); + + { + AnimInfoHeader Header{}; + std::memcpy(Header.AnimName, "CppKoreAnimation", 17); + std::memcpy(Header.Group, "None", 4); + + auto FrameCount = Animation.FrameCount(); + + Header.BoneCount = Animation.Bones.Count(); + Header.RootInclude = 1; + Header.TrackTime = (float)FrameCount; + Header.RawFrameCount = FrameCount; + Header.KeyQuotum = (Header.BoneCount * Header.RawFrameCount); + + Writer.Write(Header); + } + + List AnimKeys; + + // TODO: Build animation keys (UE3 PSA) + // foreach bone: + // foreach frame: + // output value at time... POS/ROT + + Writer.Write({ "ANIMKEYS", sizeof(BoneKey), AnimKeys.Count() }); + + { + Writer.Write((uint8_t*)&AnimKeys[0], 0, AnimKeys.Count() * sizeof(BoneKey)); + } + + return true; + } + + bool UnrealEngine::ExportModel(const Model& Model, const string& Path) + { + auto Writer = IO::BinaryWriter(IO::File::Create(Path)); + + Writer.Write({ "ACTRHEAD", 0, 0 }); + + auto VertexCount = Model.VertexCount(); + auto FaceCount = Model.FaceCount(); + auto MatCount = Model.Materials.Count(); + auto BoneCount = Model.Bones.Count(); + + Writer.Write({ "PNTS0000", 0xC, VertexCount }); + + for (auto& Submesh : Model.Meshes) + for (auto& Vertex : Submesh.Vertices) + Writer.Write(Vertex.Position()); + + Writer.Write({ "VTXW0000", 0x10, VertexCount }); + + for (auto& Submesh : Model.Meshes) + { + for (uint32_t i = 0; i < Submesh.Vertices.Count(); i++) + { + auto Vertex = Submesh.Vertices[i]; + + Writer.Write(i); + Writer.Write(Vertex.UVLayers(0)); + Writer.Write(0x0); + } + } + + Writer.Write({ "FACE0032", 0x12, FaceCount }); + + uint32_t FaceShift = 0x0; + + for (auto& Submesh : Model.Meshes) + { + for (auto& Face : Submesh.Faces) + { + Writer.Write(Face[0] + FaceShift); + Writer.Write(Face[1] + FaceShift); + Writer.Write(Face[2] + FaceShift); + + Writer.Write(Submesh.MaterialIndices.Count() > 0 ? Submesh.MaterialIndices[0] : 0); + Writer.Write(0x0); + } + + FaceShift += Submesh.Vertices.Count(); + } + + Writer.Write({ "MATT0000", 0x58, MatCount }); + + for (auto& Material : Model.Materials) + { + MaterialHeader Header{}; + std::memcpy(Header.MaterialName, Material.Name.ToCString(), Material.Name.Length() > 64 ? 64 : Material.Name.Length()); + + Writer.Write(Header); + } + + Writer.Write({ "REFSKELT", 0x78, BoneCount }); + + uint32_t BoneIndex = 0; + for (auto& Bone : Model.Bones) + { + BoneHeader Header{}; + std::memcpy(Header.BoneName, Bone.Name().ToCString(), Bone.Name().Length() > 64 ? 64 : Bone.Name().Length()); + + Header.Rotation = Bone.LocalRotation(); + Header.Position = Bone.LocalPosition(); + + Header.ParentIndex = (Bone.Parent() == -1) ? 0 : Bone.Parent(); + + uint32_t ChildCount = 0; + for (auto& BChild : Model.Bones) + if (BChild.Parent() == BoneIndex) + ChildCount++; + + Header.NumChildren = ChildCount; + + Writer.Write(Header); + + BoneIndex++; + } + + uint32_t WeightCount = 0; + + for (auto& Submesh : Model.Meshes) + for (auto& Vertex : Submesh.Vertices) + WeightCount += Vertex.WeightCount(); + + Writer.Write({ "RAWWEIGHTS", 0xC, WeightCount }); + + FaceShift = 0; + + for (auto& Submesh : Model.Meshes) + { + for (auto& Vertex : Submesh.Vertices) + { + for (uint8_t i = 0; i < Vertex.WeightCount(); i++) + { + auto& Weight = Vertex.Weights(i); + + Writer.Write(Weight.Value); + Writer.Write(FaceShift); + Writer.Write(Weight.Bone); + } + + FaceShift++; + } + } + + return true; + } + + imstring UnrealEngine::ModelExtension() + { + return ".psk"; + } + + imstring UnrealEngine::AnimationExtension() + { + return ".psa"; + } + + ExporterScale UnrealEngine::ExportScale() + { + return ExporterScale::Default; + } + + bool UnrealEngine::SupportsAnimations() + { + return true; + } + + bool UnrealEngine::SupportsModels() + { + return true; + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/UnrealEngine.h b/r5dev/thirdparty/cppnet/cppkore/UnrealEngine.h new file mode 100644 index 00000000..d8278d37 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/UnrealEngine.h @@ -0,0 +1,32 @@ +#pragma once + +#include +#include "Exporter.h" + +namespace Assets::Exporters +{ + class UnrealEngine : public Exporter + { + public: + UnrealEngine() = default; + ~UnrealEngine() = default; + + // Exports the given animation to the provided path. + virtual bool ExportAnimation(const Animation& Animation, const string& Path); + // Exports the given model to the provided path. + virtual bool ExportModel(const Model& Model, const string& Path); + + // Gets the file extension for this exporters model format. + virtual imstring ModelExtension(); + // Gets the file extension for this exporters animation format. + virtual imstring AnimationExtension(); + + // Gets the required scaling constant for this exporter. + virtual ExporterScale ExportScale(); + + // Gets whether or not the exporter supports animation exporting. + virtual bool SupportsAnimations(); + // Gets whether or not the exporter supports model exporting. + virtual bool SupportsModels(); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Uri.cpp b/r5dev/thirdparty/cppnet/cppkore/Uri.cpp new file mode 100644 index 00000000..15f57a6c --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Uri.cpp @@ -0,0 +1,56 @@ +#include "stdafx.h" +#include "Uri.h" + +namespace Net +{ + Uri::Uri(const char* Url) + : Uri(string(Url)) + { + } + + Uri::Uri(const string& Url) + : InternetPort(InternetPortType::Default), Host(""), Path("") + { + this->ParseUri(Url); + } + + string Uri::GetUrl() + { + auto Base = (InternetPort == InternetPortType::Http) ? "http://" : "https://"; + + return Base + Host + Path; + } + + void Uri::ParseUri(const string& Url) + { + auto LowerCaseUrl = Url.ToLower(); + uint32_t ParsePoint = 0; + + if (LowerCaseUrl.StartsWith("https://")) + { + this->InternetPort = InternetPortType::Https; + ParsePoint = 8; + } + else if (LowerCaseUrl.StartsWith("http://")) + { + this->InternetPort = InternetPortType::Http; + ParsePoint = 7; + } + else if (LowerCaseUrl.StartsWith("//")) + { + ParsePoint = 2; + } + + auto PathStart = Url.IndexOf("/", ParsePoint); + + if (PathStart != string::InvalidPosition) + { + this->Host = Url.Substring(ParsePoint, PathStart - ParsePoint); + this->Path = Url.Substring(PathStart + 1); + } + else + { + this->Host = Url.Substring(ParsePoint); + } + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/Uri.h b/r5dev/thirdparty/cppnet/cppkore/Uri.h new file mode 100644 index 00000000..6ac9ac36 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Uri.h @@ -0,0 +1,32 @@ +#pragma once + +#include +#include +#include "StringBase.h" +#include "InternetPortType.h" + +namespace Net +{ + // Represents a parsed Url with all components required for a WebRequest + class Uri + { + public: + explicit Uri(const char* Url); + Uri(const string& Url); + + // Returns the internet port of the Uri + InternetPortType InternetPort; + // Returns the host name of the Uri + string Host; + // Returns the full path and query of the Uri + string Path; + + // Returns the fully built url of the Uri components + string GetUrl(); + + private: + + // Internal routine to parse a Uri + void ParseUri(const string& Url); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/ValveSMD.cpp b/r5dev/thirdparty/cppnet/cppkore/ValveSMD.cpp new file mode 100644 index 00000000..e270bab7 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ValveSMD.cpp @@ -0,0 +1,113 @@ +#include "stdafx.h" +#include "ValveSMD.h" + +#include "File.h" +#include "Path.h" +#include "MathHelper.h" +#include "StreamWriter.h" + +namespace Assets::Exporters +{ + void ProcessVertex(IO::StreamWriter& Writer, const Vertex& Vertex) + { + auto Normal = Vertex.Normal().GetNormalized(); + + auto& Position = Vertex.Position(); + auto& UVLayer = Vertex.UVLayers(0); + + Writer.WriteFmt("0 %f %f %f %f %f %f %f %f %d ", Position.X, Position.Y, Position.Z, Normal.X, Normal.Y, Normal.Z, UVLayer.U, (1 - UVLayer.V), Vertex.WeightCount()); + + for (uint8_t i = 0; i < Vertex.WeightCount(); i++) + Writer.WriteFmt("%d %f ", Vertex.Weights(i).Bone, Vertex.Weights(i).Value); + + Writer.Write("\n"); + } + + bool ValveSMD::ExportAnimation(const Animation& Animation, const string& Path) + { + return false; + } + + bool ValveSMD::ExportModel(const Model& Model, const string& Path) + { + auto Writer = IO::StreamWriter(IO::File::Create(Path)); + + Writer.WriteLine( + "version 1\n" + "nodes" + ); + + uint32_t BoneIndex = 0; + + for (auto& Bone : Model.Bones) + { + Writer.WriteLineFmt("%d \"%s\" %d", BoneIndex, (char*)Bone.Name(), Bone.Parent()); + BoneIndex++; + } + + Writer.WriteLine( + "end\n" + "skeleton\n" + "time 0" + ); + + BoneIndex = 0; + + for (auto& Bone : Model.Bones) + { + auto Euler = Bone.LocalRotation().ToEulerAngles(); + + Writer.WriteLineFmt("%d %f %f %f %f %f %f", BoneIndex, Bone.LocalPosition().X, Bone.LocalPosition().Y, Bone.LocalPosition().Z, MathHelper::DegreesToRadians(Euler.X), MathHelper::DegreesToRadians(Euler.Y), MathHelper::DegreesToRadians(Euler.Z)); + BoneIndex++; + } + + Writer.WriteLine("end"); + + for (auto& Submesh : Model.Meshes) + { + Writer.WriteLine("triangles"); + + for (auto& Face : Submesh.Faces) + { + if (Submesh.MaterialIndices[0] > -1) + Writer.WriteLine(Model.Materials[Submesh.MaterialIndices[0]].Name); + else + Writer.WriteLine("default_material"); + + ProcessVertex(Writer, Submesh.Vertices[Face[2]]); + ProcessVertex(Writer, Submesh.Vertices[Face[1]]); + ProcessVertex(Writer, Submesh.Vertices[Face[0]]); + } + + Writer.WriteLine("end"); + } + + return true; + } + + imstring ValveSMD::ModelExtension() + { + return ".smd"; + } + + imstring ValveSMD::AnimationExtension() + { + return ".smd"; + } + + ExporterScale ValveSMD::ExportScale() + { + // Evaluate whether or not SMDs need a scale constant. + return ExporterScale::Default; + } + + bool ValveSMD::SupportsAnimations() + { + return true; + } + + bool ValveSMD::SupportsModels() + { + return true; + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/ValveSMD.h b/r5dev/thirdparty/cppnet/cppkore/ValveSMD.h new file mode 100644 index 00000000..2c533228 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ValveSMD.h @@ -0,0 +1,33 @@ +#pragma once + +#include +#include "Exporter.h" + +namespace Assets::Exporters +{ + // The Valve SMD exporter + class ValveSMD : public Exporter + { + public: + ValveSMD() = default; + ~ValveSMD() = default; + + // Exports the given animation to the provided path. + virtual bool ExportAnimation(const Animation& Animation, const string& Path); + // Exports the given model to the provided path. + virtual bool ExportModel(const Model& Model, const string& Path); + + // Gets the file extension for this exporters model format. + virtual imstring ModelExtension(); + // Gets the file extension for this exporters animation format. + virtual imstring AnimationExtension(); + + // Gets the required scaling constant for this exporter. + virtual ExporterScale ExportScale(); + + // Gets whether or not the exporter supports animation exporting. + virtual bool SupportsAnimations(); + // Gets whether or not the exporter supports model exporting. + virtual bool SupportsModels(); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Vector2.cpp b/r5dev/thirdparty/cppnet/cppkore/Vector2.cpp new file mode 100644 index 00000000..8d74d4e1 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Vector2.cpp @@ -0,0 +1,185 @@ +#include "stdafx.h" +#include "Vector2.h" + +namespace Math +{ + Vector2::Vector2() + : X(0), Y(0) + { + } + + Vector2::Vector2(float X, float Y) + : X(X), Y(Y) + { + } + + float& Vector2::operator[](int Index) + { + if (Index == 0) + return X; + + return Y; + } + + Vector2 Vector2::operator+(const Vector2& Rhs) const + { + return Vector2(X + Rhs.X, Y + Rhs.Y); + } + + Vector2 Vector2::operator-(const Vector2& Rhs) const + { + return Vector2(X - Rhs.X, Y - Rhs.Y); + } + + Vector2 Vector2::operator*(const Vector2& Rhs) const + { + return Vector2(X*Rhs.X, Y*Rhs.Y); + } + + Vector2 Vector2::operator/(const Vector2& Rhs) const + { + return Vector2(X / Rhs.X, Y / Rhs.Y); + } + + Vector2& Vector2::operator+=(const Vector2& Rhs) + { + X += Rhs.X; + Y += Rhs.Y; + + return *this; + } + + Vector2& Vector2::operator-=(const Vector2& Rhs) + { + X -= Rhs.X; + Y -= Rhs.Y; + + return *this; + } + + Vector2& Vector2::operator*=(const Vector2& Rhs) + { + X *= Rhs.X; + Y *= Rhs.Y; + + return *this; + } + + Vector2& Vector2::operator/=(const Vector2& Rhs) + { + X /= Rhs.X; + Y /= Rhs.Y; + + return *this; + } + + Vector2 Vector2::operator+(const float Rhs) const + { + return Vector2(X + Rhs, Y + Rhs); + } + + Vector2 Vector2::operator-(const float Rhs) const + { + return Vector2(X - Rhs, Y - Rhs); + } + + Vector2 Vector2::operator*(const float Rhs) const + { + return Vector2(X * Rhs, Y * Rhs); + } + + Vector2 Vector2::operator/(const float Rhs) const + { + return Vector2(X / Rhs, Y / Rhs); + } + + Vector2& Vector2::operator+=(const float Rhs) + { + X += Rhs; + Y += Rhs; + + return *this; + } + + Vector2& Vector2::operator-=(const float Rhs) + { + X -= Rhs; + Y -= Rhs; + + return *this; + } + + Vector2& Vector2::operator*=(const float Rhs) + { + X *= Rhs; + Y *= Rhs; + + return *this; + } + + Vector2& Vector2::operator/=(const float Rhs) + { + X /= Rhs; + Y /= Rhs; + + return *this; + } + + bool Vector2::operator==(const Vector2& Rhs) const + { + return (std::abs(X - Rhs.X) < MathHelper::Epsilon) && (std::abs(Y - Rhs.Y) < MathHelper::Epsilon); + } + + bool Vector2::operator!=(const Vector2& Rhs) const + { + return !(*this == Rhs); + } + + Vector2 Vector2::operator-() const + { + return Vector2(-X, -Y); + } + + float Vector2::Length() const + { + return (float)std::sqrt(X * X + Y * Y); + } + + float Vector2::LengthSq() const + { + return X * X + Y * Y; + } + + void Vector2::Normalize() + { + auto Length = this->Length(); + + if (Length > 0.0f) + { + X /= Length; + Y /= Length; + } + } + + Vector2 Vector2::GetNormalized() const + { + auto Length = this->Length(); + + return (Length > 0.0f) ? Vector2(X / Length, Y / Length) : Vector2(X, Y); + } + + Vector2 Vector2::Lerp(float Factor, const Vector2& Rhs) const + { + return (*this) + (Rhs - (*this)) * Factor; + } + + Vector2 Vector2::Zero() + { + return Vector2(); + } + + Vector2 Vector2::One() + { + return Vector2(1.0f, 1.0f); + } +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Vector2.h b/r5dev/thirdparty/cppnet/cppkore/Vector2.h new file mode 100644 index 00000000..20fa7188 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Vector2.h @@ -0,0 +1,78 @@ +#pragma once + +#include +#include "MathHelper.h" + +namespace Math +{ + // Represents a 2D vector with two points (X/Y) + class Vector2 + { + public: + Vector2(); + Vector2(float X, float Y); + + union + { + float X; + float U; + }; + + union + { + float Y; + float V; + }; + + // Array index operator + float& operator[](int Index); + + // Logical operators + Vector2 operator+(const Vector2& Rhs) const; + Vector2 operator-(const Vector2& Rhs) const; + Vector2 operator*(const Vector2& Rhs) const; + Vector2 operator/(const Vector2& Rhs) const; + + // Logical assignment operators + Vector2& operator+=(const Vector2& Rhs); + Vector2& operator-=(const Vector2& Rhs); + Vector2& operator*=(const Vector2& Rhs); + Vector2& operator/=(const Vector2& Rhs); + + // Scale logical operators + Vector2 operator+(const float Rhs) const; + Vector2 operator-(const float Rhs) const; + Vector2 operator*(const float Rhs) const; + Vector2 operator/(const float Rhs) const; + + // Scale assignment operators + Vector2& operator+=(const float Rhs); + Vector2& operator-=(const float Rhs); + Vector2& operator*=(const float Rhs); + Vector2& operator/=(const float Rhs); + + // Equality operator + bool operator==(const Vector2& Rhs) const; + // Inequality operator + bool operator!=(const Vector2& Rhs) const; + + // Unary operator + Vector2 operator-() const; + + // Get the length of this instance + float Length() const; + // Get the length squared of this instance + float LengthSq() const; + // Normalize this instance + void Normalize(); + // Get a normalized version of this instance + Vector2 GetNormalized() const; + // Linear interpolation against another instance + Vector2 Lerp(float Factor, const Vector2& Rhs) const; + + // Represents a 2D vector set to 0.0 + static Vector2 Zero(); + // Represents a 2D vector set to 1.0 + static Vector2 One(); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Vector3.cpp b/r5dev/thirdparty/cppnet/cppkore/Vector3.cpp new file mode 100644 index 00000000..30af874f --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Vector3.cpp @@ -0,0 +1,212 @@ +#include "stdafx.h" +#include "Vector3.h" + +namespace Math +{ + Vector3::Vector3() + : X(0), Y(0), Z(0) + { + } + + Vector3::Vector3(float X, float Y, float Z) + : X(X), Y(Y), Z(Z) + { + } + + float& Vector3::operator[](int Index) + { + if (Index == 0) + return X; + else if (Index == 1) + return Y; + + return Z; + } + + Vector3 Vector3::operator+(const Vector3& Rhs) const + { + return Vector3(X + Rhs.X, Y + Rhs.Y, Z + Rhs.Z); + } + + Vector3 Vector3::operator-(const Vector3& Rhs) const + { + return Vector3(X - Rhs.X, Y - Rhs.Y, Z - Rhs.Z); + } + + Vector3 Vector3::operator*(const Vector3& Rhs) const + { + return Vector3(X * Rhs.X, Y * Rhs.Y, Z * Rhs.Z); + } + + Vector3 Vector3::operator/(const Vector3& Rhs) const + { + return Vector3(X / Rhs.X, Y / Rhs.Y, Z / Rhs.Z); + } + + Vector3& Vector3::operator+=(const Vector3& Rhs) + { + X += Rhs.X; + Y += Rhs.Y; + Z += Rhs.Z; + + return *this; + } + + Vector3& Vector3::operator-=(const Vector3& Rhs) + { + X -= Rhs.X; + Y -= Rhs.Y; + Z -= Rhs.Z; + + return *this; + } + + Vector3& Vector3::operator*=(const Vector3& Rhs) + { + X *= Rhs.X; + Y *= Rhs.Y; + Z *= Rhs.Z; + + return *this; + } + + Vector3& Vector3::operator/=(const Vector3& Rhs) + { + X /= Rhs.X; + Y /= Rhs.Y; + Z /= Rhs.Z; + + return *this; + } + + Vector3 Vector3::operator+(const float Rhs) const + { + return Vector3(X + Rhs, Y + Rhs, Z + Rhs); + } + + Vector3 Vector3::operator-(const float Rhs) const + { + return Vector3(X - Rhs, Y - Rhs, Z - Rhs); + } + + Vector3 Vector3::operator*(const float Rhs) const + { + return Vector3(X * Rhs, Y * Rhs, Z * Rhs); + } + + Vector3 Vector3::operator/(const float Rhs) const + { + return Vector3(X / Rhs, Y / Rhs, Z / Rhs); + } + + Vector3& Vector3::operator+=(const float Rhs) + { + X += Rhs; + Y += Rhs; + Z += Rhs; + + return *this; + } + + Vector3& Vector3::operator-=(const float Rhs) + { + X -= Rhs; + Y -= Rhs; + Z -= Rhs; + + return *this; + } + + Vector3& Vector3::operator*=(const float Rhs) + { + X *= Rhs; + Y *= Rhs; + Z *= Rhs; + + return *this; + } + + Vector3& Vector3::operator/=(const float Rhs) + { + X /= Rhs; + Y /= Rhs; + Z /= Rhs; + + return *this; + } + + bool Vector3::operator==(const Vector3& Rhs) const + { + return (std::abs(X - Rhs.X) < MathHelper::Epsilon) && (std::abs(Y - Rhs.Y) < MathHelper::Epsilon) && (std::abs(Z - Rhs.Z) < MathHelper::Epsilon); + } + + bool Vector3::operator!=(const Vector3& Rhs) const + { + return !(*this == Rhs); + } + + Vector3 Vector3::operator-() const + { + return Vector3(-X, -Y, -Z); + } + + float Vector3::Length() const + { + return (float)std::sqrt(X * X + Y * Y + Z * Z); + } + + float Vector3::LengthSq() const + { + return X * X + Y * Y + Z * Z; + } + + void Vector3::Normalize() + { + auto Length = this->Length(); + + if (Length > 0.0f) + { + X /= Length; + Y /= Length; + Z /= Length; + } + } + + Vector3 Vector3::GetNormalized() const + { + auto Length = this->Length(); + + return (Length > 0.0f) ? Vector3(X / Length, Y / Length, Z / Length) : Vector3(X, Y, Z); + } + + Vector3 Vector3::Cross(const Vector3& Rhs) const + { + Vector3 Result; + + Result.X = (this->Y * Rhs.Z) - (this->Z * Rhs.Y); + Result.Y = (this->Z * Rhs.X) - (this->X * Rhs.Z); + Result.Z = (this->X * Rhs.Y) - (this->Y * Rhs.X); + + return Result; + } + + float Vector3::Dot(const Vector3& Rhs) + { + return (this->X * Rhs.X) + (this->Y * Rhs.Y) + (this->Z * Rhs.Z); + } + + Vector3 Vector3::Lerp(float Factor, const Vector3& Rhs) const + { + return (*this) + (Rhs - (*this)) * Factor; + } + + Vector3 Vector3::Zero() + { + return Vector3(); + } + + Vector3 Vector3::One() + { + return Vector3(1, 1, 1); + } +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Vector3.h b/r5dev/thirdparty/cppnet/cppkore/Vector3.h new file mode 100644 index 00000000..4a8e4894 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Vector3.h @@ -0,0 +1,78 @@ +#pragma once + +#include +#include "MathHelper.h" + +namespace Math +{ + // Represents a 3D vector with three points (X/Y/Z) + class Vector3 + { + public: + Vector3(); + Vector3(float X, float Y, float Z); + + float X; + float Y; + float Z; + + // Array index operator + float& operator[](int Index); + + // Logical operators + Vector3 operator+(const Vector3& Rhs) const; + Vector3 operator-(const Vector3& Rhs) const; + Vector3 operator*(const Vector3& Rhs) const; + Vector3 operator/(const Vector3& Rhs) const; + + // Logical assignment operators + Vector3& operator+=(const Vector3& Rhs); + Vector3& operator-=(const Vector3& Rhs); + Vector3& operator*=(const Vector3& Rhs); + Vector3& operator/=(const Vector3& Rhs); + + // Scale logical operators + Vector3 operator+(const float Rhs) const; + Vector3 operator-(const float Rhs) const; + Vector3 operator*(const float Rhs) const; + Vector3 operator/(const float Rhs) const; + + // Scale assignment operators + Vector3& operator+=(const float Rhs); + Vector3& operator-=(const float Rhs); + Vector3& operator*=(const float Rhs); + Vector3& operator/=(const float Rhs); + + // Equality operator + bool operator==(const Vector3& Rhs) const; + // Inequality operator + bool operator!=(const Vector3& Rhs) const; + + // Unary operator + Vector3 operator-() const; + + // Get the length of this instance + float Length() const; + // Get the length squared of this instance + float LengthSq() const; + // Normalize this instance + void Normalize(); + // Get a normalized version of this instance + Vector3 GetNormalized() const; + // Compute the cross product of this vector and another + Vector3 Cross(const Vector3& Rhs) const; + // Compute the dot product of this vector and another + float Dot(const Vector3& Rhs); + // Linear interpolation against another instance + Vector3 Lerp(float Factor, const Vector3& Rhs) const; + + // Represents a 3D vector set to 0.0 + static Vector3 Zero(); + // Represents a 3D vector set to 1.0 + static Vector3 One(); + }; + + static_assert(sizeof(Vector3) == 0xC, "Invalid Math::Vector3 size, expected 0xC"); +} + +using Vector3 = Math::Vector3; \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Vertex.cpp b/r5dev/thirdparty/cppnet/cppkore/Vertex.cpp new file mode 100644 index 00000000..2eaa68e7 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Vertex.cpp @@ -0,0 +1,164 @@ +#include "stdafx.h" +#include "Vertex.h" + +namespace Assets +{ + Vertex::Vertex(uint8_t* Address, uint8_t MaxInfluence, uint8_t UVLayers) + : _Offset(Address), _MaxInfluence(MaxInfluence), _UVLayers(UVLayers) + { + } + + Vector3& Vertex::Position() + { + return *((Vector3*)this->_Offset); + } + + const Vector3& Vertex::Position() const + { + return *((Vector3*)this->_Offset); + } + + void Vertex::SetPosition(Vector3 Value) + { + std::memcpy(this->_Offset, &Value, sizeof(Vector3)); + } + + Vector3& Vertex::Normal() + { + return *((Vector3*)(this->_Offset + sizeof(Vector3))); + } + + const Vector3& Vertex::Normal() const + { + return *((Vector3*)(this->_Offset + sizeof(Vector3))); + } + + void Vertex::SetNormal(Vector3 Value) + { + std::memcpy(this->_Offset + sizeof(Vector3), &Value, sizeof(Vector3)); + } + + VertexColor& Vertex::Color() + { + return *((VertexColor*)(this->_Offset + (sizeof(Vector3) * 2))); + } + + const VertexColor& Vertex::Color() const + { + return *((VertexColor*)(this->_Offset + (sizeof(Vector3) * 2))); + } + + void Vertex::SetColor(VertexColor Value) + { + std::memcpy(this->_Offset + (sizeof(Vector3) * 2), &Value, sizeof(VertexColor)); + } + + Vector2& Vertex::UVLayers(uint8_t Index) + { + return *((Vector2*)(this->_Offset + (sizeof(Vector3) * 2) + sizeof(VertexColor) + (sizeof(Vector2) * Index))); + } + + const Vector2& Vertex::UVLayers(uint8_t Index) const + { + return *((Vector2*)(this->_Offset + (sizeof(Vector3) * 2) + sizeof(VertexColor) + (sizeof(Vector2) * Index))); + } + + void Vertex::SetUVLayer(Vector2 Value, uint8_t Index) + { + std::memcpy(this->_Offset + (sizeof(Vector3) * 2) + sizeof(VertexColor) + (sizeof(Vector2) * Index), &Value, sizeof(Vector2)); + } + + const uint8_t Vertex::UVLayerCount() const + { + return this->_UVLayers; + } + + VertexWeight& Vertex::Weights(uint8_t Index) + { + return *((VertexWeight*)(this->_Offset + (sizeof(Vector3) * 2) + sizeof(VertexColor) + (sizeof(Vector2) * this->_UVLayers) + (sizeof(VertexWeight) * Index))); + } + + const VertexWeight& Vertex::Weights(uint8_t Index) const + { + return *((VertexWeight*)(this->_Offset + (sizeof(Vector3) * 2) + sizeof(VertexColor) + (sizeof(Vector2) * this->_UVLayers) + (sizeof(VertexWeight) * Index))); + } + + void Vertex::SetWeight(VertexWeight Value, uint8_t Index) + { + // When we set the weight, adjust the internal max count... + if ((Index + 1) > WeightCount()) + *((uint8_t*)(this->_Offset + (sizeof(Vector3) * 2) + sizeof(VertexColor) + (sizeof(Vector2) * this->_UVLayers) + (sizeof(VertexWeight) * this->_MaxInfluence))) = Index + 1; + + // Copy the weight to the buffer offset + std::memcpy(this->_Offset + (sizeof(Vector3) * 2) + sizeof(VertexColor) + (sizeof(Vector2) * this->_UVLayers) + (sizeof(VertexWeight) * Index), &Value, sizeof(VertexWeight)); + } + + const uint8_t Vertex::WeightCount() const + { + // This is the total used weight count, as in, maximum index used by SetWeight(); + return *((uint8_t*)(this->_Offset + (sizeof(Vector3) * 2) + sizeof(VertexColor) + (sizeof(Vector2) * this->_UVLayers) + (sizeof(VertexWeight) * this->_MaxInfluence))); + } + + Vertex& Vertex::operator++() + { + this->_Offset += this->VertexSize(); + return *this; + } + + Vertex Vertex::operator++(int) + { + auto Result = (*this); + ++(*this); + return Result; + } + + Vertex::operator Vertex*(void) const + { + return (Vertex*)this; + } + + bool Vertex::operator==(const Vertex& Rhs) const + { + return (this->_Offset == Rhs._Offset); + } + + bool Vertex::operator!=(const Vertex& Rhs) const + { + return !(*this == Rhs); + } + + uint32_t Vertex::VertexSize() const + { + return (sizeof(Vector3) * 2) + (sizeof(Vector2) * this->_UVLayers) + (sizeof(VertexWeight) * this->_MaxInfluence) + sizeof(VertexColor) + sizeof(uint8_t); + } + + VertexColor::VertexColor() + : _Colors{ 255, 255, 255, 255 } + { + } + + VertexColor::VertexColor(uint8_t R, uint8_t G, uint8_t B, uint8_t A) + : _Colors{ R, G, B, A } + { + } + + uint8_t& VertexColor::operator[](uint8_t Index) + { + return this->_Colors[Index]; + } + + const uint8_t& VertexColor::operator[](uint8_t Index) const + { + return this->_Colors[Index]; + } + + VertexWeight::VertexWeight() + : Bone(0), Value(1) + { + } + + VertexWeight::VertexWeight(uint32_t Bone, float Value) + : Bone(Bone), Value(Value) + { + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/Vertex.h b/r5dev/thirdparty/cppnet/cppkore/Vertex.h new file mode 100644 index 00000000..1dad544f --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Vertex.h @@ -0,0 +1,114 @@ +#pragma once + +#include +#include +#include "Vector2.h" +#include "Vector3.h" + +namespace Assets +{ + using namespace Math; // For the vector classes + + // Represents a 3D vertex weight. + class VertexWeight + { + public: + // Initialize a default vertex weight. + VertexWeight(); + // Initialize a vertex weight with the given information. + VertexWeight(uint32_t Bone, float Value); + + // The index of the bone we are weighted to. + uint32_t Bone; + // The weighting attached to this bone. + float Value; + }; + + // Represents a 3D vertex color (RGBA). + class VertexColor + { + public: + // Initialize a white vertex color. + VertexColor(); + // Initialize a vertex color with the given information. + VertexColor(uint8_t R, uint8_t G, uint8_t B, uint8_t A); + + // Array index operators + uint8_t& operator[](uint8_t Index); + const uint8_t& operator[](uint8_t Index) const; + + private: + // Internal color data + uint8_t _Colors[4]; + }; + + // Represents a 3D vertex for a mesh. + class Vertex + { + public: + // Initializes a 3D vertex from the given address of the buffer. + Vertex(uint8_t* Address, uint8_t MaxInfluence, uint8_t UVLayers); + + // Gets the position of this vertex. + Vector3& Position(); + // Gets position of this vertex. + const Vector3& Position() const; + // Sets the position of this vertex. + void SetPosition(Vector3 Value); + + // Gets the normal of this vertex. + Vector3& Normal(); + // Gets normal of this vertex. + const Vector3& Normal() const; + // Sets the normal of this vertex. + void SetNormal(Vector3 Value); + + // Gets the color of this vertex. + VertexColor& Color(); + // Gets the color of this vertex. + const VertexColor& Color() const; + // Sets the color of this vertex. + void SetColor(VertexColor Value); + + // Gets a UV layer of this vertex. + Vector2& UVLayers(uint8_t Index); + // Gets a UV layer of this vertex. + const Vector2& UVLayers(uint8_t Index) const; + // Sets a UV layer of this vertex. + void SetUVLayer(Vector2 Value, uint8_t Index); + + // Gets the total UV layer count + const uint8_t UVLayerCount() const; + + // Gets a weight for this vertex. + VertexWeight& Weights(uint8_t Index); + // Gets a weight for this vertex. + const VertexWeight& Weights(uint8_t Index) const; + // Sets a weight for this vertex. + void SetWeight(VertexWeight Value, uint8_t Index); + + // Gets the total weight count + const uint8_t WeightCount() const; + + // Increment operators + Vertex& operator++(); + Vertex operator++(int); + + // Indirection operator + operator Vertex*(void) const; + + // Equality operators + bool operator==(const Vertex& Rhs) const; + bool operator!=(const Vertex& Rhs) const; + + private: + // Internal offset of the vertex in the buffer + uint8_t* _Offset; + // Internal sizes + uint8_t _MaxInfluence; + uint8_t _UVLayers; + + // Helper routine to calculate the size of a vertex + uint32_t VertexSize() const; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/VertexBuffer.cpp b/r5dev/thirdparty/cppnet/cppkore/VertexBuffer.cpp new file mode 100644 index 00000000..2cc49a1f --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/VertexBuffer.cpp @@ -0,0 +1,216 @@ +#include "stdafx.h" +#include "VertexBuffer.h" + +namespace Assets +{ + VertexBuffer::VertexBuffer() + : _Buffer(nullptr), _BufferSize(0), _StoreSize(0), _MaxInfluence(1), _UVLayers(1) + { + } + + VertexBuffer::VertexBuffer(uint8_t MaxInfluence, uint8_t UVLayers) + : _Buffer(nullptr), _BufferSize(0), _StoreSize(0), _MaxInfluence(MaxInfluence), _UVLayers(UVLayers) + { + } + + VertexBuffer::VertexBuffer(uint32_t InitialSize, uint8_t MaxInfluence, uint8_t UVLayers) + : _Buffer(nullptr), _BufferSize(0), _StoreSize(0), _MaxInfluence(MaxInfluence), _UVLayers(UVLayers) + { + this->EnsureCapacity(InitialSize); + this->_StoreSize = 0; // Must reset this so that we start from 0 + } + + VertexBuffer& VertexBuffer::operator=(const VertexBuffer& Rhs) + { + if (Rhs._Buffer) + { + auto vSize = Rhs.VertexSize(); + this->_Buffer = new uint8_t[vSize * Rhs._BufferSize]; + this->_StoreSize = Rhs._StoreSize; + this->_BufferSize = Rhs._BufferSize; + + std::memcpy(this->_Buffer, Rhs._Buffer, vSize * Rhs._BufferSize); + } + + this->_MaxInfluence = Rhs._MaxInfluence; + this->_UVLayers = Rhs._UVLayers; + + return *this; + } + + VertexBuffer::~VertexBuffer() + { + if (this->_Buffer) + delete[] this->_Buffer; + + this->_Buffer = nullptr; + this->_BufferSize = 0; + this->_StoreSize = 0; + } + + void VertexBuffer::EmplaceBack(Vector3 Position, Vector3 Normal, VertexColor Color) + { + uint64_t nPos = this->_StoreSize; + this->EnsureCapacity((uint32_t)nPos + 1); + + // Copy the values at expected vertex offset + nPos *= this->VertexSize(); + + // Copy them + std::memcpy(this->_Buffer + nPos, &Position, sizeof(Vector3)); + std::memcpy(this->_Buffer + nPos + sizeof(Vector3), &Normal, sizeof(Vector3)); + std::memcpy(this->_Buffer + nPos + (sizeof(Vector3) * 2), &Color, sizeof(VertexColor)); + } + + Vertex VertexBuffer::Emplace(Vector3 Position, Vector3 Normal, VertexColor Color) + { + uint64_t nPos = this->_StoreSize; + this->EnsureCapacity((uint32_t)nPos + 1); + + // Copy the values at expected vertex offset + nPos *= this->VertexSize(); + + // Copy them + std::memcpy(this->_Buffer + nPos, &Position, sizeof(Vector3)); + std::memcpy(this->_Buffer + nPos + sizeof(Vector3), &Normal, sizeof(Vector3)); + std::memcpy(this->_Buffer + nPos + (sizeof(Vector3) * 2), &Color, sizeof(VertexColor)); + + // Return vertex controller + return Vertex(this->_Buffer + nPos, this->_MaxInfluence, this->_UVLayers); + } + + void VertexBuffer::EmplaceBack(Vector3 Position, Vector3 Normal, VertexColor Color, Vector2 UVLayer) + { + uint64_t nPos = this->_StoreSize; + this->EnsureCapacity((uint32_t)nPos + 1); + + // Copy the values at expected vertex offset + nPos *= this->VertexSize(); + + // Copy them + std::memcpy(this->_Buffer + nPos, &Position, sizeof(Vector3)); + std::memcpy(this->_Buffer + nPos + sizeof(Vector3), &Normal, sizeof(Vector3)); + std::memcpy(this->_Buffer + nPos + (sizeof(Vector3) * 2), &Color, sizeof(VertexColor)); + std::memcpy(this->_Buffer + nPos + (sizeof(Vector3) * 2) + sizeof(VertexColor), &UVLayer, sizeof(Vector2)); + } + + Vertex VertexBuffer::Emplace(Vector3 Position, Vector3 Normal, VertexColor Color, Vector2 UVLayer) + { + uint64_t nPos = this->_StoreSize; + this->EnsureCapacity((uint32_t)nPos + 1); + + // Copy the values at expected vertex offset + nPos *= this->VertexSize(); + + // Copy them + std::memcpy(this->_Buffer + nPos, &Position, sizeof(Vector3)); + std::memcpy(this->_Buffer + nPos + sizeof(Vector3), &Normal, sizeof(Vector3)); + std::memcpy(this->_Buffer + nPos + (sizeof(Vector3) * 2), &Color, sizeof(VertexColor)); + std::memcpy(this->_Buffer + nPos + (sizeof(Vector3) * 2) + sizeof(VertexColor), &UVLayer, sizeof(Vector2)); + + // Return vertex controller + return Vertex(this->_Buffer + nPos, this->_MaxInfluence, this->_UVLayers); + } + + void VertexBuffer::Clear() + { + if (this->_Buffer) + delete[] this->_Buffer; + + this->_Buffer = nullptr; + this->_BufferSize = 0; + this->_StoreSize = 0; + } + + void VertexBuffer::RemoveAt(uint32_t Index) + { + if (Index >= this->_StoreSize) + return; + + auto vSize = this->VertexSize(); + + this->_StoreSize--; + if (Index < this->_StoreSize) + std::memcpy(this->_Buffer + Index, this->_Buffer + (Index + 1), (this->_StoreSize - Index) * vSize); + + std::memset(&this->_Buffer[this->_StoreSize], 0, vSize); + } + + const uint8_t VertexBuffer::UVLayerCount() const + { + return this->_UVLayers; + } + + const uint8_t VertexBuffer::WeightCount() const + { + return this->_MaxInfluence; + } + + uint32_t VertexBuffer::Count() const + { + return this->_StoreSize; + } + + bool VertexBuffer::Empty() const + { + return (this->_StoreSize == 0); + } + + Vertex VertexBuffer::begin() const noexcept + { + return Vertex(this->_Buffer, this->_MaxInfluence, this->_UVLayers); + } + + Vertex VertexBuffer::end() const noexcept + { + return Vertex(this->_Buffer + (this->_StoreSize * this->VertexSize()), this->_MaxInfluence, this->_UVLayers); + } + + Vertex VertexBuffer::operator[](uint32_t Index) + { + return Vertex(this->_Buffer + (Index * this->VertexSize()), this->_MaxInfluence, this->_UVLayers); + } + + const Vertex VertexBuffer::operator[](uint32_t Index) const + { + return Vertex(this->_Buffer + (Index * this->VertexSize()), this->_MaxInfluence, this->_UVLayers); + } + + void VertexBuffer::EnsureCapacity(uint32_t Capacity) + { + // Ensure that we have a proper buffer size for the string here, this is in units, NOT bytes... + // Check to ensure we aren't wasting our time first... + if (Capacity <= this->_BufferSize) + { + this->_StoreSize = Capacity; + return; + } + + // Pre-calculate the size of a single vertex (Position Normal) (UVLayers) (Weights) (Colors) + auto vSize = this->VertexSize(); + + auto nCapacity = Capacity; + if (nCapacity < 16) + nCapacity = 16; + + if (nCapacity < (this->_BufferSize + (this->_BufferSize / 2))) + nCapacity = (this->_BufferSize + (this->_BufferSize / 2)); + + auto tBuffer = this->_Buffer; + this->_Buffer = new uint8_t[nCapacity * vSize](); + + if (tBuffer) + { + std::memcpy(this->_Buffer, tBuffer, this->_BufferSize * vSize); + delete[] tBuffer; + } + + this->_BufferSize = nCapacity; + this->_StoreSize = Capacity; + } + + uint32_t VertexBuffer::VertexSize() const + { + return (sizeof(Vector3) * 2) + (sizeof(Vector2) * this->_UVLayers) + (sizeof(VertexWeight) * this->_MaxInfluence) + sizeof(VertexColor) + sizeof(uint8_t); + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/VertexBuffer.h b/r5dev/thirdparty/cppnet/cppkore/VertexBuffer.h new file mode 100644 index 00000000..c4302483 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/VertexBuffer.h @@ -0,0 +1,74 @@ +#pragma once + +#include +#include "Vertex.h" + +namespace Assets +{ + using namespace Math; // For the vector classes + + // A vertex buffer used in a 3D mesh. + class VertexBuffer + { + public: + // Initialize a blank vertex buffer. + VertexBuffer(); + // Initialize a vertex buffer with the given max influence and UV layer count. + VertexBuffer(uint8_t MaxInfluence, uint8_t UVLayers); + // Initialize a vertex buffer with an initial size, the given max influence, and UV layer count. + VertexBuffer(uint32_t InitialSize, uint8_t MaxInfluence, uint8_t UVLayers); + + // VertexBuffer copy operator. + VertexBuffer& operator=(const VertexBuffer& Rhs); + + // Destroys all vertex buffer information. + ~VertexBuffer(); + + // Creates a new vertex with the provided position, normal, and color. + void EmplaceBack(Vector3 Position, Vector3 Normal, VertexColor Color); + // Creates a new vertex with the provided position, normal, and color and returns the result. + Vertex Emplace(Vector3 Position, Vector3 Normal, VertexColor Color); + // Creates a new vertex with the provided position, normal, color, and UV layer. + void EmplaceBack(Vector3 Position, Vector3 Normal, VertexColor Color, Vector2 UVLayer); + // Creates a new vertex with the provided position, normal, color, and UV layer and returns the result. + Vertex Emplace(Vector3 Position, Vector3 Normal, VertexColor Color, Vector2 UVLayer); + + // Clears all vertices from the buffer + void Clear(); + // Removes a vertex at the index + void RemoveAt(uint32_t Index); + + // Gets the total UV layer count + const uint8_t UVLayerCount() const; + // Gets the total weight count + const uint8_t WeightCount() const; + + // Returns the count of vertices in the buffer + uint32_t Count() const; + // Returns whether or not the buffer is empty + bool Empty() const; + + // Iterator definitions, for for(& :) loop + Vertex begin() const noexcept; + Vertex end() const noexcept; + + // Array index operators + Vertex operator[](uint32_t Index); + const Vertex operator[](uint32_t Index) const; + + private: + // Internal variables that effect the size of the buffer + uint8_t _MaxInfluence; + uint8_t _UVLayers; + + // Internal variables for the buffer + uint8_t* _Buffer; + uint32_t _BufferSize; + uint32_t _StoreSize; + + // Helper routine to allocate the buffer + void EnsureCapacity(uint32_t Capacity); + // Helper routine to calculate the size of a vertex + uint32_t VertexSize() const; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/View.h b/r5dev/thirdparty/cppnet/cppkore/View.h new file mode 100644 index 00000000..cf2e30fb --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/View.h @@ -0,0 +1,23 @@ +#pragma once + +#include +#include + +namespace Forms +{ + // Specifies how list items are displayed in a ListView control. + enum class View + { + // Each item appears as a full-sized icon with a label below it. + LargeIcon = LVS_ICON, + // Each item appears on a separate line with further information + // about each item in columns. + Details = LVS_REPORT, + // Each item appears as a small icon with a label to its right. + SmallIcon = LVS_SMALLICON, + // Each item appears as a small icon with a label to its right. + List = LVS_LIST, + // Tile view. + Tile = LV_VIEW_TILE + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/WAV.cpp b/r5dev/thirdparty/cppnet/cppkore/WAV.cpp new file mode 100644 index 00000000..ecd47218 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/WAV.cpp @@ -0,0 +1,109 @@ +#include "stdafx.h" +#include "WAV.h" + +namespace Assets +{ + WAVFormat::WAVFormat() + : FrameRate(44100), ChannelsCount(1), BitsPerSample(16), DataEncoding(WAVEncoding::PCM16), DataSize(0) + { + } + + // The maximum size of a WAV header + constexpr static uint32_t MaximumHeaderSize = 0x100; + + // Helper routine to build a WAV header, internal + const static uint32_t BuildWAVHeader(uint8_t* Buffer, const WAVFormat& Format) + { + uint32_t Offset = 4; + + // RIFF + *(uint32_t*)Buffer = 0x46464952; + + // Calculate format buffer size based on encoding + uint32_t WAVHeaderSize = 0; + uint32_t WAVfmtSize = 0; + switch (Format.DataEncoding) + { + case WAVEncoding::PCM16: + case WAVEncoding::FLOAT32: + WAVHeaderSize = 36; + WAVfmtSize = 16; + break; + // TODO: Support other encoding formats... + } + + // BufferSize + *(uint32_t*)(Buffer + Offset) = Format.DataSize + WAVHeaderSize; + Offset += sizeof(uint32_t); + + // 'WAVfmt ' + *(uint64_t*)(Buffer + Offset) = 0x20746D6645564157; + Offset += sizeof(uint64_t); + + // WAVfmtSize + *(uint32_t*)(Buffer + Offset) = WAVfmtSize; + Offset += sizeof(uint32_t); + + // Encoding + *(uint16_t*)(Buffer + Offset) = (uint16_t)Format.DataEncoding; + Offset += sizeof(uint16_t); + + // Channels + *(uint16_t*)(Buffer + Offset) = (uint16_t)Format.ChannelsCount; + Offset += sizeof(uint16_t); + + // FrameRate + *(uint32_t*)(Buffer + Offset) = Format.FrameRate; + Offset += sizeof(uint32_t); + + // AverageBps + *(uint32_t*)(Buffer + Offset) = (Format.FrameRate * (Format.ChannelsCount * (Format.BitsPerSample / 8))); + Offset += sizeof(uint32_t); + + // BlockAlign + *(uint16_t*)(Buffer + Offset) = (uint16_t)(Format.ChannelsCount * (Format.BitsPerSample / 8)); + Offset += sizeof(uint16_t); + + // BitsPerSample + *(uint16_t*)(Buffer + Offset) = (uint16_t)Format.BitsPerSample; + Offset += sizeof(uint16_t); + + // 'data' + *(uint32_t*)(Buffer + Offset) = 0x61746164; + Offset += sizeof(uint32_t); + + // DataSize + *(uint32_t*)(Buffer + Offset) = Format.DataSize; + Offset += sizeof(uint32_t); + + // TODO: Some formats require extra data here... MSADPCM/IMA + + return Offset; + } + + void WAV::WriteWAVHeader(const std::unique_ptr& Stream, const WAVFormat& Format) + { + uint8_t Header[MaximumHeaderSize]; + auto HeaderSize = BuildWAVHeader(Header, Format); + + Stream->Write(Header, 0, HeaderSize); + } + + void WAV::WriteWAVHeader(IO::Stream* Stream, const WAVFormat& Format) + { + uint8_t Header[MaximumHeaderSize]; + auto HeaderSize = BuildWAVHeader(Header, Format); + + Stream->Write(Header, 0, HeaderSize); + } + + void WAV::WriteWAVHeader(uint8_t* Buffer, const WAVFormat& Format, uint32_t& ResultSize) + { + uint8_t Header[MaximumHeaderSize]; + auto HeaderSize = BuildWAVHeader(Header, Format); + + std::memcpy(Buffer, Header, HeaderSize); + + ResultSize = HeaderSize; + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/WAV.h b/r5dev/thirdparty/cppnet/cppkore/WAV.h new file mode 100644 index 00000000..0222fce9 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/WAV.h @@ -0,0 +1,53 @@ +#pragma once + +#include +#include +#include "Stream.h" + +namespace Assets +{ + // The audio encoding format for the WAV file. + enum class WAVEncoding : uint32_t + { + PCM16 = 0x1, + MSADPCM = 0x2, + FLOAT32 = 0x3, + IMA = 0x11, + }; + + // Contains information about the WAV audio format. + struct WAVFormat + { + // The frame/sample rate of this format (44100, 48000, etc) + uint32_t FrameRate; + // The total number of channels + uint32_t ChannelsCount; + // The total number of bits per sample (16 for PCM, 32 for FLOAT32...) + uint32_t BitsPerSample; + + // The data encoding format + WAVEncoding DataEncoding; + // The size of the wav data block + uint32_t DataSize; + + WAVFormat(); + }; + + // A utility class for building WAV assets. + class WAV + { + // Don't initialize this class + WAV() = delete; + ~WAV() = delete; + + public: + + // Serializes a WAV header to the stream. + static void WriteWAVHeader(const std::unique_ptr& Stream, const WAVFormat& Format); + // Serializes a WAV header to the stream. + static void WriteWAVHeader(IO::Stream* Stream, const WAVFormat& Format); + + // Serializes a WAV header to the buffer. + static void WriteWAVHeader(uint8_t* Buffer, const WAVFormat& Format, uint32_t& ResultSize); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/WavefrontOBJ.cpp b/r5dev/thirdparty/cppnet/cppkore/WavefrontOBJ.cpp new file mode 100644 index 00000000..cc6daa5e --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/WavefrontOBJ.cpp @@ -0,0 +1,168 @@ +#include "stdafx.h" +#include "WavefrontOBJ.h" + +#include "File.h" +#include "Path.h" +#include "StreamWriter.h" + +namespace Assets::Exporters +{ + bool WavefrontOBJ::ExportAnimation(const Animation& Animation, const string& Path) + { + return false; + } + + bool WavefrontOBJ::ExportModel(const Model& Model, const string& Path) + { + auto Writer = IO::StreamWriter(IO::File::Create(Path)); + auto MaterialPath = IO::Path::ChangeExtension(Path, ".mtl"); + + Writer.WriteLineFmt("\nmtllib %s\n", (char*)IO::Path::GetFileName(MaterialPath)); + + for (auto& Submesh : Model.Meshes) + { + for (auto& Face : Submesh.Faces) + { + auto& FaceVert1 = Submesh.Vertices[Face[0]].Position(); + auto& FaceVert2 = Submesh.Vertices[Face[1]].Position(); + auto& FaceVert3 = Submesh.Vertices[Face[2]].Position(); + + Writer.WriteLineFmt( + "v %f %f %f\n" + "v %f %f %f\n" + "v %f %f %f", + FaceVert1.X, FaceVert1.Y, FaceVert1.Z, + FaceVert2.X, FaceVert2.Y, FaceVert2.Z, + FaceVert3.X, FaceVert3.Y, FaceVert3.Z + ); + } + } + + for (auto& Submesh : Model.Meshes) + { + for (auto& Face : Submesh.Faces) + { + auto& FaceVert1 = Submesh.Vertices[Face[0]].UVLayers(0); + auto& FaceVert2 = Submesh.Vertices[Face[1]].UVLayers(0); + auto& FaceVert3 = Submesh.Vertices[Face[2]].UVLayers(0); + + Writer.WriteLineFmt( + "vt %f %f\n" + "vt %f %f\n" + "vt %f %f", + FaceVert1.U, (1 - FaceVert1.V), + FaceVert2.U, (1 - FaceVert2.V), + FaceVert3.U, (1 - FaceVert3.V) + ); + } + } + + for (auto& Submesh : Model.Meshes) + { + for (auto& Face : Submesh.Faces) + { + auto& FaceVert1 = Submesh.Vertices[Face[0]].Normal(); + auto& FaceVert2 = Submesh.Vertices[Face[1]].Normal(); + auto& FaceVert3 = Submesh.Vertices[Face[2]].Normal(); + + Writer.WriteLineFmt( + "vn %f %f %f\n" + "vn %f %f %f\n" + "vn %f %f %f", + FaceVert1.X, FaceVert1.Y, FaceVert1.Z, + FaceVert2.X, FaceVert2.Y, FaceVert2.Z, + FaceVert3.X, FaceVert3.Y, FaceVert3.Z + ); + } + } + + uint64_t VertexIndex = 1; + + for (auto& Submesh : Model.Meshes) + { + if (Submesh.MaterialIndices[0] > -1) + { + auto& Material = Model.Materials[Submesh.MaterialIndices[0]]; + + Writer.WriteLineFmt( + "g %s\n" + "usemtl %s", + (char*)Material.Name, + (char*)Material.Name + ); + } + else + { + Writer.WriteLine( + "g default_material\n" + "usemtl default_material" + ); + } + + for (auto& Face : Submesh.Faces) + { + Writer.WriteLineFmt( + "f %d/%d/%d %d/%d/%d %d/%d/%d", + (VertexIndex + 2), (VertexIndex + 2), (VertexIndex + 2), + (VertexIndex + 1), (VertexIndex + 1), (VertexIndex + 1), + VertexIndex, VertexIndex, VertexIndex + ); + + VertexIndex += 3; + } + } + + + auto MatWriter = IO::StreamWriter(IO::File::Create(MaterialPath)); + + for (auto& Material : Model.Materials) + { + MatWriter.WriteLineFmt("newmtl %s", (char*)Material.Name); + + MatWriter.WriteLine( + "illum 4\n" + "Kd 0.00 0.00 0.00\n" + "Ka 0.00 0.00 0.00\n" + "Ks 0.50 0.50 0.50" + ); + + if (Material.Slots.ContainsKey(MaterialSlotType::Albedo)) + MatWriter.WriteLineFmt("map_Kd %s", (char*)Material.Slots[MaterialSlotType::Albedo].first); + else if (Material.Slots.ContainsKey(MaterialSlotType::Diffuse)) + MatWriter.WriteLineFmt("map_Kd %s", (char*)Material.Slots[MaterialSlotType::Diffuse].first); + + if (Material.Slots.ContainsKey(MaterialSlotType::Normal)) + MatWriter.WriteLineFmt("map_bump %s", (char*)Material.Slots[MaterialSlotType::Normal].first); + if (Material.Slots.ContainsKey(MaterialSlotType::Specular)) + MatWriter.WriteLineFmt("map_Ks %s", (char*)Material.Slots[MaterialSlotType::Specular].first); + } + + return true; + } + + imstring WavefrontOBJ::ModelExtension() + { + return ".obj"; + } + + imstring WavefrontOBJ::AnimationExtension() + { + return nullptr; + } + + ExporterScale WavefrontOBJ::ExportScale() + { + // OBJ is considered generic, so we won't enforce a scale constant + return ExporterScale::Default; + } + + bool WavefrontOBJ::SupportsAnimations() + { + return false; + } + + bool WavefrontOBJ::SupportsModels() + { + return true; + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/WavefrontOBJ.h b/r5dev/thirdparty/cppnet/cppkore/WavefrontOBJ.h new file mode 100644 index 00000000..d6be9f17 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/WavefrontOBJ.h @@ -0,0 +1,33 @@ +#pragma once + +#include +#include "Exporter.h" + +namespace Assets::Exporters +{ + // The Wavefront Object exporter + class WavefrontOBJ : public Exporter + { + public: + WavefrontOBJ() = default; + ~WavefrontOBJ() = default; + + // Exports the given animation to the provided path. + virtual bool ExportAnimation(const Animation& Animation, const string& Path); + // Exports the given model to the provided path. + virtual bool ExportModel(const Model& Model, const string& Path); + + // Gets the file extension for this exporters model format. + virtual imstring ModelExtension(); + // Gets the file extension for this exporters animation format. + virtual imstring AnimationExtension(); + + // Gets the required scaling constant for this exporter. + virtual ExporterScale ExportScale(); + + // Gets whether or not the exporter supports animation exporting. + virtual bool SupportsAnimations(); + // Gets whether or not the exporter supports model exporting. + virtual bool SupportsModels(); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/Win32Error.cpp b/r5dev/thirdparty/cppnet/cppkore/Win32Error.cpp new file mode 100644 index 00000000..645a951c --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Win32Error.cpp @@ -0,0 +1,28 @@ +#include "stdafx.h" +#include "Win32Error.h" + +namespace Win32 +{ + std::exception Win32Error::SystemError(DWORD ErrorCode) + { + char MessageBuffer[1024]; + FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, NULL, ErrorCode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), MessageBuffer, 1024, NULL); + + return std::exception(MessageBuffer); + } + + std::exception Win32Error::RegSubKeyMissing() + { + return std::exception("The subkey was not found"); + } + + std::exception Win32Error::RegSubKeyMalformed() + { + return std::exception("Malformed subkey detected"); + } + + std::exception Win32Error::RegSubKeyChildren() + { + return std::exception("The subkey contains nested children"); + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/Win32Error.h b/r5dev/thirdparty/cppnet/cppkore/Win32Error.h new file mode 100644 index 00000000..b7fc61e9 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/Win32Error.h @@ -0,0 +1,20 @@ +#pragma once + +#include +#include + +namespace Win32 +{ + class Win32Error + { + public: + // Sets up a system formatted error code + static std::exception SystemError(DWORD ErrorCode); + // Occurs when a subkey is missing + static std::exception RegSubKeyMissing(); + // Occurs when a subkey is malformed + static std::exception RegSubKeyMalformed(); + // Occurs when a subkey has nested children + static std::exception RegSubKeyChildren(); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/WraithTheme.cpp b/r5dev/thirdparty/cppnet/cppkore/WraithTheme.cpp new file mode 100644 index 00000000..26412f19 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/WraithTheme.cpp @@ -0,0 +1,472 @@ +#include "stdafx.h" +#include "WraithTheme.h" +#include "MessageBox.h" +#include "CheckBoxImage.h" + +namespace Themes +{ + // Constants for brushes + const static auto BorderBrush = Drawing::Color(3, 169, 244); + const static auto DisabledBorderBrush = Drawing::Color(160, 160, 160); + + const static auto BackgroundBrush = Drawing::Color(33, 33, 33); + + const static auto BackgroundGrad1 = Drawing::Color(40, 40, 40); + const static auto BackgroundGrad2 = Drawing::Color(30, 30, 30); + + const static auto BackgroundOverGrad1 = Drawing::Color(50, 50, 50); + const static auto BackgroundOverGrad2 = Drawing::Color(40, 40, 40); + + const static auto TextEnabledBrush = Drawing::Color(Drawing::Color::White); + const static auto TextDisabledBrush = Drawing::Color(Drawing::Color::Red); + + const static auto ProgressGrad1 = Drawing::Color(3, 169, 244); + const static auto ProgressGrad2 = Drawing::Color(0, 130, 220); + + const static auto HeaderGrad1 = Drawing::Color(50, 50, 50); + const static auto HeaderGrad2 = Drawing::Color(42, 42, 42); + + // Constants for images + static Drawing::Image* CheckBoxImage = nullptr; + + WraithTheme::WraithTheme() + : UIX::UIXRenderer() + { + CheckBoxImage = Drawing::ImageFromTgaData(CheckBoxImage_Src, sizeof(CheckBoxImage_Src)); + + // Change the message box colors to represent our theme + Forms::MessageBox::SetMessageBoxColors(Drawing::Color::White, Drawing::Color(30, 30, 30), Drawing::Color(50, 50, 50)); + } + + WraithTheme::~WraithTheme() + { + delete CheckBoxImage; + } + + void WraithTheme::RenderControlBorder(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIX::UIXRenderState State) const + { + Drawing::Rectangle Rect(Ctrl->ClientRectangle()); + + // + // Override for textbox rendering due to a bug in the layout rect + // + + if (Ctrl->GetType() == Forms::ControlTypes::TextBox) + { + Rect.Width = Ctrl->Size().Width; + Rect.Height = Ctrl->Size().Height; + } + + Rect.Width--; + Rect.Height--; + + auto Brush = std::make_unique((State == UIX::UIXRenderState::Disabled) ? DisabledBorderBrush : BorderBrush); + + Drawing::Pen Pen(Brush.get()); + + EventArgs->Graphics->DrawRectangle(&Pen, Rect); + } + + void WraithTheme::RenderControlBackground(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIX::UIXRenderState State) const + { + Drawing::Rectangle Rect(Ctrl->ClientRectangle()); + + auto brush = Drawing::SolidBrush(BackgroundBrush); + + EventArgs->Graphics->FillRectangle(&brush, Rect); + } + + void WraithTheme::RenderControlButtonBackground(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIX::UIXRenderState State) const + { + Drawing::Rectangle Rect(Ctrl->ClientRectangle()); + + std::unique_ptr DrawBrush = nullptr; + + switch (State) + { + case UIX::UIXRenderState::Default: + DrawBrush = std::make_unique(Rect, BackgroundGrad1, BackgroundGrad2, 90.f); + break; + case UIX::UIXRenderState::Disabled: + DrawBrush = std::make_unique(Rect, BackgroundGrad1, BackgroundGrad2, 90.f); + break; + case UIX::UIXRenderState::MouseOver: + DrawBrush = std::make_unique(Rect, BackgroundOverGrad1, BackgroundOverGrad2, 90.f); + break; + case UIX::UIXRenderState::MouseDown: + DrawBrush = std::make_unique(Rect, BackgroundGrad1, BackgroundGrad2, 270.f); + break; + } + + EventArgs->Graphics->FillRectangle(DrawBrush.get(), Rect); + } + + void WraithTheme::RenderControlText(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIX::UIXRenderState State, Drawing::Rectangle LayoutRect, Drawing::ContentAlignment Alignment) const + { + // Fetch color from foreground + Drawing::SolidBrush TextBrush((State == UIX::UIXRenderState::Disabled) ? TextDisabledBrush : TextEnabledBrush); + + // Fetch control text and font handle + auto Text = Ctrl->Text().ToWString(); + auto Font = Ctrl->GetFont()->GetFont(); + + // Setup string formatting + Gdiplus::StringFormat StrFmt; + + // Handle horizontal alignment + if (((int)Alignment & (int)Drawing::AnyLeftAlign) != 0) + StrFmt.SetAlignment(Gdiplus::StringAlignment::StringAlignmentNear); + else if (((int)Alignment & (int)Drawing::AnyRightAlign) != 0) + StrFmt.SetAlignment(Gdiplus::StringAlignment::StringAlignmentFar); + else + StrFmt.SetAlignment(Gdiplus::StringAlignment::StringAlignmentCenter); + + // Handle vertical alignment + if (((int)Alignment & (int)Drawing::AnyTopAlign) != 0) + StrFmt.SetLineAlignment(Gdiplus::StringAlignment::StringAlignmentNear); + else if (((int)Alignment & (int)Drawing::AnyBottomAlign) != 0) + StrFmt.SetLineAlignment(Gdiplus::StringAlignment::StringAlignmentFar); + else + StrFmt.SetLineAlignment(Gdiplus::StringAlignment::StringAlignmentCenter); + + // Build text layout rect + Gdiplus::RectF TextLayoutRect((float)LayoutRect.X, (float)LayoutRect.Y, (float)LayoutRect.Width, (float)LayoutRect.Height); + + // Render text to the surface + EventArgs->Graphics->DrawString((wchar_t*)Text, Text.Length(), Font.get(), TextLayoutRect, &StrFmt, &TextBrush); + } + + void WraithTheme::RenderControlProgressFill(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIX::UIXRenderState State, uint32_t Progress) const + { + // Bring client rect to stack + Drawing::Rectangle Rect(Ctrl->ClientRectangle()); + + // Generate the proper gradient if enabled/disabled + Drawing::LinearGradientBrush FillBrush(Rect, ProgressGrad1, ProgressGrad2, 90.f); + + // Render the fill to surface + EventArgs->Graphics->FillRectangle(&FillBrush, Gdiplus::RectF(2, 2, (Rect.Width - 4.f) * (Progress / 100.0f), Rect.Height - 4.f)); + } + + void WraithTheme::RenderControlGlyph(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIX::UIXRenderState State) const + { + // Bring client rect to stack + Drawing::Rectangle Rect(Ctrl->ClientRectangle()); + + // Create Brush + Drawing::SolidBrush FillBrush((State == UIX::UIXRenderState::Disabled) ? DisabledBorderBrush : BorderBrush); + + // It's already setup this way + Rect.Width--; + Rect.Height--; + + // Ensure smooth glyph + EventArgs->Graphics->SetSmoothingMode(Gdiplus::SmoothingMode::SmoothingModeAntiAlias); + + Gdiplus::GraphicsPath Path; + Drawing::Rectangle RectCheck(Rect.Width - 18, 0, 18, Rect.Height - 1); + + // Rotate the glyph + EventArgs->Graphics->TranslateTransform(RectCheck.X + RectCheck.Width / 2.f, RectCheck.Y + RectCheck.Height / 2.f); + + // Draw the triangle + Path.AddLine(Drawing::PointF(-6 / 2.0f, -3 / 2.0f), Drawing::PointF(6 / 2.0f, -3 / 2.0f)); + Path.AddLine(Drawing::PointF(6 / 2.0f, -3 / 2.0f), Drawing::PointF(0, 6 / 2.0f)); + Path.CloseFigure(); + + // Reset rotation + EventArgs->Graphics->RotateTransform(0); + + // Render the glyph to surface + EventArgs->Graphics->FillPath(&FillBrush, &Path); + } + + void WraithTheme::RenderControlCheckBoxBorder(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIX::UIXRenderState State) const + { + Drawing::Rectangle Rect(Ctrl->ClientRectangle()); + + // Create the border brush + auto brush = Drawing::SolidBrush((State == UIX::UIXRenderState::Disabled) ? DisabledBorderBrush : BorderBrush); + Drawing::Pen Pen(&brush); + + // Calculate box sizing + Drawing::Rectangle BoxRect(0, 0, Rect.Height - 1, Rect.Height - 1); + Drawing::Rectangle FillRect(1, 1, Rect.Height - 2, Rect.Height - 2); + + // Create the fill brush + std::unique_ptr FillBrush; + + // Change based on state + switch (State) + { + case UIX::UIXRenderState::Disabled: + FillBrush = std::make_unique(FillRect, DisabledBorderBrush, DisabledBorderBrush, 90.f); + break; + case UIX::UIXRenderState::Default: + FillBrush = std::make_unique(FillRect, BackgroundGrad1, BackgroundGrad2, 90.f); + break; + case UIX::UIXRenderState::MouseOver: + FillBrush = std::make_unique(FillRect, BackgroundOverGrad1, BackgroundOverGrad2, 90.f); + break; + case UIX::UIXRenderState::Selected: + FillBrush = std::make_unique(FillRect, ProgressGrad1, ProgressGrad2, 90.f); + break; + } + + // Render the boxes to surface + EventArgs->Graphics->FillRectangle(FillBrush.get(), FillRect); + EventArgs->Graphics->DrawRectangle(&Pen, BoxRect); + } + + void WraithTheme::RenderControlCheckBoxCheck(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIX::UIXRenderState State) const + { + Drawing::Rectangle Rect(Ctrl->ClientRectangle()); + Drawing::Rectangle CheckRect(((Rect.Height - 12) / 2) + 1, (Rect.Height - 12) / 2, 12, 12); + + // Render the image to the surface + if (State == UIX::UIXRenderState::Selected) + EventArgs->Graphics->DrawImage(CheckBoxImage, CheckRect); + } + + void WraithTheme::RenderControlRadioBorder(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIX::UIXRenderState State) const + { + Drawing::Rectangle Rect(Ctrl->ClientRectangle()); + + // Determine which fill to use + auto brush = Drawing::SolidBrush((State == UIX::UIXRenderState::Disabled) ? DisabledBorderBrush : BorderBrush); + Drawing::Pen Pen(&brush); + + // Adjust for overhang + Rect.Width--; + Rect.Height--; + + // Render the circle to surface + auto SmMode = EventArgs->Graphics->GetSmoothingMode(); + { + EventArgs->Graphics->SetSmoothingMode(Gdiplus::SmoothingMode::SmoothingModeAntiAlias); + EventArgs->Graphics->DrawEllipse(&Pen, Drawing::Rectangle(0, 0, Rect.Height, Rect.Height)); + } + EventArgs->Graphics->SetSmoothingMode(SmMode); + } + + void WraithTheme::RenderControlRadioCheck(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIX::UIXRenderState State) const + { + Drawing::Rectangle Rect(Ctrl->ClientRectangle()); + Drawing::Rectangle FillRect(1, 1, Rect.Height - 3, Rect.Height - 3); + + // Create the fill brush + std::unique_ptr FillBrush; + + // Change based on state + switch (State) + { + case UIX::UIXRenderState::Disabled: + FillBrush = std::make_unique(FillRect, DisabledBorderBrush, DisabledBorderBrush, 90.f); + FillRect = { 3, 3, (INT)Rect.Height - 7, (INT)Rect.Height - 7 }; + break; + case UIX::UIXRenderState::Default: + FillBrush = std::make_unique(FillRect, BackgroundGrad1, BackgroundGrad2, 90.f); + break; + case UIX::UIXRenderState::MouseOver: + FillBrush = std::make_unique(FillRect, BackgroundOverGrad1, BackgroundOverGrad2, 90.f); + break; + case UIX::UIXRenderState::Selected: + FillBrush = std::make_unique(FillRect, ProgressGrad1, ProgressGrad2, 90.f); + FillRect = { 3, 3, (INT)Rect.Height - 7, (INT)Rect.Height - 7 }; + break; + } + + // Render the state + auto SmMode = EventArgs->Graphics->GetSmoothingMode(); + { + EventArgs->Graphics->SetSmoothingMode(Gdiplus::SmoothingMode::SmoothingModeAntiAlias); + EventArgs->Graphics->FillEllipse(FillBrush.get(), FillRect); + } + EventArgs->Graphics->SetSmoothingMode(SmMode); + } + + void WraithTheme::RenderControlGroupBox(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIX::UIXRenderState State) const + { + Drawing::Rectangle Rect(Ctrl->ClientRectangle()); + + Drawing::SolidBrush BackBrush(BackgroundBrush); + Drawing::SolidBrush TextBrush((State == UIX::UIXRenderState::Disabled) ? TextDisabledBrush : TextEnabledBrush); + + EventArgs->Graphics->FillRectangle(&BackBrush, Rect); + + auto Text = Ctrl->Text().ToWString(); + auto Font = Ctrl->GetFont()->GetFont(); + + Gdiplus::RectF TextLayoutRect(0.0f, 0.0f, (float)Rect.Width, (float)Rect.Height); + Gdiplus::RectF TextSize; + + EventArgs->Graphics->MeasureString((wchar_t*)Text, Text.Length(), Font.get(), TextLayoutRect, &TextSize); + EventArgs->Graphics->DrawString((wchar_t*)Text, Text.Length(), Font.get(), Gdiplus::PointF(12, 0), &TextBrush); + + Drawing::PointF Lines[] = + { + // Top-left + {0, TextSize.Height / 2.f}, + {12, TextSize.Height / 2.f}, + // Left + {0, TextSize.Height / 2.f}, + {0, Rect.Height - 1.f}, + // Bottom + {0, Rect.Height - 1.f}, + {Rect.Width - 1.f, Rect.Height - 1.f}, + // Right + {Rect.Width - 1.f, Rect.Height - 1.f}, + {Rect.Width - 1.f, TextSize.Height / 2.f}, + // Top-right + {TextSize.Width + 11.f, TextSize.Height / 2.f}, + {Rect.Width - 1.f, TextSize.Height / 2.f} + }; + + auto pen = Drawing::Pen(&TextBrush); + EventArgs->Graphics->DrawLines(&pen, &Lines[0], _countof(Lines)); + } + + void WraithTheme::RenderControlListColumnHeader(const std::unique_ptr& EventArgs, Forms::Control* Ctrl) const + { + // Fetch color from foreground + Drawing::SolidBrush TextBrush(TextEnabledBrush); + Drawing::LinearGradientBrush BackBrush(EventArgs->Bounds, HeaderGrad1, HeaderGrad2, 90.f); + + // Fetch control text and font handle + auto Text = EventArgs->Header->Text().ToWString(); + auto Font = Ctrl->GetFont()->GetFont(); + + // Setup string formatting + Gdiplus::StringFormat StrFmt; + StrFmt.SetAlignment(Gdiplus::StringAlignment::StringAlignmentNear); + StrFmt.SetLineAlignment(Gdiplus::StringAlignment::StringAlignmentCenter); + StrFmt.SetTrimming(Gdiplus::StringTrimming::StringTrimmingEllipsisCharacter); + + // Build text layout rect + Gdiplus::RectF TextLayoutRect((float)EventArgs->Bounds.X + 3, (float)EventArgs->Bounds.Y, (float)EventArgs->Bounds.Width - 6, (float)EventArgs->Bounds.Height); + Gdiplus::RectF TextSize; + + EventArgs->Graphics->MeasureString((wchar_t*)Text, Text.Length(), Font.get(), Drawing::PointF(0, 0), &TextSize); + + TextLayoutRect.Height = TextSize.Height - 1; + TextLayoutRect.Y = (TextLayoutRect.Y) + (TextSize.Height / 2.f); + TextLayoutRect.Y--; // There is always one overlap pixel at bottom/right + + // Render to the surface + //EventArgs->Graphics->FillRectangle(&BackBrush, EventArgs->Bounds); + Drawing::Rectangle NewBounds(EventArgs->Bounds); + + NewBounds.Inflate(0, -1); + NewBounds.Width -= 2; + + auto SmMode = EventArgs->Graphics->GetSmoothingMode(); + { + EventArgs->Graphics->SetSmoothingMode(Gdiplus::SmoothingMode::SmoothingModeAntiAlias); + Drawing::FillRoundRectangle(EventArgs->Graphics.get(), &BackBrush, NewBounds, 4); + } + EventArgs->Graphics->SetSmoothingMode(SmMode); + + EventArgs->Graphics->DrawString((wchar_t*)Text, Text.Length(), Font.get(), TextLayoutRect, &StrFmt, &TextBrush); + //EventArgs->Graphics->DrawLine(&Drawing::Pen(&Drawing::SolidBrush(Drawing::Color::Black)), Drawing::Point(EventArgs->Bounds.X, EventArgs->Bounds.Height - 1), Drawing::Point(EventArgs->Bounds.X + EventArgs->Bounds.Width, EventArgs->Bounds.Height - 1)); + } + + void WraithTheme::RenderControlListHeader(const std::unique_ptr& EventArgs) const + { + auto brush = Drawing::SolidBrush(BackgroundBrush); + EventArgs->Graphics->FillRectangle(&brush, EventArgs->Region()); + Drawing::LinearGradientBrush BackBrush(EventArgs->Region(), HeaderGrad1, HeaderGrad2, 90.f); + Drawing::Rectangle NewBounds(EventArgs->Region()); + + NewBounds.Inflate(0, -1); + NewBounds.Width -= 2; + + auto SmMode = EventArgs->Graphics->GetSmoothingMode(); + { + EventArgs->Graphics->SetSmoothingMode(Gdiplus::SmoothingMode::SmoothingModeAntiAlias); + Drawing::FillRoundRectangle(EventArgs->Graphics.get(), &BackBrush, NewBounds, 4); + } + EventArgs->Graphics->SetSmoothingMode(SmMode); + } + + void WraithTheme::RenderControlListItem(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, Drawing::Rectangle SubItemBounds) const + { + // Fetch the state because we are owner draw + auto State = SendMessageA(Ctrl->GetHandle(), LVM_GETITEMSTATE, (WPARAM)EventArgs->ItemIndex, (LPARAM)LVIS_SELECTED); + + // Fetch color from style + Drawing::SolidBrush TextBrush((State == LVIS_SELECTED) ? Drawing::Color::White : EventArgs->Style.ForeColor); + Drawing::SolidBrush BackBrush((State == LVIS_SELECTED) ? BorderBrush : EventArgs->Style.BackColor); + + // Fetch control text and font handle + auto Text = EventArgs->Text.ToWString(); + auto Font = Ctrl->GetFont()->GetFont(); + + // Setup string formatting + Gdiplus::StringFormat StrFmt; + StrFmt.SetAlignment(Gdiplus::StringAlignment::StringAlignmentNear); + StrFmt.SetLineAlignment(Gdiplus::StringAlignment::StringAlignmentCenter); + StrFmt.SetTrimming(Gdiplus::StringTrimming::StringTrimmingEllipsisCharacter); + StrFmt.SetFormatFlags(Gdiplus::StringFormatFlags::StringFormatFlagsNoWrap); + + // Build text layout rect + Gdiplus::RectF TextLayoutRect((float)SubItemBounds.X, (float)SubItemBounds.Y, (float)SubItemBounds.Width, (float)SubItemBounds.Height); + Gdiplus::RectF TextSize; + + EventArgs->Graphics->MeasureString((wchar_t*)Text, Text.Length(), Font.get(), Drawing::PointF(0, 0), &TextSize); + + TextLayoutRect.Height = TextSize.Height; + TextLayoutRect.Y = (TextLayoutRect.Y) + ((SubItemBounds.Height / 2.f) - (TextSize.Height / 2.f)); + + EventArgs->Graphics->FillRectangle(&BackBrush, SubItemBounds); + EventArgs->Graphics->DrawString((wchar_t*)Text, Text.Length(), Font.get(), TextLayoutRect, &StrFmt, &TextBrush); + } + + void WraithTheme::RenderControlListSubItem(const std::unique_ptr& EventArgs, Forms::Control* Ctrl) const + { + // Use stock bounds, subitems are valid + Drawing::Rectangle SubItemBounds(EventArgs->Bounds); + + // Fetch the state because we are owner draw + auto State = SendMessageA(Ctrl->GetHandle(), LVM_GETITEMSTATE, (WPARAM)EventArgs->ItemIndex, (LPARAM)LVIS_SELECTED); + + // Fetch color from style + Drawing::SolidBrush TextBrush((State == LVIS_SELECTED) ? Drawing::Color::White : EventArgs->Style.ForeColor); + Drawing::SolidBrush BackBrush((State == LVIS_SELECTED) ? BorderBrush : EventArgs->Style.BackColor); + + // Fetch control text and font handle + auto Text = EventArgs->Text.ToWString(); + auto Font = Ctrl->GetFont()->GetFont(); + + // Setup string formatting + Gdiplus::StringFormat StrFmt; + StrFmt.SetAlignment(Gdiplus::StringAlignment::StringAlignmentNear); + StrFmt.SetLineAlignment(Gdiplus::StringAlignment::StringAlignmentCenter); + StrFmt.SetTrimming(Gdiplus::StringTrimming::StringTrimmingEllipsisCharacter); + StrFmt.SetFormatFlags(Gdiplus::StringFormatFlags::StringFormatFlagsNoWrap); + + // Build text layout rect + Gdiplus::RectF TextLayoutRect((float)SubItemBounds.X, (float)SubItemBounds.Y, (float)SubItemBounds.Width, (float)SubItemBounds.Height); + Gdiplus::RectF TextSize; + + EventArgs->Graphics->MeasureString((wchar_t*)Text, Text.Length(), Font.get(), Drawing::PointF(0, 0), &TextSize); + + TextLayoutRect.Height = TextSize.Height; + TextLayoutRect.Y = (TextLayoutRect.Y) + ((SubItemBounds.Height / 2.f) - (TextSize.Height / 2.f)); + + EventArgs->Graphics->FillRectangle(&BackBrush, SubItemBounds); + EventArgs->Graphics->DrawString((wchar_t*)Text, Text.Length(), Font.get(), TextLayoutRect, &StrFmt, &TextBrush); + } + + Drawing::Color WraithTheme::GetRenderColor(UIX::UIXRenderColor Color) const + { + switch (Color) + { + case UIX::UIXRenderColor::TextDefault: + return TextEnabledBrush; + case UIX::UIXRenderColor::BackgroundDefault: + return BackgroundBrush; + default: + return Drawing::Color(); + } + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/WraithTheme.h b/r5dev/thirdparty/cppnet/cppkore/WraithTheme.h new file mode 100644 index 00000000..10ac80cd --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/WraithTheme.h @@ -0,0 +1,39 @@ +#pragma once + +#include +#include "DrawingBase.h" +#include "ContentAlignment.h" +#include "UIXRenderer.h" + +namespace Themes +{ + class WraithTheme : public UIX::UIXRenderer + { + public: + WraithTheme(); + virtual ~WraithTheme(); + + private: + // Inherited via UIXRenderer + virtual void RenderControlBorder(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIX::UIXRenderState State) const override; + virtual void RenderControlBackground(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIX::UIXRenderState State) const override; + virtual void RenderControlButtonBackground(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIX::UIXRenderState State) const override; + virtual void RenderControlText(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIX::UIXRenderState State, Drawing::Rectangle LayoutRect, Drawing::ContentAlignment Alignment) const override; + virtual void RenderControlProgressFill(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIX::UIXRenderState State, uint32_t Progress) const override; + virtual void RenderControlGlyph(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIX::UIXRenderState State) const override; + virtual void RenderControlCheckBoxBorder(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIX::UIXRenderState State) const override; + virtual void RenderControlCheckBoxCheck(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIX::UIXRenderState State) const override; + virtual void RenderControlRadioBorder(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIX::UIXRenderState State) const override; + virtual void RenderControlRadioCheck(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIX::UIXRenderState State) const override; + virtual void RenderControlGroupBox(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, UIX::UIXRenderState State) const override; + + // Inherited via UIXRenderer + virtual void RenderControlListHeader(const std::unique_ptr& EventArgs) const override; + virtual void RenderControlListColumnHeader(const std::unique_ptr& EventArgs, Forms::Control* Ctrl) const override; + virtual void RenderControlListItem(const std::unique_ptr& EventArgs, Forms::Control* Ctrl, Drawing::Rectangle SubItemBounds) const override; + virtual void RenderControlListSubItem(const std::unique_ptr& EventArgs, Forms::Control* Ctrl) const override; + + // Inherited via UIXRenderer + virtual Drawing::Color GetRenderColor(UIX::UIXRenderColor Color) const override; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/XNALaraAscii.cpp b/r5dev/thirdparty/cppnet/cppkore/XNALaraAscii.cpp new file mode 100644 index 00000000..f8e517a6 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/XNALaraAscii.cpp @@ -0,0 +1,128 @@ +#include "stdafx.h" +#include "XNALaraAscii.h" + +#include "File.h" +#include "Path.h" +#include "StreamWriter.h" + +namespace Assets::Exporters +{ + bool XNALaraAscii::ExportAnimation(const Animation& Animation, const string& Path) + { + return false; + } + + bool XNALaraAscii::ExportModel(const Model& Model, const string& Path) + { + auto Writer = IO::StreamWriter(IO::File::Create(Path)); + + Writer.WriteLineFmt("%d", Model.Bones.Count()); + + for (auto& Bone : Model.Bones) + { + Writer.WriteLineFmt( + "%s\n" + "%d\n" + "%f %f %f", + (char*)Bone.Name(), + Bone.Parent(), + Bone.GlobalPosition().X, Bone.GlobalPosition().Y, Bone.GlobalPosition().Z + ); + } + + Writer.WriteLineFmt("%d", Model.Meshes.Count()); + + uint32_t SubmeshIndex = 0; + + for (auto& Submesh : Model.Meshes) + { + Writer.WriteLineFmt( + "KoreMesh%02d\n" + "%d\n" + "1", + SubmeshIndex, + Submesh.Vertices.UVLayerCount() + ); + + Writer.WriteLineFmt( + "%s\n" + "0\n" + "%d", + Submesh.MaterialIndices[0] > -1 ? (char*)Model.Materials[Submesh.MaterialIndices[0]].Name : "default_material", + Submesh.Vertices.Count() + ); + + for (auto& Vertex : Submesh.Vertices) + { + auto& Position = Vertex.Position(); + auto& Normal = Vertex.Normal(); + auto& Color = Vertex.Color(); + + Writer.WriteLineFmt( + "%f %f %f\n" + "%f %f %f\n" + "%d %d %d %d", + Position.X, Position.Y, Position.Z, + Normal.X, Normal.Y, Normal.Z, + Color[0], Color[1], Color[2], Color[3] + ); + + for (uint8_t i = 0; i < Vertex.UVLayerCount(); i++) + Writer.WriteLineFmt("%f %f", Vertex.UVLayers(i).U, Vertex.UVLayers(i).V); + + uint32_t Bones[] = { 0, 0, 0, 0 }; + float Values[] = { 0.f, 0.f, 0.f, 0.f }; + + for (uint8_t i = 0; i < std::min(Vertex.WeightCount(), 4); i++) + { + auto& Weight = Vertex.Weights(i); + + Bones[i] = Weight.Bone; + Values[i] = Weight.Value; + } + + Writer.WriteLineFmt( + "%d %d %d %d\n" + "%f %f %f %f", + Bones[0], Bones[1], Bones[2], Bones[3], + Values[0], Values[1], Values[2], Values[3] + ); + } + + Writer.WriteLineFmt("%d", Submesh.Faces.Count()); + + for (auto& Face : Submesh.Faces) + Writer.WriteLineFmt("%d %d %d", Face[0], Face[1], Face[2]); + + SubmeshIndex++; + } + + return true; + } + + imstring XNALaraAscii::ModelExtension() + { + return ".mesh.ascii"; + } + + imstring XNALaraAscii::AnimationExtension() + { + return nullptr; + } + + ExporterScale XNALaraAscii::ExportScale() + { + // Evaluate whether or not XNALara needs a scale constant. + return ExporterScale::Default; + } + + bool XNALaraAscii::SupportsAnimations() + { + return false; + } + + bool XNALaraAscii::SupportsModels() + { + return true; + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/XNALaraAscii.h b/r5dev/thirdparty/cppnet/cppkore/XNALaraAscii.h new file mode 100644 index 00000000..fbeeaba1 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/XNALaraAscii.h @@ -0,0 +1,33 @@ +#pragma once + +#include +#include "Exporter.h" + +namespace Assets::Exporters +{ + // The XNALara mesh ascii exporter + class XNALaraAscii : public Exporter + { + public: + XNALaraAscii() = default; + ~XNALaraAscii() = default; + + // Exports the given animation to the provided path. + virtual bool ExportAnimation(const Animation& Animation, const string& Path); + // Exports the given model to the provided path. + virtual bool ExportModel(const Model& Model, const string& Path); + + // Gets the file extension for this exporters model format. + virtual imstring ModelExtension(); + // Gets the file extension for this exporters animation format. + virtual imstring AnimationExtension(); + + // Gets the required scaling constant for this exporter. + virtual ExporterScale ExportScale(); + + // Gets whether or not the exporter supports animation exporting. + virtual bool SupportsAnimations(); + // Gets whether or not the exporter supports model exporting. + virtual bool SupportsModels(); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/XNALaraBinary.cpp b/r5dev/thirdparty/cppnet/cppkore/XNALaraBinary.cpp new file mode 100644 index 00000000..aa37fb76 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/XNALaraBinary.cpp @@ -0,0 +1,107 @@ +#include "stdafx.h" +#include "XNALaraBinary.h" + +#include "File.h" +#include "Path.h" +#include "BinaryWriter.h" + +namespace Assets::Exporters +{ + bool XNALaraBinary::ExportAnimation(const Animation& Animation, const string& Path) + { + return false; + } + + bool XNALaraBinary::ExportModel(const Model& Model, const string& Path) + { + auto Writer = IO::BinaryWriter(IO::File::Create(Path)); + + Writer.Write(Model.Bones.Count()); + + for (auto& Bone : Model.Bones) + { + Writer.WriteNetString(Bone.Name()); + Writer.Write((int16_t)Bone.Parent()); + Writer.Write(Bone.GlobalPosition()); + } + + Writer.Write(Model.Meshes.Count()); + + uint32_t SubmeshIndex = 0; + + for (auto& Submesh : Model.Meshes) + { + Writer.WriteNetString(string::Format("KoreMesh%02d", SubmeshIndex)); + Writer.Write(Submesh.Vertices.UVLayerCount()); + Writer.Write(Submesh.Vertices.UVLayerCount()); + + for (uint8_t i = 0; i < Submesh.Vertices.UVLayerCount(); i++) + { + Writer.WriteNetString(Submesh.MaterialIndices[i] > -1 ? Model.Materials[Submesh.MaterialIndices[i]].Name : string("default_material")); + Writer.Write(i); + } + + Writer.Write(Submesh.Vertices.Count()); + + for (auto& Vertex : Submesh.Vertices) + { + Writer.Write(Vertex.Position()); + Writer.Write(Vertex.Normal()); + Writer.Write(&Vertex.Color()[0], 0, sizeof(uint8_t) * 4); + + for (uint8_t i = 0; i < Vertex.UVLayerCount(); i++) + Writer.Write(Vertex.UVLayers(i)); + + for (uint8_t i = 0; i < Vertex.UVLayerCount(); i++) + Writer.Write({ 0, 0, 0, 0 }); + + uint16_t Bones[] = { 0, 0, 0, 0 }; + float Values[] = { 0.f, 0.f, 0.f, 0.f }; + + for (uint8_t i = 0; i < std::min(Vertex.WeightCount(), 4); i++) + { + Bones[i] = Vertex.Weights(i).Bone; + Values[i] = Vertex.Weights(i).Value; + } + + Writer.Write((uint8_t*)&Bones[0], 0, sizeof(uint16_t) * 4); + Writer.Write((uint8_t*)&Values[0], 0, sizeof(float) * 4); + } + + Writer.Write(Submesh.Faces.Count()); + + for (auto& Face : Submesh.Faces) + Writer.Write((uint8_t*)&Face[0], 0, sizeof(uint32_t) * 3); + + SubmeshIndex++; + } + + return true; + } + + imstring XNALaraBinary::ModelExtension() + { + return ".mesh"; + } + + imstring XNALaraBinary::AnimationExtension() + { + return nullptr; + } + + ExporterScale XNALaraBinary::ExportScale() + { + // Evaluate whether or not we need a scale constant. + return ExporterScale::Default; + } + + bool XNALaraBinary::SupportsAnimations() + { + return false; + } + + bool XNALaraBinary::SupportsModels() + { + return true; + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/XNALaraBinary.h b/r5dev/thirdparty/cppnet/cppkore/XNALaraBinary.h new file mode 100644 index 00000000..87c9f809 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/XNALaraBinary.h @@ -0,0 +1,33 @@ +#pragma once + +#include +#include "Exporter.h" + +namespace Assets::Exporters +{ + // The XNALara binary exporter + class XNALaraBinary : public Exporter + { + public: + XNALaraBinary() = default; + ~XNALaraBinary() = default; + + // Exports the given animation to the provided path. + virtual bool ExportAnimation(const Animation& Animation, const string& Path); + // Exports the given model to the provided path. + virtual bool ExportModel(const Model& Model, const string& Path); + + // Gets the file extension for this exporters model format. + virtual imstring ModelExtension(); + // Gets the file extension for this exporters animation format. + virtual imstring AnimationExtension(); + + // Gets the required scaling constant for this exporter. + virtual ExporterScale ExportScale(); + + // Gets whether or not the exporter supports animation exporting. + virtual bool SupportsAnimations(); + // Gets whether or not the exporter supports model exporting. + virtual bool SupportsModels(); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/XXHash.cpp b/r5dev/thirdparty/cppnet/cppkore/XXHash.cpp new file mode 100644 index 00000000..b49c57aa --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/XXHash.cpp @@ -0,0 +1,26 @@ +#include "stdafx.h" +#include "XXHash.h" + +#include "..\cppkore_incl\LZ4_XXHash\xxhash.h" + +#if _WIN64 +#pragma comment(lib, "..\\cppkore_libs\\LZ4_XXHash\\liblz4_static_64.lib") +#else +#pragma comment(lib, "..\\cppkore_libs\\LZ4_XXHash\\liblz4_static_32.lib") +#endif + +namespace Hashing +{ + uint64_t XXHash::HashString(const string& Input, XXHashVersion Version, uint64_t Seed) + { + return ComputeHash((uint8_t*)(char*)Input, 0, Input.Length(), Version, Seed); + } + + uint64_t XXHash::ComputeHash(uint8_t* Input, uint64_t InputOffset, uint64_t InputLength, XXHashVersion Version, uint64_t Seed) + { + if (Version == XXHashVersion::XX64) + return XXH64(Input + InputOffset, (size_t)InputLength, (uint64_t)Seed); + else + return XXH32(Input + InputOffset, (size_t)InputLength, (uint32_t)Seed); + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/XXHash.h b/r5dev/thirdparty/cppnet/cppkore/XXHash.h new file mode 100644 index 00000000..316e803d --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/XXHash.h @@ -0,0 +1,35 @@ +#pragma once + +#include +#include "StringBase.h" + +namespace Hashing +{ + // This enumeration represents the various supported xxhash versions + enum class XXHashVersion + { + // A 32bit hash value is returned. + XX32, + // A 64bit hash value is returned. + XX64 + }; + + // A hashing algo that implements XXHash. + class XXHash + { + public: + + // Computes the hash code of the integral value using XXHash algo. + template + static uint64_t HashValue(Tinput Input, XXHashVersion Version = XXHashVersion::XX64, uint64_t Seed = 0) + { + return ComputeHash((uint8_t*)&Input, 0, sizeof(Tinput), Version, Seed); + } + + // Computes the hash code of the input string using XXHash algo. + static uint64_t HashString(const string& Input, XXHashVersion Version = XXHashVersion::XX64, uint64_t Seed = 0); + + // Computes the hash code using the XXHash algo. + static uint64_t ComputeHash(uint8_t* Input, uint64_t InputOffset, uint64_t InputLength, XXHashVersion Version = XXHashVersion::XX64, uint64_t Seed = 0); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/ZLibCodec.cpp b/r5dev/thirdparty/cppnet/cppkore/ZLibCodec.cpp new file mode 100644 index 00000000..b3ec2385 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ZLibCodec.cpp @@ -0,0 +1,62 @@ +#include "stdafx.h" +#include "ZLibCodec.h" + +#include "..\cppkore_incl\ZLib\miniz.h" + +#if _DEBUG +#pragma comment(lib, "..\\cppkore_libs\\ZLib\\cppkorezlibx64d.lib") +#else +#pragma comment(lib, "..\\cppkore_libs\\ZLib\\cppkorezlibx64r.lib") +#endif + +namespace Compression +{ + uint64_t ZLibCodec::Compress(uint8_t* Input, uint64_t InputOffset, uint64_t InputLength, uint8_t* Output, uint64_t OutputOffset, uint64_t OutputLength) + { + mz_ulong ResultSize = (mz_ulong)OutputLength; + + if (compress(Output + OutputOffset, &ResultSize, Input + InputOffset, (mz_ulong)InputLength) == MZ_OK) + return ResultSize; + + return 0; + } + + std::unique_ptr ZLibCodec::Compress(uint8_t* Input, uint64_t InputOffset, uint64_t InputLength, uint64_t& OutputLength) + { + auto ResultBounds = compressBound((mz_ulong)InputLength); + auto Result = std::make_unique(ResultBounds); + + OutputLength = 0; + + if (compress(Result.get(), &ResultBounds, Input + InputOffset, (mz_ulong)InputLength) != MZ_OK) + return nullptr; + + OutputLength = (uint64_t)ResultBounds; + + return Result; + } + + uint64_t ZLibCodec::Decompress(uint8_t* Input, uint64_t InputOffset, uint64_t InputLength, uint8_t* Output, uint64_t OutputOffset, uint64_t OutputLength) + { + mz_ulong ResultSize = (mz_ulong)OutputLength; + + if (uncompress(Output + OutputOffset, &ResultSize, Input + InputOffset, (mz_ulong)InputLength) == MZ_OK) + return ResultSize; + + return 0; + } + + std::unique_ptr ZLibCodec::Decompress(uint8_t* Input, uint64_t InputOffset, uint64_t InputLength, uint64_t KnownOutputLength) + { + if (InputLength == 0) + return nullptr; + + mz_ulong ResultLength = (mz_ulong)KnownOutputLength; + auto Result = std::make_unique(KnownOutputLength); + + if (uncompress(Result.get(), &ResultLength, Input + InputOffset, (mz_ulong)InputLength) != MZ_OK) + return nullptr; + + return Result; + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/ZLibCodec.h b/r5dev/thirdparty/cppnet/cppkore/ZLibCodec.h new file mode 100644 index 00000000..eb70627d --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ZLibCodec.h @@ -0,0 +1,23 @@ +#pragma once + +#include +#include + +namespace Compression +{ + // A compression codec that implements the ZLib algo. + class ZLibCodec + { + public: + + // Compress the input buffer using the ZLib codec + static uint64_t Compress(uint8_t* Input, uint64_t InputOffset, uint64_t InputLength, uint8_t* Output, uint64_t OutputOffset, uint64_t OutputLength); + // Compress the input buffer using the ZLib codec + static std::unique_ptr Compress(uint8_t* Input, uint64_t InputOffset, uint64_t InputLength, uint64_t& OutputLength); + + // Decompress the input buffer using the ZLib codec + static uint64_t Decompress(uint8_t* Input, uint64_t InputOffset, uint64_t InputLength, uint8_t* Output, uint64_t OutputOffset, uint64_t OutputLength); + // Decompress the input buffer using the ZLib codec (With known output length) + static std::unique_ptr Decompress(uint8_t* Input, uint64_t InputOffset, uint64_t InputLength, uint64_t KnownOutputLength); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/ZipArchive.cpp b/r5dev/thirdparty/cppnet/cppkore/ZipArchive.cpp new file mode 100644 index 00000000..5fba19b2 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ZipArchive.cpp @@ -0,0 +1,445 @@ +#include "stdafx.h" +#include "Path.h" +#include "File.h" +#include "Directory.h" +#include "BinaryReader.h" +#include "BinaryWriter.h" +#include "ZipArchive.h" +#include "ZLibCodec.h" +#include "DeflateStream.h" + +namespace Compression +{ + ZipArchive::ZipArchive() + : ZipArchive(nullptr, false) + { + } + + ZipArchive::ZipArchive(std::unique_ptr Stream) + : ZipArchive(std::move(Stream), false) + { + } + + ZipArchive::ZipArchive(std::unique_ptr Stream, bool LeaveOpen) + { + this->BaseStream = std::move(Stream); + this->_LeaveOpen = LeaveOpen; + this->_ExistingFiles = 0; + this->_CentralDirLength = 0; + + this->ReadFileInfo(); + } + + ZipArchive::ZipArchive(IO::Stream* Stream) + : ZipArchive(Stream, false) + { + } + + ZipArchive::ZipArchive(IO::Stream* Stream, bool LeaveOpen) + { + this->BaseStream.reset(Stream); + this->_LeaveOpen = LeaveOpen; + this->_ExistingFiles = 0; + this->_CentralDirLength = 0; + + this->ReadFileInfo(); + } + + ZipArchive::~ZipArchive() + { + this->Close(); + } + + List ZipArchive::ReadEntries() + { + auto Result = List(); + + if (this->_CentralDir == nullptr) + return Result; + + uint8_t* Buffer = this->_CentralDir.get(); + + for (uint64_t i = 0; i < this->_CentralDirLength;) + { + auto Sig = *(uint32_t*)(&Buffer[i]); + + if (Sig != 0x02014b50) + break; + + bool EncodeUTF8 = (*(uint16_t*)(&Buffer[i + 8]) & 0x800) != 0; + uint16_t Method = *(uint16_t*)(&Buffer[i + 10]); + uint32_t ModifyTime = *(uint32_t*)(&Buffer[i + 12]); + uint32_t Crc32 = *(uint32_t*)(&Buffer[i + 16]); + uint64_t CompressedSize = *(uint32_t*)(&Buffer[i + 20]); + uint64_t FileSize = *(uint32_t*)(&Buffer[i + 24]); + uint16_t FileNameSize = *(uint16_t*)(&Buffer[i + 28]); + uint16_t ExtraSize = *(uint16_t*)(&Buffer[i + 30]); + uint16_t CommentSize = *(uint16_t*)(&Buffer[i + 32]); + uint32_t HeaderOffset = *(uint32_t*)(&Buffer[i + 42]); + uint32_t HeaderSize = (uint32_t)(46 + FileNameSize + ExtraSize + CommentSize); + + auto Entry = ZipEntry(); + + Entry.Method = (ZipCompressionMethod)Method; + Entry.FileNameInZip = string((const char*)&Buffer[i + 46], (size_t)FileNameSize); + Entry.FileOffset = GetFileOffset(HeaderOffset); + Entry.FileSize = FileSize; + Entry.CompressedSize = CompressedSize; + Entry.HeaderOffset = HeaderOffset; + Entry.HeaderSize = HeaderSize; + Entry.Crc32 = Crc32; + Entry.EncodeUTF8 = EncodeUTF8; + + if (CommentSize > 0) + Entry.Comment = string((const char*)&Buffer[i + 46 + FileNameSize + ExtraSize], (size_t)CommentSize); + + if (ExtraSize > 0) + this->ReadExtraInfo(i + 46 + FileNameSize, Entry); + + Result.EmplaceBack(std::move(Entry)); + + i += (46l + (uint64_t)FileNameSize + (uint64_t)ExtraSize + (uint64_t)CommentSize); + } + + return Result; + } + + ZipEntry ZipArchive::AddFile(ZipCompressionMethod Method, const string& Path, const string& FileNameInZip, const string& Comment) + { + auto Fs = IO::File::OpenRead(Path); + return std::move(AddStream(Method, FileNameInZip, Fs.get(), Comment)); + } + + ZipEntry ZipArchive::AddStream(ZipCompressionMethod Method, const string& FileNameInZip, IO::Stream* Stream, const string& Comment) + { + auto Entry = ZipEntry(); + + Entry.Method = Method; + Entry.EncodeUTF8 = false; + Entry.FileNameInZip = NormalizeFileName(FileNameInZip); + Entry.Comment = Comment; + Entry.Crc32 = 0; + Entry.HeaderOffset = this->BaseStream->GetPosition(); + + // Write local header + this->WriteLocalHeader(Entry); + Entry.FileOffset = this->BaseStream->GetPosition(); + + // TODO: Write file to zip (store) + + + this->UpdateCrcAndSizes(Entry); + // TODO: Add to files array... + + return std::move(Entry); + } + + void ZipArchive::ExtractFile(ZipEntry& Entry, const string& FileName) + { + auto Path = IO::Path::GetDirectoryName(FileName); + + IO::Directory::CreateDirectory(Path); + + if (IO::Directory::Exists(FileName)) + return; + + auto FileStream = IO::File::Create(FileName); + + this->ExtractFile(Entry, FileStream.get()); + } + + void ZipArchive::ExtractFile(ZipEntry& Entry, IO::Stream* Stream) + { + this->BaseStream->SetPosition(Entry.HeaderOffset); + + uint32_t Magic = 0; + this->BaseStream->Read((uint8_t*)&Magic, 0, 4); + + if (Magic != 0x04034b50) + return; + + this->BaseStream->SetPosition(Entry.FileOffset); + + if (Entry.Method == ZipCompressionMethod::Store) + { + auto Buffer = std::make_unique(65535); + auto BytesPending = (uint64_t)Entry.FileSize; + + while (BytesPending > 0) + { + auto Result = this->BaseStream->Read(Buffer.get(), 0, min(BytesPending, 65535)); + Stream->Write(Buffer.get(), 0, Result); + + BytesPending -= Result; + } + } + else if (Entry.Method == ZipCompressionMethod::Deflate) + { + auto InStream = DeflateStream(this->BaseStream.get(), CompressionMode::Decompress, true); + + auto Buffer = std::make_unique(65535); + auto BytesPending = (uint64_t)Entry.FileSize; + + while (BytesPending > 0) + { + auto Result = InStream.Read(Buffer.get(), 0, min(BytesPending, 65535)); + Stream->Write(Buffer.get(), 0, Result); + + BytesPending -= Result; + } + } + } + + void ZipArchive::ExtractFile(ZipEntry& Entry, std::unique_ptr& Stream) + { + this->ExtractFile(Entry, Stream.get()); + } + + IO::Stream* ZipArchive::GetBaseStream() const + { + return this->BaseStream.get(); + } + + void ZipArchive::Close() + { + // TODO: Finalize writing + // https://github.com/jaime-olivares/zipstorer/blob/master/src/ZipStorer.cs#L330 + + // Forcefully reset the stream + if (this->_LeaveOpen) + this->BaseStream.release(); + else + this->BaseStream.reset(); + + // Just close the central directory + this->_CentralDir.reset(); + } + + void ZipArchive::ReadFileInfo() + { + // This is the minimum size of a zip archive + if (this->BaseStream->GetLength() < 22) + return; + + try + { + this->BaseStream->SetPosition(this->BaseStream->GetLength() - 17); + + auto Reader = IO::BinaryReader(this->BaseStream.get(), true); + + do + { + this->BaseStream->SetPosition(this->BaseStream->GetPosition() - 5); + + auto Sig = Reader.Read(); + + if (Sig == 0x06054b50) + { + auto DirPosition = this->BaseStream->GetPosition() - 4; + + this->BaseStream->Seek(6, IO::SeekOrigin::Current); + + uint64_t Entries = Reader.Read(); + uint64_t CentralSize = Reader.Read(); + uint64_t CentralDirOffset = Reader.Read(); + uint16_t CommentSize = Reader.Read(); + + auto CommentPosition = this->BaseStream->GetPosition(); + + if (CentralDirOffset == 0xffffffff) // We have a Zip64 file + { + this->BaseStream->SetPosition(DirPosition - 20); + + Sig = Reader.Read(); + + if (Sig != 0x07064b50) // Invalid Zip64 central dir locator + return; + + this->BaseStream->Seek(4, IO::SeekOrigin::Current); + this->BaseStream->SetPosition(Reader.Read()); + + Sig = Reader.Read(); + + if (Sig != 0x06064b50) // Not a Zip64 central dir record + return; + + this->BaseStream->Seek(28, IO::SeekOrigin::Current); + + Entries = Reader.Read(); + CentralSize = Reader.Read(); + CentralDirOffset = Reader.Read(); + } + + if (CommentPosition + CommentSize != this->BaseStream->GetLength()) + return; + + uint64_t Temp = 0; + + this->_ExistingFiles = Entries; + + this->BaseStream->SetPosition(CentralDirOffset); + + this->_CentralDirLength = CentralSize; + this->_CentralDir = Reader.Read(CentralSize, Temp); + + this->BaseStream->SetPosition(CentralDirOffset); + return; + } + + } while (this->BaseStream->GetPosition() > 0); + } + catch (...) + { + // An error occured while reading the central directory + } + } + + uint32_t ZipArchive::GetFileOffset(uint32_t HeaderOffset) + { + uint8_t Buffer[2]{}; + + this->BaseStream->SetPosition(HeaderOffset + 26); + this->BaseStream->Read(Buffer, 0, 2); + + uint16_t FileNameSize = *(uint16_t*)&Buffer[0]; + + this->BaseStream->Read(Buffer, 0, 2); + + uint16_t ExtraSize = *(uint16_t*)&Buffer[0]; + + return (uint32_t)(30 + FileNameSize + ExtraSize + HeaderOffset); + } + + void ZipArchive::ReadExtraInfo(uint64_t i, ZipEntry& Entry) + { + if (this->_CentralDirLength < 4) + return; + + uint64_t Pos = i; + uint32_t Tag, Size; + + uint8_t* Buffer = this->_CentralDir.get(); + + while (Pos < this->_CentralDirLength - 4) + { + uint32_t ExtraId = *(uint16_t*)(&Buffer[Pos]); + uint32_t Length = *(uint16_t*)(&Buffer[Pos + 2]); + + if (ExtraId == 0x1) // Zip64 information + { + Tag = *(uint16_t*)(&Buffer[Pos + 8]); + Size = *(uint16_t*)(&Buffer[Pos + 10]); + + if (Tag == 1 && Size >= 24) + { + if (Entry.FileSize == 0xFFFFFFFF) + Entry.FileSize = *(uint64_t*)(&Buffer[Pos + 12]); + if (Entry.CompressedSize == 0xFFFFFFFF) + Entry.CompressedSize = *(uint64_t*)(&Buffer[Pos + 20]); + if (Entry.HeaderOffset == 0xFFFFFFFF) + Entry.HeaderOffset = *(uint64_t*)(&Buffer[Pos + 28]); + } + } + + Pos += Length + 4; + } + } + + string ZipArchive::NormalizeFileName(const string& FileName) + { + auto Name = FileName.Replace("\\", "/"); + + auto Pos = Name.IndexOf(":"); + if (Pos != string::InvalidPosition) + Name = Name.Substring(Pos + 1); + + if (Name.Length() > 2 && Name[0] == '/' && Name[Name.Length() - 1] == '/') + return Name.Substring(1, Name.Length() - 2); + else if (Name.Length() > 1 && Name[0] == '/') + return Name.Substring(1); + else if (Name.Length() > 1 && Name[Name.Length() - 1] == '/') + return Name.Substring(0, Name.Length() - 1); + + return Name; + } + + void ZipArchive::UpdateCrcAndSizes(ZipEntry& Entry) + { + auto LastPos = this->BaseStream->GetPosition(); + + auto Writer = IO::BinaryWriter(this->BaseStream.get(), true); + + this->BaseStream->SetPosition(Entry.HeaderOffset + 8); + Writer.Write((uint16_t)Entry.Method); + + this->BaseStream->SetPosition(Entry.HeaderOffset + 14); + Writer.Write(Entry.Crc32); + Writer.Write(Get32BitSize(Entry.CompressedSize)); + Writer.Write(Get32BitSize(Entry.FileSize)); + + this->BaseStream->SetPosition(LastPos); + } + + void ZipArchive::WriteLocalHeader(ZipEntry& Entry) + { + auto Pos = this->BaseStream->GetPosition(); + + auto Writer = IO::BinaryWriter(this->BaseStream.get(), true); + + constexpr uint8_t NoExtraData[] = { 80, 75, 3, 4, 20, 0 }; + constexpr uint8_t NoCrcSize[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + + this->BaseStream->Write((uint8_t*)&NoExtraData[0], 0, sizeof(NoExtraData)); + + Writer.Write((uint16_t)0x0800); // Encode in UTF8 + Writer.Write((uint16_t)Entry.Method); + Writer.Write(0x0); // DosTime + + this->BaseStream->Write((uint8_t*)&NoCrcSize[0], 0, sizeof(NoCrcSize)); + + Writer.Write((uint16_t)Entry.FileNameInZip.Length()); + Writer.Write((uint16_t)72); // ExtraInfo + + this->BaseStream->Write((uint8_t*)&Entry.FileNameInZip[0], 0, Entry.FileNameInZip.Length()); + + this->CreateExtraInfo(Entry, this->BaseStream.get()); + + Entry.HeaderSize = (uint32_t)(this->BaseStream->GetPosition() - Pos); + } + + void ZipArchive::CreateExtraInfo(ZipEntry& Entry, IO::Stream* Output) + { + uint8_t Buffer[72]{}; + + // + // Zip64 Extended Info + // + + *(uint16_t*)(&Buffer[0]) = 0x1; // ZIP64 Tag + *(uint16_t*)(&Buffer[2]) = 32; // Length + *(uint16_t*)(&Buffer[8]) = 1; // One tag + *(uint16_t*)(&Buffer[10]) = 24; // One Size + *(uint64_t*)(&Buffer[12]) = Entry.FileSize; + *(uint64_t*)(&Buffer[20]) = Entry.CompressedSize; + *(uint64_t*)(&Buffer[28]) = Entry.HeaderOffset; + + // + // NTFS FileTime + // + + *(uint16_t*)(&Buffer[36]) = 0xA; // NTFS Tag + *(uint16_t*)(&Buffer[38]) = 32; // Length + *(uint16_t*)(&Buffer[44]) = 1; // One tag + *(uint16_t*)(&Buffer[46]) = 24; // One Size + *(uint64_t*)(&Buffer[48]) = 0x0; + *(uint64_t*)(&Buffer[56]) = 0x0; + *(uint64_t*)(&Buffer[64]) = 0x0; + + Output->Write(Buffer, 0, sizeof(Buffer)); + } + + uint32_t ZipArchive::Get32BitSize(uint64_t Size) + { + return Size >= 0xFFFFFFFF ? 0xFFFFFFFF : (uint32_t)Size; + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/ZipArchive.h b/r5dev/thirdparty/cppnet/cppkore/ZipArchive.h new file mode 100644 index 00000000..14d3b40a --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ZipArchive.h @@ -0,0 +1,69 @@ +#pragma once + +#include +#include +#include "Stream.h" +#include "ListBase.h" +#include "ZipEntry.h" + +namespace Compression +{ + // Manages compressed Zip archives and decompresses entries. + class ZipArchive + { + public: + ZipArchive(); + ZipArchive(std::unique_ptr Stream); + ZipArchive(std::unique_ptr Stream, bool LeaveOpen); + ZipArchive(IO::Stream* Stream); + ZipArchive(IO::Stream* Stream, bool LeaveOpen); + ~ZipArchive(); + + // TODO: RemoveEntry(); + // TODO: AddDirectory(); + + // Read all the file records in the central directory + List ReadEntries(); + + // Add a file into the ZipArchive. + ZipEntry AddFile(ZipCompressionMethod Method, const string& Path, const string& FileNameInZip, const string& Comment = ""); + // Add a stream into the ZipArchive. + ZipEntry AddStream(ZipCompressionMethod Method, const string& FileNameInZip, IO::Stream* Stream, const string& Comment = ""); + + // Extract the entry to the provided file path. + void ExtractFile(ZipEntry& Entry, const string& FileName); + // Extract the entry to the provided stream. + void ExtractFile(ZipEntry& Entry, IO::Stream* Stream); + // Extract the entry to the provided stream. + void ExtractFile(ZipEntry& Entry, std::unique_ptr& Stream); + + // Get the underlying stream + IO::Stream* GetBaseStream() const; + // Close the ZipArchive and underlying stream + void Close(); + + private: + std::unique_ptr BaseStream; + std::unique_ptr _CentralDir; + uint64_t _CentralDirLength; + uint64_t _ExistingFiles; + bool _LeaveOpen; + + // Internal helper routine to parse the end of central directory record. + void ReadFileInfo(); + // Internal helper routine to calculate file offset. + uint32_t GetFileOffset(uint32_t HeaderOffset); + // Internal helper routine to read extra info. + void ReadExtraInfo(uint64_t i, ZipEntry& Entry); + // Internal helper routine to clean a file name + string NormalizeFileName(const string& FileName); + // Internal routine to calculate crc and sizes + void UpdateCrcAndSizes(ZipEntry& Entry); + // Internal routine to write the file header + void WriteLocalHeader(ZipEntry& Entry); + // Internal routine to create extra info + void CreateExtraInfo(ZipEntry& Entry, IO::Stream* Output); + // Internal routine to get maximum 32bit size + uint32_t Get32BitSize(uint64_t Size); + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/ZipEntry.h b/r5dev/thirdparty/cppnet/cppkore/ZipEntry.h new file mode 100644 index 00000000..1f5d3072 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/ZipEntry.h @@ -0,0 +1,41 @@ +#pragma once + +#include +#include "StringBase.h" + +namespace Compression +{ + // Compression method enumeration + enum class ZipCompressionMethod : uint16_t + { + // Uncompressed storage + Store = 0, + // Deflate compression method + Deflate = 8 + }; + + // Represents an entry in the ZipArchive + struct ZipEntry + { + // Compression method + ZipCompressionMethod Method; + // Full path and filename as stored in ZipArchive + string FileNameInZip; + // Original file size + uint64_t FileSize; + // Compressed file size + uint64_t CompressedSize; + // Offset of header information in the ZipArchive + uint64_t HeaderOffset; + // Offset of file inside the ZipArchive + uint64_t FileOffset; + // Size of the header information + uint32_t HeaderSize; + // The CRC32 checksum of the entire file + uint32_t Crc32; + // User comment for the file + string Comment; + // True if UTF8 encoding for filename and comments + bool EncodeUTF8; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/__ConsoleInit.cpp b/r5dev/thirdparty/cppnet/cppkore/__ConsoleInit.cpp new file mode 100644 index 00000000..e9a4b5c6 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/__ConsoleInit.cpp @@ -0,0 +1,10 @@ +#include "stdafx.h" +#include "__ConsoleInit.h" + +namespace System +{ + __ConsoleInit::__ConsoleInit() + : In(new IO::ConsoleStream(GetStdHandle(STD_INPUT_HANDLE), IO::FileAccess::Read)), Out(new IO::ConsoleStream(GetStdHandle(STD_OUTPUT_HANDLE), IO::FileAccess::Write)) + { + } +} diff --git a/r5dev/thirdparty/cppnet/cppkore/__ConsoleInit.h b/r5dev/thirdparty/cppnet/cppkore/__ConsoleInit.h new file mode 100644 index 00000000..5da5b5e9 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/__ConsoleInit.h @@ -0,0 +1,18 @@ +#pragma once + +#include "StreamWriter.h" +#include "StreamReader.h" +#include "ConsoleStream.h" + +namespace System +{ + class __ConsoleInit + { + public: + __ConsoleInit(); + + // The console streams + IO::StreamReader In; + IO::StreamWriter Out; + }; +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore/clipboard/clip.cpp b/r5dev/thirdparty/cppnet/cppkore/clipboard/clip.cpp new file mode 100644 index 00000000..637475f0 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/clipboard/clip.cpp @@ -0,0 +1,118 @@ +// Clip Library +// Copyright (c) 2015-2018 David Capello +// +// This file is released under the terms of the MIT license. +// Read LICENSE.txt for more information. + +#include "../stdafx.h" +#include "clip.h" +#include "clip_lock_impl.h" +#include + +namespace clip { + +namespace { + +void default_error_handler(ErrorCode code) { + static const char* err[] = { + "Cannot lock clipboard", + "Image format is not supported" + }; + throw std::runtime_error(err[static_cast(code)]); +} + +} // anonymous namespace + +error_handler g_error_handler = default_error_handler; + +lock::lock(void* native_window_handle) + : p(new impl(native_window_handle)) { +} + +lock::~lock() = default; + +bool lock::locked() const { + return p->locked(); +} + +bool lock::clear() { + return p->clear(); +} + +bool lock::is_convertible(format f) const { + return p->is_convertible(f); +} + +bool lock::set_data(format f, const char* buf, size_t length) { + return p->set_data(f, buf, length); +} + +bool lock::get_data(format f, char* buf, size_t len) const { + return p->get_data(f, buf, len); +} + +size_t lock::get_data_length(format f) const { + return p->get_data_length(f); +} + +format empty_format() { return 0; } +format text_format() { return 1; } +format image_format() { return 2; } + +bool has(format f) { + lock l; + if (l.locked()) + return l.is_convertible(f); + else + return false; +} + +bool clear() { + lock l; + if (l.locked()) + return l.clear(); + else + return false; +} + +bool set_text(const std::string& value) { + lock l; + if (l.locked()) { + l.clear(); + return l.set_data(text_format(), value.c_str(), value.size()); + } + else + return false; +} + +bool get_text(std::string& value) { + lock l; + if (!l.locked()) + return false; + + format f = text_format(); + if (!l.is_convertible(f)) + return false; + + size_t len = l.get_data_length(f); + if (len > 0) { + std::vector buf(len); + l.get_data(f, &buf[0], len); + value = &buf[0]; + return true; + } + else { + value.clear(); + return true; + } +} + +void set_error_handler(error_handler handler) { + g_error_handler = handler; +} + +error_handler get_error_handler() { + return g_error_handler; +} + +} // namespace clip diff --git a/r5dev/thirdparty/cppnet/cppkore/clipboard/clip.h b/r5dev/thirdparty/cppnet/cppkore/clipboard/clip.h new file mode 100644 index 00000000..999b4bdb --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/clipboard/clip.h @@ -0,0 +1,100 @@ +// Clip Library +// Copyright (c) 2015-2018 David Capello +// +// This file is released under the terms of the MIT license. +// Read LICENSE.txt for more information. + +#ifndef CLIP_H_INCLUDED +#define CLIP_H_INCLUDED +#pragma once + +#include +#include +#include + +namespace clip { + + // ====================================================================== + // Low-level API to lock the clipboard/pasteboard and modify it + // ====================================================================== + + // Clipboard format identifier. + typedef size_t format; + + struct image_spec; + + class lock { + public: + // You can give your current HWND as the "native_window_handle." + // Windows clipboard functions use this handle to open/close + // (lock/unlock) the clipboard. From the MSDN documentation we + // need this handler so SetClipboardData() doesn't fail after a + // EmptyClipboard() call. Anyway it looks to work just fine if we + // call OpenClipboard() with a null HWND. + lock(void* native_window_handle = nullptr); + ~lock(); + + // Returns true if we've locked the clipboard successfully in + // lock() constructor. + bool locked() const; + + // Clears the clipboard content. If you don't clear the content, + // previous clipboard content (in unknown formats) could persist + // after the unlock. + bool clear(); + + // Returns true if the clipboard can be converted to the given + // format. + bool is_convertible(format f) const; + bool set_data(format f, const char* buf, size_t len); + bool get_data(format f, char* buf, size_t len) const; + size_t get_data_length(format f) const; + + private: + class impl; + std::unique_ptr p; + }; + + format register_format(const std::string& name); + + // This format is when the clipboard has no content. + format empty_format(); + + // When the clipboard has UTF8 text. + format text_format(); + + // When the clipboard has an image. + format image_format(); + + // Returns true if the clipboard has content of the given type. + bool has(format f); + + // Clears the clipboard content. + bool clear(); + + // ====================================================================== + // Error handling + // ====================================================================== + + enum class ErrorCode { + CannotLock, + ImageNotSupported, + }; + + typedef void (*error_handler)(ErrorCode code); + + void set_error_handler(error_handler f); + error_handler get_error_handler(); + + // ====================================================================== + // Text + // ====================================================================== + + // High-level API to put/get UTF8 text in/from the clipboard. These + // functions returns false in case of error. + bool set_text(const std::string& value); + bool get_text(std::string& value); + +} // namespace clip + +#endif // CLIP_H_INCLUDED diff --git a/r5dev/thirdparty/cppnet/cppkore/clipboard/clip_lock_impl.h b/r5dev/thirdparty/cppnet/cppkore/clipboard/clip_lock_impl.h new file mode 100644 index 00000000..a5a2c78d --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/clipboard/clip_lock_impl.h @@ -0,0 +1,30 @@ +// Clip Library +// Copyright (c) 2015-2018 David Capello +// +// This file is released under the terms of the MIT license. +// Read LICENSE.txt for more information. + +#ifndef CLIP_LOCK_IMPL_H_INCLUDED +#define CLIP_LOCK_IMPL_H_INCLUDED + +namespace clip { + +class lock::impl { +public: + impl(void* native_window_handle); + ~impl(); + + bool locked() const { return m_locked; } + bool clear(); + bool is_convertible(format f) const; + bool set_data(format f, const char* buf, size_t len); + bool get_data(format f, char* buf, size_t len) const; + size_t get_data_length(format f) const; + +private: + bool m_locked; +}; + +} // namespace clip + +#endif diff --git a/r5dev/thirdparty/cppnet/cppkore/clipboard/clip_win.cpp b/r5dev/thirdparty/cppnet/cppkore/clipboard/clip_win.cpp new file mode 100644 index 00000000..e8bac7fe --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/clipboard/clip_win.cpp @@ -0,0 +1,279 @@ +// Clip Library +// Copyright (C) 2015-2020 David Capello +// +// This file is released under the terms of the MIT license. +// Read LICENSE.txt for more information. + +#include "../stdafx.h" +#include "clip.h" +#include "clip_lock_impl.h" +#include + +#ifndef LCS_WINDOWS_COLOR_SPACE +#define LCS_WINDOWS_COLOR_SPACE 'Win ' +#endif + +#ifndef CF_DIBV5 +#define CF_DIBV5 17 +#endif + +namespace clip { + +namespace { + +// Data type used as header for custom formats to indicate the exact +// size of the user custom data. This is necessary because it looks +// like GlobalSize() might not return the exact size, but a greater +// value. +typedef uint64_t CustomSizeT; + +unsigned long get_shift_from_mask(unsigned long mask) { + unsigned long shift = 0; + for (shift=0; shift 0) { + int reqsize = MultiByteToWideChar(CP_UTF8, 0, buf, len, NULL, 0); + if (reqsize > 0) { + ++reqsize; + + Hglobal hglobal(sizeof(WCHAR)*reqsize); + LPWSTR lpstr = static_cast(GlobalLock(hglobal)); + MultiByteToWideChar(CP_UTF8, 0, buf, len, lpstr, reqsize); + GlobalUnlock(hglobal); + + result = (SetClipboardData(CF_UNICODETEXT, hglobal)) ? true: false; + if (result) + hglobal.release(); + } + } + } + else { + Hglobal hglobal(len+sizeof(CustomSizeT)); + if (hglobal) { + auto dst = (uint8_t*)GlobalLock(hglobal); + if (dst) { + *((CustomSizeT*)dst) = len; + memcpy(dst+sizeof(CustomSizeT), buf, len); + GlobalUnlock(hglobal); + result = (SetClipboardData(f, hglobal) ? true: false); + if (result) + hglobal.release(); + } + } + } + + return result; +} + +bool lock::impl::get_data(format f, char* buf, size_t len) const { + assert(buf); + + if (!buf || !is_convertible(f)) + return false; + + bool result = false; + + if (f == text_format()) { + if (IsClipboardFormatAvailable(CF_UNICODETEXT)) { + HGLOBAL hglobal = GetClipboardData(CF_UNICODETEXT); + if (hglobal) { + LPWSTR lpstr = static_cast(GlobalLock(hglobal)); + if (lpstr) { + size_t reqsize = + WideCharToMultiByte(CP_UTF8, 0, lpstr, -1, + nullptr, 0, nullptr, nullptr); + + assert(reqsize <= len); + if (reqsize <= len) { + WideCharToMultiByte(CP_UTF8, 0, lpstr, -1, + buf, reqsize, nullptr, nullptr); + result = true; + } + GlobalUnlock(hglobal); + } + } + } + else if (IsClipboardFormatAvailable(CF_TEXT)) { + HGLOBAL hglobal = GetClipboardData(CF_TEXT); + if (hglobal) { + LPSTR lpstr = static_cast(GlobalLock(hglobal)); + if (lpstr) { + // TODO check length + memcpy(buf, lpstr, len); + result = true; + GlobalUnlock(hglobal); + } + } + } + } + else { + if (IsClipboardFormatAvailable(f)) { + HGLOBAL hglobal = GetClipboardData(f); + if (hglobal) { + const SIZE_T total_size = GlobalSize(hglobal); + auto ptr = (const uint8_t*)GlobalLock(hglobal); + if (ptr) { + CustomSizeT reqsize = *((CustomSizeT*)ptr); + + // If the registered length of data in the first CustomSizeT + // number of bytes of the hglobal data is greater than the + // GlobalSize(hglobal), something is wrong, it should not + // happen. + assert(reqsize <= total_size); + if (reqsize > total_size) + reqsize = total_size - sizeof(CustomSizeT); + + if (reqsize <= len) { + memcpy(buf, ptr+sizeof(CustomSizeT), reqsize); + result = true; + } + GlobalUnlock(hglobal); + } + } + } + } + + return result; +} + +size_t lock::impl::get_data_length(format f) const { + size_t len = 0; + + if (f == text_format()) { + if (IsClipboardFormatAvailable(CF_UNICODETEXT)) { + HGLOBAL hglobal = GetClipboardData(CF_UNICODETEXT); + if (hglobal) { + LPWSTR lpstr = static_cast(GlobalLock(hglobal)); + if (lpstr) { + len = + WideCharToMultiByte(CP_UTF8, 0, lpstr, -1, + nullptr, 0, nullptr, nullptr); + GlobalUnlock(hglobal); + } + } + } + else if (IsClipboardFormatAvailable(CF_TEXT)) { + HGLOBAL hglobal = GetClipboardData(CF_TEXT); + if (hglobal) { + LPSTR lpstr = (LPSTR)GlobalLock(hglobal); + if (lpstr) { + len = strlen(lpstr) + 1; + GlobalUnlock(hglobal); + } + } + } + } + else if (f != empty_format()) { + if (IsClipboardFormatAvailable(f)) { + HGLOBAL hglobal = GetClipboardData(f); + if (hglobal) { + const SIZE_T total_size = GlobalSize(hglobal); + auto ptr = (const uint8_t*)GlobalLock(hglobal); + if (ptr) { + len = *((CustomSizeT*)ptr); + + assert(len <= total_size); + if (len > total_size) + len = total_size - sizeof(CustomSizeT); + + GlobalUnlock(hglobal); + } + } + } + } + + return len; +} + +format register_format(const std::string& name) { + int reqsize = 1+MultiByteToWideChar(CP_UTF8, 0, + name.c_str(), name.size(), NULL, 0); + std::vector buf(reqsize); + MultiByteToWideChar(CP_UTF8, 0, name.c_str(), name.size(), + &buf[0], reqsize); + + // From MSDN, registered clipboard formats are identified by values + // in the range 0xC000 through 0xFFFF. + return (format)RegisterClipboardFormatW(&buf[0]); +} + +} // namespace clip diff --git a/r5dev/thirdparty/cppnet/cppkore/resource.h b/r5dev/thirdparty/cppnet/cppkore/resource.h new file mode 100644 index 00000000..7b4025b8 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore/resource.h @@ -0,0 +1,16 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by cppkore.rc +// +#define IDB_PNG1 101 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 102 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/r5dev/thirdparty/cppnet/cppkore/stdafx.cpp b/r5dev/thirdparty/cppnet/cppkore/stdafx.cpp new file mode 100644 index 0000000000000000000000000000000000000000..21ac7e67ba87c532e0aaa7657d57859273fa2ae3 GIT binary patch literal 40 tcmezWPnjW;A&()MA%~%qA%!88L4iSup_rir$WCNPW2j)zW5@uC007i32#Ejy literal 0 HcmV?d00001 diff --git a/r5dev/thirdparty/cppnet/cppkore/stdafx.h b/r5dev/thirdparty/cppnet/cppkore/stdafx.h new file mode 100644 index 0000000000000000000000000000000000000000..e74891a4933f36f22cfb3fc6467a53a86a9c6ef7 GIT binary patch literal 1232 zcma)+-A=+l5QWdRiSN*a8!-w-FEu6#1WgnTqFgqG+EPQo6#U`k)o&IMQPP^G+nwp@ znKQF9{ro8DS(yUGN?ARPHBw)X+SZo4tE%E{=pFA+FA90*xi2zyL(R00cfvlzKhYE` z;_|pN*iv>~C9sBAZy-DkKnIQ~!?s8zXGIQY{9RqDr6V26*A>yvuza`Hd0sC(_T^k( z*Qv4y9+AeV@Q4+#x82l5oWB{N_ZdWnH&BlZEZ&gFy+u|t?1(I^4paPAkv$A-B^-4gX@t zWc37dNVI%p3?`v6cE*zetetY^^u{@{C-4}~&N|J(r65vQg;@^j7PbI=NrAQw8C<|P z1Z(}1pS7KC5h6vMRd$(k5&pl(0FANBJAr$UTce21Fy5c1xa$5o`Sv)sm@cwuo~yOh zJT}*TyyNdKvFY?xr&rJE+2+Ox41X|1+F}0p_^RTr@>-nLTOZa3y51(W?RwrkWgRaf f*s0i`V$;MI#oIx{D>+y%@4|Vo#%q6 +#include + +// +// Contains stdlib extensions that aren't provided cross platform +// + +namespace std +{ + template + inline constexpr typename std::enable_if::type get_param(T&& t, Ts&&... ts) + { + return t; + } + + template + inline constexpr typename std::enable_if<(index > 0) && index <= sizeof...(Ts), typename std::tuple_element>::type>::type get_param(T&& t, Ts&&... ts) + { + return get_param(std::forward(ts)...); + } + + inline void* memrchr(_In_reads_bytes_opt_(_N) void* _Pv, _In_ int _C, _In_ size_t _N) + { + const unsigned char *char_ptr; + const unsigned long int *longword_ptr; + unsigned long int longword, magic_bits, charmask; + unsigned char c; + int i; + + c = (unsigned char)_C; + + for (char_ptr = (const unsigned char*)_Pv + _N; + _N > 0 && (size_t)char_ptr % sizeof longword != 0; + --_N) + if (*--char_ptr == c) + return (void*)char_ptr; + + longword_ptr = (const unsigned long int*)char_ptr; + + magic_bits = 0xfefefefe; + charmask = c | (c << 8); + charmask |= charmask << 16; +#if 0xffffffffU < ULONG_MAX + magic_bits |= magic_bits << 32; + charmask |= charmask << 32; + if (8 < sizeof longword) + for (i = 64; i < sizeof longword * 8; i *= 2) + { + magic_bits |= magic_bits << i; + charmask |= charmask << i; + } +#endif + magic_bits = (ULONG_MAX >> 1) & (magic_bits | 1); + + while (_N >= sizeof longword) + { + longword = *--longword_ptr ^ charmask; + + if ((((longword + magic_bits) ^ ~longword) & ~magic_bits) != 0) + { + const unsigned char *cp = (const unsigned char*)longword_ptr; + + if (8 < sizeof longword) + for (i = sizeof longword - 1; 8 <= i; i--) + if (cp[i] == c) + return (void *)&cp[i]; + if (7 < sizeof longword && cp[7] == c) + return (void *)&cp[7]; + if (6 < sizeof longword && cp[6] == c) + return (void *)&cp[6]; + if (5 < sizeof longword && cp[5] == c) + return (void *)&cp[5]; + if (4 < sizeof longword && cp[4] == c) + return (void *)&cp[4]; + if (cp[3] == c) + return (void *)&cp[3]; + if (cp[2] == c) + return (void *)&cp[2]; + if (cp[1] == c) + return (void *)&cp[1]; + if (cp[0] == c) + return (void *)cp; + } + + _N -= sizeof longword; + } + + char_ptr = (const unsigned char*)longword_ptr; + + while (_N-- > 0) + { + if (*--char_ptr == c) + return (void*)char_ptr; + } + + return 0; + } + + inline const wchar_t* wmemrchr(_In_reads_opt_(_N) const wchar_t* _Pv, _In_ wchar_t _C, _In_ size_t _N) + { + while (_N--) + if (_Pv[_N] == _C) + return _Pv + _N; + + return 0; + } +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore_docs/console_colors.txt b/r5dev/thirdparty/cppnet/cppkore_docs/console_colors.txt new file mode 100644 index 00000000..2a15f37f --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore_docs/console_colors.txt @@ -0,0 +1,19 @@ +Console::RemapAllConsoleColors( + { + {0, 0, 0}, // Black + {0, 122, 204}, // Dark Blue + {86, 168, 60}, // Dark Green + {0, 150, 136}, // Dark Cyan + {183, 28, 28}, // Dark Red + {197, 17, 98}, // Dark Magenta + {255, 171, 0}, // Dark Yellow + {255, 255, 255},// Gray + {32, 32, 32}, // Dark Gray + {3, 169, 244}, // Blue + {0, 200, 83}, // Green + {0, 188, 212}, // Cyan + {244, 67, 54}, // Red + {233, 30, 99}, // Magenta + {255, 193, 7}, // Yellow + {255, 255, 255},// White + }); \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore_docs/glew_reference/eglew.h b/r5dev/thirdparty/cppnet/cppkore_docs/glew_reference/eglew.h new file mode 100644 index 00000000..46701479 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore_docs/glew_reference/eglew.h @@ -0,0 +1,2618 @@ +/* +** The OpenGL Extension Wrangler Library +** Copyright (C) 2008-2017, Nigel Stewart +** Copyright (C) 2002-2008, Milan Ikits +** Copyright (C) 2002-2008, Marcelo E. Magallon +** Copyright (C) 2002, Lev Povalahev +** All rights reserved. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are met: +** +** * Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** * The name of the author may be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +** THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/* + * Mesa 3-D graphics library + * Version: 7.0 + * + * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* +** Copyright (c) 2007 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 +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +#ifndef __eglew_h__ +#define __eglew_h__ +#define __EGLEW_H__ + +#ifdef __eglext_h_ +#error eglext.h included before eglew.h +#endif + +#if defined(__egl_h_) +#error egl.h included before eglew.h +#endif + +#define __eglext_h_ + +#define __egl_h_ + +#ifndef EGLAPIENTRY +#define EGLAPIENTRY +#endif +#ifndef EGLAPI +#define EGLAPI extern +#endif + +/* EGL Types */ +#include + +#include +#include + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef int32_t EGLint; + +typedef unsigned int EGLBoolean; +typedef void *EGLDisplay; +typedef void *EGLConfig; +typedef void *EGLSurface; +typedef void *EGLContext; +typedef void (*__eglMustCastToProperFunctionPointerType)(void); + +typedef unsigned int EGLenum; +typedef void *EGLClientBuffer; + +typedef void *EGLSync; +typedef intptr_t EGLAttrib; +typedef khronos_utime_nanoseconds_t EGLTime; +typedef void *EGLImage; + +typedef void *EGLSyncKHR; +typedef intptr_t EGLAttribKHR; +typedef void *EGLLabelKHR; +typedef void *EGLObjectKHR; +typedef void (EGLAPIENTRY *EGLDEBUGPROCKHR)(EGLenum error,const char *command,EGLint messageType,EGLLabelKHR threadLabel,EGLLabelKHR objectLabel,const char* message); +typedef khronos_utime_nanoseconds_t EGLTimeKHR; +typedef void *EGLImageKHR; +typedef void *EGLStreamKHR; +typedef khronos_uint64_t EGLuint64KHR; +typedef int EGLNativeFileDescriptorKHR; +typedef khronos_ssize_t EGLsizeiANDROID; +typedef void (*EGLSetBlobFuncANDROID) (const void *key, EGLsizeiANDROID keySize, const void *value, EGLsizeiANDROID valueSize); +typedef EGLsizeiANDROID (*EGLGetBlobFuncANDROID) (const void *key, EGLsizeiANDROID keySize, void *value, EGLsizeiANDROID valueSize); +typedef void *EGLDeviceEXT; +typedef void *EGLOutputLayerEXT; +typedef void *EGLOutputPortEXT; +typedef void *EGLSyncNV; +typedef khronos_utime_nanoseconds_t EGLTimeNV; +typedef khronos_utime_nanoseconds_t EGLuint64NV; +typedef khronos_stime_nanoseconds_t EGLnsecsANDROID; + +struct EGLClientPixmapHI; + +#define EGL_DONT_CARE ((EGLint)-1) + +#define EGL_NO_CONTEXT ((EGLContext)0) +#define EGL_NO_DISPLAY ((EGLDisplay)0) +#define EGL_NO_IMAGE ((EGLImage)0) +#define EGL_NO_SURFACE ((EGLSurface)0) +#define EGL_NO_SYNC ((EGLSync)0) + +#define EGL_UNKNOWN ((EGLint)-1) + +#define EGL_DEFAULT_DISPLAY ((EGLNativeDisplayType)0) + +EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY eglGetProcAddress (const char *procname); +/* ---------------------------- EGL_VERSION_1_0 ---------------------------- */ + +#ifndef EGL_VERSION_1_0 +#define EGL_VERSION_1_0 1 + +#define EGL_FALSE 0 +#define EGL_PBUFFER_BIT 0x0001 +#define EGL_TRUE 1 +#define EGL_PIXMAP_BIT 0x0002 +#define EGL_WINDOW_BIT 0x0004 +#define EGL_SUCCESS 0x3000 +#define EGL_NOT_INITIALIZED 0x3001 +#define EGL_BAD_ACCESS 0x3002 +#define EGL_BAD_ALLOC 0x3003 +#define EGL_BAD_ATTRIBUTE 0x3004 +#define EGL_BAD_CONFIG 0x3005 +#define EGL_BAD_CONTEXT 0x3006 +#define EGL_BAD_CURRENT_SURFACE 0x3007 +#define EGL_BAD_DISPLAY 0x3008 +#define EGL_BAD_MATCH 0x3009 +#define EGL_BAD_NATIVE_PIXMAP 0x300A +#define EGL_BAD_NATIVE_WINDOW 0x300B +#define EGL_BAD_PARAMETER 0x300C +#define EGL_BAD_SURFACE 0x300D +#define EGL_BUFFER_SIZE 0x3020 +#define EGL_ALPHA_SIZE 0x3021 +#define EGL_BLUE_SIZE 0x3022 +#define EGL_GREEN_SIZE 0x3023 +#define EGL_RED_SIZE 0x3024 +#define EGL_DEPTH_SIZE 0x3025 +#define EGL_STENCIL_SIZE 0x3026 +#define EGL_CONFIG_CAVEAT 0x3027 +#define EGL_CONFIG_ID 0x3028 +#define EGL_LEVEL 0x3029 +#define EGL_MAX_PBUFFER_HEIGHT 0x302A +#define EGL_MAX_PBUFFER_PIXELS 0x302B +#define EGL_MAX_PBUFFER_WIDTH 0x302C +#define EGL_NATIVE_RENDERABLE 0x302D +#define EGL_NATIVE_VISUAL_ID 0x302E +#define EGL_NATIVE_VISUAL_TYPE 0x302F +#define EGL_SAMPLES 0x3031 +#define EGL_SAMPLE_BUFFERS 0x3032 +#define EGL_SURFACE_TYPE 0x3033 +#define EGL_TRANSPARENT_TYPE 0x3034 +#define EGL_TRANSPARENT_BLUE_VALUE 0x3035 +#define EGL_TRANSPARENT_GREEN_VALUE 0x3036 +#define EGL_TRANSPARENT_RED_VALUE 0x3037 +#define EGL_NONE 0x3038 +#define EGL_SLOW_CONFIG 0x3050 +#define EGL_NON_CONFORMANT_CONFIG 0x3051 +#define EGL_TRANSPARENT_RGB 0x3052 +#define EGL_VENDOR 0x3053 +#define EGL_VERSION 0x3054 +#define EGL_EXTENSIONS 0x3055 +#define EGL_HEIGHT 0x3056 +#define EGL_WIDTH 0x3057 +#define EGL_LARGEST_PBUFFER 0x3058 +#define EGL_DRAW 0x3059 +#define EGL_READ 0x305A +#define EGL_CORE_NATIVE_ENGINE 0x305B + +typedef EGLBoolean ( * PFNEGLCHOOSECONFIGPROC) (EGLDisplay dpy, const EGLint * attrib_list, EGLConfig * configs, EGLint config_size, EGLint * num_config); +typedef EGLBoolean ( * PFNEGLCOPYBUFFERSPROC) (EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target); +typedef EGLContext ( * PFNEGLCREATECONTEXTPROC) (EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint * attrib_list); +typedef EGLSurface ( * PFNEGLCREATEPBUFFERSURFACEPROC) (EGLDisplay dpy, EGLConfig config, const EGLint * attrib_list); +typedef EGLSurface ( * PFNEGLCREATEPIXMAPSURFACEPROC) (EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, const EGLint * attrib_list); +typedef EGLSurface ( * PFNEGLCREATEWINDOWSURFACEPROC) (EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint * attrib_list); +typedef EGLBoolean ( * PFNEGLDESTROYCONTEXTPROC) (EGLDisplay dpy, EGLContext ctx); +typedef EGLBoolean ( * PFNEGLDESTROYSURFACEPROC) (EGLDisplay dpy, EGLSurface surface); +typedef EGLBoolean ( * PFNEGLGETCONFIGATTRIBPROC) (EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint * value); +typedef EGLBoolean ( * PFNEGLGETCONFIGSPROC) (EGLDisplay dpy, EGLConfig * configs, EGLint config_size, EGLint * num_config); +typedef EGLDisplay ( * PFNEGLGETCURRENTDISPLAYPROC) ( void ); +typedef EGLSurface ( * PFNEGLGETCURRENTSURFACEPROC) (EGLint readdraw); +typedef EGLDisplay ( * PFNEGLGETDISPLAYPROC) (EGLNativeDisplayType display_id); +typedef EGLint ( * PFNEGLGETERRORPROC) ( void ); +typedef EGLBoolean ( * PFNEGLINITIALIZEPROC) (EGLDisplay dpy, EGLint * major, EGLint * minor); +typedef EGLBoolean ( * PFNEGLMAKECURRENTPROC) (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx); +typedef EGLBoolean ( * PFNEGLQUERYCONTEXTPROC) (EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint * value); +typedef const char * ( * PFNEGLQUERYSTRINGPROC) (EGLDisplay dpy, EGLint name); +typedef EGLBoolean ( * PFNEGLQUERYSURFACEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint * value); +typedef EGLBoolean ( * PFNEGLSWAPBUFFERSPROC) (EGLDisplay dpy, EGLSurface surface); +typedef EGLBoolean ( * PFNEGLTERMINATEPROC) (EGLDisplay dpy); +typedef EGLBoolean ( * PFNEGLWAITGLPROC) ( void ); +typedef EGLBoolean ( * PFNEGLWAITNATIVEPROC) (EGLint engine); + +#define eglChooseConfig EGLEW_GET_FUN(__eglewChooseConfig) +#define eglCopyBuffers EGLEW_GET_FUN(__eglewCopyBuffers) +#define eglCreateContext EGLEW_GET_FUN(__eglewCreateContext) +#define eglCreatePbufferSurface EGLEW_GET_FUN(__eglewCreatePbufferSurface) +#define eglCreatePixmapSurface EGLEW_GET_FUN(__eglewCreatePixmapSurface) +#define eglCreateWindowSurface EGLEW_GET_FUN(__eglewCreateWindowSurface) +#define eglDestroyContext EGLEW_GET_FUN(__eglewDestroyContext) +#define eglDestroySurface EGLEW_GET_FUN(__eglewDestroySurface) +#define eglGetConfigAttrib EGLEW_GET_FUN(__eglewGetConfigAttrib) +#define eglGetConfigs EGLEW_GET_FUN(__eglewGetConfigs) +#define eglGetCurrentDisplay EGLEW_GET_FUN(__eglewGetCurrentDisplay) +#define eglGetCurrentSurface EGLEW_GET_FUN(__eglewGetCurrentSurface) +#define eglGetDisplay EGLEW_GET_FUN(__eglewGetDisplay) +#define eglGetError EGLEW_GET_FUN(__eglewGetError) +#define eglInitialize EGLEW_GET_FUN(__eglewInitialize) +#define eglMakeCurrent EGLEW_GET_FUN(__eglewMakeCurrent) +#define eglQueryContext EGLEW_GET_FUN(__eglewQueryContext) +#define eglQueryString EGLEW_GET_FUN(__eglewQueryString) +#define eglQuerySurface EGLEW_GET_FUN(__eglewQuerySurface) +#define eglSwapBuffers EGLEW_GET_FUN(__eglewSwapBuffers) +#define eglTerminate EGLEW_GET_FUN(__eglewTerminate) +#define eglWaitGL EGLEW_GET_FUN(__eglewWaitGL) +#define eglWaitNative EGLEW_GET_FUN(__eglewWaitNative) + +#define EGLEW_VERSION_1_0 EGLEW_GET_VAR(__EGLEW_VERSION_1_0) + +#endif /* EGL_VERSION_1_0 */ + +/* ---------------------------- EGL_VERSION_1_1 ---------------------------- */ + +#ifndef EGL_VERSION_1_1 +#define EGL_VERSION_1_1 1 + +#define EGL_CONTEXT_LOST 0x300E +#define EGL_BIND_TO_TEXTURE_RGB 0x3039 +#define EGL_BIND_TO_TEXTURE_RGBA 0x303A +#define EGL_MIN_SWAP_INTERVAL 0x303B +#define EGL_MAX_SWAP_INTERVAL 0x303C +#define EGL_NO_TEXTURE 0x305C +#define EGL_TEXTURE_RGB 0x305D +#define EGL_TEXTURE_RGBA 0x305E +#define EGL_TEXTURE_2D 0x305F +#define EGL_TEXTURE_FORMAT 0x3080 +#define EGL_TEXTURE_TARGET 0x3081 +#define EGL_MIPMAP_TEXTURE 0x3082 +#define EGL_MIPMAP_LEVEL 0x3083 +#define EGL_BACK_BUFFER 0x3084 + +typedef EGLBoolean ( * PFNEGLBINDTEXIMAGEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint buffer); +typedef EGLBoolean ( * PFNEGLRELEASETEXIMAGEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint buffer); +typedef EGLBoolean ( * PFNEGLSURFACEATTRIBPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value); +typedef EGLBoolean ( * PFNEGLSWAPINTERVALPROC) (EGLDisplay dpy, EGLint interval); + +#define eglBindTexImage EGLEW_GET_FUN(__eglewBindTexImage) +#define eglReleaseTexImage EGLEW_GET_FUN(__eglewReleaseTexImage) +#define eglSurfaceAttrib EGLEW_GET_FUN(__eglewSurfaceAttrib) +#define eglSwapInterval EGLEW_GET_FUN(__eglewSwapInterval) + +#define EGLEW_VERSION_1_1 EGLEW_GET_VAR(__EGLEW_VERSION_1_1) + +#endif /* EGL_VERSION_1_1 */ + +/* ---------------------------- EGL_VERSION_1_2 ---------------------------- */ + +#ifndef EGL_VERSION_1_2 +#define EGL_VERSION_1_2 1 + +#define EGL_OPENGL_ES_BIT 0x0001 +#define EGL_OPENVG_BIT 0x0002 +#define EGL_LUMINANCE_SIZE 0x303D +#define EGL_ALPHA_MASK_SIZE 0x303E +#define EGL_COLOR_BUFFER_TYPE 0x303F +#define EGL_RENDERABLE_TYPE 0x3040 +#define EGL_SINGLE_BUFFER 0x3085 +#define EGL_RENDER_BUFFER 0x3086 +#define EGL_COLORSPACE 0x3087 +#define EGL_ALPHA_FORMAT 0x3088 +#define EGL_COLORSPACE_LINEAR 0x308A +#define EGL_ALPHA_FORMAT_NONPRE 0x308B +#define EGL_ALPHA_FORMAT_PRE 0x308C +#define EGL_CLIENT_APIS 0x308D +#define EGL_RGB_BUFFER 0x308E +#define EGL_LUMINANCE_BUFFER 0x308F +#define EGL_HORIZONTAL_RESOLUTION 0x3090 +#define EGL_VERTICAL_RESOLUTION 0x3091 +#define EGL_PIXEL_ASPECT_RATIO 0x3092 +#define EGL_SWAP_BEHAVIOR 0x3093 +#define EGL_BUFFER_PRESERVED 0x3094 +#define EGL_BUFFER_DESTROYED 0x3095 +#define EGL_OPENVG_IMAGE 0x3096 +#define EGL_CONTEXT_CLIENT_TYPE 0x3097 +#define EGL_OPENGL_ES_API 0x30A0 +#define EGL_OPENVG_API 0x30A1 +#define EGL_DISPLAY_SCALING 10000 + +typedef EGLBoolean ( * PFNEGLBINDAPIPROC) (EGLenum api); +typedef EGLSurface ( * PFNEGLCREATEPBUFFERFROMCLIENTBUFFERPROC) (EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint * attrib_list); +typedef EGLenum ( * PFNEGLQUERYAPIPROC) ( void ); +typedef EGLBoolean ( * PFNEGLRELEASETHREADPROC) ( void ); +typedef EGLBoolean ( * PFNEGLWAITCLIENTPROC) ( void ); + +#define eglBindAPI EGLEW_GET_FUN(__eglewBindAPI) +#define eglCreatePbufferFromClientBuffer EGLEW_GET_FUN(__eglewCreatePbufferFromClientBuffer) +#define eglQueryAPI EGLEW_GET_FUN(__eglewQueryAPI) +#define eglReleaseThread EGLEW_GET_FUN(__eglewReleaseThread) +#define eglWaitClient EGLEW_GET_FUN(__eglewWaitClient) + +#define EGLEW_VERSION_1_2 EGLEW_GET_VAR(__EGLEW_VERSION_1_2) + +#endif /* EGL_VERSION_1_2 */ + +/* ---------------------------- EGL_VERSION_1_3 ---------------------------- */ + +#ifndef EGL_VERSION_1_3 +#define EGL_VERSION_1_3 1 + +#define EGL_OPENGL_ES2_BIT 0x0004 +#define EGL_VG_COLORSPACE_LINEAR_BIT 0x0020 +#define EGL_VG_ALPHA_FORMAT_PRE_BIT 0x0040 +#define EGL_MATCH_NATIVE_PIXMAP 0x3041 +#define EGL_CONFORMANT 0x3042 +#define EGL_VG_COLORSPACE 0x3087 +#define EGL_VG_ALPHA_FORMAT 0x3088 +#define EGL_VG_COLORSPACE_LINEAR 0x308A +#define EGL_VG_ALPHA_FORMAT_NONPRE 0x308B +#define EGL_VG_ALPHA_FORMAT_PRE 0x308C +#define EGL_CONTEXT_CLIENT_VERSION 0x3098 + +#define EGLEW_VERSION_1_3 EGLEW_GET_VAR(__EGLEW_VERSION_1_3) + +#endif /* EGL_VERSION_1_3 */ + +/* ---------------------------- EGL_VERSION_1_4 ---------------------------- */ + +#ifndef EGL_VERSION_1_4 +#define EGL_VERSION_1_4 1 + +#define EGL_OPENGL_BIT 0x0008 +#define EGL_MULTISAMPLE_RESOLVE_BOX_BIT 0x0200 +#define EGL_SWAP_BEHAVIOR_PRESERVED_BIT 0x0400 +#define EGL_MULTISAMPLE_RESOLVE 0x3099 +#define EGL_MULTISAMPLE_RESOLVE_DEFAULT 0x309A +#define EGL_MULTISAMPLE_RESOLVE_BOX 0x309B +#define EGL_OPENGL_API 0x30A2 + +typedef EGLContext ( * PFNEGLGETCURRENTCONTEXTPROC) ( void ); + +#define eglGetCurrentContext EGLEW_GET_FUN(__eglewGetCurrentContext) + +#define EGLEW_VERSION_1_4 EGLEW_GET_VAR(__EGLEW_VERSION_1_4) + +#endif /* EGL_VERSION_1_4 */ + +/* ---------------------------- EGL_VERSION_1_5 ---------------------------- */ + +#ifndef EGL_VERSION_1_5 +#define EGL_VERSION_1_5 1 + +#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT 0x00000001 +#define EGL_SYNC_FLUSH_COMMANDS_BIT 0x0001 +#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT 0x00000002 +#define EGL_OPENGL_ES3_BIT 0x00000040 +#define EGL_GL_COLORSPACE_SRGB 0x3089 +#define EGL_GL_COLORSPACE_LINEAR 0x308A +#define EGL_CONTEXT_MAJOR_VERSION 0x3098 +#define EGL_CL_EVENT_HANDLE 0x309C +#define EGL_GL_COLORSPACE 0x309D +#define EGL_GL_TEXTURE_2D 0x30B1 +#define EGL_GL_TEXTURE_3D 0x30B2 +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x30B3 +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x30B4 +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x30B5 +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x30B6 +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x30B7 +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x30B8 +#define EGL_GL_RENDERBUFFER 0x30B9 +#define EGL_GL_TEXTURE_LEVEL 0x30BC +#define EGL_GL_TEXTURE_ZOFFSET 0x30BD +#define EGL_IMAGE_PRESERVED 0x30D2 +#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE 0x30F0 +#define EGL_SYNC_STATUS 0x30F1 +#define EGL_SIGNALED 0x30F2 +#define EGL_UNSIGNALED 0x30F3 +#define EGL_TIMEOUT_EXPIRED 0x30F5 +#define EGL_CONDITION_SATISFIED 0x30F6 +#define EGL_SYNC_TYPE 0x30F7 +#define EGL_SYNC_CONDITION 0x30F8 +#define EGL_SYNC_FENCE 0x30F9 +#define EGL_CONTEXT_MINOR_VERSION 0x30FB +#define EGL_CONTEXT_OPENGL_PROFILE_MASK 0x30FD +#define EGL_SYNC_CL_EVENT 0x30FE +#define EGL_SYNC_CL_EVENT_COMPLETE 0x30FF +#define EGL_CONTEXT_OPENGL_DEBUG 0x31B0 +#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE 0x31B1 +#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS 0x31B2 +#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY 0x31BD +#define EGL_NO_RESET_NOTIFICATION 0x31BE +#define EGL_LOSE_CONTEXT_ON_RESET 0x31BF +#define EGL_FOREVER 0xFFFFFFFFFFFFFFFF + +typedef EGLint ( * PFNEGLCLIENTWAITSYNCPROC) (EGLDisplay dpy, EGLSync sync, EGLint flags, EGLTime timeout); +typedef EGLImage ( * PFNEGLCREATEIMAGEPROC) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLAttrib * attrib_list); +typedef EGLSurface ( * PFNEGLCREATEPLATFORMPIXMAPSURFACEPROC) (EGLDisplay dpy, EGLConfig config, void * native_pixmap, const EGLAttrib * attrib_list); +typedef EGLSurface ( * PFNEGLCREATEPLATFORMWINDOWSURFACEPROC) (EGLDisplay dpy, EGLConfig config, void * native_window, const EGLAttrib * attrib_list); +typedef EGLSync ( * PFNEGLCREATESYNCPROC) (EGLDisplay dpy, EGLenum type, const EGLAttrib * attrib_list); +typedef EGLBoolean ( * PFNEGLDESTROYIMAGEPROC) (EGLDisplay dpy, EGLImage image); +typedef EGLBoolean ( * PFNEGLDESTROYSYNCPROC) (EGLDisplay dpy, EGLSync sync); +typedef EGLDisplay ( * PFNEGLGETPLATFORMDISPLAYPROC) (EGLenum platform, void * native_display, const EGLAttrib * attrib_list); +typedef EGLBoolean ( * PFNEGLGETSYNCATTRIBPROC) (EGLDisplay dpy, EGLSync sync, EGLint attribute, EGLAttrib * value); +typedef EGLBoolean ( * PFNEGLWAITSYNCPROC) (EGLDisplay dpy, EGLSync sync, EGLint flags); + +#define eglClientWaitSync EGLEW_GET_FUN(__eglewClientWaitSync) +#define eglCreateImage EGLEW_GET_FUN(__eglewCreateImage) +#define eglCreatePlatformPixmapSurface EGLEW_GET_FUN(__eglewCreatePlatformPixmapSurface) +#define eglCreatePlatformWindowSurface EGLEW_GET_FUN(__eglewCreatePlatformWindowSurface) +#define eglCreateSync EGLEW_GET_FUN(__eglewCreateSync) +#define eglDestroyImage EGLEW_GET_FUN(__eglewDestroyImage) +#define eglDestroySync EGLEW_GET_FUN(__eglewDestroySync) +#define eglGetPlatformDisplay EGLEW_GET_FUN(__eglewGetPlatformDisplay) +#define eglGetSyncAttrib EGLEW_GET_FUN(__eglewGetSyncAttrib) +#define eglWaitSync EGLEW_GET_FUN(__eglewWaitSync) + +#define EGLEW_VERSION_1_5 EGLEW_GET_VAR(__EGLEW_VERSION_1_5) + +#endif /* EGL_VERSION_1_5 */ + +/* ------------------------- EGL_ANDROID_blob_cache ------------------------ */ + +#ifndef EGL_ANDROID_blob_cache +#define EGL_ANDROID_blob_cache 1 + +typedef void ( * PFNEGLSETBLOBCACHEFUNCSANDROIDPROC) (EGLDisplay dpy, EGLSetBlobFuncANDROID set, EGLGetBlobFuncANDROID get); + +#define eglSetBlobCacheFuncsANDROID EGLEW_GET_FUN(__eglewSetBlobCacheFuncsANDROID) + +#define EGLEW_ANDROID_blob_cache EGLEW_GET_VAR(__EGLEW_ANDROID_blob_cache) + +#endif /* EGL_ANDROID_blob_cache */ + +/* ---------------- EGL_ANDROID_create_native_client_buffer ---------------- */ + +#ifndef EGL_ANDROID_create_native_client_buffer +#define EGL_ANDROID_create_native_client_buffer 1 + +#define EGL_NATIVE_BUFFER_USAGE_PROTECTED_BIT_ANDROID 0x00000001 +#define EGL_NATIVE_BUFFER_USAGE_RENDERBUFFER_BIT_ANDROID 0x00000002 +#define EGL_NATIVE_BUFFER_USAGE_TEXTURE_BIT_ANDROID 0x00000004 +#define EGL_NATIVE_BUFFER_USAGE_ANDROID 0x3143 + +typedef EGLClientBuffer ( * PFNEGLCREATENATIVECLIENTBUFFERANDROIDPROC) (const EGLint * attrib_list); + +#define eglCreateNativeClientBufferANDROID EGLEW_GET_FUN(__eglewCreateNativeClientBufferANDROID) + +#define EGLEW_ANDROID_create_native_client_buffer EGLEW_GET_VAR(__EGLEW_ANDROID_create_native_client_buffer) + +#endif /* EGL_ANDROID_create_native_client_buffer */ + +/* --------------------- EGL_ANDROID_framebuffer_target -------------------- */ + +#ifndef EGL_ANDROID_framebuffer_target +#define EGL_ANDROID_framebuffer_target 1 + +#define EGL_FRAMEBUFFER_TARGET_ANDROID 0x3147 + +#define EGLEW_ANDROID_framebuffer_target EGLEW_GET_VAR(__EGLEW_ANDROID_framebuffer_target) + +#endif /* EGL_ANDROID_framebuffer_target */ + +/* ----------------- EGL_ANDROID_front_buffer_auto_refresh ----------------- */ + +#ifndef EGL_ANDROID_front_buffer_auto_refresh +#define EGL_ANDROID_front_buffer_auto_refresh 1 + +#define EGL_FRONT_BUFFER_AUTO_REFRESH_ANDROID 0x314C + +#define EGLEW_ANDROID_front_buffer_auto_refresh EGLEW_GET_VAR(__EGLEW_ANDROID_front_buffer_auto_refresh) + +#endif /* EGL_ANDROID_front_buffer_auto_refresh */ + +/* -------------------- EGL_ANDROID_image_native_buffer -------------------- */ + +#ifndef EGL_ANDROID_image_native_buffer +#define EGL_ANDROID_image_native_buffer 1 + +#define EGL_NATIVE_BUFFER_ANDROID 0x3140 + +#define EGLEW_ANDROID_image_native_buffer EGLEW_GET_VAR(__EGLEW_ANDROID_image_native_buffer) + +#endif /* EGL_ANDROID_image_native_buffer */ + +/* --------------------- EGL_ANDROID_native_fence_sync --------------------- */ + +#ifndef EGL_ANDROID_native_fence_sync +#define EGL_ANDROID_native_fence_sync 1 + +#define EGL_SYNC_NATIVE_FENCE_ANDROID 0x3144 +#define EGL_SYNC_NATIVE_FENCE_FD_ANDROID 0x3145 +#define EGL_SYNC_NATIVE_FENCE_SIGNALED_ANDROID 0x3146 + +typedef EGLint ( * PFNEGLDUPNATIVEFENCEFDANDROIDPROC) (EGLDisplay dpy, EGLSyncKHR sync); + +#define eglDupNativeFenceFDANDROID EGLEW_GET_FUN(__eglewDupNativeFenceFDANDROID) + +#define EGLEW_ANDROID_native_fence_sync EGLEW_GET_VAR(__EGLEW_ANDROID_native_fence_sync) + +#endif /* EGL_ANDROID_native_fence_sync */ + +/* --------------------- EGL_ANDROID_presentation_time --------------------- */ + +#ifndef EGL_ANDROID_presentation_time +#define EGL_ANDROID_presentation_time 1 + +typedef EGLBoolean ( * PFNEGLPRESENTATIONTIMEANDROIDPROC) (EGLDisplay dpy, EGLSurface surface, EGLnsecsANDROID time); + +#define eglPresentationTimeANDROID EGLEW_GET_FUN(__eglewPresentationTimeANDROID) + +#define EGLEW_ANDROID_presentation_time EGLEW_GET_VAR(__EGLEW_ANDROID_presentation_time) + +#endif /* EGL_ANDROID_presentation_time */ + +/* ------------------------- EGL_ANDROID_recordable ------------------------ */ + +#ifndef EGL_ANDROID_recordable +#define EGL_ANDROID_recordable 1 + +#define EGL_RECORDABLE_ANDROID 0x3142 + +#define EGLEW_ANDROID_recordable EGLEW_GET_VAR(__EGLEW_ANDROID_recordable) + +#endif /* EGL_ANDROID_recordable */ + +/* ---------------- EGL_ANGLE_d3d_share_handle_client_buffer --------------- */ + +#ifndef EGL_ANGLE_d3d_share_handle_client_buffer +#define EGL_ANGLE_d3d_share_handle_client_buffer 1 + +#define EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE 0x3200 + +#define EGLEW_ANGLE_d3d_share_handle_client_buffer EGLEW_GET_VAR(__EGLEW_ANGLE_d3d_share_handle_client_buffer) + +#endif /* EGL_ANGLE_d3d_share_handle_client_buffer */ + +/* -------------------------- EGL_ANGLE_device_d3d ------------------------- */ + +#ifndef EGL_ANGLE_device_d3d +#define EGL_ANGLE_device_d3d 1 + +#define EGL_D3D9_DEVICE_ANGLE 0x33A0 +#define EGL_D3D11_DEVICE_ANGLE 0x33A1 + +#define EGLEW_ANGLE_device_d3d EGLEW_GET_VAR(__EGLEW_ANGLE_device_d3d) + +#endif /* EGL_ANGLE_device_d3d */ + +/* -------------------- EGL_ANGLE_query_surface_pointer -------------------- */ + +#ifndef EGL_ANGLE_query_surface_pointer +#define EGL_ANGLE_query_surface_pointer 1 + +typedef EGLBoolean ( * PFNEGLQUERYSURFACEPOINTERANGLEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, void ** value); + +#define eglQuerySurfacePointerANGLE EGLEW_GET_FUN(__eglewQuerySurfacePointerANGLE) + +#define EGLEW_ANGLE_query_surface_pointer EGLEW_GET_VAR(__EGLEW_ANGLE_query_surface_pointer) + +#endif /* EGL_ANGLE_query_surface_pointer */ + +/* ------------- EGL_ANGLE_surface_d3d_texture_2d_share_handle ------------- */ + +#ifndef EGL_ANGLE_surface_d3d_texture_2d_share_handle +#define EGL_ANGLE_surface_d3d_texture_2d_share_handle 1 + +#define EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE 0x3200 + +#define EGLEW_ANGLE_surface_d3d_texture_2d_share_handle EGLEW_GET_VAR(__EGLEW_ANGLE_surface_d3d_texture_2d_share_handle) + +#endif /* EGL_ANGLE_surface_d3d_texture_2d_share_handle */ + +/* ---------------------- EGL_ANGLE_window_fixed_size ---------------------- */ + +#ifndef EGL_ANGLE_window_fixed_size +#define EGL_ANGLE_window_fixed_size 1 + +#define EGL_FIXED_SIZE_ANGLE 0x3201 + +#define EGLEW_ANGLE_window_fixed_size EGLEW_GET_VAR(__EGLEW_ANGLE_window_fixed_size) + +#endif /* EGL_ANGLE_window_fixed_size */ + +/* --------------------- EGL_ARM_implicit_external_sync -------------------- */ + +#ifndef EGL_ARM_implicit_external_sync +#define EGL_ARM_implicit_external_sync 1 + +#define EGL_SYNC_PRIOR_COMMANDS_IMPLICIT_EXTERNAL_ARM 0x328A + +#define EGLEW_ARM_implicit_external_sync EGLEW_GET_VAR(__EGLEW_ARM_implicit_external_sync) + +#endif /* EGL_ARM_implicit_external_sync */ + +/* ------------------- EGL_ARM_pixmap_multisample_discard ------------------ */ + +#ifndef EGL_ARM_pixmap_multisample_discard +#define EGL_ARM_pixmap_multisample_discard 1 + +#define EGL_DISCARD_SAMPLES_ARM 0x3286 + +#define EGLEW_ARM_pixmap_multisample_discard EGLEW_GET_VAR(__EGLEW_ARM_pixmap_multisample_discard) + +#endif /* EGL_ARM_pixmap_multisample_discard */ + +/* --------------------------- EGL_EXT_buffer_age -------------------------- */ + +#ifndef EGL_EXT_buffer_age +#define EGL_EXT_buffer_age 1 + +#define EGL_BUFFER_AGE_EXT 0x313D + +#define EGLEW_EXT_buffer_age EGLEW_GET_VAR(__EGLEW_EXT_buffer_age) + +#endif /* EGL_EXT_buffer_age */ + +/* ----------------------- EGL_EXT_client_extensions ----------------------- */ + +#ifndef EGL_EXT_client_extensions +#define EGL_EXT_client_extensions 1 + +#define EGLEW_EXT_client_extensions EGLEW_GET_VAR(__EGLEW_EXT_client_extensions) + +#endif /* EGL_EXT_client_extensions */ + +/* ------------------- EGL_EXT_create_context_robustness ------------------- */ + +#ifndef EGL_EXT_create_context_robustness +#define EGL_EXT_create_context_robustness 1 + +#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT 0x30BF +#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT 0x3138 +#define EGL_NO_RESET_NOTIFICATION_EXT 0x31BE +#define EGL_LOSE_CONTEXT_ON_RESET_EXT 0x31BF + +#define EGLEW_EXT_create_context_robustness EGLEW_GET_VAR(__EGLEW_EXT_create_context_robustness) + +#endif /* EGL_EXT_create_context_robustness */ + +/* -------------------------- EGL_EXT_device_base -------------------------- */ + +#ifndef EGL_EXT_device_base +#define EGL_EXT_device_base 1 + +#define EGL_BAD_DEVICE_EXT 0x322B +#define EGL_DEVICE_EXT 0x322C + +#define EGLEW_EXT_device_base EGLEW_GET_VAR(__EGLEW_EXT_device_base) + +#endif /* EGL_EXT_device_base */ + +/* --------------------------- EGL_EXT_device_drm -------------------------- */ + +#ifndef EGL_EXT_device_drm +#define EGL_EXT_device_drm 1 + +#define EGL_DRM_DEVICE_FILE_EXT 0x3233 + +#define EGLEW_EXT_device_drm EGLEW_GET_VAR(__EGLEW_EXT_device_drm) + +#endif /* EGL_EXT_device_drm */ + +/* ----------------------- EGL_EXT_device_enumeration ---------------------- */ + +#ifndef EGL_EXT_device_enumeration +#define EGL_EXT_device_enumeration 1 + +typedef EGLBoolean ( * PFNEGLQUERYDEVICESEXTPROC) (EGLint max_devices, EGLDeviceEXT * devices, EGLint * num_devices); + +#define eglQueryDevicesEXT EGLEW_GET_FUN(__eglewQueryDevicesEXT) + +#define EGLEW_EXT_device_enumeration EGLEW_GET_VAR(__EGLEW_EXT_device_enumeration) + +#endif /* EGL_EXT_device_enumeration */ + +/* ------------------------- EGL_EXT_device_openwf ------------------------- */ + +#ifndef EGL_EXT_device_openwf +#define EGL_EXT_device_openwf 1 + +#define EGL_OPENWF_DEVICE_ID_EXT 0x3237 + +#define EGLEW_EXT_device_openwf EGLEW_GET_VAR(__EGLEW_EXT_device_openwf) + +#endif /* EGL_EXT_device_openwf */ + +/* -------------------------- EGL_EXT_device_query ------------------------- */ + +#ifndef EGL_EXT_device_query +#define EGL_EXT_device_query 1 + +#define EGL_BAD_DEVICE_EXT 0x322B +#define EGL_DEVICE_EXT 0x322C + +typedef EGLBoolean ( * PFNEGLQUERYDEVICEATTRIBEXTPROC) (EGLDeviceEXT device, EGLint attribute, EGLAttrib * value); +typedef const char * ( * PFNEGLQUERYDEVICESTRINGEXTPROC) (EGLDeviceEXT device, EGLint name); +typedef EGLBoolean ( * PFNEGLQUERYDISPLAYATTRIBEXTPROC) (EGLDisplay dpy, EGLint attribute, EGLAttrib * value); + +#define eglQueryDeviceAttribEXT EGLEW_GET_FUN(__eglewQueryDeviceAttribEXT) +#define eglQueryDeviceStringEXT EGLEW_GET_FUN(__eglewQueryDeviceStringEXT) +#define eglQueryDisplayAttribEXT EGLEW_GET_FUN(__eglewQueryDisplayAttribEXT) + +#define EGLEW_EXT_device_query EGLEW_GET_VAR(__EGLEW_EXT_device_query) + +#endif /* EGL_EXT_device_query */ + +/* ------------------ EGL_EXT_gl_colorspace_bt2020_linear ------------------ */ + +#ifndef EGL_EXT_gl_colorspace_bt2020_linear +#define EGL_EXT_gl_colorspace_bt2020_linear 1 + +#define EGL_GL_COLORSPACE_BT2020_LINEAR_EXT 0x333F + +#define EGLEW_EXT_gl_colorspace_bt2020_linear EGLEW_GET_VAR(__EGLEW_EXT_gl_colorspace_bt2020_linear) + +#endif /* EGL_EXT_gl_colorspace_bt2020_linear */ + +/* -------------------- EGL_EXT_gl_colorspace_bt2020_pq -------------------- */ + +#ifndef EGL_EXT_gl_colorspace_bt2020_pq +#define EGL_EXT_gl_colorspace_bt2020_pq 1 + +#define EGL_GL_COLORSPACE_BT2020_PQ_EXT 0x3340 + +#define EGLEW_EXT_gl_colorspace_bt2020_pq EGLEW_GET_VAR(__EGLEW_EXT_gl_colorspace_bt2020_pq) + +#endif /* EGL_EXT_gl_colorspace_bt2020_pq */ + +/* ------------------- EGL_EXT_gl_colorspace_scrgb_linear ------------------ */ + +#ifndef EGL_EXT_gl_colorspace_scrgb_linear +#define EGL_EXT_gl_colorspace_scrgb_linear 1 + +#define EGL_GL_COLORSPACE_SCRGB_LINEAR_EXT 0x3350 + +#define EGLEW_EXT_gl_colorspace_scrgb_linear EGLEW_GET_VAR(__EGLEW_EXT_gl_colorspace_scrgb_linear) + +#endif /* EGL_EXT_gl_colorspace_scrgb_linear */ + +/* ---------------------- EGL_EXT_image_dma_buf_import --------------------- */ + +#ifndef EGL_EXT_image_dma_buf_import +#define EGL_EXT_image_dma_buf_import 1 + +#define EGL_LINUX_DMA_BUF_EXT 0x3270 +#define EGL_LINUX_DRM_FOURCC_EXT 0x3271 +#define EGL_DMA_BUF_PLANE0_FD_EXT 0x3272 +#define EGL_DMA_BUF_PLANE0_OFFSET_EXT 0x3273 +#define EGL_DMA_BUF_PLANE0_PITCH_EXT 0x3274 +#define EGL_DMA_BUF_PLANE1_FD_EXT 0x3275 +#define EGL_DMA_BUF_PLANE1_OFFSET_EXT 0x3276 +#define EGL_DMA_BUF_PLANE1_PITCH_EXT 0x3277 +#define EGL_DMA_BUF_PLANE2_FD_EXT 0x3278 +#define EGL_DMA_BUF_PLANE2_OFFSET_EXT 0x3279 +#define EGL_DMA_BUF_PLANE2_PITCH_EXT 0x327A +#define EGL_YUV_COLOR_SPACE_HINT_EXT 0x327B +#define EGL_SAMPLE_RANGE_HINT_EXT 0x327C +#define EGL_YUV_CHROMA_HORIZONTAL_SITING_HINT_EXT 0x327D +#define EGL_YUV_CHROMA_VERTICAL_SITING_HINT_EXT 0x327E +#define EGL_ITU_REC601_EXT 0x327F +#define EGL_ITU_REC709_EXT 0x3280 +#define EGL_ITU_REC2020_EXT 0x3281 +#define EGL_YUV_FULL_RANGE_EXT 0x3282 +#define EGL_YUV_NARROW_RANGE_EXT 0x3283 +#define EGL_YUV_CHROMA_SITING_0_EXT 0x3284 +#define EGL_YUV_CHROMA_SITING_0_5_EXT 0x3285 + +#define EGLEW_EXT_image_dma_buf_import EGLEW_GET_VAR(__EGLEW_EXT_image_dma_buf_import) + +#endif /* EGL_EXT_image_dma_buf_import */ + +/* ----------------- EGL_EXT_image_dma_buf_import_modifiers ---------------- */ + +#ifndef EGL_EXT_image_dma_buf_import_modifiers +#define EGL_EXT_image_dma_buf_import_modifiers 1 + +#define EGL_DMA_BUF_PLANE3_FD_EXT 0x3440 +#define EGL_DMA_BUF_PLANE3_OFFSET_EXT 0x3441 +#define EGL_DMA_BUF_PLANE3_PITCH_EXT 0x3442 +#define EGL_DMA_BUF_PLANE0_MODIFIER_LO_EXT 0x3443 +#define EGL_DMA_BUF_PLANE0_MODIFIER_HI_EXT 0x3444 +#define EGL_DMA_BUF_PLANE1_MODIFIER_LO_EXT 0x3445 +#define EGL_DMA_BUF_PLANE1_MODIFIER_HI_EXT 0x3446 +#define EGL_DMA_BUF_PLANE2_MODIFIER_LO_EXT 0x3447 +#define EGL_DMA_BUF_PLANE2_MODIFIER_HI_EXT 0x3448 +#define EGL_DMA_BUF_PLANE3_MODIFIER_LO_EXT 0x3449 +#define EGL_DMA_BUF_PLANE3_MODIFIER_HI_EXT 0x344A + +typedef EGLBoolean ( * PFNEGLQUERYDMABUFFORMATSEXTPROC) (EGLDisplay dpy, EGLint max_formats, EGLint *formats, EGLint *num_formats); +typedef EGLBoolean ( * PFNEGLQUERYDMABUFMODIFIERSEXTPROC) (EGLDisplay dpy, EGLint format, EGLint max_modifiers, EGLuint64KHR *modifiers, EGLBoolean *external_only, EGLint *num_modifiers); + +#define eglQueryDmaBufFormatsEXT EGLEW_GET_FUN(__eglewQueryDmaBufFormatsEXT) +#define eglQueryDmaBufModifiersEXT EGLEW_GET_FUN(__eglewQueryDmaBufModifiersEXT) + +#define EGLEW_EXT_image_dma_buf_import_modifiers EGLEW_GET_VAR(__EGLEW_EXT_image_dma_buf_import_modifiers) + +#endif /* EGL_EXT_image_dma_buf_import_modifiers */ + +/* ------------------------ EGL_EXT_multiview_window ----------------------- */ + +#ifndef EGL_EXT_multiview_window +#define EGL_EXT_multiview_window 1 + +#define EGL_MULTIVIEW_VIEW_COUNT_EXT 0x3134 + +#define EGLEW_EXT_multiview_window EGLEW_GET_VAR(__EGLEW_EXT_multiview_window) + +#endif /* EGL_EXT_multiview_window */ + +/* -------------------------- EGL_EXT_output_base -------------------------- */ + +#ifndef EGL_EXT_output_base +#define EGL_EXT_output_base 1 + +#define EGL_BAD_OUTPUT_LAYER_EXT 0x322D +#define EGL_BAD_OUTPUT_PORT_EXT 0x322E +#define EGL_SWAP_INTERVAL_EXT 0x322F + +typedef EGLBoolean ( * PFNEGLGETOUTPUTLAYERSEXTPROC) (EGLDisplay dpy, const EGLAttrib * attrib_list, EGLOutputLayerEXT * layers, EGLint max_layers, EGLint * num_layers); +typedef EGLBoolean ( * PFNEGLGETOUTPUTPORTSEXTPROC) (EGLDisplay dpy, const EGLAttrib * attrib_list, EGLOutputPortEXT * ports, EGLint max_ports, EGLint * num_ports); +typedef EGLBoolean ( * PFNEGLOUTPUTLAYERATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint attribute, EGLAttrib value); +typedef EGLBoolean ( * PFNEGLOUTPUTPORTATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputPortEXT port, EGLint attribute, EGLAttrib value); +typedef EGLBoolean ( * PFNEGLQUERYOUTPUTLAYERATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint attribute, EGLAttrib * value); +typedef const char * ( * PFNEGLQUERYOUTPUTLAYERSTRINGEXTPROC) (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint name); +typedef EGLBoolean ( * PFNEGLQUERYOUTPUTPORTATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputPortEXT port, EGLint attribute, EGLAttrib * value); +typedef const char * ( * PFNEGLQUERYOUTPUTPORTSTRINGEXTPROC) (EGLDisplay dpy, EGLOutputPortEXT port, EGLint name); + +#define eglGetOutputLayersEXT EGLEW_GET_FUN(__eglewGetOutputLayersEXT) +#define eglGetOutputPortsEXT EGLEW_GET_FUN(__eglewGetOutputPortsEXT) +#define eglOutputLayerAttribEXT EGLEW_GET_FUN(__eglewOutputLayerAttribEXT) +#define eglOutputPortAttribEXT EGLEW_GET_FUN(__eglewOutputPortAttribEXT) +#define eglQueryOutputLayerAttribEXT EGLEW_GET_FUN(__eglewQueryOutputLayerAttribEXT) +#define eglQueryOutputLayerStringEXT EGLEW_GET_FUN(__eglewQueryOutputLayerStringEXT) +#define eglQueryOutputPortAttribEXT EGLEW_GET_FUN(__eglewQueryOutputPortAttribEXT) +#define eglQueryOutputPortStringEXT EGLEW_GET_FUN(__eglewQueryOutputPortStringEXT) + +#define EGLEW_EXT_output_base EGLEW_GET_VAR(__EGLEW_EXT_output_base) + +#endif /* EGL_EXT_output_base */ + +/* --------------------------- EGL_EXT_output_drm -------------------------- */ + +#ifndef EGL_EXT_output_drm +#define EGL_EXT_output_drm 1 + +#define EGL_DRM_CRTC_EXT 0x3234 +#define EGL_DRM_PLANE_EXT 0x3235 +#define EGL_DRM_CONNECTOR_EXT 0x3236 + +#define EGLEW_EXT_output_drm EGLEW_GET_VAR(__EGLEW_EXT_output_drm) + +#endif /* EGL_EXT_output_drm */ + +/* ------------------------- EGL_EXT_output_openwf ------------------------- */ + +#ifndef EGL_EXT_output_openwf +#define EGL_EXT_output_openwf 1 + +#define EGL_OPENWF_PIPELINE_ID_EXT 0x3238 +#define EGL_OPENWF_PORT_ID_EXT 0x3239 + +#define EGLEW_EXT_output_openwf EGLEW_GET_VAR(__EGLEW_EXT_output_openwf) + +#endif /* EGL_EXT_output_openwf */ + +/* ----------------------- EGL_EXT_pixel_format_float ---------------------- */ + +#ifndef EGL_EXT_pixel_format_float +#define EGL_EXT_pixel_format_float 1 + +#define EGL_COLOR_COMPONENT_TYPE_EXT 0x3339 +#define EGL_COLOR_COMPONENT_TYPE_FIXED_EXT 0x333A +#define EGL_COLOR_COMPONENT_TYPE_FLOAT_EXT 0x333B + +#define EGLEW_EXT_pixel_format_float EGLEW_GET_VAR(__EGLEW_EXT_pixel_format_float) + +#endif /* EGL_EXT_pixel_format_float */ + +/* ------------------------- EGL_EXT_platform_base ------------------------- */ + +#ifndef EGL_EXT_platform_base +#define EGL_EXT_platform_base 1 + +typedef EGLSurface ( * PFNEGLCREATEPLATFORMPIXMAPSURFACEEXTPROC) (EGLDisplay dpy, EGLConfig config, void * native_pixmap, const EGLint * attrib_list); +typedef EGLSurface ( * PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC) (EGLDisplay dpy, EGLConfig config, void * native_window, const EGLint * attrib_list); +typedef EGLDisplay ( * PFNEGLGETPLATFORMDISPLAYEXTPROC) (EGLenum platform, void * native_display, const EGLint * attrib_list); + +#define eglCreatePlatformPixmapSurfaceEXT EGLEW_GET_FUN(__eglewCreatePlatformPixmapSurfaceEXT) +#define eglCreatePlatformWindowSurfaceEXT EGLEW_GET_FUN(__eglewCreatePlatformWindowSurfaceEXT) +#define eglGetPlatformDisplayEXT EGLEW_GET_FUN(__eglewGetPlatformDisplayEXT) + +#define EGLEW_EXT_platform_base EGLEW_GET_VAR(__EGLEW_EXT_platform_base) + +#endif /* EGL_EXT_platform_base */ + +/* ------------------------ EGL_EXT_platform_device ------------------------ */ + +#ifndef EGL_EXT_platform_device +#define EGL_EXT_platform_device 1 + +#define EGL_PLATFORM_DEVICE_EXT 0x313F + +#define EGLEW_EXT_platform_device EGLEW_GET_VAR(__EGLEW_EXT_platform_device) + +#endif /* EGL_EXT_platform_device */ + +/* ------------------------ EGL_EXT_platform_wayland ----------------------- */ + +#ifndef EGL_EXT_platform_wayland +#define EGL_EXT_platform_wayland 1 + +#define EGL_PLATFORM_WAYLAND_EXT 0x31D8 + +#define EGLEW_EXT_platform_wayland EGLEW_GET_VAR(__EGLEW_EXT_platform_wayland) + +#endif /* EGL_EXT_platform_wayland */ + +/* -------------------------- EGL_EXT_platform_x11 ------------------------- */ + +#ifndef EGL_EXT_platform_x11 +#define EGL_EXT_platform_x11 1 + +#define EGL_PLATFORM_X11_EXT 0x31D5 +#define EGL_PLATFORM_X11_SCREEN_EXT 0x31D6 + +#define EGLEW_EXT_platform_x11 EGLEW_GET_VAR(__EGLEW_EXT_platform_x11) + +#endif /* EGL_EXT_platform_x11 */ + +/* ----------------------- EGL_EXT_protected_content ----------------------- */ + +#ifndef EGL_EXT_protected_content +#define EGL_EXT_protected_content 1 + +#define EGL_PROTECTED_CONTENT_EXT 0x32C0 + +#define EGLEW_EXT_protected_content EGLEW_GET_VAR(__EGLEW_EXT_protected_content) + +#endif /* EGL_EXT_protected_content */ + +/* ----------------------- EGL_EXT_protected_surface ----------------------- */ + +#ifndef EGL_EXT_protected_surface +#define EGL_EXT_protected_surface 1 + +#define EGL_PROTECTED_CONTENT_EXT 0x32C0 + +#define EGLEW_EXT_protected_surface EGLEW_GET_VAR(__EGLEW_EXT_protected_surface) + +#endif /* EGL_EXT_protected_surface */ + +/* ------------------- EGL_EXT_stream_consumer_egloutput ------------------- */ + +#ifndef EGL_EXT_stream_consumer_egloutput +#define EGL_EXT_stream_consumer_egloutput 1 + +typedef EGLBoolean ( * PFNEGLSTREAMCONSUMEROUTPUTEXTPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLOutputLayerEXT layer); + +#define eglStreamConsumerOutputEXT EGLEW_GET_FUN(__eglewStreamConsumerOutputEXT) + +#define EGLEW_EXT_stream_consumer_egloutput EGLEW_GET_VAR(__EGLEW_EXT_stream_consumer_egloutput) + +#endif /* EGL_EXT_stream_consumer_egloutput */ + +/* ------------------- EGL_EXT_surface_SMPTE2086_metadata ------------------ */ + +#ifndef EGL_EXT_surface_SMPTE2086_metadata +#define EGL_EXT_surface_SMPTE2086_metadata 1 + +#define EGL_SMPTE2086_DISPLAY_PRIMARY_RX_EXT 0x3341 +#define EGL_SMPTE2086_DISPLAY_PRIMARY_RY_EXT 0x3342 +#define EGL_SMPTE2086_DISPLAY_PRIMARY_GX_EXT 0x3343 +#define EGL_SMPTE2086_DISPLAY_PRIMARY_GY_EXT 0x3344 +#define EGL_SMPTE2086_DISPLAY_PRIMARY_BX_EXT 0x3345 +#define EGL_SMPTE2086_DISPLAY_PRIMARY_BY_EXT 0x3346 +#define EGL_SMPTE2086_WHITE_POINT_X_EXT 0x3347 +#define EGL_SMPTE2086_WHITE_POINT_Y_EXT 0x3348 +#define EGL_SMPTE2086_MAX_LUMINANCE_EXT 0x3349 +#define EGL_SMPTE2086_MIN_LUMINANCE_EXT 0x334A + +#define EGLEW_EXT_surface_SMPTE2086_metadata EGLEW_GET_VAR(__EGLEW_EXT_surface_SMPTE2086_metadata) + +#endif /* EGL_EXT_surface_SMPTE2086_metadata */ + +/* -------------------- EGL_EXT_swap_buffers_with_damage ------------------- */ + +#ifndef EGL_EXT_swap_buffers_with_damage +#define EGL_EXT_swap_buffers_with_damage 1 + +typedef EGLBoolean ( * PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC) (EGLDisplay dpy, EGLSurface surface, EGLint * rects, EGLint n_rects); + +#define eglSwapBuffersWithDamageEXT EGLEW_GET_FUN(__eglewSwapBuffersWithDamageEXT) + +#define EGLEW_EXT_swap_buffers_with_damage EGLEW_GET_VAR(__EGLEW_EXT_swap_buffers_with_damage) + +#endif /* EGL_EXT_swap_buffers_with_damage */ + +/* -------------------------- EGL_EXT_yuv_surface -------------------------- */ + +#ifndef EGL_EXT_yuv_surface +#define EGL_EXT_yuv_surface 1 + +#define EGL_YUV_BUFFER_EXT 0x3300 +#define EGL_YUV_ORDER_EXT 0x3301 +#define EGL_YUV_ORDER_YUV_EXT 0x3302 +#define EGL_YUV_ORDER_YVU_EXT 0x3303 +#define EGL_YUV_ORDER_YUYV_EXT 0x3304 +#define EGL_YUV_ORDER_UYVY_EXT 0x3305 +#define EGL_YUV_ORDER_YVYU_EXT 0x3306 +#define EGL_YUV_ORDER_VYUY_EXT 0x3307 +#define EGL_YUV_ORDER_AYUV_EXT 0x3308 +#define EGL_YUV_CSC_STANDARD_EXT 0x330A +#define EGL_YUV_CSC_STANDARD_601_EXT 0x330B +#define EGL_YUV_CSC_STANDARD_709_EXT 0x330C +#define EGL_YUV_CSC_STANDARD_2020_EXT 0x330D +#define EGL_YUV_NUMBER_OF_PLANES_EXT 0x3311 +#define EGL_YUV_SUBSAMPLE_EXT 0x3312 +#define EGL_YUV_SUBSAMPLE_4_2_0_EXT 0x3313 +#define EGL_YUV_SUBSAMPLE_4_2_2_EXT 0x3314 +#define EGL_YUV_SUBSAMPLE_4_4_4_EXT 0x3315 +#define EGL_YUV_DEPTH_RANGE_EXT 0x3317 +#define EGL_YUV_DEPTH_RANGE_LIMITED_EXT 0x3318 +#define EGL_YUV_DEPTH_RANGE_FULL_EXT 0x3319 +#define EGL_YUV_PLANE_BPP_EXT 0x331A +#define EGL_YUV_PLANE_BPP_0_EXT 0x331B +#define EGL_YUV_PLANE_BPP_8_EXT 0x331C +#define EGL_YUV_PLANE_BPP_10_EXT 0x331D + +#define EGLEW_EXT_yuv_surface EGLEW_GET_VAR(__EGLEW_EXT_yuv_surface) + +#endif /* EGL_EXT_yuv_surface */ + +/* -------------------------- EGL_HI_clientpixmap -------------------------- */ + +#ifndef EGL_HI_clientpixmap +#define EGL_HI_clientpixmap 1 + +#define EGL_CLIENT_PIXMAP_POINTER_HI 0x8F74 + +typedef EGLSurface ( * PFNEGLCREATEPIXMAPSURFACEHIPROC) (EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI * pixmap); + +#define eglCreatePixmapSurfaceHI EGLEW_GET_FUN(__eglewCreatePixmapSurfaceHI) + +#define EGLEW_HI_clientpixmap EGLEW_GET_VAR(__EGLEW_HI_clientpixmap) + +#endif /* EGL_HI_clientpixmap */ + +/* -------------------------- EGL_HI_colorformats -------------------------- */ + +#ifndef EGL_HI_colorformats +#define EGL_HI_colorformats 1 + +#define EGL_COLOR_FORMAT_HI 0x8F70 +#define EGL_COLOR_RGB_HI 0x8F71 +#define EGL_COLOR_RGBA_HI 0x8F72 +#define EGL_COLOR_ARGB_HI 0x8F73 + +#define EGLEW_HI_colorformats EGLEW_GET_VAR(__EGLEW_HI_colorformats) + +#endif /* EGL_HI_colorformats */ + +/* ------------------------ EGL_IMG_context_priority ----------------------- */ + +#ifndef EGL_IMG_context_priority +#define EGL_IMG_context_priority 1 + +#define EGL_CONTEXT_PRIORITY_LEVEL_IMG 0x3100 +#define EGL_CONTEXT_PRIORITY_HIGH_IMG 0x3101 +#define EGL_CONTEXT_PRIORITY_MEDIUM_IMG 0x3102 +#define EGL_CONTEXT_PRIORITY_LOW_IMG 0x3103 + +#define EGLEW_IMG_context_priority EGLEW_GET_VAR(__EGLEW_IMG_context_priority) + +#endif /* EGL_IMG_context_priority */ + +/* ---------------------- EGL_IMG_image_plane_attribs ---------------------- */ + +#ifndef EGL_IMG_image_plane_attribs +#define EGL_IMG_image_plane_attribs 1 + +#define EGL_NATIVE_BUFFER_MULTIPLANE_SEPARATE_IMG 0x3105 +#define EGL_NATIVE_BUFFER_PLANE_OFFSET_IMG 0x3106 + +#define EGLEW_IMG_image_plane_attribs EGLEW_GET_VAR(__EGLEW_IMG_image_plane_attribs) + +#endif /* EGL_IMG_image_plane_attribs */ + +/* ---------------------------- EGL_KHR_cl_event --------------------------- */ + +#ifndef EGL_KHR_cl_event +#define EGL_KHR_cl_event 1 + +#define EGL_CL_EVENT_HANDLE_KHR 0x309C +#define EGL_SYNC_CL_EVENT_KHR 0x30FE +#define EGL_SYNC_CL_EVENT_COMPLETE_KHR 0x30FF + +#define EGLEW_KHR_cl_event EGLEW_GET_VAR(__EGLEW_KHR_cl_event) + +#endif /* EGL_KHR_cl_event */ + +/* --------------------------- EGL_KHR_cl_event2 --------------------------- */ + +#ifndef EGL_KHR_cl_event2 +#define EGL_KHR_cl_event2 1 + +#define EGL_CL_EVENT_HANDLE_KHR 0x309C +#define EGL_SYNC_CL_EVENT_KHR 0x30FE +#define EGL_SYNC_CL_EVENT_COMPLETE_KHR 0x30FF + +typedef EGLSyncKHR ( * PFNEGLCREATESYNC64KHRPROC) (EGLDisplay dpy, EGLenum type, const EGLAttribKHR * attrib_list); + +#define eglCreateSync64KHR EGLEW_GET_FUN(__eglewCreateSync64KHR) + +#define EGLEW_KHR_cl_event2 EGLEW_GET_VAR(__EGLEW_KHR_cl_event2) + +#endif /* EGL_KHR_cl_event2 */ + +/* ----------------- EGL_KHR_client_get_all_proc_addresses ----------------- */ + +#ifndef EGL_KHR_client_get_all_proc_addresses +#define EGL_KHR_client_get_all_proc_addresses 1 + +#define EGLEW_KHR_client_get_all_proc_addresses EGLEW_GET_VAR(__EGLEW_KHR_client_get_all_proc_addresses) + +#endif /* EGL_KHR_client_get_all_proc_addresses */ + +/* ------------------------- EGL_KHR_config_attribs ------------------------ */ + +#ifndef EGL_KHR_config_attribs +#define EGL_KHR_config_attribs 1 + +#define EGL_VG_COLORSPACE_LINEAR_BIT_KHR 0x0020 +#define EGL_VG_ALPHA_FORMAT_PRE_BIT_KHR 0x0040 +#define EGL_CONFORMANT_KHR 0x3042 + +#define EGLEW_KHR_config_attribs EGLEW_GET_VAR(__EGLEW_KHR_config_attribs) + +#endif /* EGL_KHR_config_attribs */ + +/* --------------------- EGL_KHR_context_flush_control --------------------- */ + +#ifndef EGL_KHR_context_flush_control +#define EGL_KHR_context_flush_control 1 + +#define EGL_CONTEXT_RELEASE_BEHAVIOR_NONE_KHR 0 +#define EGL_CONTEXT_RELEASE_BEHAVIOR_KHR 0x2097 +#define EGL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_KHR 0x2098 + +#define EGLEW_KHR_context_flush_control EGLEW_GET_VAR(__EGLEW_KHR_context_flush_control) + +#endif /* EGL_KHR_context_flush_control */ + +/* ------------------------- EGL_KHR_create_context ------------------------ */ + +#ifndef EGL_KHR_create_context +#define EGL_KHR_create_context 1 + +#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR 0x00000001 +#define EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR 0x00000001 +#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR 0x00000002 +#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR 0x00000002 +#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR 0x00000004 +#define EGL_OPENGL_ES3_BIT 0x00000040 +#define EGL_OPENGL_ES3_BIT_KHR 0x00000040 +#define EGL_CONTEXT_MAJOR_VERSION_KHR 0x3098 +#define EGL_CONTEXT_MINOR_VERSION_KHR 0x30FB +#define EGL_CONTEXT_FLAGS_KHR 0x30FC +#define EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR 0x30FD +#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR 0x31BD +#define EGL_NO_RESET_NOTIFICATION_KHR 0x31BE +#define EGL_LOSE_CONTEXT_ON_RESET_KHR 0x31BF + +#define EGLEW_KHR_create_context EGLEW_GET_VAR(__EGLEW_KHR_create_context) + +#endif /* EGL_KHR_create_context */ + +/* -------------------- EGL_KHR_create_context_no_error -------------------- */ + +#ifndef EGL_KHR_create_context_no_error +#define EGL_KHR_create_context_no_error 1 + +#define EGL_CONTEXT_OPENGL_NO_ERROR_KHR 0x31B3 + +#define EGLEW_KHR_create_context_no_error EGLEW_GET_VAR(__EGLEW_KHR_create_context_no_error) + +#endif /* EGL_KHR_create_context_no_error */ + +/* ----------------------------- EGL_KHR_debug ----------------------------- */ + +#ifndef EGL_KHR_debug +#define EGL_KHR_debug 1 + +#define EGL_OBJECT_THREAD_KHR 0x33B0 +#define EGL_OBJECT_DISPLAY_KHR 0x33B1 +#define EGL_OBJECT_CONTEXT_KHR 0x33B2 +#define EGL_OBJECT_SURFACE_KHR 0x33B3 +#define EGL_OBJECT_IMAGE_KHR 0x33B4 +#define EGL_OBJECT_SYNC_KHR 0x33B5 +#define EGL_OBJECT_STREAM_KHR 0x33B6 +#define EGL_DEBUG_CALLBACK_KHR 0x33B8 +#define EGL_DEBUG_MSG_CRITICAL_KHR 0x33B9 +#define EGL_DEBUG_MSG_ERROR_KHR 0x33BA +#define EGL_DEBUG_MSG_WARN_KHR 0x33BB +#define EGL_DEBUG_MSG_INFO_KHR 0x33BC + +typedef EGLint ( * PFNEGLDEBUGMESSAGECONTROLKHRPROC) (EGLDEBUGPROCKHR callback, const EGLAttrib * attrib_list); +typedef EGLint ( * PFNEGLLABELOBJECTKHRPROC) (EGLDisplay display, EGLenum objectType, EGLObjectKHR object, EGLLabelKHR label); +typedef EGLBoolean ( * PFNEGLQUERYDEBUGKHRPROC) (EGLint attribute, EGLAttrib * value); + +#define eglDebugMessageControlKHR EGLEW_GET_FUN(__eglewDebugMessageControlKHR) +#define eglLabelObjectKHR EGLEW_GET_FUN(__eglewLabelObjectKHR) +#define eglQueryDebugKHR EGLEW_GET_FUN(__eglewQueryDebugKHR) + +#define EGLEW_KHR_debug EGLEW_GET_VAR(__EGLEW_KHR_debug) + +#endif /* EGL_KHR_debug */ + +/* --------------------------- EGL_KHR_fence_sync -------------------------- */ + +#ifndef EGL_KHR_fence_sync +#define EGL_KHR_fence_sync 1 + +#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR 0x30F0 +#define EGL_SYNC_CONDITION_KHR 0x30F8 +#define EGL_SYNC_FENCE_KHR 0x30F9 + +#define EGLEW_KHR_fence_sync EGLEW_GET_VAR(__EGLEW_KHR_fence_sync) + +#endif /* EGL_KHR_fence_sync */ + +/* --------------------- EGL_KHR_get_all_proc_addresses -------------------- */ + +#ifndef EGL_KHR_get_all_proc_addresses +#define EGL_KHR_get_all_proc_addresses 1 + +#define EGLEW_KHR_get_all_proc_addresses EGLEW_GET_VAR(__EGLEW_KHR_get_all_proc_addresses) + +#endif /* EGL_KHR_get_all_proc_addresses */ + +/* ------------------------- EGL_KHR_gl_colorspace ------------------------- */ + +#ifndef EGL_KHR_gl_colorspace +#define EGL_KHR_gl_colorspace 1 + +#define EGL_GL_COLORSPACE_SRGB_KHR 0x3089 +#define EGL_GL_COLORSPACE_LINEAR_KHR 0x308A +#define EGL_GL_COLORSPACE_KHR 0x309D + +#define EGLEW_KHR_gl_colorspace EGLEW_GET_VAR(__EGLEW_KHR_gl_colorspace) + +#endif /* EGL_KHR_gl_colorspace */ + +/* --------------------- EGL_KHR_gl_renderbuffer_image --------------------- */ + +#ifndef EGL_KHR_gl_renderbuffer_image +#define EGL_KHR_gl_renderbuffer_image 1 + +#define EGL_GL_RENDERBUFFER_KHR 0x30B9 + +#define EGLEW_KHR_gl_renderbuffer_image EGLEW_GET_VAR(__EGLEW_KHR_gl_renderbuffer_image) + +#endif /* EGL_KHR_gl_renderbuffer_image */ + +/* ---------------------- EGL_KHR_gl_texture_2D_image ---------------------- */ + +#ifndef EGL_KHR_gl_texture_2D_image +#define EGL_KHR_gl_texture_2D_image 1 + +#define EGL_GL_TEXTURE_2D_KHR 0x30B1 +#define EGL_GL_TEXTURE_LEVEL_KHR 0x30BC + +#define EGLEW_KHR_gl_texture_2D_image EGLEW_GET_VAR(__EGLEW_KHR_gl_texture_2D_image) + +#endif /* EGL_KHR_gl_texture_2D_image */ + +/* ---------------------- EGL_KHR_gl_texture_3D_image ---------------------- */ + +#ifndef EGL_KHR_gl_texture_3D_image +#define EGL_KHR_gl_texture_3D_image 1 + +#define EGL_GL_TEXTURE_3D_KHR 0x30B2 +#define EGL_GL_TEXTURE_ZOFFSET_KHR 0x30BD + +#define EGLEW_KHR_gl_texture_3D_image EGLEW_GET_VAR(__EGLEW_KHR_gl_texture_3D_image) + +#endif /* EGL_KHR_gl_texture_3D_image */ + +/* -------------------- EGL_KHR_gl_texture_cubemap_image ------------------- */ + +#ifndef EGL_KHR_gl_texture_cubemap_image +#define EGL_KHR_gl_texture_cubemap_image 1 + +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X_KHR 0x30B3 +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X_KHR 0x30B4 +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y_KHR 0x30B5 +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_KHR 0x30B6 +#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z_KHR 0x30B7 +#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_KHR 0x30B8 + +#define EGLEW_KHR_gl_texture_cubemap_image EGLEW_GET_VAR(__EGLEW_KHR_gl_texture_cubemap_image) + +#endif /* EGL_KHR_gl_texture_cubemap_image */ + +/* ----------------------------- EGL_KHR_image ----------------------------- */ + +#ifndef EGL_KHR_image +#define EGL_KHR_image 1 + +#define EGL_NATIVE_PIXMAP_KHR 0x30B0 + +typedef EGLImageKHR ( * PFNEGLCREATEIMAGEKHRPROC) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint * attrib_list); +typedef EGLBoolean ( * PFNEGLDESTROYIMAGEKHRPROC) (EGLDisplay dpy, EGLImageKHR image); + +#define eglCreateImageKHR EGLEW_GET_FUN(__eglewCreateImageKHR) +#define eglDestroyImageKHR EGLEW_GET_FUN(__eglewDestroyImageKHR) + +#define EGLEW_KHR_image EGLEW_GET_VAR(__EGLEW_KHR_image) + +#endif /* EGL_KHR_image */ + +/* --------------------------- EGL_KHR_image_base -------------------------- */ + +#ifndef EGL_KHR_image_base +#define EGL_KHR_image_base 1 + +#define EGL_IMAGE_PRESERVED_KHR 0x30D2 + +#define EGLEW_KHR_image_base EGLEW_GET_VAR(__EGLEW_KHR_image_base) + +#endif /* EGL_KHR_image_base */ + +/* -------------------------- EGL_KHR_image_pixmap ------------------------- */ + +#ifndef EGL_KHR_image_pixmap +#define EGL_KHR_image_pixmap 1 + +#define EGL_NATIVE_PIXMAP_KHR 0x30B0 + +#define EGLEW_KHR_image_pixmap EGLEW_GET_VAR(__EGLEW_KHR_image_pixmap) + +#endif /* EGL_KHR_image_pixmap */ + +/* -------------------------- EGL_KHR_lock_surface ------------------------- */ + +#ifndef EGL_KHR_lock_surface +#define EGL_KHR_lock_surface 1 + +#define EGL_READ_SURFACE_BIT_KHR 0x0001 +#define EGL_WRITE_SURFACE_BIT_KHR 0x0002 +#define EGL_LOCK_SURFACE_BIT_KHR 0x0080 +#define EGL_OPTIMAL_FORMAT_BIT_KHR 0x0100 +#define EGL_MATCH_FORMAT_KHR 0x3043 +#define EGL_FORMAT_RGB_565_EXACT_KHR 0x30C0 +#define EGL_FORMAT_RGB_565_KHR 0x30C1 +#define EGL_FORMAT_RGBA_8888_EXACT_KHR 0x30C2 +#define EGL_FORMAT_RGBA_8888_KHR 0x30C3 +#define EGL_MAP_PRESERVE_PIXELS_KHR 0x30C4 +#define EGL_LOCK_USAGE_HINT_KHR 0x30C5 +#define EGL_BITMAP_POINTER_KHR 0x30C6 +#define EGL_BITMAP_PITCH_KHR 0x30C7 +#define EGL_BITMAP_ORIGIN_KHR 0x30C8 +#define EGL_BITMAP_PIXEL_RED_OFFSET_KHR 0x30C9 +#define EGL_BITMAP_PIXEL_GREEN_OFFSET_KHR 0x30CA +#define EGL_BITMAP_PIXEL_BLUE_OFFSET_KHR 0x30CB +#define EGL_BITMAP_PIXEL_ALPHA_OFFSET_KHR 0x30CC +#define EGL_BITMAP_PIXEL_LUMINANCE_OFFSET_KHR 0x30CD +#define EGL_LOWER_LEFT_KHR 0x30CE +#define EGL_UPPER_LEFT_KHR 0x30CF + +typedef EGLBoolean ( * PFNEGLLOCKSURFACEKHRPROC) (EGLDisplay dpy, EGLSurface surface, const EGLint * attrib_list); +typedef EGLBoolean ( * PFNEGLUNLOCKSURFACEKHRPROC) (EGLDisplay dpy, EGLSurface surface); + +#define eglLockSurfaceKHR EGLEW_GET_FUN(__eglewLockSurfaceKHR) +#define eglUnlockSurfaceKHR EGLEW_GET_FUN(__eglewUnlockSurfaceKHR) + +#define EGLEW_KHR_lock_surface EGLEW_GET_VAR(__EGLEW_KHR_lock_surface) + +#endif /* EGL_KHR_lock_surface */ + +/* ------------------------- EGL_KHR_lock_surface2 ------------------------- */ + +#ifndef EGL_KHR_lock_surface2 +#define EGL_KHR_lock_surface2 1 + +#define EGL_BITMAP_PIXEL_SIZE_KHR 0x3110 + +#define EGLEW_KHR_lock_surface2 EGLEW_GET_VAR(__EGLEW_KHR_lock_surface2) + +#endif /* EGL_KHR_lock_surface2 */ + +/* ------------------------- EGL_KHR_lock_surface3 ------------------------- */ + +#ifndef EGL_KHR_lock_surface3 +#define EGL_KHR_lock_surface3 1 + +#define EGL_READ_SURFACE_BIT_KHR 0x0001 +#define EGL_WRITE_SURFACE_BIT_KHR 0x0002 +#define EGL_LOCK_SURFACE_BIT_KHR 0x0080 +#define EGL_OPTIMAL_FORMAT_BIT_KHR 0x0100 +#define EGL_MATCH_FORMAT_KHR 0x3043 +#define EGL_FORMAT_RGB_565_EXACT_KHR 0x30C0 +#define EGL_FORMAT_RGB_565_KHR 0x30C1 +#define EGL_FORMAT_RGBA_8888_EXACT_KHR 0x30C2 +#define EGL_FORMAT_RGBA_8888_KHR 0x30C3 +#define EGL_MAP_PRESERVE_PIXELS_KHR 0x30C4 +#define EGL_LOCK_USAGE_HINT_KHR 0x30C5 +#define EGL_BITMAP_POINTER_KHR 0x30C6 +#define EGL_BITMAP_PITCH_KHR 0x30C7 +#define EGL_BITMAP_ORIGIN_KHR 0x30C8 +#define EGL_BITMAP_PIXEL_RED_OFFSET_KHR 0x30C9 +#define EGL_BITMAP_PIXEL_GREEN_OFFSET_KHR 0x30CA +#define EGL_BITMAP_PIXEL_BLUE_OFFSET_KHR 0x30CB +#define EGL_BITMAP_PIXEL_ALPHA_OFFSET_KHR 0x30CC +#define EGL_BITMAP_PIXEL_LUMINANCE_OFFSET_KHR 0x30CD +#define EGL_LOWER_LEFT_KHR 0x30CE +#define EGL_UPPER_LEFT_KHR 0x30CF +#define EGL_BITMAP_PIXEL_SIZE_KHR 0x3110 + +typedef EGLBoolean ( * PFNEGLQUERYSURFACE64KHRPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLAttribKHR * value); + +#define eglQuerySurface64KHR EGLEW_GET_FUN(__eglewQuerySurface64KHR) + +#define EGLEW_KHR_lock_surface3 EGLEW_GET_VAR(__EGLEW_KHR_lock_surface3) + +#endif /* EGL_KHR_lock_surface3 */ + +/* --------------------- EGL_KHR_mutable_render_buffer --------------------- */ + +#ifndef EGL_KHR_mutable_render_buffer +#define EGL_KHR_mutable_render_buffer 1 + +#define EGL_MUTABLE_RENDER_BUFFER_BIT_KHR 0x1000 + +#define EGLEW_KHR_mutable_render_buffer EGLEW_GET_VAR(__EGLEW_KHR_mutable_render_buffer) + +#endif /* EGL_KHR_mutable_render_buffer */ + +/* ----------------------- EGL_KHR_no_config_context ----------------------- */ + +#ifndef EGL_KHR_no_config_context +#define EGL_KHR_no_config_context 1 + +#define EGLEW_KHR_no_config_context EGLEW_GET_VAR(__EGLEW_KHR_no_config_context) + +#endif /* EGL_KHR_no_config_context */ + +/* ------------------------- EGL_KHR_partial_update ------------------------ */ + +#ifndef EGL_KHR_partial_update +#define EGL_KHR_partial_update 1 + +#define EGL_BUFFER_AGE_KHR 0x313D + +typedef EGLBoolean ( * PFNEGLSETDAMAGEREGIONKHRPROC) (EGLDisplay dpy, EGLSurface surface, EGLint * rects, EGLint n_rects); + +#define eglSetDamageRegionKHR EGLEW_GET_FUN(__eglewSetDamageRegionKHR) + +#define EGLEW_KHR_partial_update EGLEW_GET_VAR(__EGLEW_KHR_partial_update) + +#endif /* EGL_KHR_partial_update */ + +/* ------------------------ EGL_KHR_platform_android ----------------------- */ + +#ifndef EGL_KHR_platform_android +#define EGL_KHR_platform_android 1 + +#define EGL_PLATFORM_ANDROID_KHR 0x3141 + +#define EGLEW_KHR_platform_android EGLEW_GET_VAR(__EGLEW_KHR_platform_android) + +#endif /* EGL_KHR_platform_android */ + +/* -------------------------- EGL_KHR_platform_gbm ------------------------- */ + +#ifndef EGL_KHR_platform_gbm +#define EGL_KHR_platform_gbm 1 + +#define EGL_PLATFORM_GBM_KHR 0x31D7 + +#define EGLEW_KHR_platform_gbm EGLEW_GET_VAR(__EGLEW_KHR_platform_gbm) + +#endif /* EGL_KHR_platform_gbm */ + +/* ------------------------ EGL_KHR_platform_wayland ----------------------- */ + +#ifndef EGL_KHR_platform_wayland +#define EGL_KHR_platform_wayland 1 + +#define EGL_PLATFORM_WAYLAND_KHR 0x31D8 + +#define EGLEW_KHR_platform_wayland EGLEW_GET_VAR(__EGLEW_KHR_platform_wayland) + +#endif /* EGL_KHR_platform_wayland */ + +/* -------------------------- EGL_KHR_platform_x11 ------------------------- */ + +#ifndef EGL_KHR_platform_x11 +#define EGL_KHR_platform_x11 1 + +#define EGL_PLATFORM_X11_KHR 0x31D5 +#define EGL_PLATFORM_X11_SCREEN_KHR 0x31D6 + +#define EGLEW_KHR_platform_x11 EGLEW_GET_VAR(__EGLEW_KHR_platform_x11) + +#endif /* EGL_KHR_platform_x11 */ + +/* ------------------------- EGL_KHR_reusable_sync ------------------------- */ + +#ifndef EGL_KHR_reusable_sync +#define EGL_KHR_reusable_sync 1 + +#define EGL_SYNC_FLUSH_COMMANDS_BIT_KHR 0x0001 +#define EGL_SYNC_STATUS_KHR 0x30F1 +#define EGL_SIGNALED_KHR 0x30F2 +#define EGL_UNSIGNALED_KHR 0x30F3 +#define EGL_TIMEOUT_EXPIRED_KHR 0x30F5 +#define EGL_CONDITION_SATISFIED_KHR 0x30F6 +#define EGL_SYNC_TYPE_KHR 0x30F7 +#define EGL_SYNC_REUSABLE_KHR 0x30FA +#define EGL_FOREVER_KHR 0xFFFFFFFFFFFFFFFF + +typedef EGLint ( * PFNEGLCLIENTWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout); +typedef EGLSyncKHR ( * PFNEGLCREATESYNCKHRPROC) (EGLDisplay dpy, EGLenum type, const EGLint * attrib_list); +typedef EGLBoolean ( * PFNEGLDESTROYSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync); +typedef EGLBoolean ( * PFNEGLGETSYNCATTRIBKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint * value); +typedef EGLBoolean ( * PFNEGLSIGNALSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode); + +#define eglClientWaitSyncKHR EGLEW_GET_FUN(__eglewClientWaitSyncKHR) +#define eglCreateSyncKHR EGLEW_GET_FUN(__eglewCreateSyncKHR) +#define eglDestroySyncKHR EGLEW_GET_FUN(__eglewDestroySyncKHR) +#define eglGetSyncAttribKHR EGLEW_GET_FUN(__eglewGetSyncAttribKHR) +#define eglSignalSyncKHR EGLEW_GET_FUN(__eglewSignalSyncKHR) + +#define EGLEW_KHR_reusable_sync EGLEW_GET_VAR(__EGLEW_KHR_reusable_sync) + +#endif /* EGL_KHR_reusable_sync */ + +/* ----------------------------- EGL_KHR_stream ---------------------------- */ + +#ifndef EGL_KHR_stream +#define EGL_KHR_stream 1 + +#define EGL_CONSUMER_LATENCY_USEC_KHR 0x3210 +#define EGL_PRODUCER_FRAME_KHR 0x3212 +#define EGL_CONSUMER_FRAME_KHR 0x3213 +#define EGL_STREAM_STATE_KHR 0x3214 +#define EGL_STREAM_STATE_CREATED_KHR 0x3215 +#define EGL_STREAM_STATE_CONNECTING_KHR 0x3216 +#define EGL_STREAM_STATE_EMPTY_KHR 0x3217 +#define EGL_STREAM_STATE_NEW_FRAME_AVAILABLE_KHR 0x3218 +#define EGL_STREAM_STATE_OLD_FRAME_AVAILABLE_KHR 0x3219 +#define EGL_STREAM_STATE_DISCONNECTED_KHR 0x321A +#define EGL_BAD_STREAM_KHR 0x321B +#define EGL_BAD_STATE_KHR 0x321C + +typedef EGLStreamKHR ( * PFNEGLCREATESTREAMKHRPROC) (EGLDisplay dpy, const EGLint * attrib_list); +typedef EGLBoolean ( * PFNEGLDESTROYSTREAMKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); +typedef EGLBoolean ( * PFNEGLQUERYSTREAMKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint * value); +typedef EGLBoolean ( * PFNEGLQUERYSTREAMU64KHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR * value); +typedef EGLBoolean ( * PFNEGLSTREAMATTRIBKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value); + +#define eglCreateStreamKHR EGLEW_GET_FUN(__eglewCreateStreamKHR) +#define eglDestroyStreamKHR EGLEW_GET_FUN(__eglewDestroyStreamKHR) +#define eglQueryStreamKHR EGLEW_GET_FUN(__eglewQueryStreamKHR) +#define eglQueryStreamu64KHR EGLEW_GET_FUN(__eglewQueryStreamu64KHR) +#define eglStreamAttribKHR EGLEW_GET_FUN(__eglewStreamAttribKHR) + +#define EGLEW_KHR_stream EGLEW_GET_VAR(__EGLEW_KHR_stream) + +#endif /* EGL_KHR_stream */ + +/* ------------------------- EGL_KHR_stream_attrib ------------------------- */ + +#ifndef EGL_KHR_stream_attrib +#define EGL_KHR_stream_attrib 1 + +#define EGL_CONSUMER_LATENCY_USEC_KHR 0x3210 +#define EGL_STREAM_STATE_KHR 0x3214 +#define EGL_STREAM_STATE_CREATED_KHR 0x3215 +#define EGL_STREAM_STATE_CONNECTING_KHR 0x3216 + +typedef EGLStreamKHR ( * PFNEGLCREATESTREAMATTRIBKHRPROC) (EGLDisplay dpy, const EGLAttrib * attrib_list); +typedef EGLBoolean ( * PFNEGLQUERYSTREAMATTRIBKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLAttrib * value); +typedef EGLBoolean ( * PFNEGLSETSTREAMATTRIBKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLAttrib value); +typedef EGLBoolean ( * PFNEGLSTREAMCONSUMERACQUIREATTRIBKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, const EGLAttrib * attrib_list); +typedef EGLBoolean ( * PFNEGLSTREAMCONSUMERRELEASEATTRIBKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, const EGLAttrib * attrib_list); + +#define eglCreateStreamAttribKHR EGLEW_GET_FUN(__eglewCreateStreamAttribKHR) +#define eglQueryStreamAttribKHR EGLEW_GET_FUN(__eglewQueryStreamAttribKHR) +#define eglSetStreamAttribKHR EGLEW_GET_FUN(__eglewSetStreamAttribKHR) +#define eglStreamConsumerAcquireAttribKHR EGLEW_GET_FUN(__eglewStreamConsumerAcquireAttribKHR) +#define eglStreamConsumerReleaseAttribKHR EGLEW_GET_FUN(__eglewStreamConsumerReleaseAttribKHR) + +#define EGLEW_KHR_stream_attrib EGLEW_GET_VAR(__EGLEW_KHR_stream_attrib) + +#endif /* EGL_KHR_stream_attrib */ + +/* ------------------- EGL_KHR_stream_consumer_gltexture ------------------- */ + +#ifndef EGL_KHR_stream_consumer_gltexture +#define EGL_KHR_stream_consumer_gltexture 1 + +#define EGL_CONSUMER_ACQUIRE_TIMEOUT_USEC_KHR 0x321E + +typedef EGLBoolean ( * PFNEGLSTREAMCONSUMERACQUIREKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); +typedef EGLBoolean ( * PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); +typedef EGLBoolean ( * PFNEGLSTREAMCONSUMERRELEASEKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); + +#define eglStreamConsumerAcquireKHR EGLEW_GET_FUN(__eglewStreamConsumerAcquireKHR) +#define eglStreamConsumerGLTextureExternalKHR EGLEW_GET_FUN(__eglewStreamConsumerGLTextureExternalKHR) +#define eglStreamConsumerReleaseKHR EGLEW_GET_FUN(__eglewStreamConsumerReleaseKHR) + +#define EGLEW_KHR_stream_consumer_gltexture EGLEW_GET_VAR(__EGLEW_KHR_stream_consumer_gltexture) + +#endif /* EGL_KHR_stream_consumer_gltexture */ + +/* -------------------- EGL_KHR_stream_cross_process_fd -------------------- */ + +#ifndef EGL_KHR_stream_cross_process_fd +#define EGL_KHR_stream_cross_process_fd 1 + +typedef EGLStreamKHR ( * PFNEGLCREATESTREAMFROMFILEDESCRIPTORKHRPROC) (EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor); +typedef EGLNativeFileDescriptorKHR ( * PFNEGLGETSTREAMFILEDESCRIPTORKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream); + +#define eglCreateStreamFromFileDescriptorKHR EGLEW_GET_FUN(__eglewCreateStreamFromFileDescriptorKHR) +#define eglGetStreamFileDescriptorKHR EGLEW_GET_FUN(__eglewGetStreamFileDescriptorKHR) + +#define EGLEW_KHR_stream_cross_process_fd EGLEW_GET_VAR(__EGLEW_KHR_stream_cross_process_fd) + +#endif /* EGL_KHR_stream_cross_process_fd */ + +/* -------------------------- EGL_KHR_stream_fifo -------------------------- */ + +#ifndef EGL_KHR_stream_fifo +#define EGL_KHR_stream_fifo 1 + +#define EGL_STREAM_FIFO_LENGTH_KHR 0x31FC +#define EGL_STREAM_TIME_NOW_KHR 0x31FD +#define EGL_STREAM_TIME_CONSUMER_KHR 0x31FE +#define EGL_STREAM_TIME_PRODUCER_KHR 0x31FF + +typedef EGLBoolean ( * PFNEGLQUERYSTREAMTIMEKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLTimeKHR * value); + +#define eglQueryStreamTimeKHR EGLEW_GET_FUN(__eglewQueryStreamTimeKHR) + +#define EGLEW_KHR_stream_fifo EGLEW_GET_VAR(__EGLEW_KHR_stream_fifo) + +#endif /* EGL_KHR_stream_fifo */ + +/* ----------------- EGL_KHR_stream_producer_aldatalocator ----------------- */ + +#ifndef EGL_KHR_stream_producer_aldatalocator +#define EGL_KHR_stream_producer_aldatalocator 1 + +#define EGLEW_KHR_stream_producer_aldatalocator EGLEW_GET_VAR(__EGLEW_KHR_stream_producer_aldatalocator) + +#endif /* EGL_KHR_stream_producer_aldatalocator */ + +/* ------------------- EGL_KHR_stream_producer_eglsurface ------------------ */ + +#ifndef EGL_KHR_stream_producer_eglsurface +#define EGL_KHR_stream_producer_eglsurface 1 + +#define EGL_STREAM_BIT_KHR 0x0800 + +typedef EGLSurface ( * PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC) (EGLDisplay dpy, EGLConfig config, EGLStreamKHR stream, const EGLint * attrib_list); + +#define eglCreateStreamProducerSurfaceKHR EGLEW_GET_FUN(__eglewCreateStreamProducerSurfaceKHR) + +#define EGLEW_KHR_stream_producer_eglsurface EGLEW_GET_VAR(__EGLEW_KHR_stream_producer_eglsurface) + +#endif /* EGL_KHR_stream_producer_eglsurface */ + +/* ---------------------- EGL_KHR_surfaceless_context ---------------------- */ + +#ifndef EGL_KHR_surfaceless_context +#define EGL_KHR_surfaceless_context 1 + +#define EGLEW_KHR_surfaceless_context EGLEW_GET_VAR(__EGLEW_KHR_surfaceless_context) + +#endif /* EGL_KHR_surfaceless_context */ + +/* -------------------- EGL_KHR_swap_buffers_with_damage ------------------- */ + +#ifndef EGL_KHR_swap_buffers_with_damage +#define EGL_KHR_swap_buffers_with_damage 1 + +typedef EGLBoolean ( * PFNEGLSWAPBUFFERSWITHDAMAGEKHRPROC) (EGLDisplay dpy, EGLSurface surface, EGLint * rects, EGLint n_rects); + +#define eglSwapBuffersWithDamageKHR EGLEW_GET_FUN(__eglewSwapBuffersWithDamageKHR) + +#define EGLEW_KHR_swap_buffers_with_damage EGLEW_GET_VAR(__EGLEW_KHR_swap_buffers_with_damage) + +#endif /* EGL_KHR_swap_buffers_with_damage */ + +/* ------------------------ EGL_KHR_vg_parent_image ------------------------ */ + +#ifndef EGL_KHR_vg_parent_image +#define EGL_KHR_vg_parent_image 1 + +#define EGL_VG_PARENT_IMAGE_KHR 0x30BA + +#define EGLEW_KHR_vg_parent_image EGLEW_GET_VAR(__EGLEW_KHR_vg_parent_image) + +#endif /* EGL_KHR_vg_parent_image */ + +/* --------------------------- EGL_KHR_wait_sync --------------------------- */ + +#ifndef EGL_KHR_wait_sync +#define EGL_KHR_wait_sync 1 + +typedef EGLint ( * PFNEGLWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags); + +#define eglWaitSyncKHR EGLEW_GET_FUN(__eglewWaitSyncKHR) + +#define EGLEW_KHR_wait_sync EGLEW_GET_VAR(__EGLEW_KHR_wait_sync) + +#endif /* EGL_KHR_wait_sync */ + +/* --------------------------- EGL_MESA_drm_image -------------------------- */ + +#ifndef EGL_MESA_drm_image +#define EGL_MESA_drm_image 1 + +#define EGL_DRM_BUFFER_USE_SCANOUT_MESA 0x00000001 +#define EGL_DRM_BUFFER_USE_SHARE_MESA 0x00000002 +#define EGL_DRM_BUFFER_FORMAT_MESA 0x31D0 +#define EGL_DRM_BUFFER_USE_MESA 0x31D1 +#define EGL_DRM_BUFFER_FORMAT_ARGB32_MESA 0x31D2 +#define EGL_DRM_BUFFER_MESA 0x31D3 +#define EGL_DRM_BUFFER_STRIDE_MESA 0x31D4 + +typedef EGLImageKHR ( * PFNEGLCREATEDRMIMAGEMESAPROC) (EGLDisplay dpy, const EGLint * attrib_list); +typedef EGLBoolean ( * PFNEGLEXPORTDRMIMAGEMESAPROC) (EGLDisplay dpy, EGLImageKHR image, EGLint * name, EGLint * handle, EGLint * stride); + +#define eglCreateDRMImageMESA EGLEW_GET_FUN(__eglewCreateDRMImageMESA) +#define eglExportDRMImageMESA EGLEW_GET_FUN(__eglewExportDRMImageMESA) + +#define EGLEW_MESA_drm_image EGLEW_GET_VAR(__EGLEW_MESA_drm_image) + +#endif /* EGL_MESA_drm_image */ + +/* --------------------- EGL_MESA_image_dma_buf_export --------------------- */ + +#ifndef EGL_MESA_image_dma_buf_export +#define EGL_MESA_image_dma_buf_export 1 + +typedef EGLBoolean ( * PFNEGLEXPORTDMABUFIMAGEMESAPROC) (EGLDisplay dpy, EGLImageKHR image, int * fds, EGLint * strides, EGLint * offsets); +typedef EGLBoolean ( * PFNEGLEXPORTDMABUFIMAGEQUERYMESAPROC) (EGLDisplay dpy, EGLImageKHR image, int * fourcc, int * num_planes, EGLuint64KHR * modifiers); + +#define eglExportDMABUFImageMESA EGLEW_GET_FUN(__eglewExportDMABUFImageMESA) +#define eglExportDMABUFImageQueryMESA EGLEW_GET_FUN(__eglewExportDMABUFImageQueryMESA) + +#define EGLEW_MESA_image_dma_buf_export EGLEW_GET_VAR(__EGLEW_MESA_image_dma_buf_export) + +#endif /* EGL_MESA_image_dma_buf_export */ + +/* ------------------------- EGL_MESA_platform_gbm ------------------------- */ + +#ifndef EGL_MESA_platform_gbm +#define EGL_MESA_platform_gbm 1 + +#define EGL_PLATFORM_GBM_MESA 0x31D7 + +#define EGLEW_MESA_platform_gbm EGLEW_GET_VAR(__EGLEW_MESA_platform_gbm) + +#endif /* EGL_MESA_platform_gbm */ + +/* --------------------- EGL_MESA_platform_surfaceless --------------------- */ + +#ifndef EGL_MESA_platform_surfaceless +#define EGL_MESA_platform_surfaceless 1 + +#define EGL_PLATFORM_SURFACELESS_MESA 0x31DD + +#define EGLEW_MESA_platform_surfaceless EGLEW_GET_VAR(__EGLEW_MESA_platform_surfaceless) + +#endif /* EGL_MESA_platform_surfaceless */ + +/* -------------------------- EGL_NOK_swap_region -------------------------- */ + +#ifndef EGL_NOK_swap_region +#define EGL_NOK_swap_region 1 + +typedef EGLBoolean ( * PFNEGLSWAPBUFFERSREGIONNOKPROC) (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint * rects); + +#define eglSwapBuffersRegionNOK EGLEW_GET_FUN(__eglewSwapBuffersRegionNOK) + +#define EGLEW_NOK_swap_region EGLEW_GET_VAR(__EGLEW_NOK_swap_region) + +#endif /* EGL_NOK_swap_region */ + +/* -------------------------- EGL_NOK_swap_region2 ------------------------- */ + +#ifndef EGL_NOK_swap_region2 +#define EGL_NOK_swap_region2 1 + +typedef EGLBoolean ( * PFNEGLSWAPBUFFERSREGION2NOKPROC) (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint * rects); + +#define eglSwapBuffersRegion2NOK EGLEW_GET_FUN(__eglewSwapBuffersRegion2NOK) + +#define EGLEW_NOK_swap_region2 EGLEW_GET_VAR(__EGLEW_NOK_swap_region2) + +#endif /* EGL_NOK_swap_region2 */ + +/* ---------------------- EGL_NOK_texture_from_pixmap ---------------------- */ + +#ifndef EGL_NOK_texture_from_pixmap +#define EGL_NOK_texture_from_pixmap 1 + +#define EGL_Y_INVERTED_NOK 0x307F + +#define EGLEW_NOK_texture_from_pixmap EGLEW_GET_VAR(__EGLEW_NOK_texture_from_pixmap) + +#endif /* EGL_NOK_texture_from_pixmap */ + +/* ------------------------ EGL_NV_3dvision_surface ------------------------ */ + +#ifndef EGL_NV_3dvision_surface +#define EGL_NV_3dvision_surface 1 + +#define EGL_AUTO_STEREO_NV 0x3136 + +#define EGLEW_NV_3dvision_surface EGLEW_GET_VAR(__EGLEW_NV_3dvision_surface) + +#endif /* EGL_NV_3dvision_surface */ + +/* ------------------------- EGL_NV_coverage_sample ------------------------ */ + +#ifndef EGL_NV_coverage_sample +#define EGL_NV_coverage_sample 1 + +#define EGL_COVERAGE_BUFFERS_NV 0x30E0 +#define EGL_COVERAGE_SAMPLES_NV 0x30E1 + +#define EGLEW_NV_coverage_sample EGLEW_GET_VAR(__EGLEW_NV_coverage_sample) + +#endif /* EGL_NV_coverage_sample */ + +/* --------------------- EGL_NV_coverage_sample_resolve -------------------- */ + +#ifndef EGL_NV_coverage_sample_resolve +#define EGL_NV_coverage_sample_resolve 1 + +#define EGL_COVERAGE_SAMPLE_RESOLVE_NV 0x3131 +#define EGL_COVERAGE_SAMPLE_RESOLVE_DEFAULT_NV 0x3132 +#define EGL_COVERAGE_SAMPLE_RESOLVE_NONE_NV 0x3133 + +#define EGLEW_NV_coverage_sample_resolve EGLEW_GET_VAR(__EGLEW_NV_coverage_sample_resolve) + +#endif /* EGL_NV_coverage_sample_resolve */ + +/* --------------------------- EGL_NV_cuda_event --------------------------- */ + +#ifndef EGL_NV_cuda_event +#define EGL_NV_cuda_event 1 + +#define EGL_CUDA_EVENT_HANDLE_NV 0x323B +#define EGL_SYNC_CUDA_EVENT_NV 0x323C +#define EGL_SYNC_CUDA_EVENT_COMPLETE_NV 0x323D + +#define EGLEW_NV_cuda_event EGLEW_GET_VAR(__EGLEW_NV_cuda_event) + +#endif /* EGL_NV_cuda_event */ + +/* ------------------------- EGL_NV_depth_nonlinear ------------------------ */ + +#ifndef EGL_NV_depth_nonlinear +#define EGL_NV_depth_nonlinear 1 + +#define EGL_DEPTH_ENCODING_NONE_NV 0 +#define EGL_DEPTH_ENCODING_NV 0x30E2 +#define EGL_DEPTH_ENCODING_NONLINEAR_NV 0x30E3 + +#define EGLEW_NV_depth_nonlinear EGLEW_GET_VAR(__EGLEW_NV_depth_nonlinear) + +#endif /* EGL_NV_depth_nonlinear */ + +/* --------------------------- EGL_NV_device_cuda -------------------------- */ + +#ifndef EGL_NV_device_cuda +#define EGL_NV_device_cuda 1 + +#define EGL_CUDA_DEVICE_NV 0x323A + +#define EGLEW_NV_device_cuda EGLEW_GET_VAR(__EGLEW_NV_device_cuda) + +#endif /* EGL_NV_device_cuda */ + +/* -------------------------- EGL_NV_native_query -------------------------- */ + +#ifndef EGL_NV_native_query +#define EGL_NV_native_query 1 + +typedef EGLBoolean ( * PFNEGLQUERYNATIVEDISPLAYNVPROC) (EGLDisplay dpy, EGLNativeDisplayType * display_id); +typedef EGLBoolean ( * PFNEGLQUERYNATIVEPIXMAPNVPROC) (EGLDisplay dpy, EGLSurface surf, EGLNativePixmapType * pixmap); +typedef EGLBoolean ( * PFNEGLQUERYNATIVEWINDOWNVPROC) (EGLDisplay dpy, EGLSurface surf, EGLNativeWindowType * window); + +#define eglQueryNativeDisplayNV EGLEW_GET_FUN(__eglewQueryNativeDisplayNV) +#define eglQueryNativePixmapNV EGLEW_GET_FUN(__eglewQueryNativePixmapNV) +#define eglQueryNativeWindowNV EGLEW_GET_FUN(__eglewQueryNativeWindowNV) + +#define EGLEW_NV_native_query EGLEW_GET_VAR(__EGLEW_NV_native_query) + +#endif /* EGL_NV_native_query */ + +/* ---------------------- EGL_NV_post_convert_rounding --------------------- */ + +#ifndef EGL_NV_post_convert_rounding +#define EGL_NV_post_convert_rounding 1 + +#define EGLEW_NV_post_convert_rounding EGLEW_GET_VAR(__EGLEW_NV_post_convert_rounding) + +#endif /* EGL_NV_post_convert_rounding */ + +/* ------------------------- EGL_NV_post_sub_buffer ------------------------ */ + +#ifndef EGL_NV_post_sub_buffer +#define EGL_NV_post_sub_buffer 1 + +#define EGL_POST_SUB_BUFFER_SUPPORTED_NV 0x30BE + +typedef EGLBoolean ( * PFNEGLPOSTSUBBUFFERNVPROC) (EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height); + +#define eglPostSubBufferNV EGLEW_GET_FUN(__eglewPostSubBufferNV) + +#define EGLEW_NV_post_sub_buffer EGLEW_GET_VAR(__EGLEW_NV_post_sub_buffer) + +#endif /* EGL_NV_post_sub_buffer */ + +/* ------------------ EGL_NV_robustness_video_memory_purge ----------------- */ + +#ifndef EGL_NV_robustness_video_memory_purge +#define EGL_NV_robustness_video_memory_purge 1 + +#define EGL_GENERATE_RESET_ON_VIDEO_MEMORY_PURGE_NV 0x334C + +#define EGLEW_NV_robustness_video_memory_purge EGLEW_GET_VAR(__EGLEW_NV_robustness_video_memory_purge) + +#endif /* EGL_NV_robustness_video_memory_purge */ + +/* ------------------ EGL_NV_stream_consumer_gltexture_yuv ----------------- */ + +#ifndef EGL_NV_stream_consumer_gltexture_yuv +#define EGL_NV_stream_consumer_gltexture_yuv 1 + +#define EGL_YUV_BUFFER_EXT 0x3300 +#define EGL_YUV_NUMBER_OF_PLANES_EXT 0x3311 +#define EGL_YUV_PLANE0_TEXTURE_UNIT_NV 0x332C +#define EGL_YUV_PLANE1_TEXTURE_UNIT_NV 0x332D +#define EGL_YUV_PLANE2_TEXTURE_UNIT_NV 0x332E + +typedef EGLBoolean ( * PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALATTRIBSNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLAttrib *attrib_list); + +#define eglStreamConsumerGLTextureExternalAttribsNV EGLEW_GET_FUN(__eglewStreamConsumerGLTextureExternalAttribsNV) + +#define EGLEW_NV_stream_consumer_gltexture_yuv EGLEW_GET_VAR(__EGLEW_NV_stream_consumer_gltexture_yuv) + +#endif /* EGL_NV_stream_consumer_gltexture_yuv */ + +/* ---------------------- EGL_NV_stream_cross_display ---------------------- */ + +#ifndef EGL_NV_stream_cross_display +#define EGL_NV_stream_cross_display 1 + +#define EGL_STREAM_CROSS_DISPLAY_NV 0x334E + +#define EGLEW_NV_stream_cross_display EGLEW_GET_VAR(__EGLEW_NV_stream_cross_display) + +#endif /* EGL_NV_stream_cross_display */ + +/* ----------------------- EGL_NV_stream_cross_object ---------------------- */ + +#ifndef EGL_NV_stream_cross_object +#define EGL_NV_stream_cross_object 1 + +#define EGL_STREAM_CROSS_OBJECT_NV 0x334D + +#define EGLEW_NV_stream_cross_object EGLEW_GET_VAR(__EGLEW_NV_stream_cross_object) + +#endif /* EGL_NV_stream_cross_object */ + +/* --------------------- EGL_NV_stream_cross_partition --------------------- */ + +#ifndef EGL_NV_stream_cross_partition +#define EGL_NV_stream_cross_partition 1 + +#define EGL_STREAM_CROSS_PARTITION_NV 0x323F + +#define EGLEW_NV_stream_cross_partition EGLEW_GET_VAR(__EGLEW_NV_stream_cross_partition) + +#endif /* EGL_NV_stream_cross_partition */ + +/* ---------------------- EGL_NV_stream_cross_process ---------------------- */ + +#ifndef EGL_NV_stream_cross_process +#define EGL_NV_stream_cross_process 1 + +#define EGL_STREAM_CROSS_PROCESS_NV 0x3245 + +#define EGLEW_NV_stream_cross_process EGLEW_GET_VAR(__EGLEW_NV_stream_cross_process) + +#endif /* EGL_NV_stream_cross_process */ + +/* ----------------------- EGL_NV_stream_cross_system ---------------------- */ + +#ifndef EGL_NV_stream_cross_system +#define EGL_NV_stream_cross_system 1 + +#define EGL_STREAM_CROSS_SYSTEM_NV 0x334F + +#define EGLEW_NV_stream_cross_system EGLEW_GET_VAR(__EGLEW_NV_stream_cross_system) + +#endif /* EGL_NV_stream_cross_system */ + +/* ------------------------ EGL_NV_stream_fifo_next ------------------------ */ + +#ifndef EGL_NV_stream_fifo_next +#define EGL_NV_stream_fifo_next 1 + +#define EGL_PENDING_FRAME_NV 0x3329 +#define EGL_STREAM_TIME_PENDING_NV 0x332A + +#define EGLEW_NV_stream_fifo_next EGLEW_GET_VAR(__EGLEW_NV_stream_fifo_next) + +#endif /* EGL_NV_stream_fifo_next */ + +/* --------------------- EGL_NV_stream_fifo_synchronous -------------------- */ + +#ifndef EGL_NV_stream_fifo_synchronous +#define EGL_NV_stream_fifo_synchronous 1 + +#define EGL_STREAM_FIFO_SYNCHRONOUS_NV 0x3336 + +#define EGLEW_NV_stream_fifo_synchronous EGLEW_GET_VAR(__EGLEW_NV_stream_fifo_synchronous) + +#endif /* EGL_NV_stream_fifo_synchronous */ + +/* ----------------------- EGL_NV_stream_frame_limits ---------------------- */ + +#ifndef EGL_NV_stream_frame_limits +#define EGL_NV_stream_frame_limits 1 + +#define EGL_PRODUCER_MAX_FRAME_HINT_NV 0x3337 +#define EGL_CONSUMER_MAX_FRAME_HINT_NV 0x3338 + +#define EGLEW_NV_stream_frame_limits EGLEW_GET_VAR(__EGLEW_NV_stream_frame_limits) + +#endif /* EGL_NV_stream_frame_limits */ + +/* ------------------------- EGL_NV_stream_metadata ------------------------ */ + +#ifndef EGL_NV_stream_metadata +#define EGL_NV_stream_metadata 1 + +#define EGL_MAX_STREAM_METADATA_BLOCKS_NV 0x3250 +#define EGL_MAX_STREAM_METADATA_BLOCK_SIZE_NV 0x3251 +#define EGL_MAX_STREAM_METADATA_TOTAL_SIZE_NV 0x3252 +#define EGL_PRODUCER_METADATA_NV 0x3253 +#define EGL_CONSUMER_METADATA_NV 0x3254 +#define EGL_METADATA0_SIZE_NV 0x3255 +#define EGL_METADATA1_SIZE_NV 0x3256 +#define EGL_METADATA2_SIZE_NV 0x3257 +#define EGL_METADATA3_SIZE_NV 0x3258 +#define EGL_METADATA0_TYPE_NV 0x3259 +#define EGL_METADATA1_TYPE_NV 0x325A +#define EGL_METADATA2_TYPE_NV 0x325B +#define EGL_METADATA3_TYPE_NV 0x325C +#define EGL_PENDING_METADATA_NV 0x3328 + +typedef EGLBoolean ( * PFNEGLQUERYDISPLAYATTRIBNVPROC) (EGLDisplay dpy, EGLint attribute, EGLAttrib * value); +typedef EGLBoolean ( * PFNEGLQUERYSTREAMMETADATANVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum name, EGLint n, EGLint offset, EGLint size, void * data); +typedef EGLBoolean ( * PFNEGLSETSTREAMMETADATANVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLint n, EGLint offset, EGLint size, const void * data); + +#define eglQueryDisplayAttribNV EGLEW_GET_FUN(__eglewQueryDisplayAttribNV) +#define eglQueryStreamMetadataNV EGLEW_GET_FUN(__eglewQueryStreamMetadataNV) +#define eglSetStreamMetadataNV EGLEW_GET_FUN(__eglewSetStreamMetadataNV) + +#define EGLEW_NV_stream_metadata EGLEW_GET_VAR(__EGLEW_NV_stream_metadata) + +#endif /* EGL_NV_stream_metadata */ + +/* -------------------------- EGL_NV_stream_remote ------------------------- */ + +#ifndef EGL_NV_stream_remote +#define EGL_NV_stream_remote 1 + +#define EGL_STREAM_STATE_INITIALIZING_NV 0x3240 +#define EGL_STREAM_TYPE_NV 0x3241 +#define EGL_STREAM_PROTOCOL_NV 0x3242 +#define EGL_STREAM_ENDPOINT_NV 0x3243 +#define EGL_STREAM_LOCAL_NV 0x3244 +#define EGL_STREAM_PROTOCOL_FD_NV 0x3246 +#define EGL_STREAM_PRODUCER_NV 0x3247 +#define EGL_STREAM_CONSUMER_NV 0x3248 + +#define EGLEW_NV_stream_remote EGLEW_GET_VAR(__EGLEW_NV_stream_remote) + +#endif /* EGL_NV_stream_remote */ + +/* -------------------------- EGL_NV_stream_reset -------------------------- */ + +#ifndef EGL_NV_stream_reset +#define EGL_NV_stream_reset 1 + +#define EGL_SUPPORT_RESET_NV 0x3334 +#define EGL_SUPPORT_REUSE_NV 0x3335 + +typedef EGLBoolean ( * PFNEGLRESETSTREAMNVPROC) (EGLDisplay dpy, EGLStreamKHR stream); + +#define eglResetStreamNV EGLEW_GET_FUN(__eglewResetStreamNV) + +#define EGLEW_NV_stream_reset EGLEW_GET_VAR(__EGLEW_NV_stream_reset) + +#endif /* EGL_NV_stream_reset */ + +/* -------------------------- EGL_NV_stream_socket ------------------------- */ + +#ifndef EGL_NV_stream_socket +#define EGL_NV_stream_socket 1 + +#define EGL_STREAM_PROTOCOL_SOCKET_NV 0x324B +#define EGL_SOCKET_HANDLE_NV 0x324C +#define EGL_SOCKET_TYPE_NV 0x324D + +#define EGLEW_NV_stream_socket EGLEW_GET_VAR(__EGLEW_NV_stream_socket) + +#endif /* EGL_NV_stream_socket */ + +/* ----------------------- EGL_NV_stream_socket_inet ----------------------- */ + +#ifndef EGL_NV_stream_socket_inet +#define EGL_NV_stream_socket_inet 1 + +#define EGL_SOCKET_TYPE_INET_NV 0x324F + +#define EGLEW_NV_stream_socket_inet EGLEW_GET_VAR(__EGLEW_NV_stream_socket_inet) + +#endif /* EGL_NV_stream_socket_inet */ + +/* ----------------------- EGL_NV_stream_socket_unix ----------------------- */ + +#ifndef EGL_NV_stream_socket_unix +#define EGL_NV_stream_socket_unix 1 + +#define EGL_SOCKET_TYPE_UNIX_NV 0x324E + +#define EGLEW_NV_stream_socket_unix EGLEW_GET_VAR(__EGLEW_NV_stream_socket_unix) + +#endif /* EGL_NV_stream_socket_unix */ + +/* --------------------------- EGL_NV_stream_sync -------------------------- */ + +#ifndef EGL_NV_stream_sync +#define EGL_NV_stream_sync 1 + +#define EGL_SYNC_TYPE_KHR 0x30F7 +#define EGL_SYNC_NEW_FRAME_NV 0x321F + +typedef EGLSyncKHR ( * PFNEGLCREATESTREAMSYNCNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum type, const EGLint * attrib_list); + +#define eglCreateStreamSyncNV EGLEW_GET_FUN(__eglewCreateStreamSyncNV) + +#define EGLEW_NV_stream_sync EGLEW_GET_VAR(__EGLEW_NV_stream_sync) + +#endif /* EGL_NV_stream_sync */ + +/* ------------------------------ EGL_NV_sync ------------------------------ */ + +#ifndef EGL_NV_sync +#define EGL_NV_sync 1 + +#define EGL_SYNC_FLUSH_COMMANDS_BIT_NV 0x0001 +#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_NV 0x30E6 +#define EGL_SYNC_STATUS_NV 0x30E7 +#define EGL_SIGNALED_NV 0x30E8 +#define EGL_UNSIGNALED_NV 0x30E9 +#define EGL_ALREADY_SIGNALED_NV 0x30EA +#define EGL_TIMEOUT_EXPIRED_NV 0x30EB +#define EGL_CONDITION_SATISFIED_NV 0x30EC +#define EGL_SYNC_TYPE_NV 0x30ED +#define EGL_SYNC_CONDITION_NV 0x30EE +#define EGL_SYNC_FENCE_NV 0x30EF +#define EGL_FOREVER_NV 0xFFFFFFFFFFFFFFFF + +typedef EGLint ( * PFNEGLCLIENTWAITSYNCNVPROC) (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout); +typedef EGLSyncNV ( * PFNEGLCREATEFENCESYNCNVPROC) (EGLDisplay dpy, EGLenum condition, const EGLint * attrib_list); +typedef EGLBoolean ( * PFNEGLDESTROYSYNCNVPROC) (EGLSyncNV sync); +typedef EGLBoolean ( * PFNEGLFENCENVPROC) (EGLSyncNV sync); +typedef EGLBoolean ( * PFNEGLGETSYNCATTRIBNVPROC) (EGLSyncNV sync, EGLint attribute, EGLint * value); +typedef EGLBoolean ( * PFNEGLSIGNALSYNCNVPROC) (EGLSyncNV sync, EGLenum mode); + +#define eglClientWaitSyncNV EGLEW_GET_FUN(__eglewClientWaitSyncNV) +#define eglCreateFenceSyncNV EGLEW_GET_FUN(__eglewCreateFenceSyncNV) +#define eglDestroySyncNV EGLEW_GET_FUN(__eglewDestroySyncNV) +#define eglFenceNV EGLEW_GET_FUN(__eglewFenceNV) +#define eglGetSyncAttribNV EGLEW_GET_FUN(__eglewGetSyncAttribNV) +#define eglSignalSyncNV EGLEW_GET_FUN(__eglewSignalSyncNV) + +#define EGLEW_NV_sync EGLEW_GET_VAR(__EGLEW_NV_sync) + +#endif /* EGL_NV_sync */ + +/* --------------------------- EGL_NV_system_time -------------------------- */ + +#ifndef EGL_NV_system_time +#define EGL_NV_system_time 1 + +typedef EGLuint64NV ( * PFNEGLGETSYSTEMTIMEFREQUENCYNVPROC) ( void ); +typedef EGLuint64NV ( * PFNEGLGETSYSTEMTIMENVPROC) ( void ); + +#define eglGetSystemTimeFrequencyNV EGLEW_GET_FUN(__eglewGetSystemTimeFrequencyNV) +#define eglGetSystemTimeNV EGLEW_GET_FUN(__eglewGetSystemTimeNV) + +#define EGLEW_NV_system_time EGLEW_GET_VAR(__EGLEW_NV_system_time) + +#endif /* EGL_NV_system_time */ + +/* --------------------- EGL_TIZEN_image_native_buffer --------------------- */ + +#ifndef EGL_TIZEN_image_native_buffer +#define EGL_TIZEN_image_native_buffer 1 + +#define EGL_NATIVE_BUFFER_TIZEN 0x32A0 + +#define EGLEW_TIZEN_image_native_buffer EGLEW_GET_VAR(__EGLEW_TIZEN_image_native_buffer) + +#endif /* EGL_TIZEN_image_native_buffer */ + +/* --------------------- EGL_TIZEN_image_native_surface -------------------- */ + +#ifndef EGL_TIZEN_image_native_surface +#define EGL_TIZEN_image_native_surface 1 + +#define EGL_NATIVE_SURFACE_TIZEN 0x32A1 + +#define EGLEW_TIZEN_image_native_surface EGLEW_GET_VAR(__EGLEW_TIZEN_image_native_surface) + +#endif /* EGL_TIZEN_image_native_surface */ + +/* ------------------------------------------------------------------------- */ + +#define EGLEW_FUN_EXPORT GLEW_FUN_EXPORT +#define EGLEW_VAR_EXPORT GLEW_VAR_EXPORT + +EGLEW_FUN_EXPORT PFNEGLCHOOSECONFIGPROC __eglewChooseConfig; +EGLEW_FUN_EXPORT PFNEGLCOPYBUFFERSPROC __eglewCopyBuffers; +EGLEW_FUN_EXPORT PFNEGLCREATECONTEXTPROC __eglewCreateContext; +EGLEW_FUN_EXPORT PFNEGLCREATEPBUFFERSURFACEPROC __eglewCreatePbufferSurface; +EGLEW_FUN_EXPORT PFNEGLCREATEPIXMAPSURFACEPROC __eglewCreatePixmapSurface; +EGLEW_FUN_EXPORT PFNEGLCREATEWINDOWSURFACEPROC __eglewCreateWindowSurface; +EGLEW_FUN_EXPORT PFNEGLDESTROYCONTEXTPROC __eglewDestroyContext; +EGLEW_FUN_EXPORT PFNEGLDESTROYSURFACEPROC __eglewDestroySurface; +EGLEW_FUN_EXPORT PFNEGLGETCONFIGATTRIBPROC __eglewGetConfigAttrib; +EGLEW_FUN_EXPORT PFNEGLGETCONFIGSPROC __eglewGetConfigs; +EGLEW_FUN_EXPORT PFNEGLGETCURRENTDISPLAYPROC __eglewGetCurrentDisplay; +EGLEW_FUN_EXPORT PFNEGLGETCURRENTSURFACEPROC __eglewGetCurrentSurface; +EGLEW_FUN_EXPORT PFNEGLGETDISPLAYPROC __eglewGetDisplay; +EGLEW_FUN_EXPORT PFNEGLGETERRORPROC __eglewGetError; +EGLEW_FUN_EXPORT PFNEGLINITIALIZEPROC __eglewInitialize; +EGLEW_FUN_EXPORT PFNEGLMAKECURRENTPROC __eglewMakeCurrent; +EGLEW_FUN_EXPORT PFNEGLQUERYCONTEXTPROC __eglewQueryContext; +EGLEW_FUN_EXPORT PFNEGLQUERYSTRINGPROC __eglewQueryString; +EGLEW_FUN_EXPORT PFNEGLQUERYSURFACEPROC __eglewQuerySurface; +EGLEW_FUN_EXPORT PFNEGLSWAPBUFFERSPROC __eglewSwapBuffers; +EGLEW_FUN_EXPORT PFNEGLTERMINATEPROC __eglewTerminate; +EGLEW_FUN_EXPORT PFNEGLWAITGLPROC __eglewWaitGL; +EGLEW_FUN_EXPORT PFNEGLWAITNATIVEPROC __eglewWaitNative; + +EGLEW_FUN_EXPORT PFNEGLBINDTEXIMAGEPROC __eglewBindTexImage; +EGLEW_FUN_EXPORT PFNEGLRELEASETEXIMAGEPROC __eglewReleaseTexImage; +EGLEW_FUN_EXPORT PFNEGLSURFACEATTRIBPROC __eglewSurfaceAttrib; +EGLEW_FUN_EXPORT PFNEGLSWAPINTERVALPROC __eglewSwapInterval; + +EGLEW_FUN_EXPORT PFNEGLBINDAPIPROC __eglewBindAPI; +EGLEW_FUN_EXPORT PFNEGLCREATEPBUFFERFROMCLIENTBUFFERPROC __eglewCreatePbufferFromClientBuffer; +EGLEW_FUN_EXPORT PFNEGLQUERYAPIPROC __eglewQueryAPI; +EGLEW_FUN_EXPORT PFNEGLRELEASETHREADPROC __eglewReleaseThread; +EGLEW_FUN_EXPORT PFNEGLWAITCLIENTPROC __eglewWaitClient; + +EGLEW_FUN_EXPORT PFNEGLGETCURRENTCONTEXTPROC __eglewGetCurrentContext; + +EGLEW_FUN_EXPORT PFNEGLCLIENTWAITSYNCPROC __eglewClientWaitSync; +EGLEW_FUN_EXPORT PFNEGLCREATEIMAGEPROC __eglewCreateImage; +EGLEW_FUN_EXPORT PFNEGLCREATEPLATFORMPIXMAPSURFACEPROC __eglewCreatePlatformPixmapSurface; +EGLEW_FUN_EXPORT PFNEGLCREATEPLATFORMWINDOWSURFACEPROC __eglewCreatePlatformWindowSurface; +EGLEW_FUN_EXPORT PFNEGLCREATESYNCPROC __eglewCreateSync; +EGLEW_FUN_EXPORT PFNEGLDESTROYIMAGEPROC __eglewDestroyImage; +EGLEW_FUN_EXPORT PFNEGLDESTROYSYNCPROC __eglewDestroySync; +EGLEW_FUN_EXPORT PFNEGLGETPLATFORMDISPLAYPROC __eglewGetPlatformDisplay; +EGLEW_FUN_EXPORT PFNEGLGETSYNCATTRIBPROC __eglewGetSyncAttrib; +EGLEW_FUN_EXPORT PFNEGLWAITSYNCPROC __eglewWaitSync; + +EGLEW_FUN_EXPORT PFNEGLSETBLOBCACHEFUNCSANDROIDPROC __eglewSetBlobCacheFuncsANDROID; + +EGLEW_FUN_EXPORT PFNEGLCREATENATIVECLIENTBUFFERANDROIDPROC __eglewCreateNativeClientBufferANDROID; + +EGLEW_FUN_EXPORT PFNEGLDUPNATIVEFENCEFDANDROIDPROC __eglewDupNativeFenceFDANDROID; + +EGLEW_FUN_EXPORT PFNEGLPRESENTATIONTIMEANDROIDPROC __eglewPresentationTimeANDROID; + +EGLEW_FUN_EXPORT PFNEGLQUERYSURFACEPOINTERANGLEPROC __eglewQuerySurfacePointerANGLE; + +EGLEW_FUN_EXPORT PFNEGLQUERYDEVICESEXTPROC __eglewQueryDevicesEXT; + +EGLEW_FUN_EXPORT PFNEGLQUERYDEVICEATTRIBEXTPROC __eglewQueryDeviceAttribEXT; +EGLEW_FUN_EXPORT PFNEGLQUERYDEVICESTRINGEXTPROC __eglewQueryDeviceStringEXT; +EGLEW_FUN_EXPORT PFNEGLQUERYDISPLAYATTRIBEXTPROC __eglewQueryDisplayAttribEXT; + +EGLEW_FUN_EXPORT PFNEGLQUERYDMABUFFORMATSEXTPROC __eglewQueryDmaBufFormatsEXT; +EGLEW_FUN_EXPORT PFNEGLQUERYDMABUFMODIFIERSEXTPROC __eglewQueryDmaBufModifiersEXT; + +EGLEW_FUN_EXPORT PFNEGLGETOUTPUTLAYERSEXTPROC __eglewGetOutputLayersEXT; +EGLEW_FUN_EXPORT PFNEGLGETOUTPUTPORTSEXTPROC __eglewGetOutputPortsEXT; +EGLEW_FUN_EXPORT PFNEGLOUTPUTLAYERATTRIBEXTPROC __eglewOutputLayerAttribEXT; +EGLEW_FUN_EXPORT PFNEGLOUTPUTPORTATTRIBEXTPROC __eglewOutputPortAttribEXT; +EGLEW_FUN_EXPORT PFNEGLQUERYOUTPUTLAYERATTRIBEXTPROC __eglewQueryOutputLayerAttribEXT; +EGLEW_FUN_EXPORT PFNEGLQUERYOUTPUTLAYERSTRINGEXTPROC __eglewQueryOutputLayerStringEXT; +EGLEW_FUN_EXPORT PFNEGLQUERYOUTPUTPORTATTRIBEXTPROC __eglewQueryOutputPortAttribEXT; +EGLEW_FUN_EXPORT PFNEGLQUERYOUTPUTPORTSTRINGEXTPROC __eglewQueryOutputPortStringEXT; + +EGLEW_FUN_EXPORT PFNEGLCREATEPLATFORMPIXMAPSURFACEEXTPROC __eglewCreatePlatformPixmapSurfaceEXT; +EGLEW_FUN_EXPORT PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC __eglewCreatePlatformWindowSurfaceEXT; +EGLEW_FUN_EXPORT PFNEGLGETPLATFORMDISPLAYEXTPROC __eglewGetPlatformDisplayEXT; + +EGLEW_FUN_EXPORT PFNEGLSTREAMCONSUMEROUTPUTEXTPROC __eglewStreamConsumerOutputEXT; + +EGLEW_FUN_EXPORT PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC __eglewSwapBuffersWithDamageEXT; + +EGLEW_FUN_EXPORT PFNEGLCREATEPIXMAPSURFACEHIPROC __eglewCreatePixmapSurfaceHI; + +EGLEW_FUN_EXPORT PFNEGLCREATESYNC64KHRPROC __eglewCreateSync64KHR; + +EGLEW_FUN_EXPORT PFNEGLDEBUGMESSAGECONTROLKHRPROC __eglewDebugMessageControlKHR; +EGLEW_FUN_EXPORT PFNEGLLABELOBJECTKHRPROC __eglewLabelObjectKHR; +EGLEW_FUN_EXPORT PFNEGLQUERYDEBUGKHRPROC __eglewQueryDebugKHR; + +EGLEW_FUN_EXPORT PFNEGLCREATEIMAGEKHRPROC __eglewCreateImageKHR; +EGLEW_FUN_EXPORT PFNEGLDESTROYIMAGEKHRPROC __eglewDestroyImageKHR; + +EGLEW_FUN_EXPORT PFNEGLLOCKSURFACEKHRPROC __eglewLockSurfaceKHR; +EGLEW_FUN_EXPORT PFNEGLUNLOCKSURFACEKHRPROC __eglewUnlockSurfaceKHR; + +EGLEW_FUN_EXPORT PFNEGLQUERYSURFACE64KHRPROC __eglewQuerySurface64KHR; + +EGLEW_FUN_EXPORT PFNEGLSETDAMAGEREGIONKHRPROC __eglewSetDamageRegionKHR; + +EGLEW_FUN_EXPORT PFNEGLCLIENTWAITSYNCKHRPROC __eglewClientWaitSyncKHR; +EGLEW_FUN_EXPORT PFNEGLCREATESYNCKHRPROC __eglewCreateSyncKHR; +EGLEW_FUN_EXPORT PFNEGLDESTROYSYNCKHRPROC __eglewDestroySyncKHR; +EGLEW_FUN_EXPORT PFNEGLGETSYNCATTRIBKHRPROC __eglewGetSyncAttribKHR; +EGLEW_FUN_EXPORT PFNEGLSIGNALSYNCKHRPROC __eglewSignalSyncKHR; + +EGLEW_FUN_EXPORT PFNEGLCREATESTREAMKHRPROC __eglewCreateStreamKHR; +EGLEW_FUN_EXPORT PFNEGLDESTROYSTREAMKHRPROC __eglewDestroyStreamKHR; +EGLEW_FUN_EXPORT PFNEGLQUERYSTREAMKHRPROC __eglewQueryStreamKHR; +EGLEW_FUN_EXPORT PFNEGLQUERYSTREAMU64KHRPROC __eglewQueryStreamu64KHR; +EGLEW_FUN_EXPORT PFNEGLSTREAMATTRIBKHRPROC __eglewStreamAttribKHR; + +EGLEW_FUN_EXPORT PFNEGLCREATESTREAMATTRIBKHRPROC __eglewCreateStreamAttribKHR; +EGLEW_FUN_EXPORT PFNEGLQUERYSTREAMATTRIBKHRPROC __eglewQueryStreamAttribKHR; +EGLEW_FUN_EXPORT PFNEGLSETSTREAMATTRIBKHRPROC __eglewSetStreamAttribKHR; +EGLEW_FUN_EXPORT PFNEGLSTREAMCONSUMERACQUIREATTRIBKHRPROC __eglewStreamConsumerAcquireAttribKHR; +EGLEW_FUN_EXPORT PFNEGLSTREAMCONSUMERRELEASEATTRIBKHRPROC __eglewStreamConsumerReleaseAttribKHR; + +EGLEW_FUN_EXPORT PFNEGLSTREAMCONSUMERACQUIREKHRPROC __eglewStreamConsumerAcquireKHR; +EGLEW_FUN_EXPORT PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALKHRPROC __eglewStreamConsumerGLTextureExternalKHR; +EGLEW_FUN_EXPORT PFNEGLSTREAMCONSUMERRELEASEKHRPROC __eglewStreamConsumerReleaseKHR; + +EGLEW_FUN_EXPORT PFNEGLCREATESTREAMFROMFILEDESCRIPTORKHRPROC __eglewCreateStreamFromFileDescriptorKHR; +EGLEW_FUN_EXPORT PFNEGLGETSTREAMFILEDESCRIPTORKHRPROC __eglewGetStreamFileDescriptorKHR; + +EGLEW_FUN_EXPORT PFNEGLQUERYSTREAMTIMEKHRPROC __eglewQueryStreamTimeKHR; + +EGLEW_FUN_EXPORT PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC __eglewCreateStreamProducerSurfaceKHR; + +EGLEW_FUN_EXPORT PFNEGLSWAPBUFFERSWITHDAMAGEKHRPROC __eglewSwapBuffersWithDamageKHR; + +EGLEW_FUN_EXPORT PFNEGLWAITSYNCKHRPROC __eglewWaitSyncKHR; + +EGLEW_FUN_EXPORT PFNEGLCREATEDRMIMAGEMESAPROC __eglewCreateDRMImageMESA; +EGLEW_FUN_EXPORT PFNEGLEXPORTDRMIMAGEMESAPROC __eglewExportDRMImageMESA; + +EGLEW_FUN_EXPORT PFNEGLEXPORTDMABUFIMAGEMESAPROC __eglewExportDMABUFImageMESA; +EGLEW_FUN_EXPORT PFNEGLEXPORTDMABUFIMAGEQUERYMESAPROC __eglewExportDMABUFImageQueryMESA; + +EGLEW_FUN_EXPORT PFNEGLSWAPBUFFERSREGIONNOKPROC __eglewSwapBuffersRegionNOK; + +EGLEW_FUN_EXPORT PFNEGLSWAPBUFFERSREGION2NOKPROC __eglewSwapBuffersRegion2NOK; + +EGLEW_FUN_EXPORT PFNEGLQUERYNATIVEDISPLAYNVPROC __eglewQueryNativeDisplayNV; +EGLEW_FUN_EXPORT PFNEGLQUERYNATIVEPIXMAPNVPROC __eglewQueryNativePixmapNV; +EGLEW_FUN_EXPORT PFNEGLQUERYNATIVEWINDOWNVPROC __eglewQueryNativeWindowNV; + +EGLEW_FUN_EXPORT PFNEGLPOSTSUBBUFFERNVPROC __eglewPostSubBufferNV; + +EGLEW_FUN_EXPORT PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALATTRIBSNVPROC __eglewStreamConsumerGLTextureExternalAttribsNV; + +EGLEW_FUN_EXPORT PFNEGLQUERYDISPLAYATTRIBNVPROC __eglewQueryDisplayAttribNV; +EGLEW_FUN_EXPORT PFNEGLQUERYSTREAMMETADATANVPROC __eglewQueryStreamMetadataNV; +EGLEW_FUN_EXPORT PFNEGLSETSTREAMMETADATANVPROC __eglewSetStreamMetadataNV; + +EGLEW_FUN_EXPORT PFNEGLRESETSTREAMNVPROC __eglewResetStreamNV; + +EGLEW_FUN_EXPORT PFNEGLCREATESTREAMSYNCNVPROC __eglewCreateStreamSyncNV; + +EGLEW_FUN_EXPORT PFNEGLCLIENTWAITSYNCNVPROC __eglewClientWaitSyncNV; +EGLEW_FUN_EXPORT PFNEGLCREATEFENCESYNCNVPROC __eglewCreateFenceSyncNV; +EGLEW_FUN_EXPORT PFNEGLDESTROYSYNCNVPROC __eglewDestroySyncNV; +EGLEW_FUN_EXPORT PFNEGLFENCENVPROC __eglewFenceNV; +EGLEW_FUN_EXPORT PFNEGLGETSYNCATTRIBNVPROC __eglewGetSyncAttribNV; +EGLEW_FUN_EXPORT PFNEGLSIGNALSYNCNVPROC __eglewSignalSyncNV; + +EGLEW_FUN_EXPORT PFNEGLGETSYSTEMTIMEFREQUENCYNVPROC __eglewGetSystemTimeFrequencyNV; +EGLEW_FUN_EXPORT PFNEGLGETSYSTEMTIMENVPROC __eglewGetSystemTimeNV; +EGLEW_VAR_EXPORT GLboolean __EGLEW_VERSION_1_0; +EGLEW_VAR_EXPORT GLboolean __EGLEW_VERSION_1_1; +EGLEW_VAR_EXPORT GLboolean __EGLEW_VERSION_1_2; +EGLEW_VAR_EXPORT GLboolean __EGLEW_VERSION_1_3; +EGLEW_VAR_EXPORT GLboolean __EGLEW_VERSION_1_4; +EGLEW_VAR_EXPORT GLboolean __EGLEW_VERSION_1_5; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ANDROID_blob_cache; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ANDROID_create_native_client_buffer; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ANDROID_framebuffer_target; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ANDROID_front_buffer_auto_refresh; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ANDROID_image_native_buffer; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ANDROID_native_fence_sync; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ANDROID_presentation_time; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ANDROID_recordable; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ANGLE_d3d_share_handle_client_buffer; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ANGLE_device_d3d; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ANGLE_query_surface_pointer; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ANGLE_surface_d3d_texture_2d_share_handle; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ANGLE_window_fixed_size; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ARM_implicit_external_sync; +EGLEW_VAR_EXPORT GLboolean __EGLEW_ARM_pixmap_multisample_discard; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_buffer_age; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_client_extensions; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_create_context_robustness; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_device_base; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_device_drm; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_device_enumeration; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_device_openwf; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_device_query; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_gl_colorspace_bt2020_linear; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_gl_colorspace_bt2020_pq; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_gl_colorspace_scrgb_linear; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_image_dma_buf_import; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_image_dma_buf_import_modifiers; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_multiview_window; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_output_base; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_output_drm; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_output_openwf; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_pixel_format_float; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_platform_base; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_platform_device; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_platform_wayland; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_platform_x11; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_protected_content; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_protected_surface; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_stream_consumer_egloutput; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_surface_SMPTE2086_metadata; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_swap_buffers_with_damage; +EGLEW_VAR_EXPORT GLboolean __EGLEW_EXT_yuv_surface; +EGLEW_VAR_EXPORT GLboolean __EGLEW_HI_clientpixmap; +EGLEW_VAR_EXPORT GLboolean __EGLEW_HI_colorformats; +EGLEW_VAR_EXPORT GLboolean __EGLEW_IMG_context_priority; +EGLEW_VAR_EXPORT GLboolean __EGLEW_IMG_image_plane_attribs; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_cl_event; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_cl_event2; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_client_get_all_proc_addresses; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_config_attribs; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_context_flush_control; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_create_context; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_create_context_no_error; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_debug; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_fence_sync; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_get_all_proc_addresses; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_gl_colorspace; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_gl_renderbuffer_image; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_gl_texture_2D_image; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_gl_texture_3D_image; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_gl_texture_cubemap_image; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_image; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_image_base; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_image_pixmap; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_lock_surface; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_lock_surface2; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_lock_surface3; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_mutable_render_buffer; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_no_config_context; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_partial_update; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_platform_android; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_platform_gbm; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_platform_wayland; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_platform_x11; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_reusable_sync; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_stream; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_stream_attrib; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_stream_consumer_gltexture; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_stream_cross_process_fd; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_stream_fifo; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_stream_producer_aldatalocator; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_stream_producer_eglsurface; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_surfaceless_context; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_swap_buffers_with_damage; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_vg_parent_image; +EGLEW_VAR_EXPORT GLboolean __EGLEW_KHR_wait_sync; +EGLEW_VAR_EXPORT GLboolean __EGLEW_MESA_drm_image; +EGLEW_VAR_EXPORT GLboolean __EGLEW_MESA_image_dma_buf_export; +EGLEW_VAR_EXPORT GLboolean __EGLEW_MESA_platform_gbm; +EGLEW_VAR_EXPORT GLboolean __EGLEW_MESA_platform_surfaceless; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NOK_swap_region; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NOK_swap_region2; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NOK_texture_from_pixmap; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_3dvision_surface; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_coverage_sample; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_coverage_sample_resolve; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_cuda_event; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_depth_nonlinear; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_device_cuda; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_native_query; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_post_convert_rounding; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_post_sub_buffer; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_robustness_video_memory_purge; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_consumer_gltexture_yuv; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_cross_display; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_cross_object; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_cross_partition; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_cross_process; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_cross_system; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_fifo_next; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_fifo_synchronous; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_frame_limits; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_metadata; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_remote; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_reset; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_socket; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_socket_inet; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_socket_unix; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_stream_sync; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_sync; +EGLEW_VAR_EXPORT GLboolean __EGLEW_NV_system_time; +EGLEW_VAR_EXPORT GLboolean __EGLEW_TIZEN_image_native_buffer; +EGLEW_VAR_EXPORT GLboolean __EGLEW_TIZEN_image_native_surface; +/* ------------------------------------------------------------------------ */ + +GLEWAPI GLenum GLEWAPIENTRY eglewInit (EGLDisplay display); +GLEWAPI GLboolean GLEWAPIENTRY eglewIsSupported (const char *name); + +#define EGLEW_GET_VAR(x) (*(const GLboolean*)&x) +#define EGLEW_GET_FUN(x) x + +GLEWAPI GLboolean GLEWAPIENTRY eglewGetExtension (const char *name); + +#ifdef __cplusplus +} +#endif + +#endif /* __eglew_h__ */ diff --git a/r5dev/thirdparty/cppnet/cppkore_docs/glew_reference/glew.h b/r5dev/thirdparty/cppnet/cppkore_docs/glew_reference/glew.h new file mode 100644 index 00000000..d5ddc6a1 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore_docs/glew_reference/glew.h @@ -0,0 +1,23688 @@ +/* +** The OpenGL Extension Wrangler Library +** Copyright (C) 2008-2017, Nigel Stewart +** Copyright (C) 2002-2008, Milan Ikits +** Copyright (C) 2002-2008, Marcelo E. Magallon +** Copyright (C) 2002, Lev Povalahev +** All rights reserved. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are met: +** +** * Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** * The name of the author may be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +** THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/* + * Mesa 3-D graphics library + * Version: 7.0 + * + * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* +** Copyright (c) 2007 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 +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +#define GLEW_STATIC + +#ifndef __glew_h__ +#define __glew_h__ +#define __GLEW_H__ + +#if defined(__gl_h_) || defined(__GL_H__) || defined(_GL_H) || defined(__X_GL_H) +#error gl.h included before glew.h +#endif +#if defined(__gl2_h_) +#error gl2.h included before glew.h +#endif +#if defined(__gltypes_h_) +#error gltypes.h included before glew.h +#endif +#if defined(__REGAL_H__) +#error Regal.h included before glew.h +#endif +#if defined(__glext_h_) || defined(__GLEXT_H_) +#error glext.h included before glew.h +#endif +#if defined(__gl_ATI_h_) +#error glATI.h included before glew.h +#endif + +#define __gl_h_ +#define __gl2_h_ +#define __GL_H__ +#define _GL_H +#define __gltypes_h_ +#define __REGAL_H__ +#define __X_GL_H +#define __glext_h_ +#define __GLEXT_H_ +#define __gl_ATI_h_ + +#if defined(_WIN32) + +/* + * GLEW does not include to avoid name space pollution. + * GL needs GLAPI and GLAPIENTRY, GLU needs APIENTRY, CALLBACK, and wchar_t + * defined properly. + */ +/* and */ +#ifdef APIENTRY +# ifndef GLAPIENTRY +# define GLAPIENTRY APIENTRY +# endif +# ifndef GLEWAPIENTRY +# define GLEWAPIENTRY APIENTRY +# endif +#else +#define GLEW_APIENTRY_DEFINED +# if defined(__MINGW32__) || defined(__CYGWIN__) || (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__BORLANDC__) +# define APIENTRY __stdcall +# ifndef GLAPIENTRY +# define GLAPIENTRY __stdcall +# endif +# ifndef GLEWAPIENTRY +# define GLEWAPIENTRY __stdcall +# endif +# else +# define APIENTRY +# endif +#endif +#ifndef GLAPI +# if defined(__MINGW32__) || defined(__CYGWIN__) +# define GLAPI extern +# endif +#endif +/* */ +#ifndef CALLBACK +#define GLEW_CALLBACK_DEFINED +# if defined(__MINGW32__) || defined(__CYGWIN__) +# define CALLBACK __attribute__ ((__stdcall__)) +# elif (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS) +# define CALLBACK __stdcall +# else +# define CALLBACK +# endif +#endif +/* and */ +#ifndef WINGDIAPI +#define GLEW_WINGDIAPI_DEFINED +#define WINGDIAPI __declspec(dllimport) +#endif +/* */ +#if (defined(_MSC_VER) || defined(__BORLANDC__)) && !defined(_WCHAR_T_DEFINED) +typedef unsigned short wchar_t; +# define _WCHAR_T_DEFINED +#endif +/* */ +#if !defined(_W64) +# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && defined(_MSC_VER) && _MSC_VER >= 1300 +# define _W64 __w64 +# else +# define _W64 +# endif +#endif +#if !defined(_PTRDIFF_T_DEFINED) && !defined(_PTRDIFF_T_) && !defined(__MINGW64__) +# ifdef _WIN64 +typedef __int64 ptrdiff_t; +# else +typedef _W64 int ptrdiff_t; +# endif +# define _PTRDIFF_T_DEFINED +# define _PTRDIFF_T_ +#endif + +#ifndef GLAPI +# if defined(__MINGW32__) || defined(__CYGWIN__) +# define GLAPI extern +# else +# define GLAPI WINGDIAPI +# endif +#endif + +/* + * GLEW_STATIC is defined for static library. + * GLEW_BUILD is defined for building the DLL library. + */ + +#ifdef GLEW_STATIC +# define GLEWAPI extern +#else +# ifdef GLEW_BUILD +# define GLEWAPI extern __declspec(dllexport) +# else +# define GLEWAPI extern __declspec(dllimport) +# endif +#endif + +#else /* _UNIX */ + +/* + * Needed for ptrdiff_t in turn needed by VBO. This is defined by ISO + * C. On my system, this amounts to _3 lines_ of included code, all of + * them pretty much harmless. If you know of a way of detecting 32 vs + * 64 _targets_ at compile time you are free to replace this with + * something that's portable. For now, _this_ is the portable solution. + * (mem, 2004-01-04) + */ + +#include + +/* SGI MIPSPro doesn't like stdint.h in C++ mode */ +/* ID: 3376260 Solaris 9 has inttypes.h, but not stdint.h */ + +#if (defined(__sgi) || defined(__sun)) && !defined(__GNUC__) +#include +#else +#include +#endif + +#define GLEW_APIENTRY_DEFINED +#define APIENTRY + +/* + * GLEW_STATIC is defined for static library. + */ + +#ifdef GLEW_STATIC +# define GLEWAPI extern +#else +# if defined(__GNUC__) && __GNUC__>=4 +# define GLEWAPI extern __attribute__ ((visibility("default"))) +# elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) +# define GLEWAPI extern __global +# else +# define GLEWAPI extern +# endif +#endif + +/* */ +#ifndef GLAPI +#define GLAPI extern +#endif + +#endif /* _WIN32 */ + +#ifndef GLAPIENTRY +#define GLAPIENTRY +#endif + +#ifndef GLEWAPIENTRY +#define GLEWAPIENTRY +#endif + +#define GLEW_VAR_EXPORT GLEWAPI +#define GLEW_FUN_EXPORT GLEWAPI + +#ifdef __cplusplus +extern "C" { +#endif + +/* ----------------------------- GL_VERSION_1_1 ---------------------------- */ + +#ifndef GL_VERSION_1_1 +#define GL_VERSION_1_1 1 + +typedef unsigned int GLenum; +typedef unsigned int GLbitfield; +typedef unsigned int GLuint; +typedef int GLint; +typedef int GLsizei; +typedef unsigned char GLboolean; +typedef signed char GLbyte; +typedef short GLshort; +typedef unsigned char GLubyte; +typedef unsigned short GLushort; +typedef unsigned long GLulong; +typedef float GLfloat; +typedef float GLclampf; +typedef double GLdouble; +typedef double GLclampd; +typedef void GLvoid; +#if defined(_MSC_VER) && _MSC_VER < 1400 +typedef __int64 GLint64EXT; +typedef unsigned __int64 GLuint64EXT; +#elif defined(_MSC_VER) || defined(__BORLANDC__) +typedef signed long long GLint64EXT; +typedef unsigned long long GLuint64EXT; +#else +# if defined(__MINGW32__) || defined(__CYGWIN__) +#include +# endif +typedef int64_t GLint64EXT; +typedef uint64_t GLuint64EXT; +#endif +typedef GLint64EXT GLint64; +typedef GLuint64EXT GLuint64; +typedef struct __GLsync *GLsync; + +typedef char GLchar; + +#define GL_ZERO 0 +#define GL_FALSE 0 +#define GL_LOGIC_OP 0x0BF1 +#define GL_NONE 0 +#define GL_TEXTURE_COMPONENTS 0x1003 +#define GL_NO_ERROR 0 +#define GL_POINTS 0x0000 +#define GL_CURRENT_BIT 0x00000001 +#define GL_TRUE 1 +#define GL_ONE 1 +#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001 +#define GL_LINES 0x0001 +#define GL_LINE_LOOP 0x0002 +#define GL_POINT_BIT 0x00000002 +#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002 +#define GL_LINE_STRIP 0x0003 +#define GL_LINE_BIT 0x00000004 +#define GL_TRIANGLES 0x0004 +#define GL_TRIANGLE_STRIP 0x0005 +#define GL_TRIANGLE_FAN 0x0006 +#define GL_QUADS 0x0007 +#define GL_QUAD_STRIP 0x0008 +#define GL_POLYGON_BIT 0x00000008 +#define GL_POLYGON 0x0009 +#define GL_POLYGON_STIPPLE_BIT 0x00000010 +#define GL_PIXEL_MODE_BIT 0x00000020 +#define GL_LIGHTING_BIT 0x00000040 +#define GL_FOG_BIT 0x00000080 +#define GL_DEPTH_BUFFER_BIT 0x00000100 +#define GL_ACCUM 0x0100 +#define GL_LOAD 0x0101 +#define GL_RETURN 0x0102 +#define GL_MULT 0x0103 +#define GL_ADD 0x0104 +#define GL_NEVER 0x0200 +#define GL_ACCUM_BUFFER_BIT 0x00000200 +#define GL_LESS 0x0201 +#define GL_EQUAL 0x0202 +#define GL_LEQUAL 0x0203 +#define GL_GREATER 0x0204 +#define GL_NOTEQUAL 0x0205 +#define GL_GEQUAL 0x0206 +#define GL_ALWAYS 0x0207 +#define GL_SRC_COLOR 0x0300 +#define GL_ONE_MINUS_SRC_COLOR 0x0301 +#define GL_SRC_ALPHA 0x0302 +#define GL_ONE_MINUS_SRC_ALPHA 0x0303 +#define GL_DST_ALPHA 0x0304 +#define GL_ONE_MINUS_DST_ALPHA 0x0305 +#define GL_DST_COLOR 0x0306 +#define GL_ONE_MINUS_DST_COLOR 0x0307 +#define GL_SRC_ALPHA_SATURATE 0x0308 +#define GL_STENCIL_BUFFER_BIT 0x00000400 +#define GL_FRONT_LEFT 0x0400 +#define GL_FRONT_RIGHT 0x0401 +#define GL_BACK_LEFT 0x0402 +#define GL_BACK_RIGHT 0x0403 +#define GL_FRONT 0x0404 +#define GL_BACK 0x0405 +#define GL_LEFT 0x0406 +#define GL_RIGHT 0x0407 +#define GL_FRONT_AND_BACK 0x0408 +#define GL_AUX0 0x0409 +#define GL_AUX1 0x040A +#define GL_AUX2 0x040B +#define GL_AUX3 0x040C +#define GL_INVALID_ENUM 0x0500 +#define GL_INVALID_VALUE 0x0501 +#define GL_INVALID_OPERATION 0x0502 +#define GL_STACK_OVERFLOW 0x0503 +#define GL_STACK_UNDERFLOW 0x0504 +#define GL_OUT_OF_MEMORY 0x0505 +#define GL_2D 0x0600 +#define GL_3D 0x0601 +#define GL_3D_COLOR 0x0602 +#define GL_3D_COLOR_TEXTURE 0x0603 +#define GL_4D_COLOR_TEXTURE 0x0604 +#define GL_PASS_THROUGH_TOKEN 0x0700 +#define GL_POINT_TOKEN 0x0701 +#define GL_LINE_TOKEN 0x0702 +#define GL_POLYGON_TOKEN 0x0703 +#define GL_BITMAP_TOKEN 0x0704 +#define GL_DRAW_PIXEL_TOKEN 0x0705 +#define GL_COPY_PIXEL_TOKEN 0x0706 +#define GL_LINE_RESET_TOKEN 0x0707 +#define GL_EXP 0x0800 +#define GL_VIEWPORT_BIT 0x00000800 +#define GL_EXP2 0x0801 +#define GL_CW 0x0900 +#define GL_CCW 0x0901 +#define GL_COEFF 0x0A00 +#define GL_ORDER 0x0A01 +#define GL_DOMAIN 0x0A02 +#define GL_CURRENT_COLOR 0x0B00 +#define GL_CURRENT_INDEX 0x0B01 +#define GL_CURRENT_NORMAL 0x0B02 +#define GL_CURRENT_TEXTURE_COORDS 0x0B03 +#define GL_CURRENT_RASTER_COLOR 0x0B04 +#define GL_CURRENT_RASTER_INDEX 0x0B05 +#define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06 +#define GL_CURRENT_RASTER_POSITION 0x0B07 +#define GL_CURRENT_RASTER_POSITION_VALID 0x0B08 +#define GL_CURRENT_RASTER_DISTANCE 0x0B09 +#define GL_POINT_SMOOTH 0x0B10 +#define GL_POINT_SIZE 0x0B11 +#define GL_POINT_SIZE_RANGE 0x0B12 +#define GL_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_LINE_SMOOTH 0x0B20 +#define GL_LINE_WIDTH 0x0B21 +#define GL_LINE_WIDTH_RANGE 0x0B22 +#define GL_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_LINE_STIPPLE 0x0B24 +#define GL_LINE_STIPPLE_PATTERN 0x0B25 +#define GL_LINE_STIPPLE_REPEAT 0x0B26 +#define GL_LIST_MODE 0x0B30 +#define GL_MAX_LIST_NESTING 0x0B31 +#define GL_LIST_BASE 0x0B32 +#define GL_LIST_INDEX 0x0B33 +#define GL_POLYGON_MODE 0x0B40 +#define GL_POLYGON_SMOOTH 0x0B41 +#define GL_POLYGON_STIPPLE 0x0B42 +#define GL_EDGE_FLAG 0x0B43 +#define GL_CULL_FACE 0x0B44 +#define GL_CULL_FACE_MODE 0x0B45 +#define GL_FRONT_FACE 0x0B46 +#define GL_LIGHTING 0x0B50 +#define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51 +#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52 +#define GL_LIGHT_MODEL_AMBIENT 0x0B53 +#define GL_SHADE_MODEL 0x0B54 +#define GL_COLOR_MATERIAL_FACE 0x0B55 +#define GL_COLOR_MATERIAL_PARAMETER 0x0B56 +#define GL_COLOR_MATERIAL 0x0B57 +#define GL_FOG 0x0B60 +#define GL_FOG_INDEX 0x0B61 +#define GL_FOG_DENSITY 0x0B62 +#define GL_FOG_START 0x0B63 +#define GL_FOG_END 0x0B64 +#define GL_FOG_MODE 0x0B65 +#define GL_FOG_COLOR 0x0B66 +#define GL_DEPTH_RANGE 0x0B70 +#define GL_DEPTH_TEST 0x0B71 +#define GL_DEPTH_WRITEMASK 0x0B72 +#define GL_DEPTH_CLEAR_VALUE 0x0B73 +#define GL_DEPTH_FUNC 0x0B74 +#define GL_ACCUM_CLEAR_VALUE 0x0B80 +#define GL_STENCIL_TEST 0x0B90 +#define GL_STENCIL_CLEAR_VALUE 0x0B91 +#define GL_STENCIL_FUNC 0x0B92 +#define GL_STENCIL_VALUE_MASK 0x0B93 +#define GL_STENCIL_FAIL 0x0B94 +#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 +#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 +#define GL_STENCIL_REF 0x0B97 +#define GL_STENCIL_WRITEMASK 0x0B98 +#define GL_MATRIX_MODE 0x0BA0 +#define GL_NORMALIZE 0x0BA1 +#define GL_VIEWPORT 0x0BA2 +#define GL_MODELVIEW_STACK_DEPTH 0x0BA3 +#define GL_PROJECTION_STACK_DEPTH 0x0BA4 +#define GL_TEXTURE_STACK_DEPTH 0x0BA5 +#define GL_MODELVIEW_MATRIX 0x0BA6 +#define GL_PROJECTION_MATRIX 0x0BA7 +#define GL_TEXTURE_MATRIX 0x0BA8 +#define GL_ATTRIB_STACK_DEPTH 0x0BB0 +#define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1 +#define GL_ALPHA_TEST 0x0BC0 +#define GL_ALPHA_TEST_FUNC 0x0BC1 +#define GL_ALPHA_TEST_REF 0x0BC2 +#define GL_DITHER 0x0BD0 +#define GL_BLEND_DST 0x0BE0 +#define GL_BLEND_SRC 0x0BE1 +#define GL_BLEND 0x0BE2 +#define GL_LOGIC_OP_MODE 0x0BF0 +#define GL_INDEX_LOGIC_OP 0x0BF1 +#define GL_COLOR_LOGIC_OP 0x0BF2 +#define GL_AUX_BUFFERS 0x0C00 +#define GL_DRAW_BUFFER 0x0C01 +#define GL_READ_BUFFER 0x0C02 +#define GL_SCISSOR_BOX 0x0C10 +#define GL_SCISSOR_TEST 0x0C11 +#define GL_INDEX_CLEAR_VALUE 0x0C20 +#define GL_INDEX_WRITEMASK 0x0C21 +#define GL_COLOR_CLEAR_VALUE 0x0C22 +#define GL_COLOR_WRITEMASK 0x0C23 +#define GL_INDEX_MODE 0x0C30 +#define GL_RGBA_MODE 0x0C31 +#define GL_DOUBLEBUFFER 0x0C32 +#define GL_STEREO 0x0C33 +#define GL_RENDER_MODE 0x0C40 +#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50 +#define GL_POINT_SMOOTH_HINT 0x0C51 +#define GL_LINE_SMOOTH_HINT 0x0C52 +#define GL_POLYGON_SMOOTH_HINT 0x0C53 +#define GL_FOG_HINT 0x0C54 +#define GL_TEXTURE_GEN_S 0x0C60 +#define GL_TEXTURE_GEN_T 0x0C61 +#define GL_TEXTURE_GEN_R 0x0C62 +#define GL_TEXTURE_GEN_Q 0x0C63 +#define GL_PIXEL_MAP_I_TO_I 0x0C70 +#define GL_PIXEL_MAP_S_TO_S 0x0C71 +#define GL_PIXEL_MAP_I_TO_R 0x0C72 +#define GL_PIXEL_MAP_I_TO_G 0x0C73 +#define GL_PIXEL_MAP_I_TO_B 0x0C74 +#define GL_PIXEL_MAP_I_TO_A 0x0C75 +#define GL_PIXEL_MAP_R_TO_R 0x0C76 +#define GL_PIXEL_MAP_G_TO_G 0x0C77 +#define GL_PIXEL_MAP_B_TO_B 0x0C78 +#define GL_PIXEL_MAP_A_TO_A 0x0C79 +#define GL_PIXEL_MAP_I_TO_I_SIZE 0x0CB0 +#define GL_PIXEL_MAP_S_TO_S_SIZE 0x0CB1 +#define GL_PIXEL_MAP_I_TO_R_SIZE 0x0CB2 +#define GL_PIXEL_MAP_I_TO_G_SIZE 0x0CB3 +#define GL_PIXEL_MAP_I_TO_B_SIZE 0x0CB4 +#define GL_PIXEL_MAP_I_TO_A_SIZE 0x0CB5 +#define GL_PIXEL_MAP_R_TO_R_SIZE 0x0CB6 +#define GL_PIXEL_MAP_G_TO_G_SIZE 0x0CB7 +#define GL_PIXEL_MAP_B_TO_B_SIZE 0x0CB8 +#define GL_PIXEL_MAP_A_TO_A_SIZE 0x0CB9 +#define GL_UNPACK_SWAP_BYTES 0x0CF0 +#define GL_UNPACK_LSB_FIRST 0x0CF1 +#define GL_UNPACK_ROW_LENGTH 0x0CF2 +#define GL_UNPACK_SKIP_ROWS 0x0CF3 +#define GL_UNPACK_SKIP_PIXELS 0x0CF4 +#define GL_UNPACK_ALIGNMENT 0x0CF5 +#define GL_PACK_SWAP_BYTES 0x0D00 +#define GL_PACK_LSB_FIRST 0x0D01 +#define GL_PACK_ROW_LENGTH 0x0D02 +#define GL_PACK_SKIP_ROWS 0x0D03 +#define GL_PACK_SKIP_PIXELS 0x0D04 +#define GL_PACK_ALIGNMENT 0x0D05 +#define GL_MAP_COLOR 0x0D10 +#define GL_MAP_STENCIL 0x0D11 +#define GL_INDEX_SHIFT 0x0D12 +#define GL_INDEX_OFFSET 0x0D13 +#define GL_RED_SCALE 0x0D14 +#define GL_RED_BIAS 0x0D15 +#define GL_ZOOM_X 0x0D16 +#define GL_ZOOM_Y 0x0D17 +#define GL_GREEN_SCALE 0x0D18 +#define GL_GREEN_BIAS 0x0D19 +#define GL_BLUE_SCALE 0x0D1A +#define GL_BLUE_BIAS 0x0D1B +#define GL_ALPHA_SCALE 0x0D1C +#define GL_ALPHA_BIAS 0x0D1D +#define GL_DEPTH_SCALE 0x0D1E +#define GL_DEPTH_BIAS 0x0D1F +#define GL_MAX_EVAL_ORDER 0x0D30 +#define GL_MAX_LIGHTS 0x0D31 +#define GL_MAX_CLIP_PLANES 0x0D32 +#define GL_MAX_TEXTURE_SIZE 0x0D33 +#define GL_MAX_PIXEL_MAP_TABLE 0x0D34 +#define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35 +#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36 +#define GL_MAX_NAME_STACK_DEPTH 0x0D37 +#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38 +#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39 +#define GL_MAX_VIEWPORT_DIMS 0x0D3A +#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B +#define GL_SUBPIXEL_BITS 0x0D50 +#define GL_INDEX_BITS 0x0D51 +#define GL_RED_BITS 0x0D52 +#define GL_GREEN_BITS 0x0D53 +#define GL_BLUE_BITS 0x0D54 +#define GL_ALPHA_BITS 0x0D55 +#define GL_DEPTH_BITS 0x0D56 +#define GL_STENCIL_BITS 0x0D57 +#define GL_ACCUM_RED_BITS 0x0D58 +#define GL_ACCUM_GREEN_BITS 0x0D59 +#define GL_ACCUM_BLUE_BITS 0x0D5A +#define GL_ACCUM_ALPHA_BITS 0x0D5B +#define GL_NAME_STACK_DEPTH 0x0D70 +#define GL_AUTO_NORMAL 0x0D80 +#define GL_MAP1_COLOR_4 0x0D90 +#define GL_MAP1_INDEX 0x0D91 +#define GL_MAP1_NORMAL 0x0D92 +#define GL_MAP1_TEXTURE_COORD_1 0x0D93 +#define GL_MAP1_TEXTURE_COORD_2 0x0D94 +#define GL_MAP1_TEXTURE_COORD_3 0x0D95 +#define GL_MAP1_TEXTURE_COORD_4 0x0D96 +#define GL_MAP1_VERTEX_3 0x0D97 +#define GL_MAP1_VERTEX_4 0x0D98 +#define GL_MAP2_COLOR_4 0x0DB0 +#define GL_MAP2_INDEX 0x0DB1 +#define GL_MAP2_NORMAL 0x0DB2 +#define GL_MAP2_TEXTURE_COORD_1 0x0DB3 +#define GL_MAP2_TEXTURE_COORD_2 0x0DB4 +#define GL_MAP2_TEXTURE_COORD_3 0x0DB5 +#define GL_MAP2_TEXTURE_COORD_4 0x0DB6 +#define GL_MAP2_VERTEX_3 0x0DB7 +#define GL_MAP2_VERTEX_4 0x0DB8 +#define GL_MAP1_GRID_DOMAIN 0x0DD0 +#define GL_MAP1_GRID_SEGMENTS 0x0DD1 +#define GL_MAP2_GRID_DOMAIN 0x0DD2 +#define GL_MAP2_GRID_SEGMENTS 0x0DD3 +#define GL_TEXTURE_1D 0x0DE0 +#define GL_TEXTURE_2D 0x0DE1 +#define GL_FEEDBACK_BUFFER_POINTER 0x0DF0 +#define GL_FEEDBACK_BUFFER_SIZE 0x0DF1 +#define GL_FEEDBACK_BUFFER_TYPE 0x0DF2 +#define GL_SELECTION_BUFFER_POINTER 0x0DF3 +#define GL_SELECTION_BUFFER_SIZE 0x0DF4 +#define GL_TEXTURE_WIDTH 0x1000 +#define GL_TRANSFORM_BIT 0x00001000 +#define GL_TEXTURE_HEIGHT 0x1001 +#define GL_TEXTURE_INTERNAL_FORMAT 0x1003 +#define GL_TEXTURE_BORDER_COLOR 0x1004 +#define GL_TEXTURE_BORDER 0x1005 +#define GL_DONT_CARE 0x1100 +#define GL_FASTEST 0x1101 +#define GL_NICEST 0x1102 +#define GL_AMBIENT 0x1200 +#define GL_DIFFUSE 0x1201 +#define GL_SPECULAR 0x1202 +#define GL_POSITION 0x1203 +#define GL_SPOT_DIRECTION 0x1204 +#define GL_SPOT_EXPONENT 0x1205 +#define GL_SPOT_CUTOFF 0x1206 +#define GL_CONSTANT_ATTENUATION 0x1207 +#define GL_LINEAR_ATTENUATION 0x1208 +#define GL_QUADRATIC_ATTENUATION 0x1209 +#define GL_COMPILE 0x1300 +#define GL_COMPILE_AND_EXECUTE 0x1301 +#define GL_BYTE 0x1400 +#define GL_UNSIGNED_BYTE 0x1401 +#define GL_SHORT 0x1402 +#define GL_UNSIGNED_SHORT 0x1403 +#define GL_INT 0x1404 +#define GL_UNSIGNED_INT 0x1405 +#define GL_FLOAT 0x1406 +#define GL_2_BYTES 0x1407 +#define GL_3_BYTES 0x1408 +#define GL_4_BYTES 0x1409 +#define GL_DOUBLE 0x140A +#define GL_CLEAR 0x1500 +#define GL_AND 0x1501 +#define GL_AND_REVERSE 0x1502 +#define GL_COPY 0x1503 +#define GL_AND_INVERTED 0x1504 +#define GL_NOOP 0x1505 +#define GL_XOR 0x1506 +#define GL_OR 0x1507 +#define GL_NOR 0x1508 +#define GL_EQUIV 0x1509 +#define GL_INVERT 0x150A +#define GL_OR_REVERSE 0x150B +#define GL_COPY_INVERTED 0x150C +#define GL_OR_INVERTED 0x150D +#define GL_NAND 0x150E +#define GL_SET 0x150F +#define GL_EMISSION 0x1600 +#define GL_SHININESS 0x1601 +#define GL_AMBIENT_AND_DIFFUSE 0x1602 +#define GL_COLOR_INDEXES 0x1603 +#define GL_MODELVIEW 0x1700 +#define GL_PROJECTION 0x1701 +#define GL_TEXTURE 0x1702 +#define GL_COLOR 0x1800 +#define GL_DEPTH 0x1801 +#define GL_STENCIL 0x1802 +#define GL_COLOR_INDEX 0x1900 +#define GL_STENCIL_INDEX 0x1901 +#define GL_DEPTH_COMPONENT 0x1902 +#define GL_RED 0x1903 +#define GL_GREEN 0x1904 +#define GL_BLUE 0x1905 +#define GL_ALPHA 0x1906 +#define GL_RGB 0x1907 +#define GL_RGBA 0x1908 +#define GL_LUMINANCE 0x1909 +#define GL_LUMINANCE_ALPHA 0x190A +#define GL_BITMAP 0x1A00 +#define GL_POINT 0x1B00 +#define GL_LINE 0x1B01 +#define GL_FILL 0x1B02 +#define GL_RENDER 0x1C00 +#define GL_FEEDBACK 0x1C01 +#define GL_SELECT 0x1C02 +#define GL_FLAT 0x1D00 +#define GL_SMOOTH 0x1D01 +#define GL_KEEP 0x1E00 +#define GL_REPLACE 0x1E01 +#define GL_INCR 0x1E02 +#define GL_DECR 0x1E03 +#define GL_VENDOR 0x1F00 +#define GL_RENDERER 0x1F01 +#define GL_VERSION 0x1F02 +#define GL_EXTENSIONS 0x1F03 +#define GL_S 0x2000 +#define GL_ENABLE_BIT 0x00002000 +#define GL_T 0x2001 +#define GL_R 0x2002 +#define GL_Q 0x2003 +#define GL_MODULATE 0x2100 +#define GL_DECAL 0x2101 +#define GL_TEXTURE_ENV_MODE 0x2200 +#define GL_TEXTURE_ENV_COLOR 0x2201 +#define GL_TEXTURE_ENV 0x2300 +#define GL_EYE_LINEAR 0x2400 +#define GL_OBJECT_LINEAR 0x2401 +#define GL_SPHERE_MAP 0x2402 +#define GL_TEXTURE_GEN_MODE 0x2500 +#define GL_OBJECT_PLANE 0x2501 +#define GL_EYE_PLANE 0x2502 +#define GL_NEAREST 0x2600 +#define GL_LINEAR 0x2601 +#define GL_NEAREST_MIPMAP_NEAREST 0x2700 +#define GL_LINEAR_MIPMAP_NEAREST 0x2701 +#define GL_NEAREST_MIPMAP_LINEAR 0x2702 +#define GL_LINEAR_MIPMAP_LINEAR 0x2703 +#define GL_TEXTURE_MAG_FILTER 0x2800 +#define GL_TEXTURE_MIN_FILTER 0x2801 +#define GL_TEXTURE_WRAP_S 0x2802 +#define GL_TEXTURE_WRAP_T 0x2803 +#define GL_CLAMP 0x2900 +#define GL_REPEAT 0x2901 +#define GL_POLYGON_OFFSET_UNITS 0x2A00 +#define GL_POLYGON_OFFSET_POINT 0x2A01 +#define GL_POLYGON_OFFSET_LINE 0x2A02 +#define GL_R3_G3_B2 0x2A10 +#define GL_V2F 0x2A20 +#define GL_V3F 0x2A21 +#define GL_C4UB_V2F 0x2A22 +#define GL_C4UB_V3F 0x2A23 +#define GL_C3F_V3F 0x2A24 +#define GL_N3F_V3F 0x2A25 +#define GL_C4F_N3F_V3F 0x2A26 +#define GL_T2F_V3F 0x2A27 +#define GL_T4F_V4F 0x2A28 +#define GL_T2F_C4UB_V3F 0x2A29 +#define GL_T2F_C3F_V3F 0x2A2A +#define GL_T2F_N3F_V3F 0x2A2B +#define GL_T2F_C4F_N3F_V3F 0x2A2C +#define GL_T4F_C4F_N3F_V4F 0x2A2D +#define GL_CLIP_PLANE0 0x3000 +#define GL_CLIP_PLANE1 0x3001 +#define GL_CLIP_PLANE2 0x3002 +#define GL_CLIP_PLANE3 0x3003 +#define GL_CLIP_PLANE4 0x3004 +#define GL_CLIP_PLANE5 0x3005 +#define GL_LIGHT0 0x4000 +#define GL_COLOR_BUFFER_BIT 0x00004000 +#define GL_LIGHT1 0x4001 +#define GL_LIGHT2 0x4002 +#define GL_LIGHT3 0x4003 +#define GL_LIGHT4 0x4004 +#define GL_LIGHT5 0x4005 +#define GL_LIGHT6 0x4006 +#define GL_LIGHT7 0x4007 +#define GL_HINT_BIT 0x00008000 +#define GL_POLYGON_OFFSET_FILL 0x8037 +#define GL_POLYGON_OFFSET_FACTOR 0x8038 +#define GL_ALPHA4 0x803B +#define GL_ALPHA8 0x803C +#define GL_ALPHA12 0x803D +#define GL_ALPHA16 0x803E +#define GL_LUMINANCE4 0x803F +#define GL_LUMINANCE8 0x8040 +#define GL_LUMINANCE12 0x8041 +#define GL_LUMINANCE16 0x8042 +#define GL_LUMINANCE4_ALPHA4 0x8043 +#define GL_LUMINANCE6_ALPHA2 0x8044 +#define GL_LUMINANCE8_ALPHA8 0x8045 +#define GL_LUMINANCE12_ALPHA4 0x8046 +#define GL_LUMINANCE12_ALPHA12 0x8047 +#define GL_LUMINANCE16_ALPHA16 0x8048 +#define GL_INTENSITY 0x8049 +#define GL_INTENSITY4 0x804A +#define GL_INTENSITY8 0x804B +#define GL_INTENSITY12 0x804C +#define GL_INTENSITY16 0x804D +#define GL_RGB4 0x804F +#define GL_RGB5 0x8050 +#define GL_RGB8 0x8051 +#define GL_RGB10 0x8052 +#define GL_RGB12 0x8053 +#define GL_RGB16 0x8054 +#define GL_RGBA2 0x8055 +#define GL_RGBA4 0x8056 +#define GL_RGB5_A1 0x8057 +#define GL_RGBA8 0x8058 +#define GL_RGB10_A2 0x8059 +#define GL_RGBA12 0x805A +#define GL_RGBA16 0x805B +#define GL_TEXTURE_RED_SIZE 0x805C +#define GL_TEXTURE_GREEN_SIZE 0x805D +#define GL_TEXTURE_BLUE_SIZE 0x805E +#define GL_TEXTURE_ALPHA_SIZE 0x805F +#define GL_TEXTURE_LUMINANCE_SIZE 0x8060 +#define GL_TEXTURE_INTENSITY_SIZE 0x8061 +#define GL_PROXY_TEXTURE_1D 0x8063 +#define GL_PROXY_TEXTURE_2D 0x8064 +#define GL_TEXTURE_PRIORITY 0x8066 +#define GL_TEXTURE_RESIDENT 0x8067 +#define GL_TEXTURE_BINDING_1D 0x8068 +#define GL_TEXTURE_BINDING_2D 0x8069 +#define GL_VERTEX_ARRAY 0x8074 +#define GL_NORMAL_ARRAY 0x8075 +#define GL_COLOR_ARRAY 0x8076 +#define GL_INDEX_ARRAY 0x8077 +#define GL_TEXTURE_COORD_ARRAY 0x8078 +#define GL_EDGE_FLAG_ARRAY 0x8079 +#define GL_VERTEX_ARRAY_SIZE 0x807A +#define GL_VERTEX_ARRAY_TYPE 0x807B +#define GL_VERTEX_ARRAY_STRIDE 0x807C +#define GL_NORMAL_ARRAY_TYPE 0x807E +#define GL_NORMAL_ARRAY_STRIDE 0x807F +#define GL_COLOR_ARRAY_SIZE 0x8081 +#define GL_COLOR_ARRAY_TYPE 0x8082 +#define GL_COLOR_ARRAY_STRIDE 0x8083 +#define GL_INDEX_ARRAY_TYPE 0x8085 +#define GL_INDEX_ARRAY_STRIDE 0x8086 +#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A +#define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C +#define GL_VERTEX_ARRAY_POINTER 0x808E +#define GL_NORMAL_ARRAY_POINTER 0x808F +#define GL_COLOR_ARRAY_POINTER 0x8090 +#define GL_INDEX_ARRAY_POINTER 0x8091 +#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092 +#define GL_EDGE_FLAG_ARRAY_POINTER 0x8093 +#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_EVAL_BIT 0x00010000 +#define GL_LIST_BIT 0x00020000 +#define GL_TEXTURE_BIT 0x00040000 +#define GL_SCISSOR_BIT 0x00080000 +#define GL_ALL_ATTRIB_BITS 0x000fffff +#define GL_CLIENT_ALL_ATTRIB_BITS 0xffffffff + +GLAPI void GLAPIENTRY glAccum (GLenum op, GLfloat value); +GLAPI void GLAPIENTRY glAlphaFunc (GLenum func, GLclampf ref); +GLAPI GLboolean GLAPIENTRY glAreTexturesResident (GLsizei n, const GLuint *textures, GLboolean *residences); +GLAPI void GLAPIENTRY glArrayElement (GLint i); +GLAPI void GLAPIENTRY glBegin (GLenum mode); +GLAPI void GLAPIENTRY glBindTexture (GLenum target, GLuint texture); +GLAPI void GLAPIENTRY glBitmap (GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap); +GLAPI void GLAPIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor); +GLAPI void GLAPIENTRY glCallList (GLuint list); +GLAPI void GLAPIENTRY glCallLists (GLsizei n, GLenum type, const void *lists); +GLAPI void GLAPIENTRY glClear (GLbitfield mask); +GLAPI void GLAPIENTRY glClearAccum (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GLAPI void GLAPIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +GLAPI void GLAPIENTRY glClearDepth (GLclampd depth); +GLAPI void GLAPIENTRY glClearIndex (GLfloat c); +GLAPI void GLAPIENTRY glClearStencil (GLint s); +GLAPI void GLAPIENTRY glClipPlane (GLenum plane, const GLdouble *equation); +GLAPI void GLAPIENTRY glColor3b (GLbyte red, GLbyte green, GLbyte blue); +GLAPI void GLAPIENTRY glColor3bv (const GLbyte *v); +GLAPI void GLAPIENTRY glColor3d (GLdouble red, GLdouble green, GLdouble blue); +GLAPI void GLAPIENTRY glColor3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glColor3f (GLfloat red, GLfloat green, GLfloat blue); +GLAPI void GLAPIENTRY glColor3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glColor3i (GLint red, GLint green, GLint blue); +GLAPI void GLAPIENTRY glColor3iv (const GLint *v); +GLAPI void GLAPIENTRY glColor3s (GLshort red, GLshort green, GLshort blue); +GLAPI void GLAPIENTRY glColor3sv (const GLshort *v); +GLAPI void GLAPIENTRY glColor3ub (GLubyte red, GLubyte green, GLubyte blue); +GLAPI void GLAPIENTRY glColor3ubv (const GLubyte *v); +GLAPI void GLAPIENTRY glColor3ui (GLuint red, GLuint green, GLuint blue); +GLAPI void GLAPIENTRY glColor3uiv (const GLuint *v); +GLAPI void GLAPIENTRY glColor3us (GLushort red, GLushort green, GLushort blue); +GLAPI void GLAPIENTRY glColor3usv (const GLushort *v); +GLAPI void GLAPIENTRY glColor4b (GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha); +GLAPI void GLAPIENTRY glColor4bv (const GLbyte *v); +GLAPI void GLAPIENTRY glColor4d (GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha); +GLAPI void GLAPIENTRY glColor4dv (const GLdouble *v); +GLAPI void GLAPIENTRY glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GLAPI void GLAPIENTRY glColor4fv (const GLfloat *v); +GLAPI void GLAPIENTRY glColor4i (GLint red, GLint green, GLint blue, GLint alpha); +GLAPI void GLAPIENTRY glColor4iv (const GLint *v); +GLAPI void GLAPIENTRY glColor4s (GLshort red, GLshort green, GLshort blue, GLshort alpha); +GLAPI void GLAPIENTRY glColor4sv (const GLshort *v); +GLAPI void GLAPIENTRY glColor4ub (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); +GLAPI void GLAPIENTRY glColor4ubv (const GLubyte *v); +GLAPI void GLAPIENTRY glColor4ui (GLuint red, GLuint green, GLuint blue, GLuint alpha); +GLAPI void GLAPIENTRY glColor4uiv (const GLuint *v); +GLAPI void GLAPIENTRY glColor4us (GLushort red, GLushort green, GLushort blue, GLushort alpha); +GLAPI void GLAPIENTRY glColor4usv (const GLushort *v); +GLAPI void GLAPIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +GLAPI void GLAPIENTRY glColorMaterial (GLenum face, GLenum mode); +GLAPI void GLAPIENTRY glColorPointer (GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI void GLAPIENTRY glCopyPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum type); +GLAPI void GLAPIENTRY glCopyTexImage1D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border); +GLAPI void GLAPIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +GLAPI void GLAPIENTRY glCopyTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +GLAPI void GLAPIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void GLAPIENTRY glCullFace (GLenum mode); +GLAPI void GLAPIENTRY glDeleteLists (GLuint list, GLsizei range); +GLAPI void GLAPIENTRY glDeleteTextures (GLsizei n, const GLuint *textures); +GLAPI void GLAPIENTRY glDepthFunc (GLenum func); +GLAPI void GLAPIENTRY glDepthMask (GLboolean flag); +GLAPI void GLAPIENTRY glDepthRange (GLclampd zNear, GLclampd zFar); +GLAPI void GLAPIENTRY glDisable (GLenum cap); +GLAPI void GLAPIENTRY glDisableClientState (GLenum array); +GLAPI void GLAPIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count); +GLAPI void GLAPIENTRY glDrawBuffer (GLenum mode); +GLAPI void GLAPIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const void *indices); +GLAPI void GLAPIENTRY glDrawPixels (GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +GLAPI void GLAPIENTRY glEdgeFlag (GLboolean flag); +GLAPI void GLAPIENTRY glEdgeFlagPointer (GLsizei stride, const void *pointer); +GLAPI void GLAPIENTRY glEdgeFlagv (const GLboolean *flag); +GLAPI void GLAPIENTRY glEnable (GLenum cap); +GLAPI void GLAPIENTRY glEnableClientState (GLenum array); +GLAPI void GLAPIENTRY glEnd (void); +GLAPI void GLAPIENTRY glEndList (void); +GLAPI void GLAPIENTRY glEvalCoord1d (GLdouble u); +GLAPI void GLAPIENTRY glEvalCoord1dv (const GLdouble *u); +GLAPI void GLAPIENTRY glEvalCoord1f (GLfloat u); +GLAPI void GLAPIENTRY glEvalCoord1fv (const GLfloat *u); +GLAPI void GLAPIENTRY glEvalCoord2d (GLdouble u, GLdouble v); +GLAPI void GLAPIENTRY glEvalCoord2dv (const GLdouble *u); +GLAPI void GLAPIENTRY glEvalCoord2f (GLfloat u, GLfloat v); +GLAPI void GLAPIENTRY glEvalCoord2fv (const GLfloat *u); +GLAPI void GLAPIENTRY glEvalMesh1 (GLenum mode, GLint i1, GLint i2); +GLAPI void GLAPIENTRY glEvalMesh2 (GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2); +GLAPI void GLAPIENTRY glEvalPoint1 (GLint i); +GLAPI void GLAPIENTRY glEvalPoint2 (GLint i, GLint j); +GLAPI void GLAPIENTRY glFeedbackBuffer (GLsizei size, GLenum type, GLfloat *buffer); +GLAPI void GLAPIENTRY glFinish (void); +GLAPI void GLAPIENTRY glFlush (void); +GLAPI void GLAPIENTRY glFogf (GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glFogfv (GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glFogi (GLenum pname, GLint param); +GLAPI void GLAPIENTRY glFogiv (GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glFrontFace (GLenum mode); +GLAPI void GLAPIENTRY glFrustum (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +GLAPI GLuint GLAPIENTRY glGenLists (GLsizei range); +GLAPI void GLAPIENTRY glGenTextures (GLsizei n, GLuint *textures); +GLAPI void GLAPIENTRY glGetBooleanv (GLenum pname, GLboolean *params); +GLAPI void GLAPIENTRY glGetClipPlane (GLenum plane, GLdouble *equation); +GLAPI void GLAPIENTRY glGetDoublev (GLenum pname, GLdouble *params); +GLAPI GLenum GLAPIENTRY glGetError (void); +GLAPI void GLAPIENTRY glGetFloatv (GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetIntegerv (GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetLightfv (GLenum light, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetLightiv (GLenum light, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetMapdv (GLenum target, GLenum query, GLdouble *v); +GLAPI void GLAPIENTRY glGetMapfv (GLenum target, GLenum query, GLfloat *v); +GLAPI void GLAPIENTRY glGetMapiv (GLenum target, GLenum query, GLint *v); +GLAPI void GLAPIENTRY glGetMaterialfv (GLenum face, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetMaterialiv (GLenum face, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetPixelMapfv (GLenum map, GLfloat *values); +GLAPI void GLAPIENTRY glGetPixelMapuiv (GLenum map, GLuint *values); +GLAPI void GLAPIENTRY glGetPixelMapusv (GLenum map, GLushort *values); +GLAPI void GLAPIENTRY glGetPointerv (GLenum pname, void* *params); +GLAPI void GLAPIENTRY glGetPolygonStipple (GLubyte *mask); +GLAPI const GLubyte * GLAPIENTRY glGetString (GLenum name); +GLAPI void GLAPIENTRY glGetTexEnvfv (GLenum target, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexEnviv (GLenum target, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetTexGendv (GLenum coord, GLenum pname, GLdouble *params); +GLAPI void GLAPIENTRY glGetTexGenfv (GLenum coord, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexGeniv (GLenum coord, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetTexImage (GLenum target, GLint level, GLenum format, GLenum type, void *pixels); +GLAPI void GLAPIENTRY glGetTexLevelParameterfv (GLenum target, GLint level, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexLevelParameteriv (GLenum target, GLint level, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glHint (GLenum target, GLenum mode); +GLAPI void GLAPIENTRY glIndexMask (GLuint mask); +GLAPI void GLAPIENTRY glIndexPointer (GLenum type, GLsizei stride, const void *pointer); +GLAPI void GLAPIENTRY glIndexd (GLdouble c); +GLAPI void GLAPIENTRY glIndexdv (const GLdouble *c); +GLAPI void GLAPIENTRY glIndexf (GLfloat c); +GLAPI void GLAPIENTRY glIndexfv (const GLfloat *c); +GLAPI void GLAPIENTRY glIndexi (GLint c); +GLAPI void GLAPIENTRY glIndexiv (const GLint *c); +GLAPI void GLAPIENTRY glIndexs (GLshort c); +GLAPI void GLAPIENTRY glIndexsv (const GLshort *c); +GLAPI void GLAPIENTRY glIndexub (GLubyte c); +GLAPI void GLAPIENTRY glIndexubv (const GLubyte *c); +GLAPI void GLAPIENTRY glInitNames (void); +GLAPI void GLAPIENTRY glInterleavedArrays (GLenum format, GLsizei stride, const void *pointer); +GLAPI GLboolean GLAPIENTRY glIsEnabled (GLenum cap); +GLAPI GLboolean GLAPIENTRY glIsList (GLuint list); +GLAPI GLboolean GLAPIENTRY glIsTexture (GLuint texture); +GLAPI void GLAPIENTRY glLightModelf (GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glLightModelfv (GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glLightModeli (GLenum pname, GLint param); +GLAPI void GLAPIENTRY glLightModeliv (GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glLightf (GLenum light, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glLightfv (GLenum light, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glLighti (GLenum light, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glLightiv (GLenum light, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glLineStipple (GLint factor, GLushort pattern); +GLAPI void GLAPIENTRY glLineWidth (GLfloat width); +GLAPI void GLAPIENTRY glListBase (GLuint base); +GLAPI void GLAPIENTRY glLoadIdentity (void); +GLAPI void GLAPIENTRY glLoadMatrixd (const GLdouble *m); +GLAPI void GLAPIENTRY glLoadMatrixf (const GLfloat *m); +GLAPI void GLAPIENTRY glLoadName (GLuint name); +GLAPI void GLAPIENTRY glLogicOp (GLenum opcode); +GLAPI void GLAPIENTRY glMap1d (GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points); +GLAPI void GLAPIENTRY glMap1f (GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points); +GLAPI void GLAPIENTRY glMap2d (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points); +GLAPI void GLAPIENTRY glMap2f (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points); +GLAPI void GLAPIENTRY glMapGrid1d (GLint un, GLdouble u1, GLdouble u2); +GLAPI void GLAPIENTRY glMapGrid1f (GLint un, GLfloat u1, GLfloat u2); +GLAPI void GLAPIENTRY glMapGrid2d (GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2); +GLAPI void GLAPIENTRY glMapGrid2f (GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2); +GLAPI void GLAPIENTRY glMaterialf (GLenum face, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glMaterialfv (GLenum face, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glMateriali (GLenum face, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glMaterialiv (GLenum face, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glMatrixMode (GLenum mode); +GLAPI void GLAPIENTRY glMultMatrixd (const GLdouble *m); +GLAPI void GLAPIENTRY glMultMatrixf (const GLfloat *m); +GLAPI void GLAPIENTRY glNewList (GLuint list, GLenum mode); +GLAPI void GLAPIENTRY glNormal3b (GLbyte nx, GLbyte ny, GLbyte nz); +GLAPI void GLAPIENTRY glNormal3bv (const GLbyte *v); +GLAPI void GLAPIENTRY glNormal3d (GLdouble nx, GLdouble ny, GLdouble nz); +GLAPI void GLAPIENTRY glNormal3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glNormal3f (GLfloat nx, GLfloat ny, GLfloat nz); +GLAPI void GLAPIENTRY glNormal3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glNormal3i (GLint nx, GLint ny, GLint nz); +GLAPI void GLAPIENTRY glNormal3iv (const GLint *v); +GLAPI void GLAPIENTRY glNormal3s (GLshort nx, GLshort ny, GLshort nz); +GLAPI void GLAPIENTRY glNormal3sv (const GLshort *v); +GLAPI void GLAPIENTRY glNormalPointer (GLenum type, GLsizei stride, const void *pointer); +GLAPI void GLAPIENTRY glOrtho (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +GLAPI void GLAPIENTRY glPassThrough (GLfloat token); +GLAPI void GLAPIENTRY glPixelMapfv (GLenum map, GLsizei mapsize, const GLfloat *values); +GLAPI void GLAPIENTRY glPixelMapuiv (GLenum map, GLsizei mapsize, const GLuint *values); +GLAPI void GLAPIENTRY glPixelMapusv (GLenum map, GLsizei mapsize, const GLushort *values); +GLAPI void GLAPIENTRY glPixelStoref (GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glPixelStorei (GLenum pname, GLint param); +GLAPI void GLAPIENTRY glPixelTransferf (GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glPixelTransferi (GLenum pname, GLint param); +GLAPI void GLAPIENTRY glPixelZoom (GLfloat xfactor, GLfloat yfactor); +GLAPI void GLAPIENTRY glPointSize (GLfloat size); +GLAPI void GLAPIENTRY glPolygonMode (GLenum face, GLenum mode); +GLAPI void GLAPIENTRY glPolygonOffset (GLfloat factor, GLfloat units); +GLAPI void GLAPIENTRY glPolygonStipple (const GLubyte *mask); +GLAPI void GLAPIENTRY glPopAttrib (void); +GLAPI void GLAPIENTRY glPopClientAttrib (void); +GLAPI void GLAPIENTRY glPopMatrix (void); +GLAPI void GLAPIENTRY glPopName (void); +GLAPI void GLAPIENTRY glPrioritizeTextures (GLsizei n, const GLuint *textures, const GLclampf *priorities); +GLAPI void GLAPIENTRY glPushAttrib (GLbitfield mask); +GLAPI void GLAPIENTRY glPushClientAttrib (GLbitfield mask); +GLAPI void GLAPIENTRY glPushMatrix (void); +GLAPI void GLAPIENTRY glPushName (GLuint name); +GLAPI void GLAPIENTRY glRasterPos2d (GLdouble x, GLdouble y); +GLAPI void GLAPIENTRY glRasterPos2dv (const GLdouble *v); +GLAPI void GLAPIENTRY glRasterPos2f (GLfloat x, GLfloat y); +GLAPI void GLAPIENTRY glRasterPos2fv (const GLfloat *v); +GLAPI void GLAPIENTRY glRasterPos2i (GLint x, GLint y); +GLAPI void GLAPIENTRY glRasterPos2iv (const GLint *v); +GLAPI void GLAPIENTRY glRasterPos2s (GLshort x, GLshort y); +GLAPI void GLAPIENTRY glRasterPos2sv (const GLshort *v); +GLAPI void GLAPIENTRY glRasterPos3d (GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glRasterPos3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glRasterPos3f (GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glRasterPos3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glRasterPos3i (GLint x, GLint y, GLint z); +GLAPI void GLAPIENTRY glRasterPos3iv (const GLint *v); +GLAPI void GLAPIENTRY glRasterPos3s (GLshort x, GLshort y, GLshort z); +GLAPI void GLAPIENTRY glRasterPos3sv (const GLshort *v); +GLAPI void GLAPIENTRY glRasterPos4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void GLAPIENTRY glRasterPos4dv (const GLdouble *v); +GLAPI void GLAPIENTRY glRasterPos4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void GLAPIENTRY glRasterPos4fv (const GLfloat *v); +GLAPI void GLAPIENTRY glRasterPos4i (GLint x, GLint y, GLint z, GLint w); +GLAPI void GLAPIENTRY glRasterPos4iv (const GLint *v); +GLAPI void GLAPIENTRY glRasterPos4s (GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void GLAPIENTRY glRasterPos4sv (const GLshort *v); +GLAPI void GLAPIENTRY glReadBuffer (GLenum mode); +GLAPI void GLAPIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels); +GLAPI void GLAPIENTRY glRectd (GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2); +GLAPI void GLAPIENTRY glRectdv (const GLdouble *v1, const GLdouble *v2); +GLAPI void GLAPIENTRY glRectf (GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); +GLAPI void GLAPIENTRY glRectfv (const GLfloat *v1, const GLfloat *v2); +GLAPI void GLAPIENTRY glRecti (GLint x1, GLint y1, GLint x2, GLint y2); +GLAPI void GLAPIENTRY glRectiv (const GLint *v1, const GLint *v2); +GLAPI void GLAPIENTRY glRects (GLshort x1, GLshort y1, GLshort x2, GLshort y2); +GLAPI void GLAPIENTRY glRectsv (const GLshort *v1, const GLshort *v2); +GLAPI GLint GLAPIENTRY glRenderMode (GLenum mode); +GLAPI void GLAPIENTRY glRotated (GLdouble angle, GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glScaled (GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glScalef (GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void GLAPIENTRY glSelectBuffer (GLsizei size, GLuint *buffer); +GLAPI void GLAPIENTRY glShadeModel (GLenum mode); +GLAPI void GLAPIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask); +GLAPI void GLAPIENTRY glStencilMask (GLuint mask); +GLAPI void GLAPIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass); +GLAPI void GLAPIENTRY glTexCoord1d (GLdouble s); +GLAPI void GLAPIENTRY glTexCoord1dv (const GLdouble *v); +GLAPI void GLAPIENTRY glTexCoord1f (GLfloat s); +GLAPI void GLAPIENTRY glTexCoord1fv (const GLfloat *v); +GLAPI void GLAPIENTRY glTexCoord1i (GLint s); +GLAPI void GLAPIENTRY glTexCoord1iv (const GLint *v); +GLAPI void GLAPIENTRY glTexCoord1s (GLshort s); +GLAPI void GLAPIENTRY glTexCoord1sv (const GLshort *v); +GLAPI void GLAPIENTRY glTexCoord2d (GLdouble s, GLdouble t); +GLAPI void GLAPIENTRY glTexCoord2dv (const GLdouble *v); +GLAPI void GLAPIENTRY glTexCoord2f (GLfloat s, GLfloat t); +GLAPI void GLAPIENTRY glTexCoord2fv (const GLfloat *v); +GLAPI void GLAPIENTRY glTexCoord2i (GLint s, GLint t); +GLAPI void GLAPIENTRY glTexCoord2iv (const GLint *v); +GLAPI void GLAPIENTRY glTexCoord2s (GLshort s, GLshort t); +GLAPI void GLAPIENTRY glTexCoord2sv (const GLshort *v); +GLAPI void GLAPIENTRY glTexCoord3d (GLdouble s, GLdouble t, GLdouble r); +GLAPI void GLAPIENTRY glTexCoord3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glTexCoord3f (GLfloat s, GLfloat t, GLfloat r); +GLAPI void GLAPIENTRY glTexCoord3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glTexCoord3i (GLint s, GLint t, GLint r); +GLAPI void GLAPIENTRY glTexCoord3iv (const GLint *v); +GLAPI void GLAPIENTRY glTexCoord3s (GLshort s, GLshort t, GLshort r); +GLAPI void GLAPIENTRY glTexCoord3sv (const GLshort *v); +GLAPI void GLAPIENTRY glTexCoord4d (GLdouble s, GLdouble t, GLdouble r, GLdouble q); +GLAPI void GLAPIENTRY glTexCoord4dv (const GLdouble *v); +GLAPI void GLAPIENTRY glTexCoord4f (GLfloat s, GLfloat t, GLfloat r, GLfloat q); +GLAPI void GLAPIENTRY glTexCoord4fv (const GLfloat *v); +GLAPI void GLAPIENTRY glTexCoord4i (GLint s, GLint t, GLint r, GLint q); +GLAPI void GLAPIENTRY glTexCoord4iv (const GLint *v); +GLAPI void GLAPIENTRY glTexCoord4s (GLshort s, GLshort t, GLshort r, GLshort q); +GLAPI void GLAPIENTRY glTexCoord4sv (const GLshort *v); +GLAPI void GLAPIENTRY glTexCoordPointer (GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI void GLAPIENTRY glTexEnvf (GLenum target, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glTexEnvfv (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glTexEnvi (GLenum target, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glTexEnviv (GLenum target, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glTexGend (GLenum coord, GLenum pname, GLdouble param); +GLAPI void GLAPIENTRY glTexGendv (GLenum coord, GLenum pname, const GLdouble *params); +GLAPI void GLAPIENTRY glTexGenf (GLenum coord, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glTexGenfv (GLenum coord, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glTexGeni (GLenum coord, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glTexGeniv (GLenum coord, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glTexImage1D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels); +GLAPI void GLAPIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); +GLAPI void GLAPIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); +GLAPI void GLAPIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +GLAPI void GLAPIENTRY glTranslated (GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glTranslatef (GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glVertex2d (GLdouble x, GLdouble y); +GLAPI void GLAPIENTRY glVertex2dv (const GLdouble *v); +GLAPI void GLAPIENTRY glVertex2f (GLfloat x, GLfloat y); +GLAPI void GLAPIENTRY glVertex2fv (const GLfloat *v); +GLAPI void GLAPIENTRY glVertex2i (GLint x, GLint y); +GLAPI void GLAPIENTRY glVertex2iv (const GLint *v); +GLAPI void GLAPIENTRY glVertex2s (GLshort x, GLshort y); +GLAPI void GLAPIENTRY glVertex2sv (const GLshort *v); +GLAPI void GLAPIENTRY glVertex3d (GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glVertex3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glVertex3f (GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glVertex3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glVertex3i (GLint x, GLint y, GLint z); +GLAPI void GLAPIENTRY glVertex3iv (const GLint *v); +GLAPI void GLAPIENTRY glVertex3s (GLshort x, GLshort y, GLshort z); +GLAPI void GLAPIENTRY glVertex3sv (const GLshort *v); +GLAPI void GLAPIENTRY glVertex4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void GLAPIENTRY glVertex4dv (const GLdouble *v); +GLAPI void GLAPIENTRY glVertex4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void GLAPIENTRY glVertex4fv (const GLfloat *v); +GLAPI void GLAPIENTRY glVertex4i (GLint x, GLint y, GLint z, GLint w); +GLAPI void GLAPIENTRY glVertex4iv (const GLint *v); +GLAPI void GLAPIENTRY glVertex4s (GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void GLAPIENTRY glVertex4sv (const GLshort *v); +GLAPI void GLAPIENTRY glVertexPointer (GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI void GLAPIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height); + +#define GLEW_VERSION_1_1 GLEW_GET_VAR(__GLEW_VERSION_1_1) + +#endif /* GL_VERSION_1_1 */ + +/* ---------------------------------- GLU ---------------------------------- */ + +#ifndef GLEW_NO_GLU +# ifdef __APPLE__ +# include +# if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) +# define GLEW_NO_GLU +# endif +# endif +#endif + +#ifndef GLEW_NO_GLU +/* this is where we can safely include GLU */ +# if defined(__APPLE__) && defined(__MACH__) +# include +# else +# include +# endif +#endif + +/* ----------------------------- GL_VERSION_1_2 ---------------------------- */ + +#ifndef GL_VERSION_1_2 +#define GL_VERSION_1_2 1 + +#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 +#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 +#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 +#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 +#define GL_UNSIGNED_INT_8_8_8_8 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2 0x8036 +#define GL_RESCALE_NORMAL 0x803A +#define GL_TEXTURE_BINDING_3D 0x806A +#define GL_PACK_SKIP_IMAGES 0x806B +#define GL_PACK_IMAGE_HEIGHT 0x806C +#define GL_UNPACK_SKIP_IMAGES 0x806D +#define GL_UNPACK_IMAGE_HEIGHT 0x806E +#define GL_TEXTURE_3D 0x806F +#define GL_PROXY_TEXTURE_3D 0x8070 +#define GL_TEXTURE_DEPTH 0x8071 +#define GL_TEXTURE_WRAP_R 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE 0x8073 +#define GL_BGR 0x80E0 +#define GL_BGRA 0x80E1 +#define GL_MAX_ELEMENTS_VERTICES 0x80E8 +#define GL_MAX_ELEMENTS_INDICES 0x80E9 +#define GL_CLAMP_TO_EDGE 0x812F +#define GL_TEXTURE_MIN_LOD 0x813A +#define GL_TEXTURE_MAX_LOD 0x813B +#define GL_TEXTURE_BASE_LEVEL 0x813C +#define GL_TEXTURE_MAX_LEVEL 0x813D +#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 +#define GL_SINGLE_COLOR 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR 0x81FA +#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 +#define GL_UNSIGNED_SHORT_5_6_5 0x8363 +#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 +#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 +#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 +#define GL_ALIASED_POINT_SIZE_RANGE 0x846D +#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E + +typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices); +typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); + +#define glCopyTexSubImage3D GLEW_GET_FUN(__glewCopyTexSubImage3D) +#define glDrawRangeElements GLEW_GET_FUN(__glewDrawRangeElements) +#define glTexImage3D GLEW_GET_FUN(__glewTexImage3D) +#define glTexSubImage3D GLEW_GET_FUN(__glewTexSubImage3D) + +#define GLEW_VERSION_1_2 GLEW_GET_VAR(__GLEW_VERSION_1_2) + +#endif /* GL_VERSION_1_2 */ + +/* ---------------------------- GL_VERSION_1_2_1 --------------------------- */ + +#ifndef GL_VERSION_1_2_1 +#define GL_VERSION_1_2_1 1 + +#define GLEW_VERSION_1_2_1 GLEW_GET_VAR(__GLEW_VERSION_1_2_1) + +#endif /* GL_VERSION_1_2_1 */ + +/* ----------------------------- GL_VERSION_1_3 ---------------------------- */ + +#ifndef GL_VERSION_1_3 +#define GL_VERSION_1_3 1 + +#define GL_MULTISAMPLE 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE 0x809F +#define GL_SAMPLE_COVERAGE 0x80A0 +#define GL_SAMPLE_BUFFERS 0x80A8 +#define GL_SAMPLES 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT 0x80AB +#define GL_CLAMP_TO_BORDER 0x812D +#define GL_TEXTURE0 0x84C0 +#define GL_TEXTURE1 0x84C1 +#define GL_TEXTURE2 0x84C2 +#define GL_TEXTURE3 0x84C3 +#define GL_TEXTURE4 0x84C4 +#define GL_TEXTURE5 0x84C5 +#define GL_TEXTURE6 0x84C6 +#define GL_TEXTURE7 0x84C7 +#define GL_TEXTURE8 0x84C8 +#define GL_TEXTURE9 0x84C9 +#define GL_TEXTURE10 0x84CA +#define GL_TEXTURE11 0x84CB +#define GL_TEXTURE12 0x84CC +#define GL_TEXTURE13 0x84CD +#define GL_TEXTURE14 0x84CE +#define GL_TEXTURE15 0x84CF +#define GL_TEXTURE16 0x84D0 +#define GL_TEXTURE17 0x84D1 +#define GL_TEXTURE18 0x84D2 +#define GL_TEXTURE19 0x84D3 +#define GL_TEXTURE20 0x84D4 +#define GL_TEXTURE21 0x84D5 +#define GL_TEXTURE22 0x84D6 +#define GL_TEXTURE23 0x84D7 +#define GL_TEXTURE24 0x84D8 +#define GL_TEXTURE25 0x84D9 +#define GL_TEXTURE26 0x84DA +#define GL_TEXTURE27 0x84DB +#define GL_TEXTURE28 0x84DC +#define GL_TEXTURE29 0x84DD +#define GL_TEXTURE30 0x84DE +#define GL_TEXTURE31 0x84DF +#define GL_ACTIVE_TEXTURE 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 +#define GL_MAX_TEXTURE_UNITS 0x84E2 +#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 +#define GL_SUBTRACT 0x84E7 +#define GL_COMPRESSED_ALPHA 0x84E9 +#define GL_COMPRESSED_LUMINANCE 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB +#define GL_COMPRESSED_INTENSITY 0x84EC +#define GL_COMPRESSED_RGB 0x84ED +#define GL_COMPRESSED_RGBA 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT 0x84EF +#define GL_NORMAL_MAP 0x8511 +#define GL_REFLECTION_MAP 0x8512 +#define GL_TEXTURE_CUBE_MAP 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C +#define GL_COMBINE 0x8570 +#define GL_COMBINE_RGB 0x8571 +#define GL_COMBINE_ALPHA 0x8572 +#define GL_RGB_SCALE 0x8573 +#define GL_ADD_SIGNED 0x8574 +#define GL_INTERPOLATE 0x8575 +#define GL_CONSTANT 0x8576 +#define GL_PRIMARY_COLOR 0x8577 +#define GL_PREVIOUS 0x8578 +#define GL_SOURCE0_RGB 0x8580 +#define GL_SOURCE1_RGB 0x8581 +#define GL_SOURCE2_RGB 0x8582 +#define GL_SOURCE0_ALPHA 0x8588 +#define GL_SOURCE1_ALPHA 0x8589 +#define GL_SOURCE2_ALPHA 0x858A +#define GL_OPERAND0_RGB 0x8590 +#define GL_OPERAND1_RGB 0x8591 +#define GL_OPERAND2_RGB 0x8592 +#define GL_OPERAND0_ALPHA 0x8598 +#define GL_OPERAND1_ALPHA 0x8599 +#define GL_OPERAND2_ALPHA 0x859A +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 +#define GL_TEXTURE_COMPRESSED 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 +#define GL_DOT3_RGB 0x86AE +#define GL_DOT3_RGBA 0x86AF +#define GL_MULTISAMPLE_BIT 0x20000000 + +typedef void (GLAPIENTRY * PFNGLACTIVETEXTUREPROC) (GLenum texture); +typedef void (GLAPIENTRY * PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * 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 (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint lod, void *img); +typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble m[16]); +typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat m[16]); +typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble m[16]); +typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat m[16]); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert); + +#define glActiveTexture GLEW_GET_FUN(__glewActiveTexture) +#define glClientActiveTexture GLEW_GET_FUN(__glewClientActiveTexture) +#define glCompressedTexImage1D GLEW_GET_FUN(__glewCompressedTexImage1D) +#define glCompressedTexImage2D GLEW_GET_FUN(__glewCompressedTexImage2D) +#define glCompressedTexImage3D GLEW_GET_FUN(__glewCompressedTexImage3D) +#define glCompressedTexSubImage1D GLEW_GET_FUN(__glewCompressedTexSubImage1D) +#define glCompressedTexSubImage2D GLEW_GET_FUN(__glewCompressedTexSubImage2D) +#define glCompressedTexSubImage3D GLEW_GET_FUN(__glewCompressedTexSubImage3D) +#define glGetCompressedTexImage GLEW_GET_FUN(__glewGetCompressedTexImage) +#define glLoadTransposeMatrixd GLEW_GET_FUN(__glewLoadTransposeMatrixd) +#define glLoadTransposeMatrixf GLEW_GET_FUN(__glewLoadTransposeMatrixf) +#define glMultTransposeMatrixd GLEW_GET_FUN(__glewMultTransposeMatrixd) +#define glMultTransposeMatrixf GLEW_GET_FUN(__glewMultTransposeMatrixf) +#define glMultiTexCoord1d GLEW_GET_FUN(__glewMultiTexCoord1d) +#define glMultiTexCoord1dv GLEW_GET_FUN(__glewMultiTexCoord1dv) +#define glMultiTexCoord1f GLEW_GET_FUN(__glewMultiTexCoord1f) +#define glMultiTexCoord1fv GLEW_GET_FUN(__glewMultiTexCoord1fv) +#define glMultiTexCoord1i GLEW_GET_FUN(__glewMultiTexCoord1i) +#define glMultiTexCoord1iv GLEW_GET_FUN(__glewMultiTexCoord1iv) +#define glMultiTexCoord1s GLEW_GET_FUN(__glewMultiTexCoord1s) +#define glMultiTexCoord1sv GLEW_GET_FUN(__glewMultiTexCoord1sv) +#define glMultiTexCoord2d GLEW_GET_FUN(__glewMultiTexCoord2d) +#define glMultiTexCoord2dv GLEW_GET_FUN(__glewMultiTexCoord2dv) +#define glMultiTexCoord2f GLEW_GET_FUN(__glewMultiTexCoord2f) +#define glMultiTexCoord2fv GLEW_GET_FUN(__glewMultiTexCoord2fv) +#define glMultiTexCoord2i GLEW_GET_FUN(__glewMultiTexCoord2i) +#define glMultiTexCoord2iv GLEW_GET_FUN(__glewMultiTexCoord2iv) +#define glMultiTexCoord2s GLEW_GET_FUN(__glewMultiTexCoord2s) +#define glMultiTexCoord2sv GLEW_GET_FUN(__glewMultiTexCoord2sv) +#define glMultiTexCoord3d GLEW_GET_FUN(__glewMultiTexCoord3d) +#define glMultiTexCoord3dv GLEW_GET_FUN(__glewMultiTexCoord3dv) +#define glMultiTexCoord3f GLEW_GET_FUN(__glewMultiTexCoord3f) +#define glMultiTexCoord3fv GLEW_GET_FUN(__glewMultiTexCoord3fv) +#define glMultiTexCoord3i GLEW_GET_FUN(__glewMultiTexCoord3i) +#define glMultiTexCoord3iv GLEW_GET_FUN(__glewMultiTexCoord3iv) +#define glMultiTexCoord3s GLEW_GET_FUN(__glewMultiTexCoord3s) +#define glMultiTexCoord3sv GLEW_GET_FUN(__glewMultiTexCoord3sv) +#define glMultiTexCoord4d GLEW_GET_FUN(__glewMultiTexCoord4d) +#define glMultiTexCoord4dv GLEW_GET_FUN(__glewMultiTexCoord4dv) +#define glMultiTexCoord4f GLEW_GET_FUN(__glewMultiTexCoord4f) +#define glMultiTexCoord4fv GLEW_GET_FUN(__glewMultiTexCoord4fv) +#define glMultiTexCoord4i GLEW_GET_FUN(__glewMultiTexCoord4i) +#define glMultiTexCoord4iv GLEW_GET_FUN(__glewMultiTexCoord4iv) +#define glMultiTexCoord4s GLEW_GET_FUN(__glewMultiTexCoord4s) +#define glMultiTexCoord4sv GLEW_GET_FUN(__glewMultiTexCoord4sv) +#define glSampleCoverage GLEW_GET_FUN(__glewSampleCoverage) + +#define GLEW_VERSION_1_3 GLEW_GET_VAR(__GLEW_VERSION_1_3) + +#endif /* GL_VERSION_1_3 */ + +/* ----------------------------- GL_VERSION_1_4 ---------------------------- */ + +#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 +#define GL_BLEND_SRC_ALPHA 0x80CB +#define GL_POINT_SIZE_MIN 0x8126 +#define GL_POINT_SIZE_MAX 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 +#define GL_POINT_DISTANCE_ATTENUATION 0x8129 +#define GL_GENERATE_MIPMAP 0x8191 +#define GL_GENERATE_MIPMAP_HINT 0x8192 +#define GL_DEPTH_COMPONENT16 0x81A5 +#define GL_DEPTH_COMPONENT24 0x81A6 +#define GL_DEPTH_COMPONENT32 0x81A7 +#define GL_MIRRORED_REPEAT 0x8370 +#define GL_FOG_COORDINATE_SOURCE 0x8450 +#define GL_FOG_COORDINATE 0x8451 +#define GL_FRAGMENT_DEPTH 0x8452 +#define GL_CURRENT_FOG_COORDINATE 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456 +#define GL_FOG_COORDINATE_ARRAY 0x8457 +#define GL_COLOR_SUM 0x8458 +#define GL_CURRENT_SECONDARY_COLOR 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D +#define GL_SECONDARY_COLOR_ARRAY 0x845E +#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD +#define GL_TEXTURE_FILTER_CONTROL 0x8500 +#define GL_TEXTURE_LOD_BIAS 0x8501 +#define GL_INCR_WRAP 0x8507 +#define GL_DECR_WRAP 0x8508 +#define GL_TEXTURE_DEPTH_SIZE 0x884A +#define GL_DEPTH_TEXTURE_MODE 0x884B +#define GL_TEXTURE_COMPARE_MODE 0x884C +#define GL_TEXTURE_COMPARE_FUNC 0x884D +#define GL_COMPARE_R_TO_TEXTURE 0x884E + +typedef void (GLAPIENTRY * PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONPROC) (GLenum mode); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const void *pointer); +typedef void (GLAPIENTRY * PFNGLFOGCOORDDPROC) (GLdouble coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDDVPROC) (const GLdouble *coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDFPROC) (GLfloat coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDFVPROC) (const GLfloat *coord); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const* indices, GLsizei drawcount); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVPROC) (const GLdouble *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FVPROC) (const GLfloat *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IPROC) (GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IVPROC) (const GLint *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SVPROC) (const GLshort *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DVPROC) (const GLdouble *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FVPROC) (const GLfloat *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IVPROC) (const GLint *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVPROC) (const GLshort *p); + +#define glBlendColor GLEW_GET_FUN(__glewBlendColor) +#define glBlendEquation GLEW_GET_FUN(__glewBlendEquation) +#define glBlendFuncSeparate GLEW_GET_FUN(__glewBlendFuncSeparate) +#define glFogCoordPointer GLEW_GET_FUN(__glewFogCoordPointer) +#define glFogCoordd GLEW_GET_FUN(__glewFogCoordd) +#define glFogCoorddv GLEW_GET_FUN(__glewFogCoorddv) +#define glFogCoordf GLEW_GET_FUN(__glewFogCoordf) +#define glFogCoordfv GLEW_GET_FUN(__glewFogCoordfv) +#define glMultiDrawArrays GLEW_GET_FUN(__glewMultiDrawArrays) +#define glMultiDrawElements GLEW_GET_FUN(__glewMultiDrawElements) +#define glPointParameterf GLEW_GET_FUN(__glewPointParameterf) +#define glPointParameterfv GLEW_GET_FUN(__glewPointParameterfv) +#define glPointParameteri GLEW_GET_FUN(__glewPointParameteri) +#define glPointParameteriv GLEW_GET_FUN(__glewPointParameteriv) +#define glSecondaryColor3b GLEW_GET_FUN(__glewSecondaryColor3b) +#define glSecondaryColor3bv GLEW_GET_FUN(__glewSecondaryColor3bv) +#define glSecondaryColor3d GLEW_GET_FUN(__glewSecondaryColor3d) +#define glSecondaryColor3dv GLEW_GET_FUN(__glewSecondaryColor3dv) +#define glSecondaryColor3f GLEW_GET_FUN(__glewSecondaryColor3f) +#define glSecondaryColor3fv GLEW_GET_FUN(__glewSecondaryColor3fv) +#define glSecondaryColor3i GLEW_GET_FUN(__glewSecondaryColor3i) +#define glSecondaryColor3iv GLEW_GET_FUN(__glewSecondaryColor3iv) +#define glSecondaryColor3s GLEW_GET_FUN(__glewSecondaryColor3s) +#define glSecondaryColor3sv GLEW_GET_FUN(__glewSecondaryColor3sv) +#define glSecondaryColor3ub GLEW_GET_FUN(__glewSecondaryColor3ub) +#define glSecondaryColor3ubv GLEW_GET_FUN(__glewSecondaryColor3ubv) +#define glSecondaryColor3ui GLEW_GET_FUN(__glewSecondaryColor3ui) +#define glSecondaryColor3uiv GLEW_GET_FUN(__glewSecondaryColor3uiv) +#define glSecondaryColor3us GLEW_GET_FUN(__glewSecondaryColor3us) +#define glSecondaryColor3usv GLEW_GET_FUN(__glewSecondaryColor3usv) +#define glSecondaryColorPointer GLEW_GET_FUN(__glewSecondaryColorPointer) +#define glWindowPos2d GLEW_GET_FUN(__glewWindowPos2d) +#define glWindowPos2dv GLEW_GET_FUN(__glewWindowPos2dv) +#define glWindowPos2f GLEW_GET_FUN(__glewWindowPos2f) +#define glWindowPos2fv GLEW_GET_FUN(__glewWindowPos2fv) +#define glWindowPos2i GLEW_GET_FUN(__glewWindowPos2i) +#define glWindowPos2iv GLEW_GET_FUN(__glewWindowPos2iv) +#define glWindowPos2s GLEW_GET_FUN(__glewWindowPos2s) +#define glWindowPos2sv GLEW_GET_FUN(__glewWindowPos2sv) +#define glWindowPos3d GLEW_GET_FUN(__glewWindowPos3d) +#define glWindowPos3dv GLEW_GET_FUN(__glewWindowPos3dv) +#define glWindowPos3f GLEW_GET_FUN(__glewWindowPos3f) +#define glWindowPos3fv GLEW_GET_FUN(__glewWindowPos3fv) +#define glWindowPos3i GLEW_GET_FUN(__glewWindowPos3i) +#define glWindowPos3iv GLEW_GET_FUN(__glewWindowPos3iv) +#define glWindowPos3s GLEW_GET_FUN(__glewWindowPos3s) +#define glWindowPos3sv GLEW_GET_FUN(__glewWindowPos3sv) + +#define GLEW_VERSION_1_4 GLEW_GET_VAR(__GLEW_VERSION_1_4) + +#endif /* GL_VERSION_1_4 */ + +/* ----------------------------- GL_VERSION_1_5 ---------------------------- */ + +#ifndef GL_VERSION_1_5 +#define GL_VERSION_1_5 1 + +#define GL_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE +#define GL_FOG_COORD GL_FOG_COORDINATE +#define GL_FOG_COORD_ARRAY GL_FOG_COORDINATE_ARRAY +#define GL_FOG_COORD_ARRAY_BUFFER_BINDING GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING +#define GL_FOG_COORD_ARRAY_POINTER GL_FOG_COORDINATE_ARRAY_POINTER +#define GL_FOG_COORD_ARRAY_STRIDE GL_FOG_COORDINATE_ARRAY_STRIDE +#define GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE +#define GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE +#define GL_SRC0_ALPHA GL_SOURCE0_ALPHA +#define GL_SRC0_RGB GL_SOURCE0_RGB +#define GL_SRC1_ALPHA GL_SOURCE1_ALPHA +#define GL_SRC1_RGB GL_SOURCE1_RGB +#define GL_SRC2_ALPHA GL_SOURCE2_ALPHA +#define GL_SRC2_RGB GL_SOURCE2_RGB +#define GL_BUFFER_SIZE 0x8764 +#define GL_BUFFER_USAGE 0x8765 +#define GL_QUERY_COUNTER_BITS 0x8864 +#define GL_CURRENT_QUERY 0x8865 +#define GL_QUERY_RESULT 0x8866 +#define GL_QUERY_RESULT_AVAILABLE 0x8867 +#define GL_ARRAY_BUFFER 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER 0x8893 +#define GL_ARRAY_BUFFER_BINDING 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 +#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F +#define GL_READ_ONLY 0x88B8 +#define GL_WRITE_ONLY 0x88B9 +#define GL_READ_WRITE 0x88BA +#define GL_BUFFER_ACCESS 0x88BB +#define GL_BUFFER_MAPPED 0x88BC +#define GL_BUFFER_MAP_POINTER 0x88BD +#define GL_STREAM_DRAW 0x88E0 +#define GL_STREAM_READ 0x88E1 +#define GL_STREAM_COPY 0x88E2 +#define GL_STATIC_DRAW 0x88E4 +#define GL_STATIC_READ 0x88E5 +#define GL_STATIC_COPY 0x88E6 +#define GL_DYNAMIC_DRAW 0x88E8 +#define GL_DYNAMIC_READ 0x88E9 +#define GL_DYNAMIC_COPY 0x88EA +#define GL_SAMPLES_PASSED 0x8914 + +typedef ptrdiff_t GLintptr; +typedef ptrdiff_t GLsizeiptr; + +typedef void (GLAPIENTRY * PFNGLBEGINQUERYPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const void* data, GLenum usage); +typedef void (GLAPIENTRY * PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const void* data); +typedef void (GLAPIENTRY * PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint* buffers); +typedef void (GLAPIENTRY * PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLENDQUERYPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLGENBUFFERSPROC) (GLsizei n, GLuint* buffers); +typedef void (GLAPIENTRY * PFNGLGENQUERIESPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, void** params); +typedef void (GLAPIENTRY * PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, void* data); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERPROC) (GLuint buffer); +typedef GLboolean (GLAPIENTRY * PFNGLISQUERYPROC) (GLuint id); +typedef void* (GLAPIENTRY * PFNGLMAPBUFFERPROC) (GLenum target, GLenum access); +typedef GLboolean (GLAPIENTRY * PFNGLUNMAPBUFFERPROC) (GLenum target); + +#define glBeginQuery GLEW_GET_FUN(__glewBeginQuery) +#define glBindBuffer GLEW_GET_FUN(__glewBindBuffer) +#define glBufferData GLEW_GET_FUN(__glewBufferData) +#define glBufferSubData GLEW_GET_FUN(__glewBufferSubData) +#define glDeleteBuffers GLEW_GET_FUN(__glewDeleteBuffers) +#define glDeleteQueries GLEW_GET_FUN(__glewDeleteQueries) +#define glEndQuery GLEW_GET_FUN(__glewEndQuery) +#define glGenBuffers GLEW_GET_FUN(__glewGenBuffers) +#define glGenQueries GLEW_GET_FUN(__glewGenQueries) +#define glGetBufferParameteriv GLEW_GET_FUN(__glewGetBufferParameteriv) +#define glGetBufferPointerv GLEW_GET_FUN(__glewGetBufferPointerv) +#define glGetBufferSubData GLEW_GET_FUN(__glewGetBufferSubData) +#define glGetQueryObjectiv GLEW_GET_FUN(__glewGetQueryObjectiv) +#define glGetQueryObjectuiv GLEW_GET_FUN(__glewGetQueryObjectuiv) +#define glGetQueryiv GLEW_GET_FUN(__glewGetQueryiv) +#define glIsBuffer GLEW_GET_FUN(__glewIsBuffer) +#define glIsQuery GLEW_GET_FUN(__glewIsQuery) +#define glMapBuffer GLEW_GET_FUN(__glewMapBuffer) +#define glUnmapBuffer GLEW_GET_FUN(__glewUnmapBuffer) + +#define GLEW_VERSION_1_5 GLEW_GET_VAR(__GLEW_VERSION_1_5) + +#endif /* GL_VERSION_1_5 */ + +/* ----------------------------- GL_VERSION_2_0 ---------------------------- */ + +#ifndef GL_VERSION_2_0 +#define GL_VERSION_2_0 1 + +#define GL_BLEND_EQUATION_RGB GL_BLEND_EQUATION +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 +#define GL_CURRENT_VERTEX_ATTRIB 0x8626 +#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 +#define GL_STENCIL_BACK_FUNC 0x8800 +#define GL_STENCIL_BACK_FAIL 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 +#define GL_MAX_DRAW_BUFFERS 0x8824 +#define GL_DRAW_BUFFER0 0x8825 +#define GL_DRAW_BUFFER1 0x8826 +#define GL_DRAW_BUFFER2 0x8827 +#define GL_DRAW_BUFFER3 0x8828 +#define GL_DRAW_BUFFER4 0x8829 +#define GL_DRAW_BUFFER5 0x882A +#define GL_DRAW_BUFFER6 0x882B +#define GL_DRAW_BUFFER7 0x882C +#define GL_DRAW_BUFFER8 0x882D +#define GL_DRAW_BUFFER9 0x882E +#define GL_DRAW_BUFFER10 0x882F +#define GL_DRAW_BUFFER11 0x8830 +#define GL_DRAW_BUFFER12 0x8831 +#define GL_DRAW_BUFFER13 0x8832 +#define GL_DRAW_BUFFER14 0x8833 +#define GL_DRAW_BUFFER15 0x8834 +#define GL_BLEND_EQUATION_ALPHA 0x883D +#define GL_POINT_SPRITE 0x8861 +#define GL_COORD_REPLACE 0x8862 +#define GL_MAX_VERTEX_ATTRIBS 0x8869 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A +#define GL_MAX_TEXTURE_COORDS 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 +#define GL_FRAGMENT_SHADER 0x8B30 +#define GL_VERTEX_SHADER 0x8B31 +#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49 +#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A +#define GL_MAX_VARYING_FLOATS 0x8B4B +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D +#define GL_SHADER_TYPE 0x8B4F +#define GL_FLOAT_VEC2 0x8B50 +#define GL_FLOAT_VEC3 0x8B51 +#define GL_FLOAT_VEC4 0x8B52 +#define GL_INT_VEC2 0x8B53 +#define GL_INT_VEC3 0x8B54 +#define GL_INT_VEC4 0x8B55 +#define GL_BOOL 0x8B56 +#define GL_BOOL_VEC2 0x8B57 +#define GL_BOOL_VEC3 0x8B58 +#define GL_BOOL_VEC4 0x8B59 +#define GL_FLOAT_MAT2 0x8B5A +#define GL_FLOAT_MAT3 0x8B5B +#define GL_FLOAT_MAT4 0x8B5C +#define GL_SAMPLER_1D 0x8B5D +#define GL_SAMPLER_2D 0x8B5E +#define GL_SAMPLER_3D 0x8B5F +#define GL_SAMPLER_CUBE 0x8B60 +#define GL_SAMPLER_1D_SHADOW 0x8B61 +#define GL_SAMPLER_2D_SHADOW 0x8B62 +#define GL_DELETE_STATUS 0x8B80 +#define GL_COMPILE_STATUS 0x8B81 +#define GL_LINK_STATUS 0x8B82 +#define GL_VALIDATE_STATUS 0x8B83 +#define GL_INFO_LOG_LENGTH 0x8B84 +#define GL_ATTACHED_SHADERS 0x8B85 +#define GL_ACTIVE_UNIFORMS 0x8B86 +#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 +#define GL_SHADER_SOURCE_LENGTH 0x8B88 +#define GL_ACTIVE_ATTRIBUTES 0x8B89 +#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B +#define GL_SHADING_LANGUAGE_VERSION 0x8B8C +#define GL_CURRENT_PROGRAM 0x8B8D +#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0 +#define GL_LOWER_LEFT 0x8CA1 +#define GL_UPPER_LEFT 0x8CA2 +#define GL_STENCIL_BACK_REF 0x8CA3 +#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 +#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 + +typedef void (GLAPIENTRY * PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader); +typedef void (GLAPIENTRY * PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha); +typedef void (GLAPIENTRY * PFNGLCOMPILESHADERPROC) (GLuint shader); +typedef GLuint (GLAPIENTRY * PFNGLCREATEPROGRAMPROC) (void); +typedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROC) (GLenum type); +typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMPROC) (GLuint program); +typedef void (GLAPIENTRY * PFNGLDELETESHADERPROC) (GLuint shader); +typedef void (GLAPIENTRY * PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader); +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index); +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum* bufs); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index); +typedef void (GLAPIENTRY * PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei* count, GLuint* shaders); +typedef GLint (GLAPIENTRY * PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei* length, GLchar* infoLog); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei* length, GLchar* infoLog); +typedef void (GLAPIENTRY * PFNGLGETSHADERSOURCEPROC) (GLuint obj, GLsizei maxLength, GLsizei* length, GLchar* source); +typedef void (GLAPIENTRY * PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint* param); +typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, void** pointer); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVPROC) (GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMPROC) (GLuint program); +typedef GLboolean (GLAPIENTRY * PFNGLISSHADERPROC) (GLuint shader); +typedef void (GLAPIENTRY * PFNGLLINKPROGRAMPROC) (GLuint program); +typedef void (GLAPIENTRY * PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar *const* string, const GLint* length); +typedef void (GLAPIENTRY * PFNGLSTENCILFUNCSEPARATEPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +typedef void (GLAPIENTRY * PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask); +typedef void (GLAPIENTRY * PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +typedef void (GLAPIENTRY * PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM1IPROC) (GLint location, GLint v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUSEPROGRAMPROC) (GLuint program); +typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMPROC) (GLuint program); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* pointer); + +#define glAttachShader GLEW_GET_FUN(__glewAttachShader) +#define glBindAttribLocation GLEW_GET_FUN(__glewBindAttribLocation) +#define glBlendEquationSeparate GLEW_GET_FUN(__glewBlendEquationSeparate) +#define glCompileShader GLEW_GET_FUN(__glewCompileShader) +#define glCreateProgram GLEW_GET_FUN(__glewCreateProgram) +#define glCreateShader GLEW_GET_FUN(__glewCreateShader) +#define glDeleteProgram GLEW_GET_FUN(__glewDeleteProgram) +#define glDeleteShader GLEW_GET_FUN(__glewDeleteShader) +#define glDetachShader GLEW_GET_FUN(__glewDetachShader) +#define glDisableVertexAttribArray GLEW_GET_FUN(__glewDisableVertexAttribArray) +#define glDrawBuffers GLEW_GET_FUN(__glewDrawBuffers) +#define glEnableVertexAttribArray GLEW_GET_FUN(__glewEnableVertexAttribArray) +#define glGetActiveAttrib GLEW_GET_FUN(__glewGetActiveAttrib) +#define glGetActiveUniform GLEW_GET_FUN(__glewGetActiveUniform) +#define glGetAttachedShaders GLEW_GET_FUN(__glewGetAttachedShaders) +#define glGetAttribLocation GLEW_GET_FUN(__glewGetAttribLocation) +#define glGetProgramInfoLog GLEW_GET_FUN(__glewGetProgramInfoLog) +#define glGetProgramiv GLEW_GET_FUN(__glewGetProgramiv) +#define glGetShaderInfoLog GLEW_GET_FUN(__glewGetShaderInfoLog) +#define glGetShaderSource GLEW_GET_FUN(__glewGetShaderSource) +#define glGetShaderiv GLEW_GET_FUN(__glewGetShaderiv) +#define glGetUniformLocation GLEW_GET_FUN(__glewGetUniformLocation) +#define glGetUniformfv GLEW_GET_FUN(__glewGetUniformfv) +#define glGetUniformiv GLEW_GET_FUN(__glewGetUniformiv) +#define glGetVertexAttribPointerv GLEW_GET_FUN(__glewGetVertexAttribPointerv) +#define glGetVertexAttribdv GLEW_GET_FUN(__glewGetVertexAttribdv) +#define glGetVertexAttribfv GLEW_GET_FUN(__glewGetVertexAttribfv) +#define glGetVertexAttribiv GLEW_GET_FUN(__glewGetVertexAttribiv) +#define glIsProgram GLEW_GET_FUN(__glewIsProgram) +#define glIsShader GLEW_GET_FUN(__glewIsShader) +#define glLinkProgram GLEW_GET_FUN(__glewLinkProgram) +#define glShaderSource GLEW_GET_FUN(__glewShaderSource) +#define glStencilFuncSeparate GLEW_GET_FUN(__glewStencilFuncSeparate) +#define glStencilMaskSeparate GLEW_GET_FUN(__glewStencilMaskSeparate) +#define glStencilOpSeparate GLEW_GET_FUN(__glewStencilOpSeparate) +#define glUniform1f GLEW_GET_FUN(__glewUniform1f) +#define glUniform1fv GLEW_GET_FUN(__glewUniform1fv) +#define glUniform1i GLEW_GET_FUN(__glewUniform1i) +#define glUniform1iv GLEW_GET_FUN(__glewUniform1iv) +#define glUniform2f GLEW_GET_FUN(__glewUniform2f) +#define glUniform2fv GLEW_GET_FUN(__glewUniform2fv) +#define glUniform2i GLEW_GET_FUN(__glewUniform2i) +#define glUniform2iv GLEW_GET_FUN(__glewUniform2iv) +#define glUniform3f GLEW_GET_FUN(__glewUniform3f) +#define glUniform3fv GLEW_GET_FUN(__glewUniform3fv) +#define glUniform3i GLEW_GET_FUN(__glewUniform3i) +#define glUniform3iv GLEW_GET_FUN(__glewUniform3iv) +#define glUniform4f GLEW_GET_FUN(__glewUniform4f) +#define glUniform4fv GLEW_GET_FUN(__glewUniform4fv) +#define glUniform4i GLEW_GET_FUN(__glewUniform4i) +#define glUniform4iv GLEW_GET_FUN(__glewUniform4iv) +#define glUniformMatrix2fv GLEW_GET_FUN(__glewUniformMatrix2fv) +#define glUniformMatrix3fv GLEW_GET_FUN(__glewUniformMatrix3fv) +#define glUniformMatrix4fv GLEW_GET_FUN(__glewUniformMatrix4fv) +#define glUseProgram GLEW_GET_FUN(__glewUseProgram) +#define glValidateProgram GLEW_GET_FUN(__glewValidateProgram) +#define glVertexAttrib1d GLEW_GET_FUN(__glewVertexAttrib1d) +#define glVertexAttrib1dv GLEW_GET_FUN(__glewVertexAttrib1dv) +#define glVertexAttrib1f GLEW_GET_FUN(__glewVertexAttrib1f) +#define glVertexAttrib1fv GLEW_GET_FUN(__glewVertexAttrib1fv) +#define glVertexAttrib1s GLEW_GET_FUN(__glewVertexAttrib1s) +#define glVertexAttrib1sv GLEW_GET_FUN(__glewVertexAttrib1sv) +#define glVertexAttrib2d GLEW_GET_FUN(__glewVertexAttrib2d) +#define glVertexAttrib2dv GLEW_GET_FUN(__glewVertexAttrib2dv) +#define glVertexAttrib2f GLEW_GET_FUN(__glewVertexAttrib2f) +#define glVertexAttrib2fv GLEW_GET_FUN(__glewVertexAttrib2fv) +#define glVertexAttrib2s GLEW_GET_FUN(__glewVertexAttrib2s) +#define glVertexAttrib2sv GLEW_GET_FUN(__glewVertexAttrib2sv) +#define glVertexAttrib3d GLEW_GET_FUN(__glewVertexAttrib3d) +#define glVertexAttrib3dv GLEW_GET_FUN(__glewVertexAttrib3dv) +#define glVertexAttrib3f GLEW_GET_FUN(__glewVertexAttrib3f) +#define glVertexAttrib3fv GLEW_GET_FUN(__glewVertexAttrib3fv) +#define glVertexAttrib3s GLEW_GET_FUN(__glewVertexAttrib3s) +#define glVertexAttrib3sv GLEW_GET_FUN(__glewVertexAttrib3sv) +#define glVertexAttrib4Nbv GLEW_GET_FUN(__glewVertexAttrib4Nbv) +#define glVertexAttrib4Niv GLEW_GET_FUN(__glewVertexAttrib4Niv) +#define glVertexAttrib4Nsv GLEW_GET_FUN(__glewVertexAttrib4Nsv) +#define glVertexAttrib4Nub GLEW_GET_FUN(__glewVertexAttrib4Nub) +#define glVertexAttrib4Nubv GLEW_GET_FUN(__glewVertexAttrib4Nubv) +#define glVertexAttrib4Nuiv GLEW_GET_FUN(__glewVertexAttrib4Nuiv) +#define glVertexAttrib4Nusv GLEW_GET_FUN(__glewVertexAttrib4Nusv) +#define glVertexAttrib4bv GLEW_GET_FUN(__glewVertexAttrib4bv) +#define glVertexAttrib4d GLEW_GET_FUN(__glewVertexAttrib4d) +#define glVertexAttrib4dv GLEW_GET_FUN(__glewVertexAttrib4dv) +#define glVertexAttrib4f GLEW_GET_FUN(__glewVertexAttrib4f) +#define glVertexAttrib4fv GLEW_GET_FUN(__glewVertexAttrib4fv) +#define glVertexAttrib4iv GLEW_GET_FUN(__glewVertexAttrib4iv) +#define glVertexAttrib4s GLEW_GET_FUN(__glewVertexAttrib4s) +#define glVertexAttrib4sv GLEW_GET_FUN(__glewVertexAttrib4sv) +#define glVertexAttrib4ubv GLEW_GET_FUN(__glewVertexAttrib4ubv) +#define glVertexAttrib4uiv GLEW_GET_FUN(__glewVertexAttrib4uiv) +#define glVertexAttrib4usv GLEW_GET_FUN(__glewVertexAttrib4usv) +#define glVertexAttribPointer GLEW_GET_FUN(__glewVertexAttribPointer) + +#define GLEW_VERSION_2_0 GLEW_GET_VAR(__GLEW_VERSION_2_0) + +#endif /* GL_VERSION_2_0 */ + +/* ----------------------------- GL_VERSION_2_1 ---------------------------- */ + +#ifndef GL_VERSION_2_1 +#define GL_VERSION_2_1 1 + +#define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F +#define GL_PIXEL_PACK_BUFFER 0x88EB +#define GL_PIXEL_UNPACK_BUFFER 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF +#define GL_FLOAT_MAT2x3 0x8B65 +#define GL_FLOAT_MAT2x4 0x8B66 +#define GL_FLOAT_MAT3x2 0x8B67 +#define GL_FLOAT_MAT3x4 0x8B68 +#define GL_FLOAT_MAT4x2 0x8B69 +#define GL_FLOAT_MAT4x3 0x8B6A +#define GL_SRGB 0x8C40 +#define GL_SRGB8 0x8C41 +#define GL_SRGB_ALPHA 0x8C42 +#define GL_SRGB8_ALPHA8 0x8C43 +#define GL_SLUMINANCE_ALPHA 0x8C44 +#define GL_SLUMINANCE8_ALPHA8 0x8C45 +#define GL_SLUMINANCE 0x8C46 +#define GL_SLUMINANCE8 0x8C47 +#define GL_COMPRESSED_SRGB 0x8C48 +#define GL_COMPRESSED_SRGB_ALPHA 0x8C49 +#define GL_COMPRESSED_SLUMINANCE 0x8C4A +#define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B + +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); + +#define glUniformMatrix2x3fv GLEW_GET_FUN(__glewUniformMatrix2x3fv) +#define glUniformMatrix2x4fv GLEW_GET_FUN(__glewUniformMatrix2x4fv) +#define glUniformMatrix3x2fv GLEW_GET_FUN(__glewUniformMatrix3x2fv) +#define glUniformMatrix3x4fv GLEW_GET_FUN(__glewUniformMatrix3x4fv) +#define glUniformMatrix4x2fv GLEW_GET_FUN(__glewUniformMatrix4x2fv) +#define glUniformMatrix4x3fv GLEW_GET_FUN(__glewUniformMatrix4x3fv) + +#define GLEW_VERSION_2_1 GLEW_GET_VAR(__GLEW_VERSION_2_1) + +#endif /* GL_VERSION_2_1 */ + +/* ----------------------------- GL_VERSION_3_0 ---------------------------- */ + +#ifndef GL_VERSION_3_0 +#define GL_VERSION_3_0 1 + +#define GL_CLIP_DISTANCE0 GL_CLIP_PLANE0 +#define GL_CLIP_DISTANCE1 GL_CLIP_PLANE1 +#define GL_CLIP_DISTANCE2 GL_CLIP_PLANE2 +#define GL_CLIP_DISTANCE3 GL_CLIP_PLANE3 +#define GL_CLIP_DISTANCE4 GL_CLIP_PLANE4 +#define GL_CLIP_DISTANCE5 GL_CLIP_PLANE5 +#define GL_COMPARE_REF_TO_TEXTURE GL_COMPARE_R_TO_TEXTURE_ARB +#define GL_MAX_CLIP_DISTANCES GL_MAX_CLIP_PLANES +#define GL_MAX_VARYING_COMPONENTS GL_MAX_VARYING_FLOATS +#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x0001 +#define GL_MAJOR_VERSION 0x821B +#define GL_MINOR_VERSION 0x821C +#define GL_NUM_EXTENSIONS 0x821D +#define GL_CONTEXT_FLAGS 0x821E +#define GL_DEPTH_BUFFER 0x8223 +#define GL_STENCIL_BUFFER 0x8224 +#define GL_RGBA32F 0x8814 +#define GL_RGB32F 0x8815 +#define GL_RGBA16F 0x881A +#define GL_RGB16F 0x881B +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD +#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF +#define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904 +#define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905 +#define GL_CLAMP_VERTEX_COLOR 0x891A +#define GL_CLAMP_FRAGMENT_COLOR 0x891B +#define GL_CLAMP_READ_COLOR 0x891C +#define GL_FIXED_ONLY 0x891D +#define GL_TEXTURE_RED_TYPE 0x8C10 +#define GL_TEXTURE_GREEN_TYPE 0x8C11 +#define GL_TEXTURE_BLUE_TYPE 0x8C12 +#define GL_TEXTURE_ALPHA_TYPE 0x8C13 +#define GL_TEXTURE_LUMINANCE_TYPE 0x8C14 +#define GL_TEXTURE_INTENSITY_TYPE 0x8C15 +#define GL_TEXTURE_DEPTH_TYPE 0x8C16 +#define GL_TEXTURE_1D_ARRAY 0x8C18 +#define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19 +#define GL_TEXTURE_2D_ARRAY 0x8C1A +#define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B +#define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C +#define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D +#define GL_R11F_G11F_B10F 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B +#define GL_RGB9_E5 0x8C3D +#define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E +#define GL_TEXTURE_SHARED_SIZE 0x8C3F +#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76 +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80 +#define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85 +#define GL_PRIMITIVES_GENERATED 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88 +#define GL_RASTERIZER_DISCARD 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B +#define GL_INTERLEAVED_ATTRIBS 0x8C8C +#define GL_SEPARATE_ATTRIBS 0x8C8D +#define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F +#define GL_RGBA32UI 0x8D70 +#define GL_RGB32UI 0x8D71 +#define GL_RGBA16UI 0x8D76 +#define GL_RGB16UI 0x8D77 +#define GL_RGBA8UI 0x8D7C +#define GL_RGB8UI 0x8D7D +#define GL_RGBA32I 0x8D82 +#define GL_RGB32I 0x8D83 +#define GL_RGBA16I 0x8D88 +#define GL_RGB16I 0x8D89 +#define GL_RGBA8I 0x8D8E +#define GL_RGB8I 0x8D8F +#define GL_RED_INTEGER 0x8D94 +#define GL_GREEN_INTEGER 0x8D95 +#define GL_BLUE_INTEGER 0x8D96 +#define GL_ALPHA_INTEGER 0x8D97 +#define GL_RGB_INTEGER 0x8D98 +#define GL_RGBA_INTEGER 0x8D99 +#define GL_BGR_INTEGER 0x8D9A +#define GL_BGRA_INTEGER 0x8D9B +#define GL_SAMPLER_1D_ARRAY 0x8DC0 +#define GL_SAMPLER_2D_ARRAY 0x8DC1 +#define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3 +#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4 +#define GL_SAMPLER_CUBE_SHADOW 0x8DC5 +#define GL_UNSIGNED_INT_VEC2 0x8DC6 +#define GL_UNSIGNED_INT_VEC3 0x8DC7 +#define GL_UNSIGNED_INT_VEC4 0x8DC8 +#define GL_INT_SAMPLER_1D 0x8DC9 +#define GL_INT_SAMPLER_2D 0x8DCA +#define GL_INT_SAMPLER_3D 0x8DCB +#define GL_INT_SAMPLER_CUBE 0x8DCC +#define GL_INT_SAMPLER_1D_ARRAY 0x8DCE +#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF +#define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1 +#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2 +#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3 +#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4 +#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6 +#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7 +#define GL_QUERY_WAIT 0x8E13 +#define GL_QUERY_NO_WAIT 0x8E14 +#define GL_QUERY_BY_REGION_WAIT 0x8E15 +#define GL_QUERY_BY_REGION_NO_WAIT 0x8E16 + +typedef void (GLAPIENTRY * PFNGLBEGINCONDITIONALRENDERPROC) (GLuint id, GLenum mode); +typedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum primitiveMode); +typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONPROC) (GLuint program, GLuint colorNumber, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLCLAMPCOLORPROC) (GLenum target, GLenum clamp); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERFIPROC) (GLenum buffer, GLint drawBuffer, GLfloat depth, GLint stencil); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERFVPROC) (GLenum buffer, GLint drawBuffer, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERIVPROC) (GLenum buffer, GLint drawBuffer, const GLint* value); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERUIVPROC) (GLenum buffer, GLint drawBuffer, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLCOLORMASKIPROC) (GLuint buf, GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +typedef void (GLAPIENTRY * PFNGLDISABLEIPROC) (GLenum cap, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEIPROC) (GLenum cap, GLuint index); +typedef void (GLAPIENTRY * PFNGLENDCONDITIONALRENDERPROC) (void); +typedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKPROC) (void); +typedef void (GLAPIENTRY * PFNGLGETBOOLEANI_VPROC) (GLenum pname, GLuint index, GLboolean* data); +typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATALOCATIONPROC) (GLuint program, const GLchar* name); +typedef const GLubyte* (GLAPIENTRY * PFNGLGETSTRINGIPROC) (GLenum name, GLuint index); +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLsizei * size, GLenum * type, GLchar * name); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMUIVPROC) (GLuint program, GLint location, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIIVPROC) (GLuint index, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint index, GLenum pname, GLuint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISENABLEDIPROC) (GLenum cap, GLuint index); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint program, GLsizei count, const GLchar *const* varyings, GLenum bufferMode); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UIPROC) (GLint location, GLuint v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UIVPROC) (GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UIPROC) (GLint location, GLuint v0, GLuint v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UIVPROC) (GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UIVPROC) (GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UIVPROC) (GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IPROC) (GLuint index, GLint v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IVPROC) (GLuint index, const GLint* v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIPROC) (GLuint index, GLuint v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIVPROC) (GLuint index, const GLuint* v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IPROC) (GLuint index, GLint v0, GLint v1); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IVPROC) (GLuint index, const GLint* v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIPROC) (GLuint index, GLuint v0, GLuint v1); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIVPROC) (GLuint index, const GLuint* v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IPROC) (GLuint index, GLint v0, GLint v1, GLint v2); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IVPROC) (GLuint index, const GLint* v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIPROC) (GLuint index, GLuint v0, GLuint v1, GLuint v2); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIVPROC) (GLuint index, const GLuint* v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4BVPROC) (GLuint index, const GLbyte* v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IPROC) (GLuint index, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IVPROC) (GLuint index, const GLint* v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4SVPROC) (GLuint index, const GLshort* v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UBVPROC) (GLuint index, const GLubyte* v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIPROC) (GLuint index, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIVPROC) (GLuint index, const GLuint* v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4USVPROC) (GLuint index, const GLushort* v0); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void*pointer); + +#define glBeginConditionalRender GLEW_GET_FUN(__glewBeginConditionalRender) +#define glBeginTransformFeedback GLEW_GET_FUN(__glewBeginTransformFeedback) +#define glBindFragDataLocation GLEW_GET_FUN(__glewBindFragDataLocation) +#define glClampColor GLEW_GET_FUN(__glewClampColor) +#define glClearBufferfi GLEW_GET_FUN(__glewClearBufferfi) +#define glClearBufferfv GLEW_GET_FUN(__glewClearBufferfv) +#define glClearBufferiv GLEW_GET_FUN(__glewClearBufferiv) +#define glClearBufferuiv GLEW_GET_FUN(__glewClearBufferuiv) +#define glColorMaski GLEW_GET_FUN(__glewColorMaski) +#define glDisablei GLEW_GET_FUN(__glewDisablei) +#define glEnablei GLEW_GET_FUN(__glewEnablei) +#define glEndConditionalRender GLEW_GET_FUN(__glewEndConditionalRender) +#define glEndTransformFeedback GLEW_GET_FUN(__glewEndTransformFeedback) +#define glGetBooleani_v GLEW_GET_FUN(__glewGetBooleani_v) +#define glGetFragDataLocation GLEW_GET_FUN(__glewGetFragDataLocation) +#define glGetStringi GLEW_GET_FUN(__glewGetStringi) +#define glGetTexParameterIiv GLEW_GET_FUN(__glewGetTexParameterIiv) +#define glGetTexParameterIuiv GLEW_GET_FUN(__glewGetTexParameterIuiv) +#define glGetTransformFeedbackVarying GLEW_GET_FUN(__glewGetTransformFeedbackVarying) +#define glGetUniformuiv GLEW_GET_FUN(__glewGetUniformuiv) +#define glGetVertexAttribIiv GLEW_GET_FUN(__glewGetVertexAttribIiv) +#define glGetVertexAttribIuiv GLEW_GET_FUN(__glewGetVertexAttribIuiv) +#define glIsEnabledi GLEW_GET_FUN(__glewIsEnabledi) +#define glTexParameterIiv GLEW_GET_FUN(__glewTexParameterIiv) +#define glTexParameterIuiv GLEW_GET_FUN(__glewTexParameterIuiv) +#define glTransformFeedbackVaryings GLEW_GET_FUN(__glewTransformFeedbackVaryings) +#define glUniform1ui GLEW_GET_FUN(__glewUniform1ui) +#define glUniform1uiv GLEW_GET_FUN(__glewUniform1uiv) +#define glUniform2ui GLEW_GET_FUN(__glewUniform2ui) +#define glUniform2uiv GLEW_GET_FUN(__glewUniform2uiv) +#define glUniform3ui GLEW_GET_FUN(__glewUniform3ui) +#define glUniform3uiv GLEW_GET_FUN(__glewUniform3uiv) +#define glUniform4ui GLEW_GET_FUN(__glewUniform4ui) +#define glUniform4uiv GLEW_GET_FUN(__glewUniform4uiv) +#define glVertexAttribI1i GLEW_GET_FUN(__glewVertexAttribI1i) +#define glVertexAttribI1iv GLEW_GET_FUN(__glewVertexAttribI1iv) +#define glVertexAttribI1ui GLEW_GET_FUN(__glewVertexAttribI1ui) +#define glVertexAttribI1uiv GLEW_GET_FUN(__glewVertexAttribI1uiv) +#define glVertexAttribI2i GLEW_GET_FUN(__glewVertexAttribI2i) +#define glVertexAttribI2iv GLEW_GET_FUN(__glewVertexAttribI2iv) +#define glVertexAttribI2ui GLEW_GET_FUN(__glewVertexAttribI2ui) +#define glVertexAttribI2uiv GLEW_GET_FUN(__glewVertexAttribI2uiv) +#define glVertexAttribI3i GLEW_GET_FUN(__glewVertexAttribI3i) +#define glVertexAttribI3iv GLEW_GET_FUN(__glewVertexAttribI3iv) +#define glVertexAttribI3ui GLEW_GET_FUN(__glewVertexAttribI3ui) +#define glVertexAttribI3uiv GLEW_GET_FUN(__glewVertexAttribI3uiv) +#define glVertexAttribI4bv GLEW_GET_FUN(__glewVertexAttribI4bv) +#define glVertexAttribI4i GLEW_GET_FUN(__glewVertexAttribI4i) +#define glVertexAttribI4iv GLEW_GET_FUN(__glewVertexAttribI4iv) +#define glVertexAttribI4sv GLEW_GET_FUN(__glewVertexAttribI4sv) +#define glVertexAttribI4ubv GLEW_GET_FUN(__glewVertexAttribI4ubv) +#define glVertexAttribI4ui GLEW_GET_FUN(__glewVertexAttribI4ui) +#define glVertexAttribI4uiv GLEW_GET_FUN(__glewVertexAttribI4uiv) +#define glVertexAttribI4usv GLEW_GET_FUN(__glewVertexAttribI4usv) +#define glVertexAttribIPointer GLEW_GET_FUN(__glewVertexAttribIPointer) + +#define GLEW_VERSION_3_0 GLEW_GET_VAR(__GLEW_VERSION_3_0) + +#endif /* GL_VERSION_3_0 */ + +/* ----------------------------- GL_VERSION_3_1 ---------------------------- */ + +#ifndef GL_VERSION_3_1 +#define GL_VERSION_3_1 1 + +#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_SAMPLER_2D_RECT 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW 0x8B64 +#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_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_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 +#define GL_BUFFER_ACCESS_FLAGS 0x911F +#define GL_BUFFER_MAP_LENGTH 0x9120 +#define GL_BUFFER_MAP_OFFSET 0x9121 + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLPRIMITIVERESTARTINDEXPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLTEXBUFFERPROC) (GLenum target, GLenum internalFormat, GLuint buffer); + +#define glDrawArraysInstanced GLEW_GET_FUN(__glewDrawArraysInstanced) +#define glDrawElementsInstanced GLEW_GET_FUN(__glewDrawElementsInstanced) +#define glPrimitiveRestartIndex GLEW_GET_FUN(__glewPrimitiveRestartIndex) +#define glTexBuffer GLEW_GET_FUN(__glewTexBuffer) + +#define GLEW_VERSION_3_1 GLEW_GET_VAR(__GLEW_VERSION_3_1) + +#endif /* GL_VERSION_3_1 */ + +/* ----------------------------- GL_VERSION_3_2 ---------------------------- */ + +#ifndef GL_VERSION_3_2 +#define GL_VERSION_3_2 1 + +#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_GEOMETRY_VERTICES_OUT 0x8916 +#define GL_GEOMETRY_INPUT_TYPE 0x8917 +#define GL_GEOMETRY_OUTPUT_TYPE 0x8918 +#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_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 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum target, GLenum value, GLint64 * data); +typedef void (GLAPIENTRY * PFNGLGETINTEGER64I_VPROC) (GLenum pname, GLuint index, GLint64 * data); + +#define glFramebufferTexture GLEW_GET_FUN(__glewFramebufferTexture) +#define glGetBufferParameteri64v GLEW_GET_FUN(__glewGetBufferParameteri64v) +#define glGetInteger64i_v GLEW_GET_FUN(__glewGetInteger64i_v) + +#define GLEW_VERSION_3_2 GLEW_GET_VAR(__GLEW_VERSION_3_2) + +#endif /* GL_VERSION_3_2 */ + +/* ----------------------------- GL_VERSION_3_3 ---------------------------- */ + +#ifndef GL_VERSION_3_3 +#define GL_VERSION_3_3 1 + +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE +#define GL_RGB10_A2UI 0x906F + +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor); + +#define glVertexAttribDivisor GLEW_GET_FUN(__glewVertexAttribDivisor) + +#define GLEW_VERSION_3_3 GLEW_GET_VAR(__GLEW_VERSION_3_3) + +#endif /* GL_VERSION_3_3 */ + +/* ----------------------------- GL_VERSION_4_0 ---------------------------- */ + +#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_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS 0x8F9F +#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 + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEIPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONIPROC) (GLuint buf, GLenum mode); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEIPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCIPROC) (GLuint buf, GLenum src, GLenum dst); +typedef void (GLAPIENTRY * PFNGLMINSAMPLESHADINGPROC) (GLclampf value); + +#define glBlendEquationSeparatei GLEW_GET_FUN(__glewBlendEquationSeparatei) +#define glBlendEquationi GLEW_GET_FUN(__glewBlendEquationi) +#define glBlendFuncSeparatei GLEW_GET_FUN(__glewBlendFuncSeparatei) +#define glBlendFunci GLEW_GET_FUN(__glewBlendFunci) +#define glMinSampleShading GLEW_GET_FUN(__glewMinSampleShading) + +#define GLEW_VERSION_4_0 GLEW_GET_VAR(__GLEW_VERSION_4_0) + +#endif /* GL_VERSION_4_0 */ + +/* ----------------------------- GL_VERSION_4_1 ---------------------------- */ + +#ifndef GL_VERSION_4_1 +#define GL_VERSION_4_1 1 + +#define GLEW_VERSION_4_1 GLEW_GET_VAR(__GLEW_VERSION_4_1) + +#endif /* GL_VERSION_4_1 */ + +/* ----------------------------- GL_VERSION_4_2 ---------------------------- */ + +#ifndef GL_VERSION_4_2 +#define GL_VERSION_4_2 1 + +#define GL_TRANSFORM_FEEDBACK_PAUSED 0x8E23 +#define GL_TRANSFORM_FEEDBACK_ACTIVE 0x8E24 +#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_COPY_READ_BUFFER_BINDING 0x8F36 +#define GL_COPY_WRITE_BUFFER_BINDING 0x8F37 + +#define GLEW_VERSION_4_2 GLEW_GET_VAR(__GLEW_VERSION_4_2) + +#endif /* GL_VERSION_4_2 */ + +/* ----------------------------- GL_VERSION_4_3 ---------------------------- */ + +#ifndef GL_VERSION_4_3 +#define GL_VERSION_4_3 1 + +#define GL_NUM_SHADING_LANGUAGE_VERSIONS 0x82E9 +#define GL_VERTEX_ATTRIB_ARRAY_LONG 0x874E + +#define GLEW_VERSION_4_3 GLEW_GET_VAR(__GLEW_VERSION_4_3) + +#endif /* GL_VERSION_4_3 */ + +/* ----------------------------- GL_VERSION_4_4 ---------------------------- */ + +#ifndef GL_VERSION_4_4 +#define GL_VERSION_4_4 1 + +#define GL_PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED 0x8221 +#define GL_MAX_VERTEX_ATTRIB_STRIDE 0x82E5 +#define GL_TEXTURE_BUFFER_BINDING 0x8C2A + +#define GLEW_VERSION_4_4 GLEW_GET_VAR(__GLEW_VERSION_4_4) + +#endif /* GL_VERSION_4_4 */ + +/* ----------------------------- GL_VERSION_4_5 ---------------------------- */ + +#ifndef GL_VERSION_4_5 +#define GL_VERSION_4_5 1 + +#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT 0x00000004 + +typedef GLenum (GLAPIENTRY * PFNGLGETGRAPHICSRESETSTATUSPROC) (void); +typedef void (GLAPIENTRY * PFNGLGETNCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint lod, GLsizei bufSize, GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLGETNTEXIMAGEPROC) (GLenum tex, GLint level, GLenum format, GLenum type, GLsizei bufSize, GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMDVPROC) (GLuint program, GLint location, GLsizei bufSize, GLdouble *params); + +#define glGetGraphicsResetStatus GLEW_GET_FUN(__glewGetGraphicsResetStatus) +#define glGetnCompressedTexImage GLEW_GET_FUN(__glewGetnCompressedTexImage) +#define glGetnTexImage GLEW_GET_FUN(__glewGetnTexImage) +#define glGetnUniformdv GLEW_GET_FUN(__glewGetnUniformdv) + +#define GLEW_VERSION_4_5 GLEW_GET_VAR(__GLEW_VERSION_4_5) + +#endif /* GL_VERSION_4_5 */ + +/* ----------------------------- GL_VERSION_4_6 ---------------------------- */ + +#ifndef GL_VERSION_4_6 +#define GL_VERSION_4_6 1 + +#define GL_CONTEXT_FLAG_NO_ERROR_BIT 0x00000008 +#define GL_PARAMETER_BUFFER 0x80EE +#define GL_PARAMETER_BUFFER_BINDING 0x80EF +#define GL_TRANSFORM_FEEDBACK_OVERFLOW 0x82EC +#define GL_TRANSFORM_FEEDBACK_STREAM_OVERFLOW 0x82ED +#define GL_VERTICES_SUBMITTED 0x82EE +#define GL_PRIMITIVES_SUBMITTED 0x82EF +#define GL_VERTEX_SHADER_INVOCATIONS 0x82F0 +#define GL_TESS_CONTROL_SHADER_PATCHES 0x82F1 +#define GL_TESS_EVALUATION_SHADER_INVOCATIONS 0x82F2 +#define GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED 0x82F3 +#define GL_FRAGMENT_SHADER_INVOCATIONS 0x82F4 +#define GL_COMPUTE_SHADER_INVOCATIONS 0x82F5 +#define GL_CLIPPING_INPUT_PRIMITIVES 0x82F6 +#define GL_CLIPPING_OUTPUT_PRIMITIVES 0x82F7 +#define GL_TEXTURE_MAX_ANISOTROPY 0x84FE +#define GL_MAX_TEXTURE_MAX_ANISOTROPY 0x84FF +#define GL_POLYGON_OFFSET_CLAMP 0x8E1B +#define GL_SHADER_BINARY_FORMAT_SPIR_V 0x9551 +#define GL_SPIR_V_BINARY 0x9552 +#define GL_SPIR_V_EXTENSIONS 0x9553 +#define GL_NUM_SPIR_V_EXTENSIONS 0x9554 + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTCOUNTPROC) (GLenum mode, const GLvoid *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTPROC) (GLenum mode, GLenum type, const GLvoid *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLSPECIALIZESHADERPROC) (GLuint shader, const GLchar *pEntryPoint, GLuint numSpecializationConstants, const GLuint *pConstantIndex, const GLuint *pConstantValue); + +#define glMultiDrawArraysIndirectCount GLEW_GET_FUN(__glewMultiDrawArraysIndirectCount) +#define glMultiDrawElementsIndirectCount GLEW_GET_FUN(__glewMultiDrawElementsIndirectCount) +#define glSpecializeShader GLEW_GET_FUN(__glewSpecializeShader) + +#define GLEW_VERSION_4_6 GLEW_GET_VAR(__GLEW_VERSION_4_6) + +#endif /* GL_VERSION_4_6 */ + +/* -------------------------- GL_3DFX_multisample -------------------------- */ + +#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 + +#define GLEW_3DFX_multisample GLEW_GET_VAR(__GLEW_3DFX_multisample) + +#endif /* GL_3DFX_multisample */ + +/* ---------------------------- GL_3DFX_tbuffer ---------------------------- */ + +#ifndef GL_3DFX_tbuffer +#define GL_3DFX_tbuffer 1 + +typedef void (GLAPIENTRY * PFNGLTBUFFERMASK3DFXPROC) (GLuint mask); + +#define glTbufferMask3DFX GLEW_GET_FUN(__glewTbufferMask3DFX) + +#define GLEW_3DFX_tbuffer GLEW_GET_VAR(__GLEW_3DFX_tbuffer) + +#endif /* GL_3DFX_tbuffer */ + +/* -------------------- GL_3DFX_texture_compression_FXT1 ------------------- */ + +#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 + +#define GLEW_3DFX_texture_compression_FXT1 GLEW_GET_VAR(__GLEW_3DFX_texture_compression_FXT1) + +#endif /* GL_3DFX_texture_compression_FXT1 */ + +/* ----------------------- GL_AMD_blend_minmax_factor ---------------------- */ + +#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 + +#define GLEW_AMD_blend_minmax_factor GLEW_GET_VAR(__GLEW_AMD_blend_minmax_factor) + +#endif /* GL_AMD_blend_minmax_factor */ + +/* --------------------- GL_AMD_compressed_3DC_texture --------------------- */ + +#ifndef GL_AMD_compressed_3DC_texture +#define GL_AMD_compressed_3DC_texture 1 + +#define GL_3DC_X_AMD 0x87F9 +#define GL_3DC_XY_AMD 0x87FA + +#define GLEW_AMD_compressed_3DC_texture GLEW_GET_VAR(__GLEW_AMD_compressed_3DC_texture) + +#endif /* GL_AMD_compressed_3DC_texture */ + +/* --------------------- GL_AMD_compressed_ATC_texture --------------------- */ + +#ifndef GL_AMD_compressed_ATC_texture +#define GL_AMD_compressed_ATC_texture 1 + +#define GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD 0x87EE +#define GL_ATC_RGB_AMD 0x8C92 +#define GL_ATC_RGBA_EXPLICIT_ALPHA_AMD 0x8C93 + +#define GLEW_AMD_compressed_ATC_texture GLEW_GET_VAR(__GLEW_AMD_compressed_ATC_texture) + +#endif /* GL_AMD_compressed_ATC_texture */ + +/* ----------------------- GL_AMD_conservative_depth ----------------------- */ + +#ifndef GL_AMD_conservative_depth +#define GL_AMD_conservative_depth 1 + +#define GLEW_AMD_conservative_depth GLEW_GET_VAR(__GLEW_AMD_conservative_depth) + +#endif /* GL_AMD_conservative_depth */ + +/* -------------------------- GL_AMD_debug_output -------------------------- */ + +#ifndef GL_AMD_debug_output +#define GL_AMD_debug_output 1 + +#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 (GLAPIENTRY *GLDEBUGPROCAMD)(GLuint id, GLenum category, GLenum severity, GLsizei length, const GLchar* message, void* userParam); + +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECALLBACKAMDPROC) (GLDEBUGPROCAMD callback, void *userParam); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEENABLEAMDPROC) (GLenum category, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEINSERTAMDPROC) (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar* buf); +typedef GLuint (GLAPIENTRY * PFNGLGETDEBUGMESSAGELOGAMDPROC) (GLuint count, GLsizei bufsize, GLenum* categories, GLuint* severities, GLuint* ids, GLsizei* lengths, GLchar* message); + +#define glDebugMessageCallbackAMD GLEW_GET_FUN(__glewDebugMessageCallbackAMD) +#define glDebugMessageEnableAMD GLEW_GET_FUN(__glewDebugMessageEnableAMD) +#define glDebugMessageInsertAMD GLEW_GET_FUN(__glewDebugMessageInsertAMD) +#define glGetDebugMessageLogAMD GLEW_GET_FUN(__glewGetDebugMessageLogAMD) + +#define GLEW_AMD_debug_output GLEW_GET_VAR(__GLEW_AMD_debug_output) + +#endif /* GL_AMD_debug_output */ + +/* ---------------------- GL_AMD_depth_clamp_separate ---------------------- */ + +#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 + +#define GLEW_AMD_depth_clamp_separate GLEW_GET_VAR(__GLEW_AMD_depth_clamp_separate) + +#endif /* GL_AMD_depth_clamp_separate */ + +/* ----------------------- GL_AMD_draw_buffers_blend ----------------------- */ + +#ifndef GL_AMD_draw_buffers_blend +#define GL_AMD_draw_buffers_blend 1 + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONINDEXEDAMDPROC) (GLuint buf, GLenum mode); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCINDEXEDAMDPROC) (GLuint buf, GLenum src, GLenum dst); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); + +#define glBlendEquationIndexedAMD GLEW_GET_FUN(__glewBlendEquationIndexedAMD) +#define glBlendEquationSeparateIndexedAMD GLEW_GET_FUN(__glewBlendEquationSeparateIndexedAMD) +#define glBlendFuncIndexedAMD GLEW_GET_FUN(__glewBlendFuncIndexedAMD) +#define glBlendFuncSeparateIndexedAMD GLEW_GET_FUN(__glewBlendFuncSeparateIndexedAMD) + +#define GLEW_AMD_draw_buffers_blend GLEW_GET_VAR(__GLEW_AMD_draw_buffers_blend) + +#endif /* GL_AMD_draw_buffers_blend */ + +/* ------------------ GL_AMD_framebuffer_sample_positions ------------------ */ + +#ifndef GL_AMD_framebuffer_sample_positions +#define GL_AMD_framebuffer_sample_positions 1 + +#define GL_SUBSAMPLE_DISTANCE_AMD 0x883F +#define GL_PIXELS_PER_SAMPLE_PATTERN_X_AMD 0x91AE +#define GL_PIXELS_PER_SAMPLE_PATTERN_Y_AMD 0x91AF +#define GL_ALL_PIXELS_AMD 0xFFFFFFFF + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERSAMPLEPOSITIONSFVAMDPROC) (GLenum target, GLuint numsamples, GLuint pixelindex, const GLfloat* values); +typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERPARAMETERFVAMDPROC) (GLenum target, GLenum pname, GLuint numsamples, GLuint pixelindex, GLsizei size, GLfloat* values); +typedef void (GLAPIENTRY * PFNGLGETNAMEDFRAMEBUFFERPARAMETERFVAMDPROC) (GLuint framebuffer, GLenum pname, GLuint numsamples, GLuint pixelindex, GLsizei size, GLfloat* values); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERSAMPLEPOSITIONSFVAMDPROC) (GLuint framebuffer, GLuint numsamples, GLuint pixelindex, const GLfloat* values); + +#define glFramebufferSamplePositionsfvAMD GLEW_GET_FUN(__glewFramebufferSamplePositionsfvAMD) +#define glGetFramebufferParameterfvAMD GLEW_GET_FUN(__glewGetFramebufferParameterfvAMD) +#define glGetNamedFramebufferParameterfvAMD GLEW_GET_FUN(__glewGetNamedFramebufferParameterfvAMD) +#define glNamedFramebufferSamplePositionsfvAMD GLEW_GET_FUN(__glewNamedFramebufferSamplePositionsfvAMD) + +#define GLEW_AMD_framebuffer_sample_positions GLEW_GET_VAR(__GLEW_AMD_framebuffer_sample_positions) + +#endif /* GL_AMD_framebuffer_sample_positions */ + +/* --------------------------- GL_AMD_gcn_shader --------------------------- */ + +#ifndef GL_AMD_gcn_shader +#define GL_AMD_gcn_shader 1 + +#define GLEW_AMD_gcn_shader GLEW_GET_VAR(__GLEW_AMD_gcn_shader) + +#endif /* GL_AMD_gcn_shader */ + +/* ---------------------- GL_AMD_gpu_shader_half_float --------------------- */ + +#ifndef GL_AMD_gpu_shader_half_float +#define GL_AMD_gpu_shader_half_float 1 + +#define GL_FLOAT16_NV 0x8FF8 +#define GL_FLOAT16_VEC2_NV 0x8FF9 +#define GL_FLOAT16_VEC3_NV 0x8FFA +#define GL_FLOAT16_VEC4_NV 0x8FFB +#define GL_FLOAT16_MAT2_AMD 0x91C5 +#define GL_FLOAT16_MAT3_AMD 0x91C6 +#define GL_FLOAT16_MAT4_AMD 0x91C7 +#define GL_FLOAT16_MAT2x3_AMD 0x91C8 +#define GL_FLOAT16_MAT2x4_AMD 0x91C9 +#define GL_FLOAT16_MAT3x2_AMD 0x91CA +#define GL_FLOAT16_MAT3x4_AMD 0x91CB +#define GL_FLOAT16_MAT4x2_AMD 0x91CC +#define GL_FLOAT16_MAT4x3_AMD 0x91CD + +#define GLEW_AMD_gpu_shader_half_float GLEW_GET_VAR(__GLEW_AMD_gpu_shader_half_float) + +#endif /* GL_AMD_gpu_shader_half_float */ + +/* ------------------------ GL_AMD_gpu_shader_int16 ------------------------ */ + +#ifndef GL_AMD_gpu_shader_int16 +#define GL_AMD_gpu_shader_int16 1 + +#define GLEW_AMD_gpu_shader_int16 GLEW_GET_VAR(__GLEW_AMD_gpu_shader_int16) + +#endif /* GL_AMD_gpu_shader_int16 */ + +/* ------------------------ GL_AMD_gpu_shader_int64 ------------------------ */ + +#ifndef GL_AMD_gpu_shader_int64 +#define GL_AMD_gpu_shader_int64 1 + +#define GLEW_AMD_gpu_shader_int64 GLEW_GET_VAR(__GLEW_AMD_gpu_shader_int64) + +#endif /* GL_AMD_gpu_shader_int64 */ + +/* ---------------------- GL_AMD_interleaved_elements ---------------------- */ + +#ifndef GL_AMD_interleaved_elements +#define GL_AMD_interleaved_elements 1 + +#define GL_RED 0x1903 +#define GL_GREEN 0x1904 +#define GL_BLUE 0x1905 +#define GL_ALPHA 0x1906 +#define GL_RG8UI 0x8238 +#define GL_RG16UI 0x823A +#define GL_RGBA8UI 0x8D7C +#define GL_VERTEX_ELEMENT_SWIZZLE_AMD 0x91A4 +#define GL_VERTEX_ID_SWIZZLE_AMD 0x91A5 + +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPARAMETERIAMDPROC) (GLuint index, GLenum pname, GLint param); + +#define glVertexAttribParameteriAMD GLEW_GET_FUN(__glewVertexAttribParameteriAMD) + +#define GLEW_AMD_interleaved_elements GLEW_GET_VAR(__GLEW_AMD_interleaved_elements) + +#endif /* GL_AMD_interleaved_elements */ + +/* ----------------------- GL_AMD_multi_draw_indirect ---------------------- */ + +#ifndef GL_AMD_multi_draw_indirect +#define GL_AMD_multi_draw_indirect 1 + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC) (GLenum mode, const void *indirect, GLsizei primcount, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei primcount, GLsizei stride); + +#define glMultiDrawArraysIndirectAMD GLEW_GET_FUN(__glewMultiDrawArraysIndirectAMD) +#define glMultiDrawElementsIndirectAMD GLEW_GET_FUN(__glewMultiDrawElementsIndirectAMD) + +#define GLEW_AMD_multi_draw_indirect GLEW_GET_VAR(__GLEW_AMD_multi_draw_indirect) + +#endif /* GL_AMD_multi_draw_indirect */ + +/* ------------------------- GL_AMD_name_gen_delete ------------------------ */ + +#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 (GLAPIENTRY * PFNGLDELETENAMESAMDPROC) (GLenum identifier, GLuint num, const GLuint* names); +typedef void (GLAPIENTRY * PFNGLGENNAMESAMDPROC) (GLenum identifier, GLuint num, GLuint* names); +typedef GLboolean (GLAPIENTRY * PFNGLISNAMEAMDPROC) (GLenum identifier, GLuint name); + +#define glDeleteNamesAMD GLEW_GET_FUN(__glewDeleteNamesAMD) +#define glGenNamesAMD GLEW_GET_FUN(__glewGenNamesAMD) +#define glIsNameAMD GLEW_GET_FUN(__glewIsNameAMD) + +#define GLEW_AMD_name_gen_delete GLEW_GET_VAR(__GLEW_AMD_name_gen_delete) + +#endif /* GL_AMD_name_gen_delete */ + +/* ---------------------- GL_AMD_occlusion_query_event --------------------- */ + +#ifndef GL_AMD_occlusion_query_event +#define GL_AMD_occlusion_query_event 1 + +#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_OCCLUSION_QUERY_EVENT_MASK_AMD 0x874F +#define GL_QUERY_ALL_EVENT_BITS_AMD 0xFFFFFFFF + +typedef void (GLAPIENTRY * PFNGLQUERYOBJECTPARAMETERUIAMDPROC) (GLenum target, GLuint id, GLenum pname, GLuint param); + +#define glQueryObjectParameteruiAMD GLEW_GET_FUN(__glewQueryObjectParameteruiAMD) + +#define GLEW_AMD_occlusion_query_event GLEW_GET_VAR(__GLEW_AMD_occlusion_query_event) + +#endif /* GL_AMD_occlusion_query_event */ + +/* ----------------------- GL_AMD_performance_monitor ---------------------- */ + +#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 (GLAPIENTRY * PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor); +typedef void (GLAPIENTRY * PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint* monitors); +typedef void (GLAPIENTRY * PFNGLENDPERFMONITORAMDPROC) (GLuint monitor); +typedef void (GLAPIENTRY * PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint* monitors); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint* data, GLint *bytesWritten); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, void *data); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei* length, GLchar *counterString); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint* numCounters, GLint *maxActiveCounters, GLsizei countersSize, GLuint *counters); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei* length, GLchar *groupString); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint* numGroups, GLsizei groupsSize, GLuint *groups); +typedef void (GLAPIENTRY * PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint* counterList); + +#define glBeginPerfMonitorAMD GLEW_GET_FUN(__glewBeginPerfMonitorAMD) +#define glDeletePerfMonitorsAMD GLEW_GET_FUN(__glewDeletePerfMonitorsAMD) +#define glEndPerfMonitorAMD GLEW_GET_FUN(__glewEndPerfMonitorAMD) +#define glGenPerfMonitorsAMD GLEW_GET_FUN(__glewGenPerfMonitorsAMD) +#define glGetPerfMonitorCounterDataAMD GLEW_GET_FUN(__glewGetPerfMonitorCounterDataAMD) +#define glGetPerfMonitorCounterInfoAMD GLEW_GET_FUN(__glewGetPerfMonitorCounterInfoAMD) +#define glGetPerfMonitorCounterStringAMD GLEW_GET_FUN(__glewGetPerfMonitorCounterStringAMD) +#define glGetPerfMonitorCountersAMD GLEW_GET_FUN(__glewGetPerfMonitorCountersAMD) +#define glGetPerfMonitorGroupStringAMD GLEW_GET_FUN(__glewGetPerfMonitorGroupStringAMD) +#define glGetPerfMonitorGroupsAMD GLEW_GET_FUN(__glewGetPerfMonitorGroupsAMD) +#define glSelectPerfMonitorCountersAMD GLEW_GET_FUN(__glewSelectPerfMonitorCountersAMD) + +#define GLEW_AMD_performance_monitor GLEW_GET_VAR(__GLEW_AMD_performance_monitor) + +#endif /* GL_AMD_performance_monitor */ + +/* -------------------------- GL_AMD_pinned_memory ------------------------- */ + +#ifndef GL_AMD_pinned_memory +#define GL_AMD_pinned_memory 1 + +#define GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD 0x9160 + +#define GLEW_AMD_pinned_memory GLEW_GET_VAR(__GLEW_AMD_pinned_memory) + +#endif /* GL_AMD_pinned_memory */ + +/* ----------------------- GL_AMD_program_binary_Z400 ---------------------- */ + +#ifndef GL_AMD_program_binary_Z400 +#define GL_AMD_program_binary_Z400 1 + +#define GL_Z400_BINARY_AMD 0x8740 + +#define GLEW_AMD_program_binary_Z400 GLEW_GET_VAR(__GLEW_AMD_program_binary_Z400) + +#endif /* GL_AMD_program_binary_Z400 */ + +/* ----------------------- GL_AMD_query_buffer_object ---------------------- */ + +#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 + +#define GLEW_AMD_query_buffer_object GLEW_GET_VAR(__GLEW_AMD_query_buffer_object) + +#endif /* GL_AMD_query_buffer_object */ + +/* ------------------------ GL_AMD_sample_positions ------------------------ */ + +#ifndef GL_AMD_sample_positions +#define GL_AMD_sample_positions 1 + +#define GL_SUBSAMPLE_DISTANCE_AMD 0x883F + +typedef void (GLAPIENTRY * PFNGLSETMULTISAMPLEFVAMDPROC) (GLenum pname, GLuint index, const GLfloat* val); + +#define glSetMultisamplefvAMD GLEW_GET_FUN(__glewSetMultisamplefvAMD) + +#define GLEW_AMD_sample_positions GLEW_GET_VAR(__GLEW_AMD_sample_positions) + +#endif /* GL_AMD_sample_positions */ + +/* ------------------ GL_AMD_seamless_cubemap_per_texture ------------------ */ + +#ifndef GL_AMD_seamless_cubemap_per_texture +#define GL_AMD_seamless_cubemap_per_texture 1 + +#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F + +#define GLEW_AMD_seamless_cubemap_per_texture GLEW_GET_VAR(__GLEW_AMD_seamless_cubemap_per_texture) + +#endif /* GL_AMD_seamless_cubemap_per_texture */ + +/* -------------------- GL_AMD_shader_atomic_counter_ops ------------------- */ + +#ifndef GL_AMD_shader_atomic_counter_ops +#define GL_AMD_shader_atomic_counter_ops 1 + +#define GLEW_AMD_shader_atomic_counter_ops GLEW_GET_VAR(__GLEW_AMD_shader_atomic_counter_ops) + +#endif /* GL_AMD_shader_atomic_counter_ops */ + +/* -------------------------- GL_AMD_shader_ballot ------------------------- */ + +#ifndef GL_AMD_shader_ballot +#define GL_AMD_shader_ballot 1 + +#define GLEW_AMD_shader_ballot GLEW_GET_VAR(__GLEW_AMD_shader_ballot) + +#endif /* GL_AMD_shader_ballot */ + +/* ---------------- GL_AMD_shader_explicit_vertex_parameter ---------------- */ + +#ifndef GL_AMD_shader_explicit_vertex_parameter +#define GL_AMD_shader_explicit_vertex_parameter 1 + +#define GLEW_AMD_shader_explicit_vertex_parameter GLEW_GET_VAR(__GLEW_AMD_shader_explicit_vertex_parameter) + +#endif /* GL_AMD_shader_explicit_vertex_parameter */ + +/* ---------------------- GL_AMD_shader_stencil_export --------------------- */ + +#ifndef GL_AMD_shader_stencil_export +#define GL_AMD_shader_stencil_export 1 + +#define GLEW_AMD_shader_stencil_export GLEW_GET_VAR(__GLEW_AMD_shader_stencil_export) + +#endif /* GL_AMD_shader_stencil_export */ + +/* ------------------- GL_AMD_shader_stencil_value_export ------------------ */ + +#ifndef GL_AMD_shader_stencil_value_export +#define GL_AMD_shader_stencil_value_export 1 + +#define GLEW_AMD_shader_stencil_value_export GLEW_GET_VAR(__GLEW_AMD_shader_stencil_value_export) + +#endif /* GL_AMD_shader_stencil_value_export */ + +/* ---------------------- GL_AMD_shader_trinary_minmax --------------------- */ + +#ifndef GL_AMD_shader_trinary_minmax +#define GL_AMD_shader_trinary_minmax 1 + +#define GLEW_AMD_shader_trinary_minmax GLEW_GET_VAR(__GLEW_AMD_shader_trinary_minmax) + +#endif /* GL_AMD_shader_trinary_minmax */ + +/* ------------------------- GL_AMD_sparse_texture ------------------------- */ + +#ifndef GL_AMD_sparse_texture +#define GL_AMD_sparse_texture 1 + +#define GL_TEXTURE_STORAGE_SPARSE_BIT_AMD 0x00000001 +#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 + +typedef void (GLAPIENTRY * PFNGLTEXSTORAGESPARSEAMDPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGESPARSEAMDPROC) (GLuint texture, GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); + +#define glTexStorageSparseAMD GLEW_GET_FUN(__glewTexStorageSparseAMD) +#define glTextureStorageSparseAMD GLEW_GET_FUN(__glewTextureStorageSparseAMD) + +#define GLEW_AMD_sparse_texture GLEW_GET_VAR(__GLEW_AMD_sparse_texture) + +#endif /* GL_AMD_sparse_texture */ + +/* ------------------- GL_AMD_stencil_operation_extended ------------------- */ + +#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 (GLAPIENTRY * PFNGLSTENCILOPVALUEAMDPROC) (GLenum face, GLuint value); + +#define glStencilOpValueAMD GLEW_GET_FUN(__glewStencilOpValueAMD) + +#define GLEW_AMD_stencil_operation_extended GLEW_GET_VAR(__GLEW_AMD_stencil_operation_extended) + +#endif /* GL_AMD_stencil_operation_extended */ + +/* --------------------- GL_AMD_texture_gather_bias_lod -------------------- */ + +#ifndef GL_AMD_texture_gather_bias_lod +#define GL_AMD_texture_gather_bias_lod 1 + +#define GLEW_AMD_texture_gather_bias_lod GLEW_GET_VAR(__GLEW_AMD_texture_gather_bias_lod) + +#endif /* GL_AMD_texture_gather_bias_lod */ + +/* ------------------------ GL_AMD_texture_texture4 ------------------------ */ + +#ifndef GL_AMD_texture_texture4 +#define GL_AMD_texture_texture4 1 + +#define GLEW_AMD_texture_texture4 GLEW_GET_VAR(__GLEW_AMD_texture_texture4) + +#endif /* GL_AMD_texture_texture4 */ + +/* --------------- GL_AMD_transform_feedback3_lines_triangles -------------- */ + +#ifndef GL_AMD_transform_feedback3_lines_triangles +#define GL_AMD_transform_feedback3_lines_triangles 1 + +#define GLEW_AMD_transform_feedback3_lines_triangles GLEW_GET_VAR(__GLEW_AMD_transform_feedback3_lines_triangles) + +#endif /* GL_AMD_transform_feedback3_lines_triangles */ + +/* ----------------------- GL_AMD_transform_feedback4 ---------------------- */ + +#ifndef GL_AMD_transform_feedback4 +#define GL_AMD_transform_feedback4 1 + +#define GL_STREAM_RASTERIZATION_AMD 0x91A0 + +#define GLEW_AMD_transform_feedback4 GLEW_GET_VAR(__GLEW_AMD_transform_feedback4) + +#endif /* GL_AMD_transform_feedback4 */ + +/* ----------------------- GL_AMD_vertex_shader_layer ---------------------- */ + +#ifndef GL_AMD_vertex_shader_layer +#define GL_AMD_vertex_shader_layer 1 + +#define GLEW_AMD_vertex_shader_layer GLEW_GET_VAR(__GLEW_AMD_vertex_shader_layer) + +#endif /* GL_AMD_vertex_shader_layer */ + +/* -------------------- GL_AMD_vertex_shader_tessellator ------------------- */ + +#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 (GLAPIENTRY * PFNGLTESSELLATIONFACTORAMDPROC) (GLfloat factor); +typedef void (GLAPIENTRY * PFNGLTESSELLATIONMODEAMDPROC) (GLenum mode); + +#define glTessellationFactorAMD GLEW_GET_FUN(__glewTessellationFactorAMD) +#define glTessellationModeAMD GLEW_GET_FUN(__glewTessellationModeAMD) + +#define GLEW_AMD_vertex_shader_tessellator GLEW_GET_VAR(__GLEW_AMD_vertex_shader_tessellator) + +#endif /* GL_AMD_vertex_shader_tessellator */ + +/* ------------------ GL_AMD_vertex_shader_viewport_index ------------------ */ + +#ifndef GL_AMD_vertex_shader_viewport_index +#define GL_AMD_vertex_shader_viewport_index 1 + +#define GLEW_AMD_vertex_shader_viewport_index GLEW_GET_VAR(__GLEW_AMD_vertex_shader_viewport_index) + +#endif /* GL_AMD_vertex_shader_viewport_index */ + +/* -------------------- GL_ANDROID_extension_pack_es31a -------------------- */ + +#ifndef GL_ANDROID_extension_pack_es31a +#define GL_ANDROID_extension_pack_es31a 1 + +#define GLEW_ANDROID_extension_pack_es31a GLEW_GET_VAR(__GLEW_ANDROID_extension_pack_es31a) + +#endif /* GL_ANDROID_extension_pack_es31a */ + +/* ------------------------- GL_ANGLE_depth_texture ------------------------ */ + +#ifndef GL_ANGLE_depth_texture +#define GL_ANGLE_depth_texture 1 + +#define GLEW_ANGLE_depth_texture GLEW_GET_VAR(__GLEW_ANGLE_depth_texture) + +#endif /* GL_ANGLE_depth_texture */ + +/* ----------------------- GL_ANGLE_framebuffer_blit ----------------------- */ + +#ifndef GL_ANGLE_framebuffer_blit +#define GL_ANGLE_framebuffer_blit 1 + +#define GL_DRAW_FRAMEBUFFER_BINDING_ANGLE 0x8CA6 +#define GL_READ_FRAMEBUFFER_ANGLE 0x8CA8 +#define GL_DRAW_FRAMEBUFFER_ANGLE 0x8CA9 +#define GL_READ_FRAMEBUFFER_BINDING_ANGLE 0x8CAA + +typedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFERANGLEPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); + +#define glBlitFramebufferANGLE GLEW_GET_FUN(__glewBlitFramebufferANGLE) + +#define GLEW_ANGLE_framebuffer_blit GLEW_GET_VAR(__GLEW_ANGLE_framebuffer_blit) + +#endif /* GL_ANGLE_framebuffer_blit */ + +/* -------------------- GL_ANGLE_framebuffer_multisample ------------------- */ + +#ifndef GL_ANGLE_framebuffer_multisample +#define GL_ANGLE_framebuffer_multisample 1 + +#define GL_RENDERBUFFER_SAMPLES_ANGLE 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_ANGLE 0x8D56 +#define GL_MAX_SAMPLES_ANGLE 0x8D57 + +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); + +#define glRenderbufferStorageMultisampleANGLE GLEW_GET_FUN(__glewRenderbufferStorageMultisampleANGLE) + +#define GLEW_ANGLE_framebuffer_multisample GLEW_GET_VAR(__GLEW_ANGLE_framebuffer_multisample) + +#endif /* GL_ANGLE_framebuffer_multisample */ + +/* ----------------------- GL_ANGLE_instanced_arrays ----------------------- */ + +#ifndef GL_ANGLE_instanced_arrays +#define GL_ANGLE_instanced_arrays 1 + +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE 0x88FE + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDANGLEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDANGLEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORANGLEPROC) (GLuint index, GLuint divisor); + +#define glDrawArraysInstancedANGLE GLEW_GET_FUN(__glewDrawArraysInstancedANGLE) +#define glDrawElementsInstancedANGLE GLEW_GET_FUN(__glewDrawElementsInstancedANGLE) +#define glVertexAttribDivisorANGLE GLEW_GET_FUN(__glewVertexAttribDivisorANGLE) + +#define GLEW_ANGLE_instanced_arrays GLEW_GET_VAR(__GLEW_ANGLE_instanced_arrays) + +#endif /* GL_ANGLE_instanced_arrays */ + +/* -------------------- GL_ANGLE_pack_reverse_row_order -------------------- */ + +#ifndef GL_ANGLE_pack_reverse_row_order +#define GL_ANGLE_pack_reverse_row_order 1 + +#define GL_PACK_REVERSE_ROW_ORDER_ANGLE 0x93A4 + +#define GLEW_ANGLE_pack_reverse_row_order GLEW_GET_VAR(__GLEW_ANGLE_pack_reverse_row_order) + +#endif /* GL_ANGLE_pack_reverse_row_order */ + +/* ------------------------ GL_ANGLE_program_binary ------------------------ */ + +#ifndef GL_ANGLE_program_binary +#define GL_ANGLE_program_binary 1 + +#define GL_PROGRAM_BINARY_ANGLE 0x93A6 + +#define GLEW_ANGLE_program_binary GLEW_GET_VAR(__GLEW_ANGLE_program_binary) + +#endif /* GL_ANGLE_program_binary */ + +/* ------------------- GL_ANGLE_texture_compression_dxt1 ------------------- */ + +#ifndef GL_ANGLE_texture_compression_dxt1 +#define GL_ANGLE_texture_compression_dxt1 1 + +#define GL_COMPRESSED_RGB_S3TC_DXT1_ANGLE 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_ANGLE 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3 + +#define GLEW_ANGLE_texture_compression_dxt1 GLEW_GET_VAR(__GLEW_ANGLE_texture_compression_dxt1) + +#endif /* GL_ANGLE_texture_compression_dxt1 */ + +/* ------------------- GL_ANGLE_texture_compression_dxt3 ------------------- */ + +#ifndef GL_ANGLE_texture_compression_dxt3 +#define GL_ANGLE_texture_compression_dxt3 1 + +#define GL_COMPRESSED_RGB_S3TC_DXT1_ANGLE 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_ANGLE 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3 + +#define GLEW_ANGLE_texture_compression_dxt3 GLEW_GET_VAR(__GLEW_ANGLE_texture_compression_dxt3) + +#endif /* GL_ANGLE_texture_compression_dxt3 */ + +/* ------------------- GL_ANGLE_texture_compression_dxt5 ------------------- */ + +#ifndef GL_ANGLE_texture_compression_dxt5 +#define GL_ANGLE_texture_compression_dxt5 1 + +#define GL_COMPRESSED_RGB_S3TC_DXT1_ANGLE 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_ANGLE 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3 + +#define GLEW_ANGLE_texture_compression_dxt5 GLEW_GET_VAR(__GLEW_ANGLE_texture_compression_dxt5) + +#endif /* GL_ANGLE_texture_compression_dxt5 */ + +/* ------------------------- GL_ANGLE_texture_usage ------------------------ */ + +#ifndef GL_ANGLE_texture_usage +#define GL_ANGLE_texture_usage 1 + +#define GL_TEXTURE_USAGE_ANGLE 0x93A2 +#define GL_FRAMEBUFFER_ATTACHMENT_ANGLE 0x93A3 + +#define GLEW_ANGLE_texture_usage GLEW_GET_VAR(__GLEW_ANGLE_texture_usage) + +#endif /* GL_ANGLE_texture_usage */ + +/* -------------------------- GL_ANGLE_timer_query ------------------------- */ + +#ifndef GL_ANGLE_timer_query +#define GL_ANGLE_timer_query 1 + +#define GL_QUERY_COUNTER_BITS_ANGLE 0x8864 +#define GL_CURRENT_QUERY_ANGLE 0x8865 +#define GL_QUERY_RESULT_ANGLE 0x8866 +#define GL_QUERY_RESULT_AVAILABLE_ANGLE 0x8867 +#define GL_TIME_ELAPSED_ANGLE 0x88BF +#define GL_TIMESTAMP_ANGLE 0x8E28 + +typedef void (GLAPIENTRY * PFNGLBEGINQUERYANGLEPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETEQUERIESANGLEPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLENDQUERYANGLEPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLGENQUERIESANGLEPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTI64VANGLEPROC) (GLuint id, GLenum pname, GLint64* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTIVANGLEPROC) (GLuint id, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUI64VANGLEPROC) (GLuint id, GLenum pname, GLuint64* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUIVANGLEPROC) (GLuint id, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYIVANGLEPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISQUERYANGLEPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLQUERYCOUNTERANGLEPROC) (GLuint id, GLenum target); + +#define glBeginQueryANGLE GLEW_GET_FUN(__glewBeginQueryANGLE) +#define glDeleteQueriesANGLE GLEW_GET_FUN(__glewDeleteQueriesANGLE) +#define glEndQueryANGLE GLEW_GET_FUN(__glewEndQueryANGLE) +#define glGenQueriesANGLE GLEW_GET_FUN(__glewGenQueriesANGLE) +#define glGetQueryObjecti64vANGLE GLEW_GET_FUN(__glewGetQueryObjecti64vANGLE) +#define glGetQueryObjectivANGLE GLEW_GET_FUN(__glewGetQueryObjectivANGLE) +#define glGetQueryObjectui64vANGLE GLEW_GET_FUN(__glewGetQueryObjectui64vANGLE) +#define glGetQueryObjectuivANGLE GLEW_GET_FUN(__glewGetQueryObjectuivANGLE) +#define glGetQueryivANGLE GLEW_GET_FUN(__glewGetQueryivANGLE) +#define glIsQueryANGLE GLEW_GET_FUN(__glewIsQueryANGLE) +#define glQueryCounterANGLE GLEW_GET_FUN(__glewQueryCounterANGLE) + +#define GLEW_ANGLE_timer_query GLEW_GET_VAR(__GLEW_ANGLE_timer_query) + +#endif /* GL_ANGLE_timer_query */ + +/* ------------------- GL_ANGLE_translated_shader_source ------------------- */ + +#ifndef GL_ANGLE_translated_shader_source +#define GL_ANGLE_translated_shader_source 1 + +#define GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE 0x93A0 + +typedef void (GLAPIENTRY * PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC) (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source); + +#define glGetTranslatedShaderSourceANGLE GLEW_GET_FUN(__glewGetTranslatedShaderSourceANGLE) + +#define GLEW_ANGLE_translated_shader_source GLEW_GET_VAR(__GLEW_ANGLE_translated_shader_source) + +#endif /* GL_ANGLE_translated_shader_source */ + +/* ----------------------- GL_APPLE_aux_depth_stencil ---------------------- */ + +#ifndef GL_APPLE_aux_depth_stencil +#define GL_APPLE_aux_depth_stencil 1 + +#define GL_AUX_DEPTH_STENCIL_APPLE 0x8A14 + +#define GLEW_APPLE_aux_depth_stencil GLEW_GET_VAR(__GLEW_APPLE_aux_depth_stencil) + +#endif /* GL_APPLE_aux_depth_stencil */ + +/* ------------------------ GL_APPLE_client_storage ------------------------ */ + +#ifndef GL_APPLE_client_storage +#define GL_APPLE_client_storage 1 + +#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2 + +#define GLEW_APPLE_client_storage GLEW_GET_VAR(__GLEW_APPLE_client_storage) + +#endif /* GL_APPLE_client_storage */ + +/* ------------------------- GL_APPLE_clip_distance ------------------------ */ + +#ifndef GL_APPLE_clip_distance +#define GL_APPLE_clip_distance 1 + +#define GL_MAX_CLIP_DISTANCES_APPLE 0x0D32 +#define GL_CLIP_DISTANCE0_APPLE 0x3000 +#define GL_CLIP_DISTANCE1_APPLE 0x3001 +#define GL_CLIP_DISTANCE2_APPLE 0x3002 +#define GL_CLIP_DISTANCE3_APPLE 0x3003 +#define GL_CLIP_DISTANCE4_APPLE 0x3004 +#define GL_CLIP_DISTANCE5_APPLE 0x3005 +#define GL_CLIP_DISTANCE6_APPLE 0x3006 +#define GL_CLIP_DISTANCE7_APPLE 0x3007 + +#define GLEW_APPLE_clip_distance GLEW_GET_VAR(__GLEW_APPLE_clip_distance) + +#endif /* GL_APPLE_clip_distance */ + +/* ------------------- GL_APPLE_color_buffer_packed_float ------------------ */ + +#ifndef GL_APPLE_color_buffer_packed_float +#define GL_APPLE_color_buffer_packed_float 1 + +#define GLEW_APPLE_color_buffer_packed_float GLEW_GET_VAR(__GLEW_APPLE_color_buffer_packed_float) + +#endif /* GL_APPLE_color_buffer_packed_float */ + +/* ---------------------- GL_APPLE_copy_texture_levels --------------------- */ + +#ifndef GL_APPLE_copy_texture_levels +#define GL_APPLE_copy_texture_levels 1 + +typedef void (GLAPIENTRY * PFNGLCOPYTEXTURELEVELSAPPLEPROC) (GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount); + +#define glCopyTextureLevelsAPPLE GLEW_GET_FUN(__glewCopyTextureLevelsAPPLE) + +#define GLEW_APPLE_copy_texture_levels GLEW_GET_VAR(__GLEW_APPLE_copy_texture_levels) + +#endif /* GL_APPLE_copy_texture_levels */ + +/* ------------------------- GL_APPLE_element_array ------------------------ */ + +#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 (GLAPIENTRY * PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); +typedef void (GLAPIENTRY * PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const void *pointer); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint* first, const GLsizei *count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint* first, const GLsizei *count, GLsizei primcount); + +#define glDrawElementArrayAPPLE GLEW_GET_FUN(__glewDrawElementArrayAPPLE) +#define glDrawRangeElementArrayAPPLE GLEW_GET_FUN(__glewDrawRangeElementArrayAPPLE) +#define glElementPointerAPPLE GLEW_GET_FUN(__glewElementPointerAPPLE) +#define glMultiDrawElementArrayAPPLE GLEW_GET_FUN(__glewMultiDrawElementArrayAPPLE) +#define glMultiDrawRangeElementArrayAPPLE GLEW_GET_FUN(__glewMultiDrawRangeElementArrayAPPLE) + +#define GLEW_APPLE_element_array GLEW_GET_VAR(__GLEW_APPLE_element_array) + +#endif /* GL_APPLE_element_array */ + +/* ----------------------------- GL_APPLE_fence ---------------------------- */ + +#ifndef GL_APPLE_fence +#define GL_APPLE_fence 1 + +#define GL_DRAW_PIXELS_APPLE 0x8A0A +#define GL_FENCE_APPLE 0x8A0B + +typedef void (GLAPIENTRY * PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint* fences); +typedef void (GLAPIENTRY * PFNGLFINISHFENCEAPPLEPROC) (GLuint fence); +typedef void (GLAPIENTRY * PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name); +typedef void (GLAPIENTRY * PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint* fences); +typedef GLboolean (GLAPIENTRY * PFNGLISFENCEAPPLEPROC) (GLuint fence); +typedef void (GLAPIENTRY * PFNGLSETFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (GLAPIENTRY * PFNGLTESTFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (GLAPIENTRY * PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name); + +#define glDeleteFencesAPPLE GLEW_GET_FUN(__glewDeleteFencesAPPLE) +#define glFinishFenceAPPLE GLEW_GET_FUN(__glewFinishFenceAPPLE) +#define glFinishObjectAPPLE GLEW_GET_FUN(__glewFinishObjectAPPLE) +#define glGenFencesAPPLE GLEW_GET_FUN(__glewGenFencesAPPLE) +#define glIsFenceAPPLE GLEW_GET_FUN(__glewIsFenceAPPLE) +#define glSetFenceAPPLE GLEW_GET_FUN(__glewSetFenceAPPLE) +#define glTestFenceAPPLE GLEW_GET_FUN(__glewTestFenceAPPLE) +#define glTestObjectAPPLE GLEW_GET_FUN(__glewTestObjectAPPLE) + +#define GLEW_APPLE_fence GLEW_GET_VAR(__GLEW_APPLE_fence) + +#endif /* GL_APPLE_fence */ + +/* ------------------------- GL_APPLE_float_pixels ------------------------- */ + +#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 + +#define GLEW_APPLE_float_pixels GLEW_GET_VAR(__GLEW_APPLE_float_pixels) + +#endif /* GL_APPLE_float_pixels */ + +/* ---------------------- GL_APPLE_flush_buffer_range ---------------------- */ + +#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 (GLAPIENTRY * PFNGLBUFFERPARAMETERIAPPLEPROC) (GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, GLintptr offset, GLsizeiptr size); + +#define glBufferParameteriAPPLE GLEW_GET_FUN(__glewBufferParameteriAPPLE) +#define glFlushMappedBufferRangeAPPLE GLEW_GET_FUN(__glewFlushMappedBufferRangeAPPLE) + +#define GLEW_APPLE_flush_buffer_range GLEW_GET_VAR(__GLEW_APPLE_flush_buffer_range) + +#endif /* GL_APPLE_flush_buffer_range */ + +/* -------------------- GL_APPLE_framebuffer_multisample ------------------- */ + +#ifndef GL_APPLE_framebuffer_multisample +#define GL_APPLE_framebuffer_multisample 1 + +#define GL_DRAW_FRAMEBUFFER_BINDING_APPLE 0x8CA6 +#define GL_READ_FRAMEBUFFER_APPLE 0x8CA8 +#define GL_DRAW_FRAMEBUFFER_APPLE 0x8CA9 +#define GL_READ_FRAMEBUFFER_BINDING_APPLE 0x8CAA +#define GL_RENDERBUFFER_SAMPLES_APPLE 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_APPLE 0x8D56 +#define GL_MAX_SAMPLES_APPLE 0x8D57 + +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEAPPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLEPROC) (void); + +#define glRenderbufferStorageMultisampleAPPLE GLEW_GET_FUN(__glewRenderbufferStorageMultisampleAPPLE) +#define glResolveMultisampleFramebufferAPPLE GLEW_GET_FUN(__glewResolveMultisampleFramebufferAPPLE) + +#define GLEW_APPLE_framebuffer_multisample GLEW_GET_VAR(__GLEW_APPLE_framebuffer_multisample) + +#endif /* GL_APPLE_framebuffer_multisample */ + +/* ----------------------- GL_APPLE_object_purgeable ----------------------- */ + +#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 void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERIVAPPLEPROC) (GLenum objectType, GLuint name, GLenum pname, GLint* params); +typedef GLenum (GLAPIENTRY * PFNGLOBJECTPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option); +typedef GLenum (GLAPIENTRY * PFNGLOBJECTUNPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option); + +#define glGetObjectParameterivAPPLE GLEW_GET_FUN(__glewGetObjectParameterivAPPLE) +#define glObjectPurgeableAPPLE GLEW_GET_FUN(__glewObjectPurgeableAPPLE) +#define glObjectUnpurgeableAPPLE GLEW_GET_FUN(__glewObjectUnpurgeableAPPLE) + +#define GLEW_APPLE_object_purgeable GLEW_GET_VAR(__GLEW_APPLE_object_purgeable) + +#endif /* GL_APPLE_object_purgeable */ + +/* ------------------------- GL_APPLE_pixel_buffer ------------------------- */ + +#ifndef GL_APPLE_pixel_buffer +#define GL_APPLE_pixel_buffer 1 + +#define GL_MIN_PBUFFER_VIEWPORT_DIMS_APPLE 0x8A10 + +#define GLEW_APPLE_pixel_buffer GLEW_GET_VAR(__GLEW_APPLE_pixel_buffer) + +#endif /* GL_APPLE_pixel_buffer */ + +/* ---------------------------- GL_APPLE_rgb_422 --------------------------- */ + +#ifndef GL_APPLE_rgb_422 +#define GL_APPLE_rgb_422 1 + +#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA +#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB +#define GL_RGB_422_APPLE 0x8A1F +#define GL_RGB_RAW_422_APPLE 0x8A51 + +#define GLEW_APPLE_rgb_422 GLEW_GET_VAR(__GLEW_APPLE_rgb_422) + +#endif /* GL_APPLE_rgb_422 */ + +/* --------------------------- GL_APPLE_row_bytes -------------------------- */ + +#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 + +#define GLEW_APPLE_row_bytes GLEW_GET_VAR(__GLEW_APPLE_row_bytes) + +#endif /* GL_APPLE_row_bytes */ + +/* ------------------------ GL_APPLE_specular_vector ----------------------- */ + +#ifndef GL_APPLE_specular_vector +#define GL_APPLE_specular_vector 1 + +#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0 + +#define GLEW_APPLE_specular_vector GLEW_GET_VAR(__GLEW_APPLE_specular_vector) + +#endif /* GL_APPLE_specular_vector */ + +/* ----------------------------- GL_APPLE_sync ----------------------------- */ + +#ifndef GL_APPLE_sync +#define GL_APPLE_sync 1 + +#define GL_SYNC_FLUSH_COMMANDS_BIT_APPLE 0x00000001 +#define GL_SYNC_OBJECT_APPLE 0x8A53 +#define GL_MAX_SERVER_WAIT_TIMEOUT_APPLE 0x9111 +#define GL_OBJECT_TYPE_APPLE 0x9112 +#define GL_SYNC_CONDITION_APPLE 0x9113 +#define GL_SYNC_STATUS_APPLE 0x9114 +#define GL_SYNC_FLAGS_APPLE 0x9115 +#define GL_SYNC_FENCE_APPLE 0x9116 +#define GL_SYNC_GPU_COMMANDS_COMPLETE_APPLE 0x9117 +#define GL_UNSIGNALED_APPLE 0x9118 +#define GL_SIGNALED_APPLE 0x9119 +#define GL_ALREADY_SIGNALED_APPLE 0x911A +#define GL_TIMEOUT_EXPIRED_APPLE 0x911B +#define GL_CONDITION_SATISFIED_APPLE 0x911C +#define GL_WAIT_FAILED_APPLE 0x911D +#define GL_TIMEOUT_IGNORED_APPLE 0xFFFFFFFFFFFFFFFFull + +typedef GLenum (GLAPIENTRY * PFNGLCLIENTWAITSYNCAPPLEPROC) (GLsync GLsync, GLbitfield flags, GLuint64 timeout); +typedef void (GLAPIENTRY * PFNGLDELETESYNCAPPLEPROC) (GLsync GLsync); +typedef GLsync (GLAPIENTRY * PFNGLFENCESYNCAPPLEPROC) (GLenum condition, GLbitfield flags); +typedef void (GLAPIENTRY * PFNGLGETINTEGER64VAPPLEPROC) (GLenum pname, GLint64* params); +typedef void (GLAPIENTRY * PFNGLGETSYNCIVAPPLEPROC) (GLsync GLsync, GLenum pname, GLsizei bufSize, GLsizei* length, GLint *values); +typedef GLboolean (GLAPIENTRY * PFNGLISSYNCAPPLEPROC) (GLsync GLsync); +typedef void (GLAPIENTRY * PFNGLWAITSYNCAPPLEPROC) (GLsync GLsync, GLbitfield flags, GLuint64 timeout); + +#define glClientWaitSyncAPPLE GLEW_GET_FUN(__glewClientWaitSyncAPPLE) +#define glDeleteSyncAPPLE GLEW_GET_FUN(__glewDeleteSyncAPPLE) +#define glFenceSyncAPPLE GLEW_GET_FUN(__glewFenceSyncAPPLE) +#define glGetInteger64vAPPLE GLEW_GET_FUN(__glewGetInteger64vAPPLE) +#define glGetSyncivAPPLE GLEW_GET_FUN(__glewGetSyncivAPPLE) +#define glIsSyncAPPLE GLEW_GET_FUN(__glewIsSyncAPPLE) +#define glWaitSyncAPPLE GLEW_GET_FUN(__glewWaitSyncAPPLE) + +#define GLEW_APPLE_sync GLEW_GET_VAR(__GLEW_APPLE_sync) + +#endif /* GL_APPLE_sync */ + +/* -------------------- GL_APPLE_texture_2D_limited_npot ------------------- */ + +#ifndef GL_APPLE_texture_2D_limited_npot +#define GL_APPLE_texture_2D_limited_npot 1 + +#define GLEW_APPLE_texture_2D_limited_npot GLEW_GET_VAR(__GLEW_APPLE_texture_2D_limited_npot) + +#endif /* GL_APPLE_texture_2D_limited_npot */ + +/* -------------------- GL_APPLE_texture_format_BGRA8888 ------------------- */ + +#ifndef GL_APPLE_texture_format_BGRA8888 +#define GL_APPLE_texture_format_BGRA8888 1 + +#define GL_BGRA_EXT 0x80E1 +#define GL_BGRA8_EXT 0x93A1 + +#define GLEW_APPLE_texture_format_BGRA8888 GLEW_GET_VAR(__GLEW_APPLE_texture_format_BGRA8888) + +#endif /* GL_APPLE_texture_format_BGRA8888 */ + +/* ----------------------- GL_APPLE_texture_max_level ---------------------- */ + +#ifndef GL_APPLE_texture_max_level +#define GL_APPLE_texture_max_level 1 + +#define GL_TEXTURE_MAX_LEVEL_APPLE 0x813D + +#define GLEW_APPLE_texture_max_level GLEW_GET_VAR(__GLEW_APPLE_texture_max_level) + +#endif /* GL_APPLE_texture_max_level */ + +/* --------------------- GL_APPLE_texture_packed_float --------------------- */ + +#ifndef GL_APPLE_texture_packed_float +#define GL_APPLE_texture_packed_float 1 + +#define GL_R11F_G11F_B10F_APPLE 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV_APPLE 0x8C3B +#define GL_RGB9_E5_APPLE 0x8C3D +#define GL_UNSIGNED_INT_5_9_9_9_REV_APPLE 0x8C3E + +#define GLEW_APPLE_texture_packed_float GLEW_GET_VAR(__GLEW_APPLE_texture_packed_float) + +#endif /* GL_APPLE_texture_packed_float */ + +/* ------------------------- GL_APPLE_texture_range ------------------------ */ + +#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 (GLAPIENTRY * PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC) (GLenum target, GLenum pname, void **params); +typedef void (GLAPIENTRY * PFNGLTEXTURERANGEAPPLEPROC) (GLenum target, GLsizei length, void *pointer); + +#define glGetTexParameterPointervAPPLE GLEW_GET_FUN(__glewGetTexParameterPointervAPPLE) +#define glTextureRangeAPPLE GLEW_GET_FUN(__glewTextureRangeAPPLE) + +#define GLEW_APPLE_texture_range GLEW_GET_VAR(__GLEW_APPLE_texture_range) + +#endif /* GL_APPLE_texture_range */ + +/* ------------------------ GL_APPLE_transform_hint ------------------------ */ + +#ifndef GL_APPLE_transform_hint +#define GL_APPLE_transform_hint 1 + +#define GL_TRANSFORM_HINT_APPLE 0x85B1 + +#define GLEW_APPLE_transform_hint GLEW_GET_VAR(__GLEW_APPLE_transform_hint) + +#endif /* GL_APPLE_transform_hint */ + +/* ---------------------- GL_APPLE_vertex_array_object --------------------- */ + +#ifndef GL_APPLE_vertex_array_object +#define GL_APPLE_vertex_array_object 1 + +#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5 + +typedef void (GLAPIENTRY * PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array); +typedef void (GLAPIENTRY * PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint* arrays); +typedef void (GLAPIENTRY * PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint* arrays); +typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array); + +#define glBindVertexArrayAPPLE GLEW_GET_FUN(__glewBindVertexArrayAPPLE) +#define glDeleteVertexArraysAPPLE GLEW_GET_FUN(__glewDeleteVertexArraysAPPLE) +#define glGenVertexArraysAPPLE GLEW_GET_FUN(__glewGenVertexArraysAPPLE) +#define glIsVertexArrayAPPLE GLEW_GET_FUN(__glewIsVertexArrayAPPLE) + +#define GLEW_APPLE_vertex_array_object GLEW_GET_VAR(__GLEW_APPLE_vertex_array_object) + +#endif /* GL_APPLE_vertex_array_object */ + +/* ---------------------- GL_APPLE_vertex_array_range ---------------------- */ + +#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_MAX_VERTEX_ARRAY_RANGE_ELEMENT_APPLE 0x8520 +#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 + +typedef void (GLAPIENTRY * PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, void *pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, void *pointer); + +#define glFlushVertexArrayRangeAPPLE GLEW_GET_FUN(__glewFlushVertexArrayRangeAPPLE) +#define glVertexArrayParameteriAPPLE GLEW_GET_FUN(__glewVertexArrayParameteriAPPLE) +#define glVertexArrayRangeAPPLE GLEW_GET_FUN(__glewVertexArrayRangeAPPLE) + +#define GLEW_APPLE_vertex_array_range GLEW_GET_VAR(__GLEW_APPLE_vertex_array_range) + +#endif /* GL_APPLE_vertex_array_range */ + +/* ------------------- GL_APPLE_vertex_program_evaluators ------------------ */ + +#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 (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname); +typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXATTRIBENABLEDAPPLEPROC) (GLuint index, GLenum pname); +typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB1DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble* points); +typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB1FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat* points); +typedef void (GLAPIENTRY * 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 (GLAPIENTRY * PFNGLMAPVERTEXATTRIB2FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat* points); + +#define glDisableVertexAttribAPPLE GLEW_GET_FUN(__glewDisableVertexAttribAPPLE) +#define glEnableVertexAttribAPPLE GLEW_GET_FUN(__glewEnableVertexAttribAPPLE) +#define glIsVertexAttribEnabledAPPLE GLEW_GET_FUN(__glewIsVertexAttribEnabledAPPLE) +#define glMapVertexAttrib1dAPPLE GLEW_GET_FUN(__glewMapVertexAttrib1dAPPLE) +#define glMapVertexAttrib1fAPPLE GLEW_GET_FUN(__glewMapVertexAttrib1fAPPLE) +#define glMapVertexAttrib2dAPPLE GLEW_GET_FUN(__glewMapVertexAttrib2dAPPLE) +#define glMapVertexAttrib2fAPPLE GLEW_GET_FUN(__glewMapVertexAttrib2fAPPLE) + +#define GLEW_APPLE_vertex_program_evaluators GLEW_GET_VAR(__GLEW_APPLE_vertex_program_evaluators) + +#endif /* GL_APPLE_vertex_program_evaluators */ + +/* --------------------------- GL_APPLE_ycbcr_422 -------------------------- */ + +#ifndef GL_APPLE_ycbcr_422 +#define GL_APPLE_ycbcr_422 1 + +#define GL_YCBCR_422_APPLE 0x85B9 + +#define GLEW_APPLE_ycbcr_422 GLEW_GET_VAR(__GLEW_APPLE_ycbcr_422) + +#endif /* GL_APPLE_ycbcr_422 */ + +/* ------------------------ GL_ARB_ES2_compatibility ----------------------- */ + +#ifndef GL_ARB_ES2_compatibility +#define GL_ARB_ES2_compatibility 1 + +#define GL_FIXED 0x140C +#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B +#define GL_RGB565 0x8D62 +#define GL_LOW_FLOAT 0x8DF0 +#define GL_MEDIUM_FLOAT 0x8DF1 +#define GL_HIGH_FLOAT 0x8DF2 +#define GL_LOW_INT 0x8DF3 +#define GL_MEDIUM_INT 0x8DF4 +#define GL_HIGH_INT 0x8DF5 +#define GL_SHADER_BINARY_FORMATS 0x8DF8 +#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 +#define GL_SHADER_COMPILER 0x8DFA +#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB +#define GL_MAX_VARYING_VECTORS 0x8DFC +#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD + +typedef int GLfixed; + +typedef void (GLAPIENTRY * PFNGLCLEARDEPTHFPROC) (GLclampf d); +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEFPROC) (GLclampf n, GLclampf f); +typedef void (GLAPIENTRY * PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint* range, GLint *precision); +typedef void (GLAPIENTRY * PFNGLRELEASESHADERCOMPILERPROC) (void); +typedef void (GLAPIENTRY * PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint* shaders, GLenum binaryformat, const void*binary, GLsizei length); + +#define glClearDepthf GLEW_GET_FUN(__glewClearDepthf) +#define glDepthRangef GLEW_GET_FUN(__glewDepthRangef) +#define glGetShaderPrecisionFormat GLEW_GET_FUN(__glewGetShaderPrecisionFormat) +#define glReleaseShaderCompiler GLEW_GET_FUN(__glewReleaseShaderCompiler) +#define glShaderBinary GLEW_GET_FUN(__glewShaderBinary) + +#define GLEW_ARB_ES2_compatibility GLEW_GET_VAR(__GLEW_ARB_ES2_compatibility) + +#endif /* GL_ARB_ES2_compatibility */ + +/* ----------------------- GL_ARB_ES3_1_compatibility ---------------------- */ + +#ifndef GL_ARB_ES3_1_compatibility +#define GL_ARB_ES3_1_compatibility 1 + +typedef void (GLAPIENTRY * PFNGLMEMORYBARRIERBYREGIONPROC) (GLbitfield barriers); + +#define glMemoryBarrierByRegion GLEW_GET_FUN(__glewMemoryBarrierByRegion) + +#define GLEW_ARB_ES3_1_compatibility GLEW_GET_VAR(__GLEW_ARB_ES3_1_compatibility) + +#endif /* GL_ARB_ES3_1_compatibility */ + +/* ----------------------- GL_ARB_ES3_2_compatibility ---------------------- */ + +#ifndef GL_ARB_ES3_2_compatibility +#define GL_ARB_ES3_2_compatibility 1 + +#define GL_PRIMITIVE_BOUNDING_BOX_ARB 0x92BE +#define GL_MULTISAMPLE_LINE_WIDTH_RANGE_ARB 0x9381 +#define GL_MULTISAMPLE_LINE_WIDTH_GRANULARITY_ARB 0x9382 + +typedef void (GLAPIENTRY * PFNGLPRIMITIVEBOUNDINGBOXARBPROC) (GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW); + +#define glPrimitiveBoundingBoxARB GLEW_GET_FUN(__glewPrimitiveBoundingBoxARB) + +#define GLEW_ARB_ES3_2_compatibility GLEW_GET_VAR(__GLEW_ARB_ES3_2_compatibility) + +#endif /* GL_ARB_ES3_2_compatibility */ + +/* ------------------------ GL_ARB_ES3_compatibility ----------------------- */ + +#ifndef GL_ARB_ES3_compatibility +#define GL_ARB_ES3_compatibility 1 + +#define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF +#define GL_PRIMITIVE_RESTART_FIXED_INDEX 0x8D69 +#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE 0x8D6A +#define GL_MAX_ELEMENT_INDEX 0x8D6B +#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_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 GLEW_ARB_ES3_compatibility GLEW_GET_VAR(__GLEW_ARB_ES3_compatibility) + +#endif /* GL_ARB_ES3_compatibility */ + +/* ------------------------ GL_ARB_arrays_of_arrays ------------------------ */ + +#ifndef GL_ARB_arrays_of_arrays +#define GL_ARB_arrays_of_arrays 1 + +#define GLEW_ARB_arrays_of_arrays GLEW_GET_VAR(__GLEW_ARB_arrays_of_arrays) + +#endif /* GL_ARB_arrays_of_arrays */ + +/* -------------------------- GL_ARB_base_instance ------------------------- */ + +#ifndef GL_ARB_base_instance +#define GL_ARB_base_instance 1 + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount, GLuint baseinstance); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount, GLuint baseinstance); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount, GLint basevertex, GLuint baseinstance); + +#define glDrawArraysInstancedBaseInstance GLEW_GET_FUN(__glewDrawArraysInstancedBaseInstance) +#define glDrawElementsInstancedBaseInstance GLEW_GET_FUN(__glewDrawElementsInstancedBaseInstance) +#define glDrawElementsInstancedBaseVertexBaseInstance GLEW_GET_FUN(__glewDrawElementsInstancedBaseVertexBaseInstance) + +#define GLEW_ARB_base_instance GLEW_GET_VAR(__GLEW_ARB_base_instance) + +#endif /* GL_ARB_base_instance */ + +/* ------------------------ GL_ARB_bindless_texture ------------------------ */ + +#ifndef GL_ARB_bindless_texture +#define GL_ARB_bindless_texture 1 + +#define GL_UNSIGNED_INT64_ARB 0x140F + +typedef GLuint64 (GLAPIENTRY * PFNGLGETIMAGEHANDLEARBPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); +typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTUREHANDLEARBPROC) (GLuint texture); +typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTURESAMPLERHANDLEARBPROC) (GLuint texture, GLuint sampler); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLUI64VARBPROC) (GLuint index, GLenum pname, GLuint64EXT* params); +typedef GLboolean (GLAPIENTRY * PFNGLISIMAGEHANDLERESIDENTARBPROC) (GLuint64 handle); +typedef GLboolean (GLAPIENTRY * PFNGLISTEXTUREHANDLERESIDENTARBPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLERESIDENTARBPROC) (GLuint64 handle, GLenum access); +typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLERESIDENTARBPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC) (GLuint program, GLint location, GLuint64 value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* values); +typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64ARBPROC) (GLint location, GLuint64 value); +typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64VARBPROC) (GLint location, GLsizei count, const GLuint64* value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64ARBPROC) (GLuint index, GLuint64EXT x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64VARBPROC) (GLuint index, const GLuint64EXT* v); + +#define glGetImageHandleARB GLEW_GET_FUN(__glewGetImageHandleARB) +#define glGetTextureHandleARB GLEW_GET_FUN(__glewGetTextureHandleARB) +#define glGetTextureSamplerHandleARB GLEW_GET_FUN(__glewGetTextureSamplerHandleARB) +#define glGetVertexAttribLui64vARB GLEW_GET_FUN(__glewGetVertexAttribLui64vARB) +#define glIsImageHandleResidentARB GLEW_GET_FUN(__glewIsImageHandleResidentARB) +#define glIsTextureHandleResidentARB GLEW_GET_FUN(__glewIsTextureHandleResidentARB) +#define glMakeImageHandleNonResidentARB GLEW_GET_FUN(__glewMakeImageHandleNonResidentARB) +#define glMakeImageHandleResidentARB GLEW_GET_FUN(__glewMakeImageHandleResidentARB) +#define glMakeTextureHandleNonResidentARB GLEW_GET_FUN(__glewMakeTextureHandleNonResidentARB) +#define glMakeTextureHandleResidentARB GLEW_GET_FUN(__glewMakeTextureHandleResidentARB) +#define glProgramUniformHandleui64ARB GLEW_GET_FUN(__glewProgramUniformHandleui64ARB) +#define glProgramUniformHandleui64vARB GLEW_GET_FUN(__glewProgramUniformHandleui64vARB) +#define glUniformHandleui64ARB GLEW_GET_FUN(__glewUniformHandleui64ARB) +#define glUniformHandleui64vARB GLEW_GET_FUN(__glewUniformHandleui64vARB) +#define glVertexAttribL1ui64ARB GLEW_GET_FUN(__glewVertexAttribL1ui64ARB) +#define glVertexAttribL1ui64vARB GLEW_GET_FUN(__glewVertexAttribL1ui64vARB) + +#define GLEW_ARB_bindless_texture GLEW_GET_VAR(__GLEW_ARB_bindless_texture) + +#endif /* GL_ARB_bindless_texture */ + +/* ----------------------- GL_ARB_blend_func_extended ---------------------- */ + +#ifndef GL_ARB_blend_func_extended +#define GL_ARB_blend_func_extended 1 + +#define GL_SRC1_COLOR 0x88F9 +#define GL_ONE_MINUS_SRC1_COLOR 0x88FA +#define GL_ONE_MINUS_SRC1_ALPHA 0x88FB +#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS 0x88FC + +typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONINDEXEDPROC) (GLuint program, GLuint colorNumber, GLuint index, const GLchar * name); +typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATAINDEXPROC) (GLuint program, const GLchar * name); + +#define glBindFragDataLocationIndexed GLEW_GET_FUN(__glewBindFragDataLocationIndexed) +#define glGetFragDataIndex GLEW_GET_FUN(__glewGetFragDataIndex) + +#define GLEW_ARB_blend_func_extended GLEW_GET_VAR(__GLEW_ARB_blend_func_extended) + +#endif /* GL_ARB_blend_func_extended */ + +/* ------------------------- GL_ARB_buffer_storage ------------------------- */ + +#ifndef GL_ARB_buffer_storage +#define GL_ARB_buffer_storage 1 + +#define GL_MAP_READ_BIT 0x0001 +#define GL_MAP_WRITE_BIT 0x0002 +#define GL_MAP_PERSISTENT_BIT 0x00000040 +#define GL_MAP_COHERENT_BIT 0x00000080 +#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 + +typedef void (GLAPIENTRY * PFNGLBUFFERSTORAGEPROC) (GLenum target, GLsizeiptr size, const void *data, GLbitfield flags); + +#define glBufferStorage GLEW_GET_FUN(__glewBufferStorage) + +#define GLEW_ARB_buffer_storage GLEW_GET_VAR(__GLEW_ARB_buffer_storage) + +#endif /* GL_ARB_buffer_storage */ + +/* ---------------------------- GL_ARB_cl_event ---------------------------- */ + +#ifndef GL_ARB_cl_event +#define GL_ARB_cl_event 1 + +#define GL_SYNC_CL_EVENT_ARB 0x8240 +#define GL_SYNC_CL_EVENT_COMPLETE_ARB 0x8241 + +typedef struct _cl_context *cl_context; +typedef struct _cl_event *cl_event; + +typedef GLsync (GLAPIENTRY * PFNGLCREATESYNCFROMCLEVENTARBPROC) (cl_context context, cl_event event, GLbitfield flags); + +#define glCreateSyncFromCLeventARB GLEW_GET_FUN(__glewCreateSyncFromCLeventARB) + +#define GLEW_ARB_cl_event GLEW_GET_VAR(__GLEW_ARB_cl_event) + +#endif /* GL_ARB_cl_event */ + +/* ----------------------- GL_ARB_clear_buffer_object ---------------------- */ + +#ifndef GL_ARB_clear_buffer_object +#define GL_ARB_clear_buffer_object 1 + +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERDATAPROC) (GLenum target, GLenum internalformat, GLenum format, GLenum type, const void *data); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERSUBDATAPROC) (GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); +typedef void (GLAPIENTRY * PFNGLCLEARNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data); +typedef void (GLAPIENTRY * PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); + +#define glClearBufferData GLEW_GET_FUN(__glewClearBufferData) +#define glClearBufferSubData GLEW_GET_FUN(__glewClearBufferSubData) +#define glClearNamedBufferDataEXT GLEW_GET_FUN(__glewClearNamedBufferDataEXT) +#define glClearNamedBufferSubDataEXT GLEW_GET_FUN(__glewClearNamedBufferSubDataEXT) + +#define GLEW_ARB_clear_buffer_object GLEW_GET_VAR(__GLEW_ARB_clear_buffer_object) + +#endif /* GL_ARB_clear_buffer_object */ + +/* -------------------------- GL_ARB_clear_texture ------------------------- */ + +#ifndef GL_ARB_clear_texture +#define GL_ARB_clear_texture 1 + +#define GL_CLEAR_TEXTURE 0x9365 + +typedef void (GLAPIENTRY * PFNGLCLEARTEXIMAGEPROC) (GLuint texture, GLint level, GLenum format, GLenum type, const void *data); +typedef void (GLAPIENTRY * PFNGLCLEARTEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data); + +#define glClearTexImage GLEW_GET_FUN(__glewClearTexImage) +#define glClearTexSubImage GLEW_GET_FUN(__glewClearTexSubImage) + +#define GLEW_ARB_clear_texture GLEW_GET_VAR(__GLEW_ARB_clear_texture) + +#endif /* GL_ARB_clear_texture */ + +/* -------------------------- GL_ARB_clip_control -------------------------- */ + +#ifndef GL_ARB_clip_control +#define GL_ARB_clip_control 1 + +#define GL_LOWER_LEFT 0x8CA1 +#define GL_UPPER_LEFT 0x8CA2 +#define GL_CLIP_ORIGIN 0x935C +#define GL_CLIP_DEPTH_MODE 0x935D +#define GL_NEGATIVE_ONE_TO_ONE 0x935E +#define GL_ZERO_TO_ONE 0x935F + +typedef void (GLAPIENTRY * PFNGLCLIPCONTROLPROC) (GLenum origin, GLenum depth); + +#define glClipControl GLEW_GET_FUN(__glewClipControl) + +#define GLEW_ARB_clip_control GLEW_GET_VAR(__GLEW_ARB_clip_control) + +#endif /* GL_ARB_clip_control */ + +/* ----------------------- GL_ARB_color_buffer_float ----------------------- */ + +#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 (GLAPIENTRY * PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp); + +#define glClampColorARB GLEW_GET_FUN(__glewClampColorARB) + +#define GLEW_ARB_color_buffer_float GLEW_GET_VAR(__GLEW_ARB_color_buffer_float) + +#endif /* GL_ARB_color_buffer_float */ + +/* -------------------------- GL_ARB_compatibility ------------------------- */ + +#ifndef GL_ARB_compatibility +#define GL_ARB_compatibility 1 + +#define GLEW_ARB_compatibility GLEW_GET_VAR(__GLEW_ARB_compatibility) + +#endif /* GL_ARB_compatibility */ + +/* ---------------- GL_ARB_compressed_texture_pixel_storage ---------------- */ + +#ifndef GL_ARB_compressed_texture_pixel_storage +#define GL_ARB_compressed_texture_pixel_storage 1 + +#define GL_UNPACK_COMPRESSED_BLOCK_WIDTH 0x9127 +#define GL_UNPACK_COMPRESSED_BLOCK_HEIGHT 0x9128 +#define GL_UNPACK_COMPRESSED_BLOCK_DEPTH 0x9129 +#define GL_UNPACK_COMPRESSED_BLOCK_SIZE 0x912A +#define GL_PACK_COMPRESSED_BLOCK_WIDTH 0x912B +#define GL_PACK_COMPRESSED_BLOCK_HEIGHT 0x912C +#define GL_PACK_COMPRESSED_BLOCK_DEPTH 0x912D +#define GL_PACK_COMPRESSED_BLOCK_SIZE 0x912E + +#define GLEW_ARB_compressed_texture_pixel_storage GLEW_GET_VAR(__GLEW_ARB_compressed_texture_pixel_storage) + +#endif /* GL_ARB_compressed_texture_pixel_storage */ + +/* ------------------------- GL_ARB_compute_shader ------------------------- */ + +#ifndef GL_ARB_compute_shader +#define GL_ARB_compute_shader 1 + +#define GL_COMPUTE_SHADER_BIT 0x00000020 +#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_COMPUTE_WORK_GROUP_SIZE 0x8267 +#define GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS 0x90EB +#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 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_WORK_GROUP_COUNT 0x91BE +#define GL_MAX_COMPUTE_WORK_GROUP_SIZE 0x91BF + +typedef void (GLAPIENTRY * PFNGLDISPATCHCOMPUTEPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z); +typedef void (GLAPIENTRY * PFNGLDISPATCHCOMPUTEINDIRECTPROC) (GLintptr indirect); + +#define glDispatchCompute GLEW_GET_FUN(__glewDispatchCompute) +#define glDispatchComputeIndirect GLEW_GET_FUN(__glewDispatchComputeIndirect) + +#define GLEW_ARB_compute_shader GLEW_GET_VAR(__GLEW_ARB_compute_shader) + +#endif /* GL_ARB_compute_shader */ + +/* ------------------- GL_ARB_compute_variable_group_size ------------------ */ + +#ifndef GL_ARB_compute_variable_group_size +#define GL_ARB_compute_variable_group_size 1 + +#define GL_MAX_COMPUTE_FIXED_GROUP_INVOCATIONS_ARB 0x90EB +#define GL_MAX_COMPUTE_FIXED_GROUP_SIZE_ARB 0x91BF +#define GL_MAX_COMPUTE_VARIABLE_GROUP_INVOCATIONS_ARB 0x9344 +#define GL_MAX_COMPUTE_VARIABLE_GROUP_SIZE_ARB 0x9345 + +typedef void (GLAPIENTRY * 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); + +#define glDispatchComputeGroupSizeARB GLEW_GET_FUN(__glewDispatchComputeGroupSizeARB) + +#define GLEW_ARB_compute_variable_group_size GLEW_GET_VAR(__GLEW_ARB_compute_variable_group_size) + +#endif /* GL_ARB_compute_variable_group_size */ + +/* ------------------- GL_ARB_conditional_render_inverted ------------------ */ + +#ifndef GL_ARB_conditional_render_inverted +#define GL_ARB_conditional_render_inverted 1 + +#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 GLEW_ARB_conditional_render_inverted GLEW_GET_VAR(__GLEW_ARB_conditional_render_inverted) + +#endif /* GL_ARB_conditional_render_inverted */ + +/* ----------------------- GL_ARB_conservative_depth ----------------------- */ + +#ifndef GL_ARB_conservative_depth +#define GL_ARB_conservative_depth 1 + +#define GLEW_ARB_conservative_depth GLEW_GET_VAR(__GLEW_ARB_conservative_depth) + +#endif /* GL_ARB_conservative_depth */ + +/* --------------------------- GL_ARB_copy_buffer -------------------------- */ + +#ifndef GL_ARB_copy_buffer +#define GL_ARB_copy_buffer 1 + +#define GL_COPY_READ_BUFFER 0x8F36 +#define GL_COPY_WRITE_BUFFER 0x8F37 + +typedef void (GLAPIENTRY * PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readtarget, GLenum writetarget, GLintptr readoffset, GLintptr writeoffset, GLsizeiptr size); + +#define glCopyBufferSubData GLEW_GET_FUN(__glewCopyBufferSubData) + +#define GLEW_ARB_copy_buffer GLEW_GET_VAR(__GLEW_ARB_copy_buffer) + +#endif /* GL_ARB_copy_buffer */ + +/* --------------------------- GL_ARB_copy_image --------------------------- */ + +#ifndef GL_ARB_copy_image +#define GL_ARB_copy_image 1 + +typedef void (GLAPIENTRY * 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); + +#define glCopyImageSubData GLEW_GET_FUN(__glewCopyImageSubData) + +#define GLEW_ARB_copy_image GLEW_GET_VAR(__GLEW_ARB_copy_image) + +#endif /* GL_ARB_copy_image */ + +/* -------------------------- GL_ARB_cull_distance ------------------------- */ + +#ifndef GL_ARB_cull_distance +#define GL_ARB_cull_distance 1 + +#define GL_MAX_CULL_DISTANCES 0x82F9 +#define GL_MAX_COMBINED_CLIP_AND_CULL_DISTANCES 0x82FA + +#define GLEW_ARB_cull_distance GLEW_GET_VAR(__GLEW_ARB_cull_distance) + +#endif /* GL_ARB_cull_distance */ + +/* -------------------------- GL_ARB_debug_output -------------------------- */ + +#ifndef GL_ARB_debug_output +#define GL_ARB_debug_output 1 + +#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 (GLAPIENTRY *GLDEBUGPROCARB)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, const void* userParam); + +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECALLBACKARBPROC) (GLDEBUGPROCARB callback, const void *userParam); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECONTROLARBPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEINSERTARBPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* buf); +typedef GLuint (GLAPIENTRY * PFNGLGETDEBUGMESSAGELOGARBPROC) (GLuint count, GLsizei bufSize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, GLchar* messageLog); + +#define glDebugMessageCallbackARB GLEW_GET_FUN(__glewDebugMessageCallbackARB) +#define glDebugMessageControlARB GLEW_GET_FUN(__glewDebugMessageControlARB) +#define glDebugMessageInsertARB GLEW_GET_FUN(__glewDebugMessageInsertARB) +#define glGetDebugMessageLogARB GLEW_GET_FUN(__glewGetDebugMessageLogARB) + +#define GLEW_ARB_debug_output GLEW_GET_VAR(__GLEW_ARB_debug_output) + +#endif /* GL_ARB_debug_output */ + +/* ----------------------- GL_ARB_depth_buffer_float ----------------------- */ + +#ifndef GL_ARB_depth_buffer_float +#define GL_ARB_depth_buffer_float 1 + +#define GL_DEPTH_COMPONENT32F 0x8CAC +#define GL_DEPTH32F_STENCIL8 0x8CAD +#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD + +#define GLEW_ARB_depth_buffer_float GLEW_GET_VAR(__GLEW_ARB_depth_buffer_float) + +#endif /* GL_ARB_depth_buffer_float */ + +/* --------------------------- GL_ARB_depth_clamp -------------------------- */ + +#ifndef GL_ARB_depth_clamp +#define GL_ARB_depth_clamp 1 + +#define GL_DEPTH_CLAMP 0x864F + +#define GLEW_ARB_depth_clamp GLEW_GET_VAR(__GLEW_ARB_depth_clamp) + +#endif /* GL_ARB_depth_clamp */ + +/* -------------------------- GL_ARB_depth_texture ------------------------- */ + +#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 + +#define GLEW_ARB_depth_texture GLEW_GET_VAR(__GLEW_ARB_depth_texture) + +#endif /* GL_ARB_depth_texture */ + +/* ----------------------- GL_ARB_derivative_control ----------------------- */ + +#ifndef GL_ARB_derivative_control +#define GL_ARB_derivative_control 1 + +#define GLEW_ARB_derivative_control GLEW_GET_VAR(__GLEW_ARB_derivative_control) + +#endif /* GL_ARB_derivative_control */ + +/* ----------------------- GL_ARB_direct_state_access ---------------------- */ + +#ifndef GL_ARB_direct_state_access +#define GL_ARB_direct_state_access 1 + +#define GL_TEXTURE_TARGET 0x1006 +#define GL_QUERY_TARGET 0x82EA + +typedef void (GLAPIENTRY * PFNGLBINDTEXTUREUNITPROC) (GLuint unit, GLuint texture); +typedef void (GLAPIENTRY * 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 (GLAPIENTRY * PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC) (GLuint framebuffer, GLenum target); +typedef void (GLAPIENTRY * PFNGLCLEARNAMEDBUFFERDATAPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data); +typedef void (GLAPIENTRY * PFNGLCLEARNAMEDBUFFERSUBDATAPROC) (GLuint buffer, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); +typedef void (GLAPIENTRY * PFNGLCLEARNAMEDFRAMEBUFFERFIPROC) (GLuint framebuffer, GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); +typedef void (GLAPIENTRY * PFNGLCLEARNAMEDFRAMEBUFFERFVPROC) (GLuint framebuffer, GLenum buffer, GLint drawbuffer, GLfloat* value); +typedef void (GLAPIENTRY * PFNGLCLEARNAMEDFRAMEBUFFERIVPROC) (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLint* value); +typedef void (GLAPIENTRY * PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC) (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC) (GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * 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 (GLAPIENTRY * PFNGLCOPYNAMEDBUFFERSUBDATAPROC) (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE1DPROC) (GLuint texture, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE2DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE3DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLCREATEBUFFERSPROC) (GLsizei n, GLuint* buffers); +typedef void (GLAPIENTRY * PFNGLCREATEFRAMEBUFFERSPROC) (GLsizei n, GLuint* framebuffers); +typedef void (GLAPIENTRY * PFNGLCREATEPROGRAMPIPELINESPROC) (GLsizei n, GLuint* pipelines); +typedef void (GLAPIENTRY * PFNGLCREATEQUERIESPROC) (GLenum target, GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLCREATERENDERBUFFERSPROC) (GLsizei n, GLuint* renderbuffers); +typedef void (GLAPIENTRY * PFNGLCREATESAMPLERSPROC) (GLsizei n, GLuint* samplers); +typedef void (GLAPIENTRY * PFNGLCREATETEXTURESPROC) (GLenum target, GLsizei n, GLuint* textures); +typedef void (GLAPIENTRY * PFNGLCREATETRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLCREATEVERTEXARRAYSPROC) (GLsizei n, GLuint* arrays); +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXARRAYATTRIBPROC) (GLuint vaobj, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXARRAYATTRIBPROC) (GLuint vaobj, GLuint index); +typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); +typedef void (GLAPIENTRY * PFNGLGENERATETEXTUREMIPMAPPROC) (GLuint texture); +typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC) (GLuint texture, GLint level, GLsizei bufSize, void *pixels); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPARAMETERI64VPROC) (GLuint buffer, GLenum pname, GLint64* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPARAMETERIVPROC) (GLuint buffer, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPOINTERVPROC) (GLuint buffer, GLenum pname, void** params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, void *data); +typedef void (GLAPIENTRY * PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC) (GLuint framebuffer, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC) (GLuint renderbuffer, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYBUFFEROBJECTI64VPROC) (GLuint id, GLuint buffer, GLenum pname, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLGETQUERYBUFFEROBJECTIVPROC) (GLuint id, GLuint buffer, GLenum pname, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLGETQUERYBUFFEROBJECTUI64VPROC) (GLuint id, GLuint buffer, GLenum pname, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLGETQUERYBUFFEROBJECTUIVPROC) (GLuint id, GLuint buffer, GLenum pname, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREIMAGEPROC) (GLuint texture, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *pixels); +typedef void (GLAPIENTRY * PFNGLGETTEXTURELEVELPARAMETERFVPROC) (GLuint texture, GLint level, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTURELEVELPARAMETERIVPROC) (GLuint texture, GLint level, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIIVPROC) (GLuint texture, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIUIVPROC) (GLuint texture, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERFVPROC) (GLuint texture, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIVPROC) (GLuint texture, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKI64_VPROC) (GLuint xfb, GLenum pname, GLuint index, GLint64* param); +typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKI_VPROC) (GLuint xfb, GLenum pname, GLuint index, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKIVPROC) (GLuint xfb, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYINDEXED64IVPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint64* param); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYINDEXEDIVPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYIVPROC) (GLuint vaobj, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC) (GLuint framebuffer, GLsizei numAttachments, const GLenum* attachments); +typedef void (GLAPIENTRY * PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC) (GLuint framebuffer, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void * (GLAPIENTRY * PFNGLMAPNAMEDBUFFERPROC) (GLuint buffer, GLenum access); +typedef void * (GLAPIENTRY * PFNGLMAPNAMEDBUFFERRANGEPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); +typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERDATAPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLenum usage); +typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSTORAGEPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags); +typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC) (GLuint framebuffer, GLenum mode); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC) (GLuint framebuffer, GLsizei n, const GLenum* bufs); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC) (GLuint framebuffer, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC) (GLuint framebuffer, GLenum mode); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTUREPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLTEXTUREBUFFERPROC) (GLuint texture, GLenum internalformat, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLTEXTUREBUFFERRANGEPROC) (GLuint texture, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIIVPROC) (GLuint texture, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIUIVPROC) (GLuint texture, GLenum pname, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERFPROC) (GLuint texture, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERFVPROC) (GLuint texture, GLenum pname, const GLfloat* param); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIPROC) (GLuint texture, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIVPROC) (GLuint texture, GLenum pname, const GLint* param); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE1DPROC) (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE2DPROC) (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC) (GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE3DPROC) (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC) (GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE1DPROC) (GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE2DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * 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 (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC) (GLuint xfb, GLuint index, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC) (GLuint xfb, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef GLboolean (GLAPIENTRY * PFNGLUNMAPNAMEDBUFFERPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYATTRIBBINDINGPROC) (GLuint vaobj, GLuint attribindex, GLuint bindingindex); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYATTRIBFORMATPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYATTRIBIFORMATPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYATTRIBLFORMATPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYBINDINGDIVISORPROC) (GLuint vaobj, GLuint bindingindex, GLuint divisor); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYELEMENTBUFFERPROC) (GLuint vaobj, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXBUFFERPROC) (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXBUFFERSPROC) (GLuint vaobj, GLuint first, GLsizei count, const GLuint* buffers, const GLintptr *offsets, const GLsizei *strides); + +#define glBindTextureUnit GLEW_GET_FUN(__glewBindTextureUnit) +#define glBlitNamedFramebuffer GLEW_GET_FUN(__glewBlitNamedFramebuffer) +#define glCheckNamedFramebufferStatus GLEW_GET_FUN(__glewCheckNamedFramebufferStatus) +#define glClearNamedBufferData GLEW_GET_FUN(__glewClearNamedBufferData) +#define glClearNamedBufferSubData GLEW_GET_FUN(__glewClearNamedBufferSubData) +#define glClearNamedFramebufferfi GLEW_GET_FUN(__glewClearNamedFramebufferfi) +#define glClearNamedFramebufferfv GLEW_GET_FUN(__glewClearNamedFramebufferfv) +#define glClearNamedFramebufferiv GLEW_GET_FUN(__glewClearNamedFramebufferiv) +#define glClearNamedFramebufferuiv GLEW_GET_FUN(__glewClearNamedFramebufferuiv) +#define glCompressedTextureSubImage1D GLEW_GET_FUN(__glewCompressedTextureSubImage1D) +#define glCompressedTextureSubImage2D GLEW_GET_FUN(__glewCompressedTextureSubImage2D) +#define glCompressedTextureSubImage3D GLEW_GET_FUN(__glewCompressedTextureSubImage3D) +#define glCopyNamedBufferSubData GLEW_GET_FUN(__glewCopyNamedBufferSubData) +#define glCopyTextureSubImage1D GLEW_GET_FUN(__glewCopyTextureSubImage1D) +#define glCopyTextureSubImage2D GLEW_GET_FUN(__glewCopyTextureSubImage2D) +#define glCopyTextureSubImage3D GLEW_GET_FUN(__glewCopyTextureSubImage3D) +#define glCreateBuffers GLEW_GET_FUN(__glewCreateBuffers) +#define glCreateFramebuffers GLEW_GET_FUN(__glewCreateFramebuffers) +#define glCreateProgramPipelines GLEW_GET_FUN(__glewCreateProgramPipelines) +#define glCreateQueries GLEW_GET_FUN(__glewCreateQueries) +#define glCreateRenderbuffers GLEW_GET_FUN(__glewCreateRenderbuffers) +#define glCreateSamplers GLEW_GET_FUN(__glewCreateSamplers) +#define glCreateTextures GLEW_GET_FUN(__glewCreateTextures) +#define glCreateTransformFeedbacks GLEW_GET_FUN(__glewCreateTransformFeedbacks) +#define glCreateVertexArrays GLEW_GET_FUN(__glewCreateVertexArrays) +#define glDisableVertexArrayAttrib GLEW_GET_FUN(__glewDisableVertexArrayAttrib) +#define glEnableVertexArrayAttrib GLEW_GET_FUN(__glewEnableVertexArrayAttrib) +#define glFlushMappedNamedBufferRange GLEW_GET_FUN(__glewFlushMappedNamedBufferRange) +#define glGenerateTextureMipmap GLEW_GET_FUN(__glewGenerateTextureMipmap) +#define glGetCompressedTextureImage GLEW_GET_FUN(__glewGetCompressedTextureImage) +#define glGetNamedBufferParameteri64v GLEW_GET_FUN(__glewGetNamedBufferParameteri64v) +#define glGetNamedBufferParameteriv GLEW_GET_FUN(__glewGetNamedBufferParameteriv) +#define glGetNamedBufferPointerv GLEW_GET_FUN(__glewGetNamedBufferPointerv) +#define glGetNamedBufferSubData GLEW_GET_FUN(__glewGetNamedBufferSubData) +#define glGetNamedFramebufferAttachmentParameteriv GLEW_GET_FUN(__glewGetNamedFramebufferAttachmentParameteriv) +#define glGetNamedFramebufferParameteriv GLEW_GET_FUN(__glewGetNamedFramebufferParameteriv) +#define glGetNamedRenderbufferParameteriv GLEW_GET_FUN(__glewGetNamedRenderbufferParameteriv) +#define glGetQueryBufferObjecti64v GLEW_GET_FUN(__glewGetQueryBufferObjecti64v) +#define glGetQueryBufferObjectiv GLEW_GET_FUN(__glewGetQueryBufferObjectiv) +#define glGetQueryBufferObjectui64v GLEW_GET_FUN(__glewGetQueryBufferObjectui64v) +#define glGetQueryBufferObjectuiv GLEW_GET_FUN(__glewGetQueryBufferObjectuiv) +#define glGetTextureImage GLEW_GET_FUN(__glewGetTextureImage) +#define glGetTextureLevelParameterfv GLEW_GET_FUN(__glewGetTextureLevelParameterfv) +#define glGetTextureLevelParameteriv GLEW_GET_FUN(__glewGetTextureLevelParameteriv) +#define glGetTextureParameterIiv GLEW_GET_FUN(__glewGetTextureParameterIiv) +#define glGetTextureParameterIuiv GLEW_GET_FUN(__glewGetTextureParameterIuiv) +#define glGetTextureParameterfv GLEW_GET_FUN(__glewGetTextureParameterfv) +#define glGetTextureParameteriv GLEW_GET_FUN(__glewGetTextureParameteriv) +#define glGetTransformFeedbacki64_v GLEW_GET_FUN(__glewGetTransformFeedbacki64_v) +#define glGetTransformFeedbacki_v GLEW_GET_FUN(__glewGetTransformFeedbacki_v) +#define glGetTransformFeedbackiv GLEW_GET_FUN(__glewGetTransformFeedbackiv) +#define glGetVertexArrayIndexed64iv GLEW_GET_FUN(__glewGetVertexArrayIndexed64iv) +#define glGetVertexArrayIndexediv GLEW_GET_FUN(__glewGetVertexArrayIndexediv) +#define glGetVertexArrayiv GLEW_GET_FUN(__glewGetVertexArrayiv) +#define glInvalidateNamedFramebufferData GLEW_GET_FUN(__glewInvalidateNamedFramebufferData) +#define glInvalidateNamedFramebufferSubData GLEW_GET_FUN(__glewInvalidateNamedFramebufferSubData) +#define glMapNamedBuffer GLEW_GET_FUN(__glewMapNamedBuffer) +#define glMapNamedBufferRange GLEW_GET_FUN(__glewMapNamedBufferRange) +#define glNamedBufferData GLEW_GET_FUN(__glewNamedBufferData) +#define glNamedBufferStorage GLEW_GET_FUN(__glewNamedBufferStorage) +#define glNamedBufferSubData GLEW_GET_FUN(__glewNamedBufferSubData) +#define glNamedFramebufferDrawBuffer GLEW_GET_FUN(__glewNamedFramebufferDrawBuffer) +#define glNamedFramebufferDrawBuffers GLEW_GET_FUN(__glewNamedFramebufferDrawBuffers) +#define glNamedFramebufferParameteri GLEW_GET_FUN(__glewNamedFramebufferParameteri) +#define glNamedFramebufferReadBuffer GLEW_GET_FUN(__glewNamedFramebufferReadBuffer) +#define glNamedFramebufferRenderbuffer GLEW_GET_FUN(__glewNamedFramebufferRenderbuffer) +#define glNamedFramebufferTexture GLEW_GET_FUN(__glewNamedFramebufferTexture) +#define glNamedFramebufferTextureLayer GLEW_GET_FUN(__glewNamedFramebufferTextureLayer) +#define glNamedRenderbufferStorage GLEW_GET_FUN(__glewNamedRenderbufferStorage) +#define glNamedRenderbufferStorageMultisample GLEW_GET_FUN(__glewNamedRenderbufferStorageMultisample) +#define glTextureBuffer GLEW_GET_FUN(__glewTextureBuffer) +#define glTextureBufferRange GLEW_GET_FUN(__glewTextureBufferRange) +#define glTextureParameterIiv GLEW_GET_FUN(__glewTextureParameterIiv) +#define glTextureParameterIuiv GLEW_GET_FUN(__glewTextureParameterIuiv) +#define glTextureParameterf GLEW_GET_FUN(__glewTextureParameterf) +#define glTextureParameterfv GLEW_GET_FUN(__glewTextureParameterfv) +#define glTextureParameteri GLEW_GET_FUN(__glewTextureParameteri) +#define glTextureParameteriv GLEW_GET_FUN(__glewTextureParameteriv) +#define glTextureStorage1D GLEW_GET_FUN(__glewTextureStorage1D) +#define glTextureStorage2D GLEW_GET_FUN(__glewTextureStorage2D) +#define glTextureStorage2DMultisample GLEW_GET_FUN(__glewTextureStorage2DMultisample) +#define glTextureStorage3D GLEW_GET_FUN(__glewTextureStorage3D) +#define glTextureStorage3DMultisample GLEW_GET_FUN(__glewTextureStorage3DMultisample) +#define glTextureSubImage1D GLEW_GET_FUN(__glewTextureSubImage1D) +#define glTextureSubImage2D GLEW_GET_FUN(__glewTextureSubImage2D) +#define glTextureSubImage3D GLEW_GET_FUN(__glewTextureSubImage3D) +#define glTransformFeedbackBufferBase GLEW_GET_FUN(__glewTransformFeedbackBufferBase) +#define glTransformFeedbackBufferRange GLEW_GET_FUN(__glewTransformFeedbackBufferRange) +#define glUnmapNamedBuffer GLEW_GET_FUN(__glewUnmapNamedBuffer) +#define glVertexArrayAttribBinding GLEW_GET_FUN(__glewVertexArrayAttribBinding) +#define glVertexArrayAttribFormat GLEW_GET_FUN(__glewVertexArrayAttribFormat) +#define glVertexArrayAttribIFormat GLEW_GET_FUN(__glewVertexArrayAttribIFormat) +#define glVertexArrayAttribLFormat GLEW_GET_FUN(__glewVertexArrayAttribLFormat) +#define glVertexArrayBindingDivisor GLEW_GET_FUN(__glewVertexArrayBindingDivisor) +#define glVertexArrayElementBuffer GLEW_GET_FUN(__glewVertexArrayElementBuffer) +#define glVertexArrayVertexBuffer GLEW_GET_FUN(__glewVertexArrayVertexBuffer) +#define glVertexArrayVertexBuffers GLEW_GET_FUN(__glewVertexArrayVertexBuffers) + +#define GLEW_ARB_direct_state_access GLEW_GET_VAR(__GLEW_ARB_direct_state_access) + +#endif /* GL_ARB_direct_state_access */ + +/* -------------------------- GL_ARB_draw_buffers -------------------------- */ + +#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 (GLAPIENTRY * PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum* bufs); + +#define glDrawBuffersARB GLEW_GET_FUN(__glewDrawBuffersARB) + +#define GLEW_ARB_draw_buffers GLEW_GET_VAR(__GLEW_ARB_draw_buffers) + +#endif /* GL_ARB_draw_buffers */ + +/* ----------------------- GL_ARB_draw_buffers_blend ----------------------- */ + +#ifndef GL_ARB_draw_buffers_blend +#define GL_ARB_draw_buffers_blend 1 + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEIARBPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONIARBPROC) (GLuint buf, GLenum mode); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEIARBPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCIARBPROC) (GLuint buf, GLenum src, GLenum dst); + +#define glBlendEquationSeparateiARB GLEW_GET_FUN(__glewBlendEquationSeparateiARB) +#define glBlendEquationiARB GLEW_GET_FUN(__glewBlendEquationiARB) +#define glBlendFuncSeparateiARB GLEW_GET_FUN(__glewBlendFuncSeparateiARB) +#define glBlendFunciARB GLEW_GET_FUN(__glewBlendFunciARB) + +#define GLEW_ARB_draw_buffers_blend GLEW_GET_VAR(__GLEW_ARB_draw_buffers_blend) + +#endif /* GL_ARB_draw_buffers_blend */ + +/* -------------------- GL_ARB_draw_elements_base_vertex ------------------- */ + +#ifndef GL_ARB_draw_elements_base_vertex +#define GL_ARB_draw_elements_base_vertex 1 + +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, void *indices, GLint basevertex); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount, GLint basevertex); +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, void *indices, GLint basevertex); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei* count, GLenum type, void**indices, GLsizei primcount, GLint *basevertex); + +#define glDrawElementsBaseVertex GLEW_GET_FUN(__glewDrawElementsBaseVertex) +#define glDrawElementsInstancedBaseVertex GLEW_GET_FUN(__glewDrawElementsInstancedBaseVertex) +#define glDrawRangeElementsBaseVertex GLEW_GET_FUN(__glewDrawRangeElementsBaseVertex) +#define glMultiDrawElementsBaseVertex GLEW_GET_FUN(__glewMultiDrawElementsBaseVertex) + +#define GLEW_ARB_draw_elements_base_vertex GLEW_GET_VAR(__GLEW_ARB_draw_elements_base_vertex) + +#endif /* GL_ARB_draw_elements_base_vertex */ + +/* -------------------------- GL_ARB_draw_indirect ------------------------- */ + +#ifndef GL_ARB_draw_indirect +#define GL_ARB_draw_indirect 1 + +#define GL_DRAW_INDIRECT_BUFFER 0x8F3F +#define GL_DRAW_INDIRECT_BUFFER_BINDING 0x8F43 + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINDIRECTPROC) (GLenum mode, const void *indirect); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const void *indirect); + +#define glDrawArraysIndirect GLEW_GET_FUN(__glewDrawArraysIndirect) +#define glDrawElementsIndirect GLEW_GET_FUN(__glewDrawElementsIndirect) + +#define GLEW_ARB_draw_indirect GLEW_GET_VAR(__GLEW_ARB_draw_indirect) + +#endif /* GL_ARB_draw_indirect */ + +/* ------------------------- GL_ARB_draw_instanced ------------------------- */ + +#ifndef GL_ARB_draw_instanced +#define GL_ARB_draw_instanced 1 + +#define GLEW_ARB_draw_instanced GLEW_GET_VAR(__GLEW_ARB_draw_instanced) + +#endif /* GL_ARB_draw_instanced */ + +/* ------------------------ GL_ARB_enhanced_layouts ------------------------ */ + +#ifndef GL_ARB_enhanced_layouts +#define GL_ARB_enhanced_layouts 1 + +#define GL_LOCATION_COMPONENT 0x934A +#define GL_TRANSFORM_FEEDBACK_BUFFER_INDEX 0x934B +#define GL_TRANSFORM_FEEDBACK_BUFFER_STRIDE 0x934C + +#define GLEW_ARB_enhanced_layouts GLEW_GET_VAR(__GLEW_ARB_enhanced_layouts) + +#endif /* GL_ARB_enhanced_layouts */ + +/* -------------------- GL_ARB_explicit_attrib_location -------------------- */ + +#ifndef GL_ARB_explicit_attrib_location +#define GL_ARB_explicit_attrib_location 1 + +#define GLEW_ARB_explicit_attrib_location GLEW_GET_VAR(__GLEW_ARB_explicit_attrib_location) + +#endif /* GL_ARB_explicit_attrib_location */ + +/* -------------------- GL_ARB_explicit_uniform_location ------------------- */ + +#ifndef GL_ARB_explicit_uniform_location +#define GL_ARB_explicit_uniform_location 1 + +#define GL_MAX_UNIFORM_LOCATIONS 0x826E + +#define GLEW_ARB_explicit_uniform_location GLEW_GET_VAR(__GLEW_ARB_explicit_uniform_location) + +#endif /* GL_ARB_explicit_uniform_location */ + +/* ------------------- GL_ARB_fragment_coord_conventions ------------------- */ + +#ifndef GL_ARB_fragment_coord_conventions +#define GL_ARB_fragment_coord_conventions 1 + +#define GLEW_ARB_fragment_coord_conventions GLEW_GET_VAR(__GLEW_ARB_fragment_coord_conventions) + +#endif /* GL_ARB_fragment_coord_conventions */ + +/* --------------------- GL_ARB_fragment_layer_viewport -------------------- */ + +#ifndef GL_ARB_fragment_layer_viewport +#define GL_ARB_fragment_layer_viewport 1 + +#define GLEW_ARB_fragment_layer_viewport GLEW_GET_VAR(__GLEW_ARB_fragment_layer_viewport) + +#endif /* GL_ARB_fragment_layer_viewport */ + +/* ------------------------ GL_ARB_fragment_program ------------------------ */ + +#ifndef GL_ARB_fragment_program +#define GL_ARB_fragment_program 1 + +#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 + +#define GLEW_ARB_fragment_program GLEW_GET_VAR(__GLEW_ARB_fragment_program) + +#endif /* GL_ARB_fragment_program */ + +/* --------------------- GL_ARB_fragment_program_shadow -------------------- */ + +#ifndef GL_ARB_fragment_program_shadow +#define GL_ARB_fragment_program_shadow 1 + +#define GLEW_ARB_fragment_program_shadow GLEW_GET_VAR(__GLEW_ARB_fragment_program_shadow) + +#endif /* GL_ARB_fragment_program_shadow */ + +/* ------------------------- GL_ARB_fragment_shader ------------------------ */ + +#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 + +#define GLEW_ARB_fragment_shader GLEW_GET_VAR(__GLEW_ARB_fragment_shader) + +#endif /* GL_ARB_fragment_shader */ + +/* -------------------- GL_ARB_fragment_shader_interlock ------------------- */ + +#ifndef GL_ARB_fragment_shader_interlock +#define GL_ARB_fragment_shader_interlock 1 + +#define GLEW_ARB_fragment_shader_interlock GLEW_GET_VAR(__GLEW_ARB_fragment_shader_interlock) + +#endif /* GL_ARB_fragment_shader_interlock */ + +/* ------------------- GL_ARB_framebuffer_no_attachments ------------------- */ + +#ifndef GL_ARB_framebuffer_no_attachments +#define GL_ARB_framebuffer_no_attachments 1 + +#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 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERPARAMETERIPROC) (GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC) (GLuint framebuffer, GLenum pname, GLint param); + +#define glFramebufferParameteri GLEW_GET_FUN(__glewFramebufferParameteri) +#define glGetFramebufferParameteriv GLEW_GET_FUN(__glewGetFramebufferParameteriv) +#define glGetNamedFramebufferParameterivEXT GLEW_GET_FUN(__glewGetNamedFramebufferParameterivEXT) +#define glNamedFramebufferParameteriEXT GLEW_GET_FUN(__glewNamedFramebufferParameteriEXT) + +#define GLEW_ARB_framebuffer_no_attachments GLEW_GET_VAR(__GLEW_ARB_framebuffer_no_attachments) + +#endif /* GL_ARB_framebuffer_no_attachments */ + +/* ----------------------- GL_ARB_framebuffer_object ----------------------- */ + +#ifndef GL_ARB_framebuffer_object +#define GL_ARB_framebuffer_object 1 + +#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 +#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210 +#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211 +#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212 +#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213 +#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214 +#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215 +#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216 +#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217 +#define GL_FRAMEBUFFER_DEFAULT 0x8218 +#define GL_FRAMEBUFFER_UNDEFINED 0x8219 +#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A +#define GL_INDEX 0x8222 +#define GL_MAX_RENDERBUFFER_SIZE 0x84E8 +#define GL_DEPTH_STENCIL 0x84F9 +#define GL_UNSIGNED_INT_24_8 0x84FA +#define GL_DEPTH24_STENCIL8 0x88F0 +#define GL_TEXTURE_STENCIL_SIZE 0x88F1 +#define GL_UNSIGNED_NORMALIZED 0x8C17 +#define GL_SRGB 0x8C40 +#define GL_DRAW_FRAMEBUFFER_BINDING 0x8CA6 +#define GL_FRAMEBUFFER_BINDING 0x8CA6 +#define GL_RENDERBUFFER_BINDING 0x8CA7 +#define GL_READ_FRAMEBUFFER 0x8CA8 +#define GL_DRAW_FRAMEBUFFER 0x8CA9 +#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA +#define GL_RENDERBUFFER_SAMPLES 0x8CAB +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 +#define GL_FRAMEBUFFER_COMPLETE 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB +#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC +#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD +#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF +#define GL_COLOR_ATTACHMENT0 0x8CE0 +#define GL_COLOR_ATTACHMENT1 0x8CE1 +#define GL_COLOR_ATTACHMENT2 0x8CE2 +#define GL_COLOR_ATTACHMENT3 0x8CE3 +#define GL_COLOR_ATTACHMENT4 0x8CE4 +#define GL_COLOR_ATTACHMENT5 0x8CE5 +#define GL_COLOR_ATTACHMENT6 0x8CE6 +#define GL_COLOR_ATTACHMENT7 0x8CE7 +#define GL_COLOR_ATTACHMENT8 0x8CE8 +#define GL_COLOR_ATTACHMENT9 0x8CE9 +#define GL_COLOR_ATTACHMENT10 0x8CEA +#define GL_COLOR_ATTACHMENT11 0x8CEB +#define GL_COLOR_ATTACHMENT12 0x8CEC +#define GL_COLOR_ATTACHMENT13 0x8CED +#define GL_COLOR_ATTACHMENT14 0x8CEE +#define GL_COLOR_ATTACHMENT15 0x8CEF +#define GL_DEPTH_ATTACHMENT 0x8D00 +#define GL_STENCIL_ATTACHMENT 0x8D20 +#define GL_FRAMEBUFFER 0x8D40 +#define GL_RENDERBUFFER 0x8D41 +#define GL_RENDERBUFFER_WIDTH 0x8D42 +#define GL_RENDERBUFFER_HEIGHT 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 +#define GL_STENCIL_INDEX1 0x8D46 +#define GL_STENCIL_INDEX4 0x8D47 +#define GL_STENCIL_INDEX8 0x8D48 +#define GL_STENCIL_INDEX16 0x8D49 +#define GL_RENDERBUFFER_RED_SIZE 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56 +#define GL_MAX_SAMPLES 0x8D57 + +typedef void (GLAPIENTRY * PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer); +typedef void (GLAPIENTRY * PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +typedef GLenum (GLAPIENTRY * PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint* framebuffers); +typedef void (GLAPIENTRY * PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint* renderbuffers); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE1DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE3DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint layer); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target,GLenum attachment, GLuint texture,GLint level,GLint layer); +typedef void (GLAPIENTRY * PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint* framebuffers); +typedef void (GLAPIENTRY * PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint* renderbuffers); +typedef void (GLAPIENTRY * PFNGLGENERATEMIPMAPPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer); +typedef GLboolean (GLAPIENTRY * PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); + +#define glBindFramebuffer GLEW_GET_FUN(__glewBindFramebuffer) +#define glBindRenderbuffer GLEW_GET_FUN(__glewBindRenderbuffer) +#define glBlitFramebuffer GLEW_GET_FUN(__glewBlitFramebuffer) +#define glCheckFramebufferStatus GLEW_GET_FUN(__glewCheckFramebufferStatus) +#define glDeleteFramebuffers GLEW_GET_FUN(__glewDeleteFramebuffers) +#define glDeleteRenderbuffers GLEW_GET_FUN(__glewDeleteRenderbuffers) +#define glFramebufferRenderbuffer GLEW_GET_FUN(__glewFramebufferRenderbuffer) +#define glFramebufferTexture1D GLEW_GET_FUN(__glewFramebufferTexture1D) +#define glFramebufferTexture2D GLEW_GET_FUN(__glewFramebufferTexture2D) +#define glFramebufferTexture3D GLEW_GET_FUN(__glewFramebufferTexture3D) +#define glFramebufferTextureLayer GLEW_GET_FUN(__glewFramebufferTextureLayer) +#define glGenFramebuffers GLEW_GET_FUN(__glewGenFramebuffers) +#define glGenRenderbuffers GLEW_GET_FUN(__glewGenRenderbuffers) +#define glGenerateMipmap GLEW_GET_FUN(__glewGenerateMipmap) +#define glGetFramebufferAttachmentParameteriv GLEW_GET_FUN(__glewGetFramebufferAttachmentParameteriv) +#define glGetRenderbufferParameteriv GLEW_GET_FUN(__glewGetRenderbufferParameteriv) +#define glIsFramebuffer GLEW_GET_FUN(__glewIsFramebuffer) +#define glIsRenderbuffer GLEW_GET_FUN(__glewIsRenderbuffer) +#define glRenderbufferStorage GLEW_GET_FUN(__glewRenderbufferStorage) +#define glRenderbufferStorageMultisample GLEW_GET_FUN(__glewRenderbufferStorageMultisample) + +#define GLEW_ARB_framebuffer_object GLEW_GET_VAR(__GLEW_ARB_framebuffer_object) + +#endif /* GL_ARB_framebuffer_object */ + +/* ------------------------ GL_ARB_framebuffer_sRGB ------------------------ */ + +#ifndef GL_ARB_framebuffer_sRGB +#define GL_ARB_framebuffer_sRGB 1 + +#define GL_FRAMEBUFFER_SRGB 0x8DB9 + +#define GLEW_ARB_framebuffer_sRGB GLEW_GET_VAR(__GLEW_ARB_framebuffer_sRGB) + +#endif /* GL_ARB_framebuffer_sRGB */ + +/* ------------------------ GL_ARB_geometry_shader4 ------------------------ */ + +#ifndef GL_ARB_geometry_shader4 +#define GL_ARB_geometry_shader4 1 + +#define GL_LINES_ADJACENCY_ARB 0xA +#define GL_LINE_STRIP_ADJACENCY_ARB 0xB +#define GL_TRIANGLES_ADJACENCY_ARB 0xC +#define GL_TRIANGLE_STRIP_ADJACENCY_ARB 0xD +#define GL_PROGRAM_POINT_SIZE_ARB 0x8642 +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 +#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 (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREFACEARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYERARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIARBPROC) (GLuint program, GLenum pname, GLint value); + +#define glFramebufferTextureARB GLEW_GET_FUN(__glewFramebufferTextureARB) +#define glFramebufferTextureFaceARB GLEW_GET_FUN(__glewFramebufferTextureFaceARB) +#define glFramebufferTextureLayerARB GLEW_GET_FUN(__glewFramebufferTextureLayerARB) +#define glProgramParameteriARB GLEW_GET_FUN(__glewProgramParameteriARB) + +#define GLEW_ARB_geometry_shader4 GLEW_GET_VAR(__GLEW_ARB_geometry_shader4) + +#endif /* GL_ARB_geometry_shader4 */ + +/* ----------------------- GL_ARB_get_program_binary ----------------------- */ + +#ifndef GL_ARB_get_program_binary +#define GL_ARB_get_program_binary 1 + +#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 + +typedef void (GLAPIENTRY * PFNGLGETPROGRAMBINARYPROC) (GLuint program, GLsizei bufSize, GLsizei* length, GLenum *binaryFormat, void*binary); +typedef void (GLAPIENTRY * PFNGLPROGRAMBINARYPROC) (GLuint program, GLenum binaryFormat, const void *binary, GLsizei length); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIPROC) (GLuint program, GLenum pname, GLint value); + +#define glGetProgramBinary GLEW_GET_FUN(__glewGetProgramBinary) +#define glProgramBinary GLEW_GET_FUN(__glewProgramBinary) +#define glProgramParameteri GLEW_GET_FUN(__glewProgramParameteri) + +#define GLEW_ARB_get_program_binary GLEW_GET_VAR(__GLEW_ARB_get_program_binary) + +#endif /* GL_ARB_get_program_binary */ + +/* ---------------------- GL_ARB_get_texture_sub_image --------------------- */ + +#ifndef GL_ARB_get_texture_sub_image +#define GL_ARB_get_texture_sub_image 1 + +typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei bufSize, void *pixels); +typedef void (GLAPIENTRY * 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); + +#define glGetCompressedTextureSubImage GLEW_GET_FUN(__glewGetCompressedTextureSubImage) +#define glGetTextureSubImage GLEW_GET_FUN(__glewGetTextureSubImage) + +#define GLEW_ARB_get_texture_sub_image GLEW_GET_VAR(__GLEW_ARB_get_texture_sub_image) + +#endif /* GL_ARB_get_texture_sub_image */ + +/* ---------------------------- GL_ARB_gl_spirv ---------------------------- */ + +#ifndef GL_ARB_gl_spirv +#define GL_ARB_gl_spirv 1 + +#define GL_SHADER_BINARY_FORMAT_SPIR_V_ARB 0x9551 +#define GL_SPIR_V_BINARY_ARB 0x9552 + +typedef void (GLAPIENTRY * PFNGLSPECIALIZESHADERARBPROC) (GLuint shader, const GLchar* pEntryPoint, GLuint numSpecializationConstants, const GLuint* pConstantIndex, const GLuint* pConstantValue); + +#define glSpecializeShaderARB GLEW_GET_FUN(__glewSpecializeShaderARB) + +#define GLEW_ARB_gl_spirv GLEW_GET_VAR(__GLEW_ARB_gl_spirv) + +#endif /* GL_ARB_gl_spirv */ + +/* --------------------------- GL_ARB_gpu_shader5 -------------------------- */ + +#ifndef GL_ARB_gpu_shader5 +#define GL_ARB_gpu_shader5 1 + +#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 +#define GL_MAX_VERTEX_STREAMS 0x8E71 + +#define GLEW_ARB_gpu_shader5 GLEW_GET_VAR(__GLEW_ARB_gpu_shader5) + +#endif /* GL_ARB_gpu_shader5 */ + +/* ------------------------- GL_ARB_gpu_shader_fp64 ------------------------ */ + +#ifndef GL_ARB_gpu_shader_fp64 +#define GL_ARB_gpu_shader_fp64 1 + +#define GL_DOUBLE_MAT2 0x8F46 +#define GL_DOUBLE_MAT3 0x8F47 +#define GL_DOUBLE_MAT4 0x8F48 +#define GL_DOUBLE_MAT2x3 0x8F49 +#define GL_DOUBLE_MAT2x4 0x8F4A +#define GL_DOUBLE_MAT3x2 0x8F4B +#define GL_DOUBLE_MAT3x4 0x8F4C +#define GL_DOUBLE_MAT4x2 0x8F4D +#define GL_DOUBLE_MAT4x3 0x8F4E +#define GL_DOUBLE_VEC2 0x8FFC +#define GL_DOUBLE_VEC3 0x8FFD +#define GL_DOUBLE_VEC4 0x8FFE + +typedef void (GLAPIENTRY * PFNGLGETUNIFORMDVPROC) (GLuint program, GLint location, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLUNIFORM1DPROC) (GLint location, GLdouble x); +typedef void (GLAPIENTRY * PFNGLUNIFORM1DVPROC) (GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2DPROC) (GLint location, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLUNIFORM2DVPROC) (GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLUNIFORM3DVPROC) (GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLUNIFORM4DVPROC) (GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); + +#define glGetUniformdv GLEW_GET_FUN(__glewGetUniformdv) +#define glUniform1d GLEW_GET_FUN(__glewUniform1d) +#define glUniform1dv GLEW_GET_FUN(__glewUniform1dv) +#define glUniform2d GLEW_GET_FUN(__glewUniform2d) +#define glUniform2dv GLEW_GET_FUN(__glewUniform2dv) +#define glUniform3d GLEW_GET_FUN(__glewUniform3d) +#define glUniform3dv GLEW_GET_FUN(__glewUniform3dv) +#define glUniform4d GLEW_GET_FUN(__glewUniform4d) +#define glUniform4dv GLEW_GET_FUN(__glewUniform4dv) +#define glUniformMatrix2dv GLEW_GET_FUN(__glewUniformMatrix2dv) +#define glUniformMatrix2x3dv GLEW_GET_FUN(__glewUniformMatrix2x3dv) +#define glUniformMatrix2x4dv GLEW_GET_FUN(__glewUniformMatrix2x4dv) +#define glUniformMatrix3dv GLEW_GET_FUN(__glewUniformMatrix3dv) +#define glUniformMatrix3x2dv GLEW_GET_FUN(__glewUniformMatrix3x2dv) +#define glUniformMatrix3x4dv GLEW_GET_FUN(__glewUniformMatrix3x4dv) +#define glUniformMatrix4dv GLEW_GET_FUN(__glewUniformMatrix4dv) +#define glUniformMatrix4x2dv GLEW_GET_FUN(__glewUniformMatrix4x2dv) +#define glUniformMatrix4x3dv GLEW_GET_FUN(__glewUniformMatrix4x3dv) + +#define GLEW_ARB_gpu_shader_fp64 GLEW_GET_VAR(__GLEW_ARB_gpu_shader_fp64) + +#endif /* GL_ARB_gpu_shader_fp64 */ + +/* ------------------------ GL_ARB_gpu_shader_int64 ------------------------ */ + +#ifndef GL_ARB_gpu_shader_int64 +#define GL_ARB_gpu_shader_int64 1 + +#define GL_INT64_ARB 0x140E +#define GL_UNSIGNED_INT64_ARB 0x140F +#define GL_INT64_VEC2_ARB 0x8FE9 +#define GL_INT64_VEC3_ARB 0x8FEA +#define GL_INT64_VEC4_ARB 0x8FEB +#define GL_UNSIGNED_INT64_VEC2_ARB 0x8FF5 +#define GL_UNSIGNED_INT64_VEC3_ARB 0x8FF6 +#define GL_UNSIGNED_INT64_VEC4_ARB 0x8FF7 + +typedef void (GLAPIENTRY * PFNGLGETUNIFORMI64VARBPROC) (GLuint program, GLint location, GLint64* params); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMUI64VARBPROC) (GLuint program, GLint location, GLuint64* params); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMI64VARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLint64* params); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMUI64VARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint64* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1I64ARBPROC) (GLuint program, GLint location, GLint64 x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1I64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLint64* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UI64ARBPROC) (GLuint program, GLint location, GLuint64 x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2I64ARBPROC) (GLuint program, GLint location, GLint64 x, GLint64 y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2I64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLint64* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UI64ARBPROC) (GLuint program, GLint location, GLuint64 x, GLuint64 y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3I64ARBPROC) (GLuint program, GLint location, GLint64 x, GLint64 y, GLint64 z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3I64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLint64* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UI64ARBPROC) (GLuint program, GLint location, GLuint64 x, GLuint64 y, GLuint64 z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4I64ARBPROC) (GLuint program, GLint location, GLint64 x, GLint64 y, GLint64 z, GLint64 w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4I64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLint64* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UI64ARBPROC) (GLuint program, GLint location, GLuint64 x, GLuint64 y, GLuint64 z, GLuint64 w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM1I64ARBPROC) (GLint location, GLint64 x); +typedef void (GLAPIENTRY * PFNGLUNIFORM1I64VARBPROC) (GLint location, GLsizei count, const GLint64* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UI64ARBPROC) (GLint location, GLuint64 x); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UI64VARBPROC) (GLint location, GLsizei count, const GLuint64* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2I64ARBPROC) (GLint location, GLint64 x, GLint64 y); +typedef void (GLAPIENTRY * PFNGLUNIFORM2I64VARBPROC) (GLint location, GLsizei count, const GLint64* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UI64ARBPROC) (GLint location, GLuint64 x, GLuint64 y); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UI64VARBPROC) (GLint location, GLsizei count, const GLuint64* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3I64ARBPROC) (GLint location, GLint64 x, GLint64 y, GLint64 z); +typedef void (GLAPIENTRY * PFNGLUNIFORM3I64VARBPROC) (GLint location, GLsizei count, const GLint64* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UI64ARBPROC) (GLint location, GLuint64 x, GLuint64 y, GLuint64 z); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UI64VARBPROC) (GLint location, GLsizei count, const GLuint64* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4I64ARBPROC) (GLint location, GLint64 x, GLint64 y, GLint64 z, GLint64 w); +typedef void (GLAPIENTRY * PFNGLUNIFORM4I64VARBPROC) (GLint location, GLsizei count, const GLint64* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UI64ARBPROC) (GLint location, GLuint64 x, GLuint64 y, GLuint64 z, GLuint64 w); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UI64VARBPROC) (GLint location, GLsizei count, const GLuint64* value); + +#define glGetUniformi64vARB GLEW_GET_FUN(__glewGetUniformi64vARB) +#define glGetUniformui64vARB GLEW_GET_FUN(__glewGetUniformui64vARB) +#define glGetnUniformi64vARB GLEW_GET_FUN(__glewGetnUniformi64vARB) +#define glGetnUniformui64vARB GLEW_GET_FUN(__glewGetnUniformui64vARB) +#define glProgramUniform1i64ARB GLEW_GET_FUN(__glewProgramUniform1i64ARB) +#define glProgramUniform1i64vARB GLEW_GET_FUN(__glewProgramUniform1i64vARB) +#define glProgramUniform1ui64ARB GLEW_GET_FUN(__glewProgramUniform1ui64ARB) +#define glProgramUniform1ui64vARB GLEW_GET_FUN(__glewProgramUniform1ui64vARB) +#define glProgramUniform2i64ARB GLEW_GET_FUN(__glewProgramUniform2i64ARB) +#define glProgramUniform2i64vARB GLEW_GET_FUN(__glewProgramUniform2i64vARB) +#define glProgramUniform2ui64ARB GLEW_GET_FUN(__glewProgramUniform2ui64ARB) +#define glProgramUniform2ui64vARB GLEW_GET_FUN(__glewProgramUniform2ui64vARB) +#define glProgramUniform3i64ARB GLEW_GET_FUN(__glewProgramUniform3i64ARB) +#define glProgramUniform3i64vARB GLEW_GET_FUN(__glewProgramUniform3i64vARB) +#define glProgramUniform3ui64ARB GLEW_GET_FUN(__glewProgramUniform3ui64ARB) +#define glProgramUniform3ui64vARB GLEW_GET_FUN(__glewProgramUniform3ui64vARB) +#define glProgramUniform4i64ARB GLEW_GET_FUN(__glewProgramUniform4i64ARB) +#define glProgramUniform4i64vARB GLEW_GET_FUN(__glewProgramUniform4i64vARB) +#define glProgramUniform4ui64ARB GLEW_GET_FUN(__glewProgramUniform4ui64ARB) +#define glProgramUniform4ui64vARB GLEW_GET_FUN(__glewProgramUniform4ui64vARB) +#define glUniform1i64ARB GLEW_GET_FUN(__glewUniform1i64ARB) +#define glUniform1i64vARB GLEW_GET_FUN(__glewUniform1i64vARB) +#define glUniform1ui64ARB GLEW_GET_FUN(__glewUniform1ui64ARB) +#define glUniform1ui64vARB GLEW_GET_FUN(__glewUniform1ui64vARB) +#define glUniform2i64ARB GLEW_GET_FUN(__glewUniform2i64ARB) +#define glUniform2i64vARB GLEW_GET_FUN(__glewUniform2i64vARB) +#define glUniform2ui64ARB GLEW_GET_FUN(__glewUniform2ui64ARB) +#define glUniform2ui64vARB GLEW_GET_FUN(__glewUniform2ui64vARB) +#define glUniform3i64ARB GLEW_GET_FUN(__glewUniform3i64ARB) +#define glUniform3i64vARB GLEW_GET_FUN(__glewUniform3i64vARB) +#define glUniform3ui64ARB GLEW_GET_FUN(__glewUniform3ui64ARB) +#define glUniform3ui64vARB GLEW_GET_FUN(__glewUniform3ui64vARB) +#define glUniform4i64ARB GLEW_GET_FUN(__glewUniform4i64ARB) +#define glUniform4i64vARB GLEW_GET_FUN(__glewUniform4i64vARB) +#define glUniform4ui64ARB GLEW_GET_FUN(__glewUniform4ui64ARB) +#define glUniform4ui64vARB GLEW_GET_FUN(__glewUniform4ui64vARB) + +#define GLEW_ARB_gpu_shader_int64 GLEW_GET_VAR(__GLEW_ARB_gpu_shader_int64) + +#endif /* GL_ARB_gpu_shader_int64 */ + +/* ------------------------ GL_ARB_half_float_pixel ------------------------ */ + +#ifndef GL_ARB_half_float_pixel +#define GL_ARB_half_float_pixel 1 + +#define GL_HALF_FLOAT_ARB 0x140B + +#define GLEW_ARB_half_float_pixel GLEW_GET_VAR(__GLEW_ARB_half_float_pixel) + +#endif /* GL_ARB_half_float_pixel */ + +/* ------------------------ GL_ARB_half_float_vertex ----------------------- */ + +#ifndef GL_ARB_half_float_vertex +#define GL_ARB_half_float_vertex 1 + +#define GL_HALF_FLOAT 0x140B + +#define GLEW_ARB_half_float_vertex GLEW_GET_VAR(__GLEW_ARB_half_float_vertex) + +#endif /* GL_ARB_half_float_vertex */ + +/* ----------------------------- GL_ARB_imaging ---------------------------- */ + +#ifndef GL_ARB_imaging +#define GL_ARB_imaging 1 + +#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 +#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_IGNORE_BORDER 0x8150 +#define GL_CONSTANT_BORDER 0x8151 +#define GL_WRAP_BORDER 0x8152 +#define GL_REPLICATE_BORDER 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR 0x8154 + +typedef void (GLAPIENTRY * PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data); +typedef void (GLAPIENTRY * PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *table); +typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *image); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *image); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (GLAPIENTRY * PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, void *table); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, void *image); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum types, void *values); +typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, void *row, void *column, void *span); +typedef void (GLAPIENTRY * PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (GLAPIENTRY * PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (GLAPIENTRY * PFNGLRESETHISTOGRAMPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLRESETMINMAXPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *row, const void *column); + +#define glColorSubTable GLEW_GET_FUN(__glewColorSubTable) +#define glColorTable GLEW_GET_FUN(__glewColorTable) +#define glColorTableParameterfv GLEW_GET_FUN(__glewColorTableParameterfv) +#define glColorTableParameteriv GLEW_GET_FUN(__glewColorTableParameteriv) +#define glConvolutionFilter1D GLEW_GET_FUN(__glewConvolutionFilter1D) +#define glConvolutionFilter2D GLEW_GET_FUN(__glewConvolutionFilter2D) +#define glConvolutionParameterf GLEW_GET_FUN(__glewConvolutionParameterf) +#define glConvolutionParameterfv GLEW_GET_FUN(__glewConvolutionParameterfv) +#define glConvolutionParameteri GLEW_GET_FUN(__glewConvolutionParameteri) +#define glConvolutionParameteriv GLEW_GET_FUN(__glewConvolutionParameteriv) +#define glCopyColorSubTable GLEW_GET_FUN(__glewCopyColorSubTable) +#define glCopyColorTable GLEW_GET_FUN(__glewCopyColorTable) +#define glCopyConvolutionFilter1D GLEW_GET_FUN(__glewCopyConvolutionFilter1D) +#define glCopyConvolutionFilter2D GLEW_GET_FUN(__glewCopyConvolutionFilter2D) +#define glGetColorTable GLEW_GET_FUN(__glewGetColorTable) +#define glGetColorTableParameterfv GLEW_GET_FUN(__glewGetColorTableParameterfv) +#define glGetColorTableParameteriv GLEW_GET_FUN(__glewGetColorTableParameteriv) +#define glGetConvolutionFilter GLEW_GET_FUN(__glewGetConvolutionFilter) +#define glGetConvolutionParameterfv GLEW_GET_FUN(__glewGetConvolutionParameterfv) +#define glGetConvolutionParameteriv GLEW_GET_FUN(__glewGetConvolutionParameteriv) +#define glGetHistogram GLEW_GET_FUN(__glewGetHistogram) +#define glGetHistogramParameterfv GLEW_GET_FUN(__glewGetHistogramParameterfv) +#define glGetHistogramParameteriv GLEW_GET_FUN(__glewGetHistogramParameteriv) +#define glGetMinmax GLEW_GET_FUN(__glewGetMinmax) +#define glGetMinmaxParameterfv GLEW_GET_FUN(__glewGetMinmaxParameterfv) +#define glGetMinmaxParameteriv GLEW_GET_FUN(__glewGetMinmaxParameteriv) +#define glGetSeparableFilter GLEW_GET_FUN(__glewGetSeparableFilter) +#define glHistogram GLEW_GET_FUN(__glewHistogram) +#define glMinmax GLEW_GET_FUN(__glewMinmax) +#define glResetHistogram GLEW_GET_FUN(__glewResetHistogram) +#define glResetMinmax GLEW_GET_FUN(__glewResetMinmax) +#define glSeparableFilter2D GLEW_GET_FUN(__glewSeparableFilter2D) + +#define GLEW_ARB_imaging GLEW_GET_VAR(__GLEW_ARB_imaging) + +#endif /* GL_ARB_imaging */ + +/* ----------------------- GL_ARB_indirect_parameters ---------------------- */ + +#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 (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC) (GLenum mode, const void *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC) (GLenum mode, GLenum type, const void *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); + +#define glMultiDrawArraysIndirectCountARB GLEW_GET_FUN(__glewMultiDrawArraysIndirectCountARB) +#define glMultiDrawElementsIndirectCountARB GLEW_GET_FUN(__glewMultiDrawElementsIndirectCountARB) + +#define GLEW_ARB_indirect_parameters GLEW_GET_VAR(__GLEW_ARB_indirect_parameters) + +#endif /* GL_ARB_indirect_parameters */ + +/* ------------------------ GL_ARB_instanced_arrays ------------------------ */ + +#ifndef GL_ARB_instanced_arrays +#define GL_ARB_instanced_arrays 1 + +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB 0x88FE + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDARBPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORARBPROC) (GLuint index, GLuint divisor); + +#define glDrawArraysInstancedARB GLEW_GET_FUN(__glewDrawArraysInstancedARB) +#define glDrawElementsInstancedARB GLEW_GET_FUN(__glewDrawElementsInstancedARB) +#define glVertexAttribDivisorARB GLEW_GET_FUN(__glewVertexAttribDivisorARB) + +#define GLEW_ARB_instanced_arrays GLEW_GET_VAR(__GLEW_ARB_instanced_arrays) + +#endif /* GL_ARB_instanced_arrays */ + +/* ---------------------- GL_ARB_internalformat_query ---------------------- */ + +#ifndef GL_ARB_internalformat_query +#define GL_ARB_internalformat_query 1 + +#define GL_NUM_SAMPLE_COUNTS 0x9380 + +typedef void (GLAPIENTRY * PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params); + +#define glGetInternalformativ GLEW_GET_FUN(__glewGetInternalformativ) + +#define GLEW_ARB_internalformat_query GLEW_GET_VAR(__GLEW_ARB_internalformat_query) + +#endif /* GL_ARB_internalformat_query */ + +/* ---------------------- GL_ARB_internalformat_query2 --------------------- */ + +#ifndef GL_ARB_internalformat_query2 +#define GL_ARB_internalformat_query2 1 + +#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_SRGB_DECODE_ARB 0x8299 +#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 + +typedef void (GLAPIENTRY * PFNGLGETINTERNALFORMATI64VPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64* params); + +#define glGetInternalformati64v GLEW_GET_FUN(__glewGetInternalformati64v) + +#define GLEW_ARB_internalformat_query2 GLEW_GET_VAR(__GLEW_ARB_internalformat_query2) + +#endif /* GL_ARB_internalformat_query2 */ + +/* ----------------------- GL_ARB_invalidate_subdata ----------------------- */ + +#ifndef GL_ARB_invalidate_subdata +#define GL_ARB_invalidate_subdata 1 + +typedef void (GLAPIENTRY * PFNGLINVALIDATEBUFFERDATAPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLINVALIDATEBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); +typedef void (GLAPIENTRY * PFNGLINVALIDATEFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum* attachments); +typedef void (GLAPIENTRY * PFNGLINVALIDATESUBFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLINVALIDATETEXIMAGEPROC) (GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLINVALIDATETEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth); + +#define glInvalidateBufferData GLEW_GET_FUN(__glewInvalidateBufferData) +#define glInvalidateBufferSubData GLEW_GET_FUN(__glewInvalidateBufferSubData) +#define glInvalidateFramebuffer GLEW_GET_FUN(__glewInvalidateFramebuffer) +#define glInvalidateSubFramebuffer GLEW_GET_FUN(__glewInvalidateSubFramebuffer) +#define glInvalidateTexImage GLEW_GET_FUN(__glewInvalidateTexImage) +#define glInvalidateTexSubImage GLEW_GET_FUN(__glewInvalidateTexSubImage) + +#define GLEW_ARB_invalidate_subdata GLEW_GET_VAR(__GLEW_ARB_invalidate_subdata) + +#endif /* GL_ARB_invalidate_subdata */ + +/* ---------------------- GL_ARB_map_buffer_alignment ---------------------- */ + +#ifndef GL_ARB_map_buffer_alignment +#define GL_ARB_map_buffer_alignment 1 + +#define GL_MIN_MAP_BUFFER_ALIGNMENT 0x90BC + +#define GLEW_ARB_map_buffer_alignment GLEW_GET_VAR(__GLEW_ARB_map_buffer_alignment) + +#endif /* GL_ARB_map_buffer_alignment */ + +/* ------------------------ GL_ARB_map_buffer_range ------------------------ */ + +#ifndef GL_ARB_map_buffer_range +#define GL_ARB_map_buffer_range 1 + +#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 + +typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length); +typedef void * (GLAPIENTRY * PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); + +#define glFlushMappedBufferRange GLEW_GET_FUN(__glewFlushMappedBufferRange) +#define glMapBufferRange GLEW_GET_FUN(__glewMapBufferRange) + +#define GLEW_ARB_map_buffer_range GLEW_GET_VAR(__GLEW_ARB_map_buffer_range) + +#endif /* GL_ARB_map_buffer_range */ + +/* ------------------------- GL_ARB_matrix_palette ------------------------- */ + +#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 (GLAPIENTRY * PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index); +typedef void (GLAPIENTRY * PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, void *pointer); +typedef void (GLAPIENTRY * PFNGLMATRIXINDEXUBVARBPROC) (GLint size, GLubyte *indices); +typedef void (GLAPIENTRY * PFNGLMATRIXINDEXUIVARBPROC) (GLint size, GLuint *indices); +typedef void (GLAPIENTRY * PFNGLMATRIXINDEXUSVARBPROC) (GLint size, GLushort *indices); + +#define glCurrentPaletteMatrixARB GLEW_GET_FUN(__glewCurrentPaletteMatrixARB) +#define glMatrixIndexPointerARB GLEW_GET_FUN(__glewMatrixIndexPointerARB) +#define glMatrixIndexubvARB GLEW_GET_FUN(__glewMatrixIndexubvARB) +#define glMatrixIndexuivARB GLEW_GET_FUN(__glewMatrixIndexuivARB) +#define glMatrixIndexusvARB GLEW_GET_FUN(__glewMatrixIndexusvARB) + +#define GLEW_ARB_matrix_palette GLEW_GET_VAR(__GLEW_ARB_matrix_palette) + +#endif /* GL_ARB_matrix_palette */ + +/* --------------------------- GL_ARB_multi_bind --------------------------- */ + +#ifndef GL_ARB_multi_bind +#define GL_ARB_multi_bind 1 + +typedef void (GLAPIENTRY * PFNGLBINDBUFFERSBASEPROC) (GLenum target, GLuint first, GLsizei count, const GLuint* buffers); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERSRANGEPROC) (GLenum target, GLuint first, GLsizei count, const GLuint* buffers, const GLintptr *offsets, const GLsizeiptr *sizes); +typedef void (GLAPIENTRY * PFNGLBINDIMAGETEXTURESPROC) (GLuint first, GLsizei count, const GLuint* textures); +typedef void (GLAPIENTRY * PFNGLBINDSAMPLERSPROC) (GLuint first, GLsizei count, const GLuint* samplers); +typedef void (GLAPIENTRY * PFNGLBINDTEXTURESPROC) (GLuint first, GLsizei count, const GLuint* textures); +typedef void (GLAPIENTRY * PFNGLBINDVERTEXBUFFERSPROC) (GLuint first, GLsizei count, const GLuint* buffers, const GLintptr *offsets, const GLsizei *strides); + +#define glBindBuffersBase GLEW_GET_FUN(__glewBindBuffersBase) +#define glBindBuffersRange GLEW_GET_FUN(__glewBindBuffersRange) +#define glBindImageTextures GLEW_GET_FUN(__glewBindImageTextures) +#define glBindSamplers GLEW_GET_FUN(__glewBindSamplers) +#define glBindTextures GLEW_GET_FUN(__glewBindTextures) +#define glBindVertexBuffers GLEW_GET_FUN(__glewBindVertexBuffers) + +#define GLEW_ARB_multi_bind GLEW_GET_VAR(__GLEW_ARB_multi_bind) + +#endif /* GL_ARB_multi_bind */ + +/* ----------------------- GL_ARB_multi_draw_indirect ---------------------- */ + +#ifndef GL_ARB_multi_draw_indirect +#define GL_ARB_multi_draw_indirect 1 + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTPROC) (GLenum mode, const void *indirect, GLsizei primcount, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei primcount, GLsizei stride); + +#define glMultiDrawArraysIndirect GLEW_GET_FUN(__glewMultiDrawArraysIndirect) +#define glMultiDrawElementsIndirect GLEW_GET_FUN(__glewMultiDrawElementsIndirect) + +#define GLEW_ARB_multi_draw_indirect GLEW_GET_VAR(__GLEW_ARB_multi_draw_indirect) + +#endif /* GL_ARB_multi_draw_indirect */ + +/* --------------------------- GL_ARB_multisample -------------------------- */ + +#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 (GLAPIENTRY * PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert); + +#define glSampleCoverageARB GLEW_GET_FUN(__glewSampleCoverageARB) + +#define GLEW_ARB_multisample GLEW_GET_VAR(__GLEW_ARB_multisample) + +#endif /* GL_ARB_multisample */ + +/* -------------------------- GL_ARB_multitexture -------------------------- */ + +#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 (GLAPIENTRY * PFNGLACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (GLAPIENTRY * PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); + +#define glActiveTextureARB GLEW_GET_FUN(__glewActiveTextureARB) +#define glClientActiveTextureARB GLEW_GET_FUN(__glewClientActiveTextureARB) +#define glMultiTexCoord1dARB GLEW_GET_FUN(__glewMultiTexCoord1dARB) +#define glMultiTexCoord1dvARB GLEW_GET_FUN(__glewMultiTexCoord1dvARB) +#define glMultiTexCoord1fARB GLEW_GET_FUN(__glewMultiTexCoord1fARB) +#define glMultiTexCoord1fvARB GLEW_GET_FUN(__glewMultiTexCoord1fvARB) +#define glMultiTexCoord1iARB GLEW_GET_FUN(__glewMultiTexCoord1iARB) +#define glMultiTexCoord1ivARB GLEW_GET_FUN(__glewMultiTexCoord1ivARB) +#define glMultiTexCoord1sARB GLEW_GET_FUN(__glewMultiTexCoord1sARB) +#define glMultiTexCoord1svARB GLEW_GET_FUN(__glewMultiTexCoord1svARB) +#define glMultiTexCoord2dARB GLEW_GET_FUN(__glewMultiTexCoord2dARB) +#define glMultiTexCoord2dvARB GLEW_GET_FUN(__glewMultiTexCoord2dvARB) +#define glMultiTexCoord2fARB GLEW_GET_FUN(__glewMultiTexCoord2fARB) +#define glMultiTexCoord2fvARB GLEW_GET_FUN(__glewMultiTexCoord2fvARB) +#define glMultiTexCoord2iARB GLEW_GET_FUN(__glewMultiTexCoord2iARB) +#define glMultiTexCoord2ivARB GLEW_GET_FUN(__glewMultiTexCoord2ivARB) +#define glMultiTexCoord2sARB GLEW_GET_FUN(__glewMultiTexCoord2sARB) +#define glMultiTexCoord2svARB GLEW_GET_FUN(__glewMultiTexCoord2svARB) +#define glMultiTexCoord3dARB GLEW_GET_FUN(__glewMultiTexCoord3dARB) +#define glMultiTexCoord3dvARB GLEW_GET_FUN(__glewMultiTexCoord3dvARB) +#define glMultiTexCoord3fARB GLEW_GET_FUN(__glewMultiTexCoord3fARB) +#define glMultiTexCoord3fvARB GLEW_GET_FUN(__glewMultiTexCoord3fvARB) +#define glMultiTexCoord3iARB GLEW_GET_FUN(__glewMultiTexCoord3iARB) +#define glMultiTexCoord3ivARB GLEW_GET_FUN(__glewMultiTexCoord3ivARB) +#define glMultiTexCoord3sARB GLEW_GET_FUN(__glewMultiTexCoord3sARB) +#define glMultiTexCoord3svARB GLEW_GET_FUN(__glewMultiTexCoord3svARB) +#define glMultiTexCoord4dARB GLEW_GET_FUN(__glewMultiTexCoord4dARB) +#define glMultiTexCoord4dvARB GLEW_GET_FUN(__glewMultiTexCoord4dvARB) +#define glMultiTexCoord4fARB GLEW_GET_FUN(__glewMultiTexCoord4fARB) +#define glMultiTexCoord4fvARB GLEW_GET_FUN(__glewMultiTexCoord4fvARB) +#define glMultiTexCoord4iARB GLEW_GET_FUN(__glewMultiTexCoord4iARB) +#define glMultiTexCoord4ivARB GLEW_GET_FUN(__glewMultiTexCoord4ivARB) +#define glMultiTexCoord4sARB GLEW_GET_FUN(__glewMultiTexCoord4sARB) +#define glMultiTexCoord4svARB GLEW_GET_FUN(__glewMultiTexCoord4svARB) + +#define GLEW_ARB_multitexture GLEW_GET_VAR(__GLEW_ARB_multitexture) + +#endif /* GL_ARB_multitexture */ + +/* ------------------------- GL_ARB_occlusion_query ------------------------ */ + +#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 (GLAPIENTRY * PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLENDQUERYARBPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISQUERYARBPROC) (GLuint id); + +#define glBeginQueryARB GLEW_GET_FUN(__glewBeginQueryARB) +#define glDeleteQueriesARB GLEW_GET_FUN(__glewDeleteQueriesARB) +#define glEndQueryARB GLEW_GET_FUN(__glewEndQueryARB) +#define glGenQueriesARB GLEW_GET_FUN(__glewGenQueriesARB) +#define glGetQueryObjectivARB GLEW_GET_FUN(__glewGetQueryObjectivARB) +#define glGetQueryObjectuivARB GLEW_GET_FUN(__glewGetQueryObjectuivARB) +#define glGetQueryivARB GLEW_GET_FUN(__glewGetQueryivARB) +#define glIsQueryARB GLEW_GET_FUN(__glewIsQueryARB) + +#define GLEW_ARB_occlusion_query GLEW_GET_VAR(__GLEW_ARB_occlusion_query) + +#endif /* GL_ARB_occlusion_query */ + +/* ------------------------ GL_ARB_occlusion_query2 ------------------------ */ + +#ifndef GL_ARB_occlusion_query2 +#define GL_ARB_occlusion_query2 1 + +#define GL_ANY_SAMPLES_PASSED 0x8C2F + +#define GLEW_ARB_occlusion_query2 GLEW_GET_VAR(__GLEW_ARB_occlusion_query2) + +#endif /* GL_ARB_occlusion_query2 */ + +/* --------------------- GL_ARB_parallel_shader_compile -------------------- */ + +#ifndef GL_ARB_parallel_shader_compile +#define GL_ARB_parallel_shader_compile 1 + +#define GL_MAX_SHADER_COMPILER_THREADS_ARB 0x91B0 +#define GL_COMPLETION_STATUS_ARB 0x91B1 + +typedef void (GLAPIENTRY * PFNGLMAXSHADERCOMPILERTHREADSARBPROC) (GLuint count); + +#define glMaxShaderCompilerThreadsARB GLEW_GET_FUN(__glewMaxShaderCompilerThreadsARB) + +#define GLEW_ARB_parallel_shader_compile GLEW_GET_VAR(__GLEW_ARB_parallel_shader_compile) + +#endif /* GL_ARB_parallel_shader_compile */ + +/* -------------------- GL_ARB_pipeline_statistics_query ------------------- */ + +#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 +#define GL_GEOMETRY_SHADER_INVOCATIONS 0x887F + +#define GLEW_ARB_pipeline_statistics_query GLEW_GET_VAR(__GLEW_ARB_pipeline_statistics_query) + +#endif /* GL_ARB_pipeline_statistics_query */ + +/* ----------------------- GL_ARB_pixel_buffer_object ---------------------- */ + +#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 + +#define GLEW_ARB_pixel_buffer_object GLEW_GET_VAR(__GLEW_ARB_pixel_buffer_object) + +#endif /* GL_ARB_pixel_buffer_object */ + +/* ------------------------ GL_ARB_point_parameters ------------------------ */ + +#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 (GLAPIENTRY * PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat* params); + +#define glPointParameterfARB GLEW_GET_FUN(__glewPointParameterfARB) +#define glPointParameterfvARB GLEW_GET_FUN(__glewPointParameterfvARB) + +#define GLEW_ARB_point_parameters GLEW_GET_VAR(__GLEW_ARB_point_parameters) + +#endif /* GL_ARB_point_parameters */ + +/* -------------------------- GL_ARB_point_sprite -------------------------- */ + +#ifndef GL_ARB_point_sprite +#define GL_ARB_point_sprite 1 + +#define GL_POINT_SPRITE_ARB 0x8861 +#define GL_COORD_REPLACE_ARB 0x8862 + +#define GLEW_ARB_point_sprite GLEW_GET_VAR(__GLEW_ARB_point_sprite) + +#endif /* GL_ARB_point_sprite */ + +/* ---------------------- GL_ARB_polygon_offset_clamp ---------------------- */ + +#ifndef GL_ARB_polygon_offset_clamp +#define GL_ARB_polygon_offset_clamp 1 + +#define GL_POLYGON_OFFSET_CLAMP 0x8E1B + +typedef void (GLAPIENTRY * PFNGLPOLYGONOFFSETCLAMPPROC) (GLfloat factor, GLfloat units, GLfloat clamp); + +#define glPolygonOffsetClamp GLEW_GET_FUN(__glewPolygonOffsetClamp) + +#define GLEW_ARB_polygon_offset_clamp GLEW_GET_VAR(__GLEW_ARB_polygon_offset_clamp) + +#endif /* GL_ARB_polygon_offset_clamp */ + +/* ----------------------- GL_ARB_post_depth_coverage ---------------------- */ + +#ifndef GL_ARB_post_depth_coverage +#define GL_ARB_post_depth_coverage 1 + +#define GLEW_ARB_post_depth_coverage GLEW_GET_VAR(__GLEW_ARB_post_depth_coverage) + +#endif /* GL_ARB_post_depth_coverage */ + +/* --------------------- GL_ARB_program_interface_query -------------------- */ + +#ifndef GL_ARB_program_interface_query +#define GL_ARB_program_interface_query 1 + +#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_IS_PER_PATCH 0x92E7 +#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 + +typedef void (GLAPIENTRY * PFNGLGETPROGRAMINTERFACEIVPROC) (GLuint program, GLenum programInterface, GLenum pname, GLint* params); +typedef GLuint (GLAPIENTRY * PFNGLGETPROGRAMRESOURCEINDEXPROC) (GLuint program, GLenum programInterface, const GLchar* name); +typedef GLint (GLAPIENTRY * PFNGLGETPROGRAMRESOURCELOCATIONPROC) (GLuint program, GLenum programInterface, const GLchar* name); +typedef GLint (GLAPIENTRY * PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC) (GLuint program, GLenum programInterface, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMRESOURCENAMEPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei* length, GLchar *name); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMRESOURCEIVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum* props, GLsizei bufSize, GLsizei *length, GLint *params); + +#define glGetProgramInterfaceiv GLEW_GET_FUN(__glewGetProgramInterfaceiv) +#define glGetProgramResourceIndex GLEW_GET_FUN(__glewGetProgramResourceIndex) +#define glGetProgramResourceLocation GLEW_GET_FUN(__glewGetProgramResourceLocation) +#define glGetProgramResourceLocationIndex GLEW_GET_FUN(__glewGetProgramResourceLocationIndex) +#define glGetProgramResourceName GLEW_GET_FUN(__glewGetProgramResourceName) +#define glGetProgramResourceiv GLEW_GET_FUN(__glewGetProgramResourceiv) + +#define GLEW_ARB_program_interface_query GLEW_GET_VAR(__GLEW_ARB_program_interface_query) + +#endif /* GL_ARB_program_interface_query */ + +/* ------------------------ GL_ARB_provoking_vertex ------------------------ */ + +#ifndef GL_ARB_provoking_vertex +#define GL_ARB_provoking_vertex 1 + +#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 + +typedef void (GLAPIENTRY * PFNGLPROVOKINGVERTEXPROC) (GLenum mode); + +#define glProvokingVertex GLEW_GET_FUN(__glewProvokingVertex) + +#define GLEW_ARB_provoking_vertex GLEW_GET_VAR(__GLEW_ARB_provoking_vertex) + +#endif /* GL_ARB_provoking_vertex */ + +/* ----------------------- GL_ARB_query_buffer_object ---------------------- */ + +#ifndef GL_ARB_query_buffer_object +#define GL_ARB_query_buffer_object 1 + +#define GL_QUERY_BUFFER_BARRIER_BIT 0x00008000 +#define GL_QUERY_BUFFER 0x9192 +#define GL_QUERY_BUFFER_BINDING 0x9193 +#define GL_QUERY_RESULT_NO_WAIT 0x9194 + +#define GLEW_ARB_query_buffer_object GLEW_GET_VAR(__GLEW_ARB_query_buffer_object) + +#endif /* GL_ARB_query_buffer_object */ + +/* ------------------ GL_ARB_robust_buffer_access_behavior ----------------- */ + +#ifndef GL_ARB_robust_buffer_access_behavior +#define GL_ARB_robust_buffer_access_behavior 1 + +#define GLEW_ARB_robust_buffer_access_behavior GLEW_GET_VAR(__GLEW_ARB_robust_buffer_access_behavior) + +#endif /* GL_ARB_robust_buffer_access_behavior */ + +/* --------------------------- GL_ARB_robustness --------------------------- */ + +#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 (GLAPIENTRY * PFNGLGETGRAPHICSRESETSTATUSARBPROC) (void); +typedef void (GLAPIENTRY * PFNGLGETNCOLORTABLEARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void* table); +typedef void (GLAPIENTRY * PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, GLsizei bufSize, void* img); +typedef void (GLAPIENTRY * PFNGLGETNCONVOLUTIONFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void* image); +typedef void (GLAPIENTRY * PFNGLGETNHISTOGRAMARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void* values); +typedef void (GLAPIENTRY * PFNGLGETNMAPDVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLdouble* v); +typedef void (GLAPIENTRY * PFNGLGETNMAPFVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLfloat* v); +typedef void (GLAPIENTRY * PFNGLGETNMAPIVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLint* v); +typedef void (GLAPIENTRY * PFNGLGETNMINMAXARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void* values); +typedef void (GLAPIENTRY * PFNGLGETNPIXELMAPFVARBPROC) (GLenum map, GLsizei bufSize, GLfloat* values); +typedef void (GLAPIENTRY * PFNGLGETNPIXELMAPUIVARBPROC) (GLenum map, GLsizei bufSize, GLuint* values); +typedef void (GLAPIENTRY * PFNGLGETNPIXELMAPUSVARBPROC) (GLenum map, GLsizei bufSize, GLushort* values); +typedef void (GLAPIENTRY * PFNGLGETNPOLYGONSTIPPLEARBPROC) (GLsizei bufSize, GLubyte* pattern); +typedef void (GLAPIENTRY * PFNGLGETNSEPARABLEFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void* row, GLsizei columnBufSize, void*column, void*span); +typedef void (GLAPIENTRY * PFNGLGETNTEXIMAGEARBPROC) (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void* img); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMDVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMFVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMUIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint* params); +typedef void (GLAPIENTRY * PFNGLREADNPIXELSARBPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void* data); + +#define glGetGraphicsResetStatusARB GLEW_GET_FUN(__glewGetGraphicsResetStatusARB) +#define glGetnColorTableARB GLEW_GET_FUN(__glewGetnColorTableARB) +#define glGetnCompressedTexImageARB GLEW_GET_FUN(__glewGetnCompressedTexImageARB) +#define glGetnConvolutionFilterARB GLEW_GET_FUN(__glewGetnConvolutionFilterARB) +#define glGetnHistogramARB GLEW_GET_FUN(__glewGetnHistogramARB) +#define glGetnMapdvARB GLEW_GET_FUN(__glewGetnMapdvARB) +#define glGetnMapfvARB GLEW_GET_FUN(__glewGetnMapfvARB) +#define glGetnMapivARB GLEW_GET_FUN(__glewGetnMapivARB) +#define glGetnMinmaxARB GLEW_GET_FUN(__glewGetnMinmaxARB) +#define glGetnPixelMapfvARB GLEW_GET_FUN(__glewGetnPixelMapfvARB) +#define glGetnPixelMapuivARB GLEW_GET_FUN(__glewGetnPixelMapuivARB) +#define glGetnPixelMapusvARB GLEW_GET_FUN(__glewGetnPixelMapusvARB) +#define glGetnPolygonStippleARB GLEW_GET_FUN(__glewGetnPolygonStippleARB) +#define glGetnSeparableFilterARB GLEW_GET_FUN(__glewGetnSeparableFilterARB) +#define glGetnTexImageARB GLEW_GET_FUN(__glewGetnTexImageARB) +#define glGetnUniformdvARB GLEW_GET_FUN(__glewGetnUniformdvARB) +#define glGetnUniformfvARB GLEW_GET_FUN(__glewGetnUniformfvARB) +#define glGetnUniformivARB GLEW_GET_FUN(__glewGetnUniformivARB) +#define glGetnUniformuivARB GLEW_GET_FUN(__glewGetnUniformuivARB) +#define glReadnPixelsARB GLEW_GET_FUN(__glewReadnPixelsARB) + +#define GLEW_ARB_robustness GLEW_GET_VAR(__GLEW_ARB_robustness) + +#endif /* GL_ARB_robustness */ + +/* ---------------- GL_ARB_robustness_application_isolation ---------------- */ + +#ifndef GL_ARB_robustness_application_isolation +#define GL_ARB_robustness_application_isolation 1 + +#define GLEW_ARB_robustness_application_isolation GLEW_GET_VAR(__GLEW_ARB_robustness_application_isolation) + +#endif /* GL_ARB_robustness_application_isolation */ + +/* ---------------- GL_ARB_robustness_share_group_isolation ---------------- */ + +#ifndef GL_ARB_robustness_share_group_isolation +#define GL_ARB_robustness_share_group_isolation 1 + +#define GLEW_ARB_robustness_share_group_isolation GLEW_GET_VAR(__GLEW_ARB_robustness_share_group_isolation) + +#endif /* GL_ARB_robustness_share_group_isolation */ + +/* ------------------------ GL_ARB_sample_locations ------------------------ */ + +#ifndef GL_ARB_sample_locations +#define GL_ARB_sample_locations 1 + +#define GL_SAMPLE_LOCATION_ARB 0x8E50 +#define GL_SAMPLE_LOCATION_SUBPIXEL_BITS_ARB 0x933D +#define GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_ARB 0x933E +#define GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_ARB 0x933F +#define GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_ARB 0x9340 +#define GL_PROGRAMMABLE_SAMPLE_LOCATION_ARB 0x9341 +#define GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_ARB 0x9342 +#define GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_ARB 0x9343 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC) (GLenum target, GLuint start, GLsizei count, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC) (GLuint framebuffer, GLuint start, GLsizei count, const GLfloat* v); + +#define glFramebufferSampleLocationsfvARB GLEW_GET_FUN(__glewFramebufferSampleLocationsfvARB) +#define glNamedFramebufferSampleLocationsfvARB GLEW_GET_FUN(__glewNamedFramebufferSampleLocationsfvARB) + +#define GLEW_ARB_sample_locations GLEW_GET_VAR(__GLEW_ARB_sample_locations) + +#endif /* GL_ARB_sample_locations */ + +/* ------------------------- GL_ARB_sample_shading ------------------------- */ + +#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 (GLAPIENTRY * PFNGLMINSAMPLESHADINGARBPROC) (GLclampf value); + +#define glMinSampleShadingARB GLEW_GET_FUN(__glewMinSampleShadingARB) + +#define GLEW_ARB_sample_shading GLEW_GET_VAR(__GLEW_ARB_sample_shading) + +#endif /* GL_ARB_sample_shading */ + +/* ------------------------- GL_ARB_sampler_objects ------------------------ */ + +#ifndef GL_ARB_sampler_objects +#define GL_ARB_sampler_objects 1 + +#define GL_SAMPLER_BINDING 0x8919 + +typedef void (GLAPIENTRY * PFNGLBINDSAMPLERPROC) (GLuint unit, GLuint sampler); +typedef void (GLAPIENTRY * PFNGLDELETESAMPLERSPROC) (GLsizei count, const GLuint * samplers); +typedef void (GLAPIENTRY * PFNGLGENSAMPLERSPROC) (GLsizei count, GLuint* samplers); +typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISSAMPLERPROC) (GLuint sampler); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERFPROC) (GLuint sampler, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIPROC) (GLuint sampler, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, const GLint* params); + +#define glBindSampler GLEW_GET_FUN(__glewBindSampler) +#define glDeleteSamplers GLEW_GET_FUN(__glewDeleteSamplers) +#define glGenSamplers GLEW_GET_FUN(__glewGenSamplers) +#define glGetSamplerParameterIiv GLEW_GET_FUN(__glewGetSamplerParameterIiv) +#define glGetSamplerParameterIuiv GLEW_GET_FUN(__glewGetSamplerParameterIuiv) +#define glGetSamplerParameterfv GLEW_GET_FUN(__glewGetSamplerParameterfv) +#define glGetSamplerParameteriv GLEW_GET_FUN(__glewGetSamplerParameteriv) +#define glIsSampler GLEW_GET_FUN(__glewIsSampler) +#define glSamplerParameterIiv GLEW_GET_FUN(__glewSamplerParameterIiv) +#define glSamplerParameterIuiv GLEW_GET_FUN(__glewSamplerParameterIuiv) +#define glSamplerParameterf GLEW_GET_FUN(__glewSamplerParameterf) +#define glSamplerParameterfv GLEW_GET_FUN(__glewSamplerParameterfv) +#define glSamplerParameteri GLEW_GET_FUN(__glewSamplerParameteri) +#define glSamplerParameteriv GLEW_GET_FUN(__glewSamplerParameteriv) + +#define GLEW_ARB_sampler_objects GLEW_GET_VAR(__GLEW_ARB_sampler_objects) + +#endif /* GL_ARB_sampler_objects */ + +/* ------------------------ GL_ARB_seamless_cube_map ----------------------- */ + +#ifndef GL_ARB_seamless_cube_map +#define GL_ARB_seamless_cube_map 1 + +#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F + +#define GLEW_ARB_seamless_cube_map GLEW_GET_VAR(__GLEW_ARB_seamless_cube_map) + +#endif /* GL_ARB_seamless_cube_map */ + +/* ------------------ GL_ARB_seamless_cubemap_per_texture ------------------ */ + +#ifndef GL_ARB_seamless_cubemap_per_texture +#define GL_ARB_seamless_cubemap_per_texture 1 + +#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F + +#define GLEW_ARB_seamless_cubemap_per_texture GLEW_GET_VAR(__GLEW_ARB_seamless_cubemap_per_texture) + +#endif /* GL_ARB_seamless_cubemap_per_texture */ + +/* --------------------- GL_ARB_separate_shader_objects -------------------- */ + +#ifndef GL_ARB_separate_shader_objects +#define GL_ARB_separate_shader_objects 1 + +#define GL_VERTEX_SHADER_BIT 0x00000001 +#define GL_FRAGMENT_SHADER_BIT 0x00000002 +#define GL_GEOMETRY_SHADER_BIT 0x00000004 +#define GL_TESS_CONTROL_SHADER_BIT 0x00000008 +#define GL_TESS_EVALUATION_SHADER_BIT 0x00000010 +#define GL_PROGRAM_SEPARABLE 0x8258 +#define GL_ACTIVE_PROGRAM 0x8259 +#define GL_PROGRAM_PIPELINE_BINDING 0x825A +#define GL_ALL_SHADER_BITS 0xFFFFFFFF + +typedef void (GLAPIENTRY * PFNGLACTIVESHADERPROGRAMPROC) (GLuint pipeline, GLuint program); +typedef void (GLAPIENTRY * PFNGLBINDPROGRAMPIPELINEPROC) (GLuint pipeline); +typedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROGRAMVPROC) (GLenum type, GLsizei count, const GLchar * const * strings); +typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMPIPELINESPROC) (GLsizei n, const GLuint* pipelines); +typedef void (GLAPIENTRY * PFNGLGENPROGRAMPIPELINESPROC) (GLsizei n, GLuint* pipelines); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMPIPELINEINFOLOGPROC) (GLuint pipeline, GLsizei bufSize, GLsizei* length, GLchar *infoLog); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMPIPELINEIVPROC) (GLuint pipeline, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMPIPELINEPROC) (GLuint pipeline); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1DPROC) (GLuint program, GLint location, GLdouble x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FPROC) (GLuint program, GLint location, GLfloat x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IPROC) (GLuint program, GLint location, GLint x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIPROC) (GLuint program, GLint location, GLuint x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2DPROC) (GLuint program, GLint location, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FPROC) (GLuint program, GLint location, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IPROC) (GLuint program, GLint location, GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIPROC) (GLuint program, GLint location, GLuint x, GLuint y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3DPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIPROC) (GLuint program, GLint location, GLuint x, GLuint y, GLuint z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4DPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIPROC) (GLuint program, GLint location, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUSEPROGRAMSTAGESPROC) (GLuint pipeline, GLbitfield stages, GLuint program); +typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMPIPELINEPROC) (GLuint pipeline); + +#define glActiveShaderProgram GLEW_GET_FUN(__glewActiveShaderProgram) +#define glBindProgramPipeline GLEW_GET_FUN(__glewBindProgramPipeline) +#define glCreateShaderProgramv GLEW_GET_FUN(__glewCreateShaderProgramv) +#define glDeleteProgramPipelines GLEW_GET_FUN(__glewDeleteProgramPipelines) +#define glGenProgramPipelines GLEW_GET_FUN(__glewGenProgramPipelines) +#define glGetProgramPipelineInfoLog GLEW_GET_FUN(__glewGetProgramPipelineInfoLog) +#define glGetProgramPipelineiv GLEW_GET_FUN(__glewGetProgramPipelineiv) +#define glIsProgramPipeline GLEW_GET_FUN(__glewIsProgramPipeline) +#define glProgramUniform1d GLEW_GET_FUN(__glewProgramUniform1d) +#define glProgramUniform1dv GLEW_GET_FUN(__glewProgramUniform1dv) +#define glProgramUniform1f GLEW_GET_FUN(__glewProgramUniform1f) +#define glProgramUniform1fv GLEW_GET_FUN(__glewProgramUniform1fv) +#define glProgramUniform1i GLEW_GET_FUN(__glewProgramUniform1i) +#define glProgramUniform1iv GLEW_GET_FUN(__glewProgramUniform1iv) +#define glProgramUniform1ui GLEW_GET_FUN(__glewProgramUniform1ui) +#define glProgramUniform1uiv GLEW_GET_FUN(__glewProgramUniform1uiv) +#define glProgramUniform2d GLEW_GET_FUN(__glewProgramUniform2d) +#define glProgramUniform2dv GLEW_GET_FUN(__glewProgramUniform2dv) +#define glProgramUniform2f GLEW_GET_FUN(__glewProgramUniform2f) +#define glProgramUniform2fv GLEW_GET_FUN(__glewProgramUniform2fv) +#define glProgramUniform2i GLEW_GET_FUN(__glewProgramUniform2i) +#define glProgramUniform2iv GLEW_GET_FUN(__glewProgramUniform2iv) +#define glProgramUniform2ui GLEW_GET_FUN(__glewProgramUniform2ui) +#define glProgramUniform2uiv GLEW_GET_FUN(__glewProgramUniform2uiv) +#define glProgramUniform3d GLEW_GET_FUN(__glewProgramUniform3d) +#define glProgramUniform3dv GLEW_GET_FUN(__glewProgramUniform3dv) +#define glProgramUniform3f GLEW_GET_FUN(__glewProgramUniform3f) +#define glProgramUniform3fv GLEW_GET_FUN(__glewProgramUniform3fv) +#define glProgramUniform3i GLEW_GET_FUN(__glewProgramUniform3i) +#define glProgramUniform3iv GLEW_GET_FUN(__glewProgramUniform3iv) +#define glProgramUniform3ui GLEW_GET_FUN(__glewProgramUniform3ui) +#define glProgramUniform3uiv GLEW_GET_FUN(__glewProgramUniform3uiv) +#define glProgramUniform4d GLEW_GET_FUN(__glewProgramUniform4d) +#define glProgramUniform4dv GLEW_GET_FUN(__glewProgramUniform4dv) +#define glProgramUniform4f GLEW_GET_FUN(__glewProgramUniform4f) +#define glProgramUniform4fv GLEW_GET_FUN(__glewProgramUniform4fv) +#define glProgramUniform4i GLEW_GET_FUN(__glewProgramUniform4i) +#define glProgramUniform4iv GLEW_GET_FUN(__glewProgramUniform4iv) +#define glProgramUniform4ui GLEW_GET_FUN(__glewProgramUniform4ui) +#define glProgramUniform4uiv GLEW_GET_FUN(__glewProgramUniform4uiv) +#define glProgramUniformMatrix2dv GLEW_GET_FUN(__glewProgramUniformMatrix2dv) +#define glProgramUniformMatrix2fv GLEW_GET_FUN(__glewProgramUniformMatrix2fv) +#define glProgramUniformMatrix2x3dv GLEW_GET_FUN(__glewProgramUniformMatrix2x3dv) +#define glProgramUniformMatrix2x3fv GLEW_GET_FUN(__glewProgramUniformMatrix2x3fv) +#define glProgramUniformMatrix2x4dv GLEW_GET_FUN(__glewProgramUniformMatrix2x4dv) +#define glProgramUniformMatrix2x4fv GLEW_GET_FUN(__glewProgramUniformMatrix2x4fv) +#define glProgramUniformMatrix3dv GLEW_GET_FUN(__glewProgramUniformMatrix3dv) +#define glProgramUniformMatrix3fv GLEW_GET_FUN(__glewProgramUniformMatrix3fv) +#define glProgramUniformMatrix3x2dv GLEW_GET_FUN(__glewProgramUniformMatrix3x2dv) +#define glProgramUniformMatrix3x2fv GLEW_GET_FUN(__glewProgramUniformMatrix3x2fv) +#define glProgramUniformMatrix3x4dv GLEW_GET_FUN(__glewProgramUniformMatrix3x4dv) +#define glProgramUniformMatrix3x4fv GLEW_GET_FUN(__glewProgramUniformMatrix3x4fv) +#define glProgramUniformMatrix4dv GLEW_GET_FUN(__glewProgramUniformMatrix4dv) +#define glProgramUniformMatrix4fv GLEW_GET_FUN(__glewProgramUniformMatrix4fv) +#define glProgramUniformMatrix4x2dv GLEW_GET_FUN(__glewProgramUniformMatrix4x2dv) +#define glProgramUniformMatrix4x2fv GLEW_GET_FUN(__glewProgramUniformMatrix4x2fv) +#define glProgramUniformMatrix4x3dv GLEW_GET_FUN(__glewProgramUniformMatrix4x3dv) +#define glProgramUniformMatrix4x3fv GLEW_GET_FUN(__glewProgramUniformMatrix4x3fv) +#define glUseProgramStages GLEW_GET_FUN(__glewUseProgramStages) +#define glValidateProgramPipeline GLEW_GET_FUN(__glewValidateProgramPipeline) + +#define GLEW_ARB_separate_shader_objects GLEW_GET_VAR(__GLEW_ARB_separate_shader_objects) + +#endif /* GL_ARB_separate_shader_objects */ + +/* -------------------- GL_ARB_shader_atomic_counter_ops ------------------- */ + +#ifndef GL_ARB_shader_atomic_counter_ops +#define GL_ARB_shader_atomic_counter_ops 1 + +#define GLEW_ARB_shader_atomic_counter_ops GLEW_GET_VAR(__GLEW_ARB_shader_atomic_counter_ops) + +#endif /* GL_ARB_shader_atomic_counter_ops */ + +/* --------------------- GL_ARB_shader_atomic_counters --------------------- */ + +#ifndef GL_ARB_shader_atomic_counters +#define GL_ARB_shader_atomic_counters 1 + +#define GL_ATOMIC_COUNTER_BUFFER 0x92C0 +#define GL_ATOMIC_COUNTER_BUFFER_BINDING 0x92C1 +#define GL_ATOMIC_COUNTER_BUFFER_START 0x92C2 +#define GL_ATOMIC_COUNTER_BUFFER_SIZE 0x92C3 +#define GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE 0x92C4 +#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS 0x92C5 +#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES 0x92C6 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER 0x92C7 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER 0x92C8 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER 0x92C9 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER 0x92CA +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER 0x92CB +#define GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS 0x92CC +#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS 0x92CD +#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS 0x92CE +#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS 0x92CF +#define GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS 0x92D0 +#define GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS 0x92D1 +#define GL_MAX_VERTEX_ATOMIC_COUNTERS 0x92D2 +#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS 0x92D3 +#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS 0x92D4 +#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS 0x92D5 +#define GL_MAX_FRAGMENT_ATOMIC_COUNTERS 0x92D6 +#define GL_MAX_COMBINED_ATOMIC_COUNTERS 0x92D7 +#define GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE 0x92D8 +#define GL_ACTIVE_ATOMIC_COUNTER_BUFFERS 0x92D9 +#define GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX 0x92DA +#define GL_UNSIGNED_INT_ATOMIC_COUNTER 0x92DB +#define GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS 0x92DC + +typedef void (GLAPIENTRY * PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC) (GLuint program, GLuint bufferIndex, GLenum pname, GLint* params); + +#define glGetActiveAtomicCounterBufferiv GLEW_GET_FUN(__glewGetActiveAtomicCounterBufferiv) + +#define GLEW_ARB_shader_atomic_counters GLEW_GET_VAR(__GLEW_ARB_shader_atomic_counters) + +#endif /* GL_ARB_shader_atomic_counters */ + +/* -------------------------- GL_ARB_shader_ballot ------------------------- */ + +#ifndef GL_ARB_shader_ballot +#define GL_ARB_shader_ballot 1 + +#define GLEW_ARB_shader_ballot GLEW_GET_VAR(__GLEW_ARB_shader_ballot) + +#endif /* GL_ARB_shader_ballot */ + +/* ----------------------- GL_ARB_shader_bit_encoding ---------------------- */ + +#ifndef GL_ARB_shader_bit_encoding +#define GL_ARB_shader_bit_encoding 1 + +#define GLEW_ARB_shader_bit_encoding GLEW_GET_VAR(__GLEW_ARB_shader_bit_encoding) + +#endif /* GL_ARB_shader_bit_encoding */ + +/* -------------------------- GL_ARB_shader_clock -------------------------- */ + +#ifndef GL_ARB_shader_clock +#define GL_ARB_shader_clock 1 + +#define GLEW_ARB_shader_clock GLEW_GET_VAR(__GLEW_ARB_shader_clock) + +#endif /* GL_ARB_shader_clock */ + +/* --------------------- GL_ARB_shader_draw_parameters --------------------- */ + +#ifndef GL_ARB_shader_draw_parameters +#define GL_ARB_shader_draw_parameters 1 + +#define GLEW_ARB_shader_draw_parameters GLEW_GET_VAR(__GLEW_ARB_shader_draw_parameters) + +#endif /* GL_ARB_shader_draw_parameters */ + +/* ------------------------ GL_ARB_shader_group_vote ----------------------- */ + +#ifndef GL_ARB_shader_group_vote +#define GL_ARB_shader_group_vote 1 + +#define GLEW_ARB_shader_group_vote GLEW_GET_VAR(__GLEW_ARB_shader_group_vote) + +#endif /* GL_ARB_shader_group_vote */ + +/* --------------------- GL_ARB_shader_image_load_store -------------------- */ + +#ifndef GL_ARB_shader_image_load_store +#define GL_ARB_shader_image_load_store 1 + +#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT 0x00000001 +#define GL_ELEMENT_ARRAY_BARRIER_BIT 0x00000002 +#define GL_UNIFORM_BARRIER_BIT 0x00000004 +#define GL_TEXTURE_FETCH_BARRIER_BIT 0x00000008 +#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT 0x00000020 +#define GL_COMMAND_BARRIER_BIT 0x00000040 +#define GL_PIXEL_BUFFER_BARRIER_BIT 0x00000080 +#define GL_TEXTURE_UPDATE_BARRIER_BIT 0x00000100 +#define GL_BUFFER_UPDATE_BARRIER_BIT 0x00000200 +#define GL_FRAMEBUFFER_BARRIER_BIT 0x00000400 +#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT 0x00000800 +#define GL_ATOMIC_COUNTER_BARRIER_BIT 0x00001000 +#define GL_MAX_IMAGE_UNITS 0x8F38 +#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS 0x8F39 +#define GL_IMAGE_BINDING_NAME 0x8F3A +#define GL_IMAGE_BINDING_LEVEL 0x8F3B +#define GL_IMAGE_BINDING_LAYERED 0x8F3C +#define GL_IMAGE_BINDING_LAYER 0x8F3D +#define GL_IMAGE_BINDING_ACCESS 0x8F3E +#define GL_IMAGE_1D 0x904C +#define GL_IMAGE_2D 0x904D +#define GL_IMAGE_3D 0x904E +#define GL_IMAGE_2D_RECT 0x904F +#define GL_IMAGE_CUBE 0x9050 +#define GL_IMAGE_BUFFER 0x9051 +#define GL_IMAGE_1D_ARRAY 0x9052 +#define GL_IMAGE_2D_ARRAY 0x9053 +#define GL_IMAGE_CUBE_MAP_ARRAY 0x9054 +#define GL_IMAGE_2D_MULTISAMPLE 0x9055 +#define GL_IMAGE_2D_MULTISAMPLE_ARRAY 0x9056 +#define GL_INT_IMAGE_1D 0x9057 +#define GL_INT_IMAGE_2D 0x9058 +#define GL_INT_IMAGE_3D 0x9059 +#define GL_INT_IMAGE_2D_RECT 0x905A +#define GL_INT_IMAGE_CUBE 0x905B +#define GL_INT_IMAGE_BUFFER 0x905C +#define GL_INT_IMAGE_1D_ARRAY 0x905D +#define GL_INT_IMAGE_2D_ARRAY 0x905E +#define GL_INT_IMAGE_CUBE_MAP_ARRAY 0x905F +#define GL_INT_IMAGE_2D_MULTISAMPLE 0x9060 +#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x9061 +#define GL_UNSIGNED_INT_IMAGE_1D 0x9062 +#define GL_UNSIGNED_INT_IMAGE_2D 0x9063 +#define GL_UNSIGNED_INT_IMAGE_3D 0x9064 +#define GL_UNSIGNED_INT_IMAGE_2D_RECT 0x9065 +#define GL_UNSIGNED_INT_IMAGE_CUBE 0x9066 +#define GL_UNSIGNED_INT_IMAGE_BUFFER 0x9067 +#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY 0x9068 +#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY 0x9069 +#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY 0x906A +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE 0x906B +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x906C +#define GL_MAX_IMAGE_SAMPLES 0x906D +#define GL_IMAGE_BINDING_FORMAT 0x906E +#define GL_IMAGE_FORMAT_COMPATIBILITY_TYPE 0x90C7 +#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE 0x90C8 +#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS 0x90C9 +#define GL_MAX_VERTEX_IMAGE_UNIFORMS 0x90CA +#define GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS 0x90CB +#define GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS 0x90CC +#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS 0x90CD +#define GL_MAX_FRAGMENT_IMAGE_UNIFORMS 0x90CE +#define GL_MAX_COMBINED_IMAGE_UNIFORMS 0x90CF +#define GL_ALL_BARRIER_BITS 0xFFFFFFFF + +typedef void (GLAPIENTRY * PFNGLBINDIMAGETEXTUREPROC) (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format); +typedef void (GLAPIENTRY * PFNGLMEMORYBARRIERPROC) (GLbitfield barriers); + +#define glBindImageTexture GLEW_GET_FUN(__glewBindImageTexture) +#define glMemoryBarrier GLEW_GET_FUN(__glewMemoryBarrier) + +#define GLEW_ARB_shader_image_load_store GLEW_GET_VAR(__GLEW_ARB_shader_image_load_store) + +#endif /* GL_ARB_shader_image_load_store */ + +/* ------------------------ GL_ARB_shader_image_size ----------------------- */ + +#ifndef GL_ARB_shader_image_size +#define GL_ARB_shader_image_size 1 + +#define GLEW_ARB_shader_image_size GLEW_GET_VAR(__GLEW_ARB_shader_image_size) + +#endif /* GL_ARB_shader_image_size */ + +/* ------------------------- GL_ARB_shader_objects ------------------------- */ + +#ifndef GL_ARB_shader_objects +#define GL_ARB_shader_objects 1 + +#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 char GLcharARB; +typedef unsigned int GLhandleARB; + +typedef void (GLAPIENTRY * PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj); +typedef void (GLAPIENTRY * PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj); +typedef GLhandleARB (GLAPIENTRY * PFNGLCREATEPROGRAMOBJECTARBPROC) (void); +typedef GLhandleARB (GLAPIENTRY * PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType); +typedef void (GLAPIENTRY * PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj); +typedef void (GLAPIENTRY * PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei* length, GLint *size, GLenum *type, GLcharARB *name); +typedef void (GLAPIENTRY * PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei* count, GLhandleARB *obj); +typedef GLhandleARB (GLAPIENTRY * PFNGLGETHANDLEARBPROC) (GLenum pname); +typedef void (GLAPIENTRY * PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei* length, GLcharARB *infoLog); +typedef void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei* length, GLcharARB *source); +typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB* name); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint* params); +typedef void (GLAPIENTRY * PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj); +typedef void (GLAPIENTRY * PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB ** string, const GLint *length); +typedef void (GLAPIENTRY * PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj); +typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj); + +#define glAttachObjectARB GLEW_GET_FUN(__glewAttachObjectARB) +#define glCompileShaderARB GLEW_GET_FUN(__glewCompileShaderARB) +#define glCreateProgramObjectARB GLEW_GET_FUN(__glewCreateProgramObjectARB) +#define glCreateShaderObjectARB GLEW_GET_FUN(__glewCreateShaderObjectARB) +#define glDeleteObjectARB GLEW_GET_FUN(__glewDeleteObjectARB) +#define glDetachObjectARB GLEW_GET_FUN(__glewDetachObjectARB) +#define glGetActiveUniformARB GLEW_GET_FUN(__glewGetActiveUniformARB) +#define glGetAttachedObjectsARB GLEW_GET_FUN(__glewGetAttachedObjectsARB) +#define glGetHandleARB GLEW_GET_FUN(__glewGetHandleARB) +#define glGetInfoLogARB GLEW_GET_FUN(__glewGetInfoLogARB) +#define glGetObjectParameterfvARB GLEW_GET_FUN(__glewGetObjectParameterfvARB) +#define glGetObjectParameterivARB GLEW_GET_FUN(__glewGetObjectParameterivARB) +#define glGetShaderSourceARB GLEW_GET_FUN(__glewGetShaderSourceARB) +#define glGetUniformLocationARB GLEW_GET_FUN(__glewGetUniformLocationARB) +#define glGetUniformfvARB GLEW_GET_FUN(__glewGetUniformfvARB) +#define glGetUniformivARB GLEW_GET_FUN(__glewGetUniformivARB) +#define glLinkProgramARB GLEW_GET_FUN(__glewLinkProgramARB) +#define glShaderSourceARB GLEW_GET_FUN(__glewShaderSourceARB) +#define glUniform1fARB GLEW_GET_FUN(__glewUniform1fARB) +#define glUniform1fvARB GLEW_GET_FUN(__glewUniform1fvARB) +#define glUniform1iARB GLEW_GET_FUN(__glewUniform1iARB) +#define glUniform1ivARB GLEW_GET_FUN(__glewUniform1ivARB) +#define glUniform2fARB GLEW_GET_FUN(__glewUniform2fARB) +#define glUniform2fvARB GLEW_GET_FUN(__glewUniform2fvARB) +#define glUniform2iARB GLEW_GET_FUN(__glewUniform2iARB) +#define glUniform2ivARB GLEW_GET_FUN(__glewUniform2ivARB) +#define glUniform3fARB GLEW_GET_FUN(__glewUniform3fARB) +#define glUniform3fvARB GLEW_GET_FUN(__glewUniform3fvARB) +#define glUniform3iARB GLEW_GET_FUN(__glewUniform3iARB) +#define glUniform3ivARB GLEW_GET_FUN(__glewUniform3ivARB) +#define glUniform4fARB GLEW_GET_FUN(__glewUniform4fARB) +#define glUniform4fvARB GLEW_GET_FUN(__glewUniform4fvARB) +#define glUniform4iARB GLEW_GET_FUN(__glewUniform4iARB) +#define glUniform4ivARB GLEW_GET_FUN(__glewUniform4ivARB) +#define glUniformMatrix2fvARB GLEW_GET_FUN(__glewUniformMatrix2fvARB) +#define glUniformMatrix3fvARB GLEW_GET_FUN(__glewUniformMatrix3fvARB) +#define glUniformMatrix4fvARB GLEW_GET_FUN(__glewUniformMatrix4fvARB) +#define glUseProgramObjectARB GLEW_GET_FUN(__glewUseProgramObjectARB) +#define glValidateProgramARB GLEW_GET_FUN(__glewValidateProgramARB) + +#define GLEW_ARB_shader_objects GLEW_GET_VAR(__GLEW_ARB_shader_objects) + +#endif /* GL_ARB_shader_objects */ + +/* ------------------------ GL_ARB_shader_precision ------------------------ */ + +#ifndef GL_ARB_shader_precision +#define GL_ARB_shader_precision 1 + +#define GLEW_ARB_shader_precision GLEW_GET_VAR(__GLEW_ARB_shader_precision) + +#endif /* GL_ARB_shader_precision */ + +/* ---------------------- GL_ARB_shader_stencil_export --------------------- */ + +#ifndef GL_ARB_shader_stencil_export +#define GL_ARB_shader_stencil_export 1 + +#define GLEW_ARB_shader_stencil_export GLEW_GET_VAR(__GLEW_ARB_shader_stencil_export) + +#endif /* GL_ARB_shader_stencil_export */ + +/* ------------------ GL_ARB_shader_storage_buffer_object ------------------ */ + +#ifndef GL_ARB_shader_storage_buffer_object +#define GL_ARB_shader_storage_buffer_object 1 + +#define GL_SHADER_STORAGE_BARRIER_BIT 0x2000 +#define GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES 0x8F39 +#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 + +typedef void (GLAPIENTRY * PFNGLSHADERSTORAGEBLOCKBINDINGPROC) (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding); + +#define glShaderStorageBlockBinding GLEW_GET_FUN(__glewShaderStorageBlockBinding) + +#define GLEW_ARB_shader_storage_buffer_object GLEW_GET_VAR(__GLEW_ARB_shader_storage_buffer_object) + +#endif /* GL_ARB_shader_storage_buffer_object */ + +/* ------------------------ GL_ARB_shader_subroutine ----------------------- */ + +#ifndef GL_ARB_shader_subroutine +#define GL_ARB_shader_subroutine 1 + +#define GL_ACTIVE_SUBROUTINES 0x8DE5 +#define GL_ACTIVE_SUBROUTINE_UNIFORMS 0x8DE6 +#define GL_MAX_SUBROUTINES 0x8DE7 +#define GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS 0x8DE8 +#define GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS 0x8E47 +#define GL_ACTIVE_SUBROUTINE_MAX_LENGTH 0x8E48 +#define GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH 0x8E49 +#define GL_NUM_COMPATIBLE_SUBROUTINES 0x8E4A +#define GL_COMPATIBLE_SUBROUTINES 0x8E4B + +typedef void (GLAPIENTRY * PFNGLGETACTIVESUBROUTINENAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei* length, GLchar *name); +typedef void (GLAPIENTRY * PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei* length, GLchar *name); +typedef void (GLAPIENTRY * PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC) (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint* values); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTAGEIVPROC) (GLuint program, GLenum shadertype, GLenum pname, GLint* values); +typedef GLuint (GLAPIENTRY * PFNGLGETSUBROUTINEINDEXPROC) (GLuint program, GLenum shadertype, const GLchar* name); +typedef GLint (GLAPIENTRY * PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC) (GLuint program, GLenum shadertype, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMSUBROUTINEUIVPROC) (GLenum shadertype, GLint location, GLuint* params); +typedef void (GLAPIENTRY * PFNGLUNIFORMSUBROUTINESUIVPROC) (GLenum shadertype, GLsizei count, const GLuint* indices); + +#define glGetActiveSubroutineName GLEW_GET_FUN(__glewGetActiveSubroutineName) +#define glGetActiveSubroutineUniformName GLEW_GET_FUN(__glewGetActiveSubroutineUniformName) +#define glGetActiveSubroutineUniformiv GLEW_GET_FUN(__glewGetActiveSubroutineUniformiv) +#define glGetProgramStageiv GLEW_GET_FUN(__glewGetProgramStageiv) +#define glGetSubroutineIndex GLEW_GET_FUN(__glewGetSubroutineIndex) +#define glGetSubroutineUniformLocation GLEW_GET_FUN(__glewGetSubroutineUniformLocation) +#define glGetUniformSubroutineuiv GLEW_GET_FUN(__glewGetUniformSubroutineuiv) +#define glUniformSubroutinesuiv GLEW_GET_FUN(__glewUniformSubroutinesuiv) + +#define GLEW_ARB_shader_subroutine GLEW_GET_VAR(__GLEW_ARB_shader_subroutine) + +#endif /* GL_ARB_shader_subroutine */ + +/* ------------------ GL_ARB_shader_texture_image_samples ------------------ */ + +#ifndef GL_ARB_shader_texture_image_samples +#define GL_ARB_shader_texture_image_samples 1 + +#define GLEW_ARB_shader_texture_image_samples GLEW_GET_VAR(__GLEW_ARB_shader_texture_image_samples) + +#endif /* GL_ARB_shader_texture_image_samples */ + +/* ----------------------- GL_ARB_shader_texture_lod ----------------------- */ + +#ifndef GL_ARB_shader_texture_lod +#define GL_ARB_shader_texture_lod 1 + +#define GLEW_ARB_shader_texture_lod GLEW_GET_VAR(__GLEW_ARB_shader_texture_lod) + +#endif /* GL_ARB_shader_texture_lod */ + +/* ------------------- GL_ARB_shader_viewport_layer_array ------------------ */ + +#ifndef GL_ARB_shader_viewport_layer_array +#define GL_ARB_shader_viewport_layer_array 1 + +#define GLEW_ARB_shader_viewport_layer_array GLEW_GET_VAR(__GLEW_ARB_shader_viewport_layer_array) + +#endif /* GL_ARB_shader_viewport_layer_array */ + +/* ---------------------- GL_ARB_shading_language_100 ---------------------- */ + +#ifndef GL_ARB_shading_language_100 +#define GL_ARB_shading_language_100 1 + +#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C + +#define GLEW_ARB_shading_language_100 GLEW_GET_VAR(__GLEW_ARB_shading_language_100) + +#endif /* GL_ARB_shading_language_100 */ + +/* -------------------- GL_ARB_shading_language_420pack -------------------- */ + +#ifndef GL_ARB_shading_language_420pack +#define GL_ARB_shading_language_420pack 1 + +#define GLEW_ARB_shading_language_420pack GLEW_GET_VAR(__GLEW_ARB_shading_language_420pack) + +#endif /* GL_ARB_shading_language_420pack */ + +/* -------------------- GL_ARB_shading_language_include -------------------- */ + +#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 (GLAPIENTRY * PFNGLCOMPILESHADERINCLUDEARBPROC) (GLuint shader, GLsizei count, const GLchar* const *path, const GLint *length); +typedef void (GLAPIENTRY * PFNGLDELETENAMEDSTRINGARBPROC) (GLint namelen, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETNAMEDSTRINGARBPROC) (GLint namelen, const GLchar* name, GLsizei bufSize, GLint *stringlen, GLchar *string); +typedef void (GLAPIENTRY * PFNGLGETNAMEDSTRINGIVARBPROC) (GLint namelen, const GLchar* name, GLenum pname, GLint *params); +typedef GLboolean (GLAPIENTRY * PFNGLISNAMEDSTRINGARBPROC) (GLint namelen, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLNAMEDSTRINGARBPROC) (GLenum type, GLint namelen, const GLchar* name, GLint stringlen, const GLchar *string); + +#define glCompileShaderIncludeARB GLEW_GET_FUN(__glewCompileShaderIncludeARB) +#define glDeleteNamedStringARB GLEW_GET_FUN(__glewDeleteNamedStringARB) +#define glGetNamedStringARB GLEW_GET_FUN(__glewGetNamedStringARB) +#define glGetNamedStringivARB GLEW_GET_FUN(__glewGetNamedStringivARB) +#define glIsNamedStringARB GLEW_GET_FUN(__glewIsNamedStringARB) +#define glNamedStringARB GLEW_GET_FUN(__glewNamedStringARB) + +#define GLEW_ARB_shading_language_include GLEW_GET_VAR(__GLEW_ARB_shading_language_include) + +#endif /* GL_ARB_shading_language_include */ + +/* -------------------- GL_ARB_shading_language_packing -------------------- */ + +#ifndef GL_ARB_shading_language_packing +#define GL_ARB_shading_language_packing 1 + +#define GLEW_ARB_shading_language_packing GLEW_GET_VAR(__GLEW_ARB_shading_language_packing) + +#endif /* GL_ARB_shading_language_packing */ + +/* ----------------------------- GL_ARB_shadow ----------------------------- */ + +#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 + +#define GLEW_ARB_shadow GLEW_GET_VAR(__GLEW_ARB_shadow) + +#endif /* GL_ARB_shadow */ + +/* ------------------------- GL_ARB_shadow_ambient ------------------------- */ + +#ifndef GL_ARB_shadow_ambient +#define GL_ARB_shadow_ambient 1 + +#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF + +#define GLEW_ARB_shadow_ambient GLEW_GET_VAR(__GLEW_ARB_shadow_ambient) + +#endif /* GL_ARB_shadow_ambient */ + +/* -------------------------- GL_ARB_sparse_buffer ------------------------- */ + +#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 (GLAPIENTRY * PFNGLBUFFERPAGECOMMITMENTARBPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLboolean commit); + +#define glBufferPageCommitmentARB GLEW_GET_FUN(__glewBufferPageCommitmentARB) + +#define GLEW_ARB_sparse_buffer GLEW_GET_VAR(__GLEW_ARB_sparse_buffer) + +#endif /* GL_ARB_sparse_buffer */ + +/* ------------------------- GL_ARB_sparse_texture ------------------------- */ + +#ifndef GL_ARB_sparse_texture +#define GL_ARB_sparse_texture 1 + +#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_TEXTURE_SPARSE_ARB 0x91A6 +#define GL_VIRTUAL_PAGE_SIZE_INDEX_ARB 0x91A7 +#define GL_NUM_VIRTUAL_PAGE_SIZES_ARB 0x91A8 +#define GL_SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_ARB 0x91A9 +#define GL_NUM_SPARSE_LEVELS_ARB 0x91AA + +typedef void (GLAPIENTRY * PFNGLTEXPAGECOMMITMENTARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); + +#define glTexPageCommitmentARB GLEW_GET_FUN(__glewTexPageCommitmentARB) + +#define GLEW_ARB_sparse_texture GLEW_GET_VAR(__GLEW_ARB_sparse_texture) + +#endif /* GL_ARB_sparse_texture */ + +/* ------------------------- GL_ARB_sparse_texture2 ------------------------ */ + +#ifndef GL_ARB_sparse_texture2 +#define GL_ARB_sparse_texture2 1 + +#define GLEW_ARB_sparse_texture2 GLEW_GET_VAR(__GLEW_ARB_sparse_texture2) + +#endif /* GL_ARB_sparse_texture2 */ + +/* ---------------------- GL_ARB_sparse_texture_clamp ---------------------- */ + +#ifndef GL_ARB_sparse_texture_clamp +#define GL_ARB_sparse_texture_clamp 1 + +#define GLEW_ARB_sparse_texture_clamp GLEW_GET_VAR(__GLEW_ARB_sparse_texture_clamp) + +#endif /* GL_ARB_sparse_texture_clamp */ + +/* ------------------------ GL_ARB_spirv_extensions ------------------------ */ + +#ifndef GL_ARB_spirv_extensions +#define GL_ARB_spirv_extensions 1 + +#define GL_SPIR_V_EXTENSIONS 0x9553 +#define GL_NUM_SPIR_V_EXTENSIONS 0x9554 + +#define GLEW_ARB_spirv_extensions GLEW_GET_VAR(__GLEW_ARB_spirv_extensions) + +#endif /* GL_ARB_spirv_extensions */ + +/* ------------------------ GL_ARB_stencil_texturing ----------------------- */ + +#ifndef GL_ARB_stencil_texturing +#define GL_ARB_stencil_texturing 1 + +#define GL_DEPTH_STENCIL_TEXTURE_MODE 0x90EA + +#define GLEW_ARB_stencil_texturing GLEW_GET_VAR(__GLEW_ARB_stencil_texturing) + +#endif /* GL_ARB_stencil_texturing */ + +/* ------------------------------ GL_ARB_sync ------------------------------ */ + +#ifndef GL_ARB_sync +#define GL_ARB_sync 1 + +#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001 +#define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111 +#define GL_OBJECT_TYPE 0x9112 +#define GL_SYNC_CONDITION 0x9113 +#define GL_SYNC_STATUS 0x9114 +#define GL_SYNC_FLAGS 0x9115 +#define GL_SYNC_FENCE 0x9116 +#define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117 +#define GL_UNSIGNALED 0x9118 +#define GL_SIGNALED 0x9119 +#define GL_ALREADY_SIGNALED 0x911A +#define GL_TIMEOUT_EXPIRED 0x911B +#define GL_CONDITION_SATISFIED 0x911C +#define GL_WAIT_FAILED 0x911D +#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFFull + +typedef GLenum (GLAPIENTRY * PFNGLCLIENTWAITSYNCPROC) (GLsync GLsync,GLbitfield flags,GLuint64 timeout); +typedef void (GLAPIENTRY * PFNGLDELETESYNCPROC) (GLsync GLsync); +typedef GLsync (GLAPIENTRY * PFNGLFENCESYNCPROC) (GLenum condition,GLbitfield flags); +typedef void (GLAPIENTRY * PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64* params); +typedef void (GLAPIENTRY * PFNGLGETSYNCIVPROC) (GLsync GLsync,GLenum pname,GLsizei bufSize,GLsizei* length, GLint *values); +typedef GLboolean (GLAPIENTRY * PFNGLISSYNCPROC) (GLsync GLsync); +typedef void (GLAPIENTRY * PFNGLWAITSYNCPROC) (GLsync GLsync,GLbitfield flags,GLuint64 timeout); + +#define glClientWaitSync GLEW_GET_FUN(__glewClientWaitSync) +#define glDeleteSync GLEW_GET_FUN(__glewDeleteSync) +#define glFenceSync GLEW_GET_FUN(__glewFenceSync) +#define glGetInteger64v GLEW_GET_FUN(__glewGetInteger64v) +#define glGetSynciv GLEW_GET_FUN(__glewGetSynciv) +#define glIsSync GLEW_GET_FUN(__glewIsSync) +#define glWaitSync GLEW_GET_FUN(__glewWaitSync) + +#define GLEW_ARB_sync GLEW_GET_VAR(__GLEW_ARB_sync) + +#endif /* GL_ARB_sync */ + +/* ----------------------- GL_ARB_tessellation_shader ---------------------- */ + +#ifndef GL_ARB_tessellation_shader +#define GL_ARB_tessellation_shader 1 + +#define GL_PATCHES 0xE +#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER 0x84F0 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER 0x84F1 +#define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS 0x886C +#define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS 0x886D +#define GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E1E +#define GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E1F +#define GL_PATCH_VERTICES 0x8E72 +#define GL_PATCH_DEFAULT_INNER_LEVEL 0x8E73 +#define GL_PATCH_DEFAULT_OUTER_LEVEL 0x8E74 +#define GL_TESS_CONTROL_OUTPUT_VERTICES 0x8E75 +#define GL_TESS_GEN_MODE 0x8E76 +#define GL_TESS_GEN_SPACING 0x8E77 +#define GL_TESS_GEN_VERTEX_ORDER 0x8E78 +#define GL_TESS_GEN_POINT_MODE 0x8E79 +#define GL_ISOLINES 0x8E7A +#define GL_FRACTIONAL_ODD 0x8E7B +#define GL_FRACTIONAL_EVEN 0x8E7C +#define GL_MAX_PATCH_VERTICES 0x8E7D +#define GL_MAX_TESS_GEN_LEVEL 0x8E7E +#define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E7F +#define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E80 +#define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS 0x8E81 +#define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS 0x8E82 +#define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS 0x8E83 +#define GL_MAX_TESS_PATCH_COMPONENTS 0x8E84 +#define GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS 0x8E85 +#define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS 0x8E86 +#define GL_TESS_EVALUATION_SHADER 0x8E87 +#define GL_TESS_CONTROL_SHADER 0x8E88 +#define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS 0x8E89 +#define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS 0x8E8A + +typedef void (GLAPIENTRY * PFNGLPATCHPARAMETERFVPROC) (GLenum pname, const GLfloat* values); +typedef void (GLAPIENTRY * PFNGLPATCHPARAMETERIPROC) (GLenum pname, GLint value); + +#define glPatchParameterfv GLEW_GET_FUN(__glewPatchParameterfv) +#define glPatchParameteri GLEW_GET_FUN(__glewPatchParameteri) + +#define GLEW_ARB_tessellation_shader GLEW_GET_VAR(__GLEW_ARB_tessellation_shader) + +#endif /* GL_ARB_tessellation_shader */ + +/* ------------------------- GL_ARB_texture_barrier ------------------------ */ + +#ifndef GL_ARB_texture_barrier +#define GL_ARB_texture_barrier 1 + +typedef void (GLAPIENTRY * PFNGLTEXTUREBARRIERPROC) (void); + +#define glTextureBarrier GLEW_GET_FUN(__glewTextureBarrier) + +#define GLEW_ARB_texture_barrier GLEW_GET_VAR(__GLEW_ARB_texture_barrier) + +#endif /* GL_ARB_texture_barrier */ + +/* ---------------------- GL_ARB_texture_border_clamp ---------------------- */ + +#ifndef GL_ARB_texture_border_clamp +#define GL_ARB_texture_border_clamp 1 + +#define GL_CLAMP_TO_BORDER_ARB 0x812D + +#define GLEW_ARB_texture_border_clamp GLEW_GET_VAR(__GLEW_ARB_texture_border_clamp) + +#endif /* GL_ARB_texture_border_clamp */ + +/* ---------------------- GL_ARB_texture_buffer_object --------------------- */ + +#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 (GLAPIENTRY * PFNGLTEXBUFFERARBPROC) (GLenum target, GLenum internalformat, GLuint buffer); + +#define glTexBufferARB GLEW_GET_FUN(__glewTexBufferARB) + +#define GLEW_ARB_texture_buffer_object GLEW_GET_VAR(__GLEW_ARB_texture_buffer_object) + +#endif /* GL_ARB_texture_buffer_object */ + +/* ------------------- GL_ARB_texture_buffer_object_rgb32 ------------------ */ + +#ifndef GL_ARB_texture_buffer_object_rgb32 +#define GL_ARB_texture_buffer_object_rgb32 1 + +#define GLEW_ARB_texture_buffer_object_rgb32 GLEW_GET_VAR(__GLEW_ARB_texture_buffer_object_rgb32) + +#endif /* GL_ARB_texture_buffer_object_rgb32 */ + +/* ---------------------- GL_ARB_texture_buffer_range ---------------------- */ + +#ifndef GL_ARB_texture_buffer_range +#define GL_ARB_texture_buffer_range 1 + +#define GL_TEXTURE_BUFFER_OFFSET 0x919D +#define GL_TEXTURE_BUFFER_SIZE 0x919E +#define GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT 0x919F + +typedef void (GLAPIENTRY * PFNGLTEXBUFFERRANGEPROC) (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLTEXTUREBUFFERRANGEEXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); + +#define glTexBufferRange GLEW_GET_FUN(__glewTexBufferRange) +#define glTextureBufferRangeEXT GLEW_GET_FUN(__glewTextureBufferRangeEXT) + +#define GLEW_ARB_texture_buffer_range GLEW_GET_VAR(__GLEW_ARB_texture_buffer_range) + +#endif /* GL_ARB_texture_buffer_range */ + +/* ----------------------- GL_ARB_texture_compression ---------------------- */ + +#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 (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * 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 (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, void *img); + +#define glCompressedTexImage1DARB GLEW_GET_FUN(__glewCompressedTexImage1DARB) +#define glCompressedTexImage2DARB GLEW_GET_FUN(__glewCompressedTexImage2DARB) +#define glCompressedTexImage3DARB GLEW_GET_FUN(__glewCompressedTexImage3DARB) +#define glCompressedTexSubImage1DARB GLEW_GET_FUN(__glewCompressedTexSubImage1DARB) +#define glCompressedTexSubImage2DARB GLEW_GET_FUN(__glewCompressedTexSubImage2DARB) +#define glCompressedTexSubImage3DARB GLEW_GET_FUN(__glewCompressedTexSubImage3DARB) +#define glGetCompressedTexImageARB GLEW_GET_FUN(__glewGetCompressedTexImageARB) + +#define GLEW_ARB_texture_compression GLEW_GET_VAR(__GLEW_ARB_texture_compression) + +#endif /* GL_ARB_texture_compression */ + +/* -------------------- GL_ARB_texture_compression_bptc -------------------- */ + +#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 + +#define GLEW_ARB_texture_compression_bptc GLEW_GET_VAR(__GLEW_ARB_texture_compression_bptc) + +#endif /* GL_ARB_texture_compression_bptc */ + +/* -------------------- GL_ARB_texture_compression_rgtc -------------------- */ + +#ifndef GL_ARB_texture_compression_rgtc +#define GL_ARB_texture_compression_rgtc 1 + +#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 + +#define GLEW_ARB_texture_compression_rgtc GLEW_GET_VAR(__GLEW_ARB_texture_compression_rgtc) + +#endif /* GL_ARB_texture_compression_rgtc */ + +/* ------------------------ GL_ARB_texture_cube_map ------------------------ */ + +#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 + +#define GLEW_ARB_texture_cube_map GLEW_GET_VAR(__GLEW_ARB_texture_cube_map) + +#endif /* GL_ARB_texture_cube_map */ + +/* --------------------- GL_ARB_texture_cube_map_array --------------------- */ + +#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 + +#define GLEW_ARB_texture_cube_map_array GLEW_GET_VAR(__GLEW_ARB_texture_cube_map_array) + +#endif /* GL_ARB_texture_cube_map_array */ + +/* ------------------------- GL_ARB_texture_env_add ------------------------ */ + +#ifndef GL_ARB_texture_env_add +#define GL_ARB_texture_env_add 1 + +#define GLEW_ARB_texture_env_add GLEW_GET_VAR(__GLEW_ARB_texture_env_add) + +#endif /* GL_ARB_texture_env_add */ + +/* ----------------------- GL_ARB_texture_env_combine ---------------------- */ + +#ifndef GL_ARB_texture_env_combine +#define GL_ARB_texture_env_combine 1 + +#define GL_SUBTRACT_ARB 0x84E7 +#define GL_COMBINE_ARB 0x8570 +#define GL_COMBINE_RGB_ARB 0x8571 +#define GL_COMBINE_ALPHA_ARB 0x8572 +#define GL_RGB_SCALE_ARB 0x8573 +#define GL_ADD_SIGNED_ARB 0x8574 +#define GL_INTERPOLATE_ARB 0x8575 +#define GL_CONSTANT_ARB 0x8576 +#define GL_PRIMARY_COLOR_ARB 0x8577 +#define GL_PREVIOUS_ARB 0x8578 +#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 GLEW_ARB_texture_env_combine GLEW_GET_VAR(__GLEW_ARB_texture_env_combine) + +#endif /* GL_ARB_texture_env_combine */ + +/* ---------------------- GL_ARB_texture_env_crossbar ---------------------- */ + +#ifndef GL_ARB_texture_env_crossbar +#define GL_ARB_texture_env_crossbar 1 + +#define GLEW_ARB_texture_env_crossbar GLEW_GET_VAR(__GLEW_ARB_texture_env_crossbar) + +#endif /* GL_ARB_texture_env_crossbar */ + +/* ------------------------ GL_ARB_texture_env_dot3 ------------------------ */ + +#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 + +#define GLEW_ARB_texture_env_dot3 GLEW_GET_VAR(__GLEW_ARB_texture_env_dot3) + +#endif /* GL_ARB_texture_env_dot3 */ + +/* ------------------- GL_ARB_texture_filter_anisotropic ------------------- */ + +#ifndef GL_ARB_texture_filter_anisotropic +#define GL_ARB_texture_filter_anisotropic 1 + +#define GL_TEXTURE_MAX_ANISOTROPY 0x84FE +#define GL_MAX_TEXTURE_MAX_ANISOTROPY 0x84FF + +#define GLEW_ARB_texture_filter_anisotropic GLEW_GET_VAR(__GLEW_ARB_texture_filter_anisotropic) + +#endif /* GL_ARB_texture_filter_anisotropic */ + +/* ---------------------- GL_ARB_texture_filter_minmax --------------------- */ + +#ifndef GL_ARB_texture_filter_minmax +#define GL_ARB_texture_filter_minmax 1 + +#define GL_TEXTURE_REDUCTION_MODE_ARB 0x9366 +#define GL_WEIGHTED_AVERAGE_ARB 0x9367 + +#define GLEW_ARB_texture_filter_minmax GLEW_GET_VAR(__GLEW_ARB_texture_filter_minmax) + +#endif /* GL_ARB_texture_filter_minmax */ + +/* -------------------------- GL_ARB_texture_float ------------------------- */ + +#ifndef GL_ARB_texture_float +#define GL_ARB_texture_float 1 + +#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 +#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 GLEW_ARB_texture_float GLEW_GET_VAR(__GLEW_ARB_texture_float) + +#endif /* GL_ARB_texture_float */ + +/* ------------------------- GL_ARB_texture_gather ------------------------- */ + +#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 + +#define GLEW_ARB_texture_gather GLEW_GET_VAR(__GLEW_ARB_texture_gather) + +#endif /* GL_ARB_texture_gather */ + +/* ------------------ GL_ARB_texture_mirror_clamp_to_edge ------------------ */ + +#ifndef GL_ARB_texture_mirror_clamp_to_edge +#define GL_ARB_texture_mirror_clamp_to_edge 1 + +#define GL_MIRROR_CLAMP_TO_EDGE 0x8743 + +#define GLEW_ARB_texture_mirror_clamp_to_edge GLEW_GET_VAR(__GLEW_ARB_texture_mirror_clamp_to_edge) + +#endif /* GL_ARB_texture_mirror_clamp_to_edge */ + +/* --------------------- GL_ARB_texture_mirrored_repeat -------------------- */ + +#ifndef GL_ARB_texture_mirrored_repeat +#define GL_ARB_texture_mirrored_repeat 1 + +#define GL_MIRRORED_REPEAT_ARB 0x8370 + +#define GLEW_ARB_texture_mirrored_repeat GLEW_GET_VAR(__GLEW_ARB_texture_mirrored_repeat) + +#endif /* GL_ARB_texture_mirrored_repeat */ + +/* ----------------------- GL_ARB_texture_multisample ---------------------- */ + +#ifndef GL_ARB_texture_multisample +#define GL_ARB_texture_multisample 1 + +#define GL_SAMPLE_POSITION 0x8E50 +#define GL_SAMPLE_MASK 0x8E51 +#define GL_SAMPLE_MASK_VALUE 0x8E52 +#define GL_MAX_SAMPLE_MASK_WORDS 0x8E59 +#define GL_TEXTURE_2D_MULTISAMPLE 0x9100 +#define GL_PROXY_TEXTURE_2D_MULTISAMPLE 0x9101 +#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102 +#define GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9103 +#define GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104 +#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY 0x9105 +#define GL_TEXTURE_SAMPLES 0x9106 +#define GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107 +#define GL_SAMPLER_2D_MULTISAMPLE 0x9108 +#define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109 +#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A +#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B +#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C +#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D +#define GL_MAX_COLOR_TEXTURE_SAMPLES 0x910E +#define GL_MAX_DEPTH_TEXTURE_SAMPLES 0x910F +#define GL_MAX_INTEGER_SAMPLES 0x9110 + +typedef void (GLAPIENTRY * PFNGLGETMULTISAMPLEFVPROC) (GLenum pname, GLuint index, GLfloat* val); +typedef void (GLAPIENTRY * PFNGLSAMPLEMASKIPROC) (GLuint index, GLbitfield mask); +typedef void (GLAPIENTRY * PFNGLTEXIMAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); + +#define glGetMultisamplefv GLEW_GET_FUN(__glewGetMultisamplefv) +#define glSampleMaski GLEW_GET_FUN(__glewSampleMaski) +#define glTexImage2DMultisample GLEW_GET_FUN(__glewTexImage2DMultisample) +#define glTexImage3DMultisample GLEW_GET_FUN(__glewTexImage3DMultisample) + +#define GLEW_ARB_texture_multisample GLEW_GET_VAR(__GLEW_ARB_texture_multisample) + +#endif /* GL_ARB_texture_multisample */ + +/* -------------------- GL_ARB_texture_non_power_of_two -------------------- */ + +#ifndef GL_ARB_texture_non_power_of_two +#define GL_ARB_texture_non_power_of_two 1 + +#define GLEW_ARB_texture_non_power_of_two GLEW_GET_VAR(__GLEW_ARB_texture_non_power_of_two) + +#endif /* GL_ARB_texture_non_power_of_two */ + +/* ---------------------- GL_ARB_texture_query_levels ---------------------- */ + +#ifndef GL_ARB_texture_query_levels +#define GL_ARB_texture_query_levels 1 + +#define GLEW_ARB_texture_query_levels GLEW_GET_VAR(__GLEW_ARB_texture_query_levels) + +#endif /* GL_ARB_texture_query_levels */ + +/* ------------------------ GL_ARB_texture_query_lod ----------------------- */ + +#ifndef GL_ARB_texture_query_lod +#define GL_ARB_texture_query_lod 1 + +#define GLEW_ARB_texture_query_lod GLEW_GET_VAR(__GLEW_ARB_texture_query_lod) + +#endif /* GL_ARB_texture_query_lod */ + +/* ------------------------ GL_ARB_texture_rectangle ----------------------- */ + +#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 +#define GL_SAMPLER_2D_RECT_ARB 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 + +#define GLEW_ARB_texture_rectangle GLEW_GET_VAR(__GLEW_ARB_texture_rectangle) + +#endif /* GL_ARB_texture_rectangle */ + +/* --------------------------- GL_ARB_texture_rg --------------------------- */ + +#ifndef GL_ARB_texture_rg +#define GL_ARB_texture_rg 1 + +#define GL_COMPRESSED_RED 0x8225 +#define GL_COMPRESSED_RG 0x8226 +#define GL_RG 0x8227 +#define GL_RG_INTEGER 0x8228 +#define GL_R8 0x8229 +#define GL_R16 0x822A +#define GL_RG8 0x822B +#define GL_RG16 0x822C +#define GL_R16F 0x822D +#define GL_R32F 0x822E +#define GL_RG16F 0x822F +#define GL_RG32F 0x8230 +#define GL_R8I 0x8231 +#define GL_R8UI 0x8232 +#define GL_R16I 0x8233 +#define GL_R16UI 0x8234 +#define GL_R32I 0x8235 +#define GL_R32UI 0x8236 +#define GL_RG8I 0x8237 +#define GL_RG8UI 0x8238 +#define GL_RG16I 0x8239 +#define GL_RG16UI 0x823A +#define GL_RG32I 0x823B +#define GL_RG32UI 0x823C + +#define GLEW_ARB_texture_rg GLEW_GET_VAR(__GLEW_ARB_texture_rg) + +#endif /* GL_ARB_texture_rg */ + +/* ----------------------- GL_ARB_texture_rgb10_a2ui ----------------------- */ + +#ifndef GL_ARB_texture_rgb10_a2ui +#define GL_ARB_texture_rgb10_a2ui 1 + +#define GL_RGB10_A2UI 0x906F + +#define GLEW_ARB_texture_rgb10_a2ui GLEW_GET_VAR(__GLEW_ARB_texture_rgb10_a2ui) + +#endif /* GL_ARB_texture_rgb10_a2ui */ + +/* ------------------------ GL_ARB_texture_stencil8 ------------------------ */ + +#ifndef GL_ARB_texture_stencil8 +#define GL_ARB_texture_stencil8 1 + +#define GL_STENCIL_INDEX 0x1901 +#define GL_STENCIL_INDEX8 0x8D48 + +#define GLEW_ARB_texture_stencil8 GLEW_GET_VAR(__GLEW_ARB_texture_stencil8) + +#endif /* GL_ARB_texture_stencil8 */ + +/* ------------------------- GL_ARB_texture_storage ------------------------ */ + +#ifndef GL_ARB_texture_storage +#define GL_ARB_texture_storage 1 + +#define GL_TEXTURE_IMMUTABLE_FORMAT 0x912F + +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE1DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE2DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE3DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); + +#define glTexStorage1D GLEW_GET_FUN(__glewTexStorage1D) +#define glTexStorage2D GLEW_GET_FUN(__glewTexStorage2D) +#define glTexStorage3D GLEW_GET_FUN(__glewTexStorage3D) + +#define GLEW_ARB_texture_storage GLEW_GET_VAR(__GLEW_ARB_texture_storage) + +#endif /* GL_ARB_texture_storage */ + +/* ------------------- GL_ARB_texture_storage_multisample ------------------ */ + +#ifndef GL_ARB_texture_storage_multisample +#define GL_ARB_texture_storage_multisample 1 + +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); + +#define glTexStorage2DMultisample GLEW_GET_FUN(__glewTexStorage2DMultisample) +#define glTexStorage3DMultisample GLEW_GET_FUN(__glewTexStorage3DMultisample) +#define glTextureStorage2DMultisampleEXT GLEW_GET_FUN(__glewTextureStorage2DMultisampleEXT) +#define glTextureStorage3DMultisampleEXT GLEW_GET_FUN(__glewTextureStorage3DMultisampleEXT) + +#define GLEW_ARB_texture_storage_multisample GLEW_GET_VAR(__GLEW_ARB_texture_storage_multisample) + +#endif /* GL_ARB_texture_storage_multisample */ + +/* ------------------------- GL_ARB_texture_swizzle ------------------------ */ + +#ifndef GL_ARB_texture_swizzle +#define GL_ARB_texture_swizzle 1 + +#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 + +#define GLEW_ARB_texture_swizzle GLEW_GET_VAR(__GLEW_ARB_texture_swizzle) + +#endif /* GL_ARB_texture_swizzle */ + +/* -------------------------- GL_ARB_texture_view -------------------------- */ + +#ifndef GL_ARB_texture_view +#define GL_ARB_texture_view 1 + +#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 + +typedef void (GLAPIENTRY * PFNGLTEXTUREVIEWPROC) (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); + +#define glTextureView GLEW_GET_FUN(__glewTextureView) + +#define GLEW_ARB_texture_view GLEW_GET_VAR(__GLEW_ARB_texture_view) + +#endif /* GL_ARB_texture_view */ + +/* --------------------------- GL_ARB_timer_query -------------------------- */ + +#ifndef GL_ARB_timer_query +#define GL_ARB_timer_query 1 + +#define GL_TIME_ELAPSED 0x88BF +#define GL_TIMESTAMP 0x8E28 + +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTI64VPROC) (GLuint id, GLenum pname, GLint64* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUI64VPROC) (GLuint id, GLenum pname, GLuint64* params); +typedef void (GLAPIENTRY * PFNGLQUERYCOUNTERPROC) (GLuint id, GLenum target); + +#define glGetQueryObjecti64v GLEW_GET_FUN(__glewGetQueryObjecti64v) +#define glGetQueryObjectui64v GLEW_GET_FUN(__glewGetQueryObjectui64v) +#define glQueryCounter GLEW_GET_FUN(__glewQueryCounter) + +#define GLEW_ARB_timer_query GLEW_GET_VAR(__GLEW_ARB_timer_query) + +#endif /* GL_ARB_timer_query */ + +/* ----------------------- GL_ARB_transform_feedback2 ---------------------- */ + +#ifndef GL_ARB_transform_feedback2 +#define GL_ARB_transform_feedback2 1 + +#define GL_TRANSFORM_FEEDBACK 0x8E22 +#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED 0x8E23 +#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE 0x8E24 +#define GL_TRANSFORM_FEEDBACK_BINDING 0x8E25 + +typedef void (GLAPIENTRY * PFNGLBINDTRANSFORMFEEDBACKPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETETRANSFORMFEEDBACKSPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKPROC) (GLenum mode, GLuint id); +typedef void (GLAPIENTRY * PFNGLGENTRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint* ids); +typedef GLboolean (GLAPIENTRY * PFNGLISTRANSFORMFEEDBACKPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLPAUSETRANSFORMFEEDBACKPROC) (void); +typedef void (GLAPIENTRY * PFNGLRESUMETRANSFORMFEEDBACKPROC) (void); + +#define glBindTransformFeedback GLEW_GET_FUN(__glewBindTransformFeedback) +#define glDeleteTransformFeedbacks GLEW_GET_FUN(__glewDeleteTransformFeedbacks) +#define glDrawTransformFeedback GLEW_GET_FUN(__glewDrawTransformFeedback) +#define glGenTransformFeedbacks GLEW_GET_FUN(__glewGenTransformFeedbacks) +#define glIsTransformFeedback GLEW_GET_FUN(__glewIsTransformFeedback) +#define glPauseTransformFeedback GLEW_GET_FUN(__glewPauseTransformFeedback) +#define glResumeTransformFeedback GLEW_GET_FUN(__glewResumeTransformFeedback) + +#define GLEW_ARB_transform_feedback2 GLEW_GET_VAR(__GLEW_ARB_transform_feedback2) + +#endif /* GL_ARB_transform_feedback2 */ + +/* ----------------------- GL_ARB_transform_feedback3 ---------------------- */ + +#ifndef GL_ARB_transform_feedback3 +#define GL_ARB_transform_feedback3 1 + +#define GL_MAX_TRANSFORM_FEEDBACK_BUFFERS 0x8E70 +#define GL_MAX_VERTEX_STREAMS 0x8E71 + +typedef void (GLAPIENTRY * PFNGLBEGINQUERYINDEXEDPROC) (GLenum target, GLuint index, GLuint id); +typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC) (GLenum mode, GLuint id, GLuint stream); +typedef void (GLAPIENTRY * PFNGLENDQUERYINDEXEDPROC) (GLenum target, GLuint index); +typedef void (GLAPIENTRY * PFNGLGETQUERYINDEXEDIVPROC) (GLenum target, GLuint index, GLenum pname, GLint* params); + +#define glBeginQueryIndexed GLEW_GET_FUN(__glewBeginQueryIndexed) +#define glDrawTransformFeedbackStream GLEW_GET_FUN(__glewDrawTransformFeedbackStream) +#define glEndQueryIndexed GLEW_GET_FUN(__glewEndQueryIndexed) +#define glGetQueryIndexediv GLEW_GET_FUN(__glewGetQueryIndexediv) + +#define GLEW_ARB_transform_feedback3 GLEW_GET_VAR(__GLEW_ARB_transform_feedback3) + +#endif /* GL_ARB_transform_feedback3 */ + +/* ------------------ GL_ARB_transform_feedback_instanced ------------------ */ + +#ifndef GL_ARB_transform_feedback_instanced +#define GL_ARB_transform_feedback_instanced 1 + +typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC) (GLenum mode, GLuint id, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC) (GLenum mode, GLuint id, GLuint stream, GLsizei primcount); + +#define glDrawTransformFeedbackInstanced GLEW_GET_FUN(__glewDrawTransformFeedbackInstanced) +#define glDrawTransformFeedbackStreamInstanced GLEW_GET_FUN(__glewDrawTransformFeedbackStreamInstanced) + +#define GLEW_ARB_transform_feedback_instanced GLEW_GET_VAR(__GLEW_ARB_transform_feedback_instanced) + +#endif /* GL_ARB_transform_feedback_instanced */ + +/* ---------------- GL_ARB_transform_feedback_overflow_query --------------- */ + +#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 + +#define GLEW_ARB_transform_feedback_overflow_query GLEW_GET_VAR(__GLEW_ARB_transform_feedback_overflow_query) + +#endif /* GL_ARB_transform_feedback_overflow_query */ + +/* ------------------------ GL_ARB_transpose_matrix ------------------------ */ + +#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 (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXDARBPROC) (GLdouble m[16]); +typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXFARBPROC) (GLfloat m[16]); +typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXDARBPROC) (GLdouble m[16]); +typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXFARBPROC) (GLfloat m[16]); + +#define glLoadTransposeMatrixdARB GLEW_GET_FUN(__glewLoadTransposeMatrixdARB) +#define glLoadTransposeMatrixfARB GLEW_GET_FUN(__glewLoadTransposeMatrixfARB) +#define glMultTransposeMatrixdARB GLEW_GET_FUN(__glewMultTransposeMatrixdARB) +#define glMultTransposeMatrixfARB GLEW_GET_FUN(__glewMultTransposeMatrixfARB) + +#define GLEW_ARB_transpose_matrix GLEW_GET_VAR(__GLEW_ARB_transpose_matrix) + +#endif /* GL_ARB_transpose_matrix */ + +/* ---------------------- GL_ARB_uniform_buffer_object --------------------- */ + +#ifndef GL_ARB_uniform_buffer_object +#define GL_ARB_uniform_buffer_object 1 + +#define GL_UNIFORM_BUFFER 0x8A11 +#define GL_UNIFORM_BUFFER_BINDING 0x8A28 +#define GL_UNIFORM_BUFFER_START 0x8A29 +#define GL_UNIFORM_BUFFER_SIZE 0x8A2A +#define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B +#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C +#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D +#define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E +#define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F +#define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30 +#define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31 +#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32 +#define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33 +#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34 +#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35 +#define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36 +#define GL_UNIFORM_TYPE 0x8A37 +#define GL_UNIFORM_SIZE 0x8A38 +#define GL_UNIFORM_NAME_LENGTH 0x8A39 +#define GL_UNIFORM_BLOCK_INDEX 0x8A3A +#define GL_UNIFORM_OFFSET 0x8A3B +#define GL_UNIFORM_ARRAY_STRIDE 0x8A3C +#define GL_UNIFORM_MATRIX_STRIDE 0x8A3D +#define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E +#define GL_UNIFORM_BLOCK_BINDING 0x8A3F +#define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40 +#define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41 +#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42 +#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44 +#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 (GLAPIENTRY * PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformBlockName); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMBLOCKIVPROC) (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMNAMEPROC) (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformName); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMSIVPROC) (GLuint program, GLsizei uniformCount, const GLuint* uniformIndices, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETINTEGERI_VPROC) (GLenum target, GLuint index, GLint* data); +typedef GLuint (GLAPIENTRY * PFNGLGETUNIFORMBLOCKINDEXPROC) (GLuint program, const GLchar* uniformBlockName); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount, const GLchar* const * uniformNames, GLuint* uniformIndices); +typedef void (GLAPIENTRY * PFNGLUNIFORMBLOCKBINDINGPROC) (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); + +#define glBindBufferBase GLEW_GET_FUN(__glewBindBufferBase) +#define glBindBufferRange GLEW_GET_FUN(__glewBindBufferRange) +#define glGetActiveUniformBlockName GLEW_GET_FUN(__glewGetActiveUniformBlockName) +#define glGetActiveUniformBlockiv GLEW_GET_FUN(__glewGetActiveUniformBlockiv) +#define glGetActiveUniformName GLEW_GET_FUN(__glewGetActiveUniformName) +#define glGetActiveUniformsiv GLEW_GET_FUN(__glewGetActiveUniformsiv) +#define glGetIntegeri_v GLEW_GET_FUN(__glewGetIntegeri_v) +#define glGetUniformBlockIndex GLEW_GET_FUN(__glewGetUniformBlockIndex) +#define glGetUniformIndices GLEW_GET_FUN(__glewGetUniformIndices) +#define glUniformBlockBinding GLEW_GET_FUN(__glewUniformBlockBinding) + +#define GLEW_ARB_uniform_buffer_object GLEW_GET_VAR(__GLEW_ARB_uniform_buffer_object) + +#endif /* GL_ARB_uniform_buffer_object */ + +/* ------------------------ GL_ARB_vertex_array_bgra ----------------------- */ + +#ifndef GL_ARB_vertex_array_bgra +#define GL_ARB_vertex_array_bgra 1 + +#define GL_BGRA 0x80E1 + +#define GLEW_ARB_vertex_array_bgra GLEW_GET_VAR(__GLEW_ARB_vertex_array_bgra) + +#endif /* GL_ARB_vertex_array_bgra */ + +/* ----------------------- GL_ARB_vertex_array_object ---------------------- */ + +#ifndef GL_ARB_vertex_array_object +#define GL_ARB_vertex_array_object 1 + +#define GL_VERTEX_ARRAY_BINDING 0x85B5 + +typedef void (GLAPIENTRY * PFNGLBINDVERTEXARRAYPROC) (GLuint array); +typedef void (GLAPIENTRY * PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint* arrays); +typedef void (GLAPIENTRY * PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint* arrays); +typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXARRAYPROC) (GLuint array); + +#define glBindVertexArray GLEW_GET_FUN(__glewBindVertexArray) +#define glDeleteVertexArrays GLEW_GET_FUN(__glewDeleteVertexArrays) +#define glGenVertexArrays GLEW_GET_FUN(__glewGenVertexArrays) +#define glIsVertexArray GLEW_GET_FUN(__glewIsVertexArray) + +#define GLEW_ARB_vertex_array_object GLEW_GET_VAR(__GLEW_ARB_vertex_array_object) + +#endif /* GL_ARB_vertex_array_object */ + +/* ----------------------- GL_ARB_vertex_attrib_64bit ---------------------- */ + +#ifndef GL_ARB_vertex_attrib_64bit +#define GL_ARB_vertex_attrib_64bit 1 + +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLDVPROC) (GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DPROC) (GLuint index, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void* pointer); + +#define glGetVertexAttribLdv GLEW_GET_FUN(__glewGetVertexAttribLdv) +#define glVertexAttribL1d GLEW_GET_FUN(__glewVertexAttribL1d) +#define glVertexAttribL1dv GLEW_GET_FUN(__glewVertexAttribL1dv) +#define glVertexAttribL2d GLEW_GET_FUN(__glewVertexAttribL2d) +#define glVertexAttribL2dv GLEW_GET_FUN(__glewVertexAttribL2dv) +#define glVertexAttribL3d GLEW_GET_FUN(__glewVertexAttribL3d) +#define glVertexAttribL3dv GLEW_GET_FUN(__glewVertexAttribL3dv) +#define glVertexAttribL4d GLEW_GET_FUN(__glewVertexAttribL4d) +#define glVertexAttribL4dv GLEW_GET_FUN(__glewVertexAttribL4dv) +#define glVertexAttribLPointer GLEW_GET_FUN(__glewVertexAttribLPointer) + +#define GLEW_ARB_vertex_attrib_64bit GLEW_GET_VAR(__GLEW_ARB_vertex_attrib_64bit) + +#endif /* GL_ARB_vertex_attrib_64bit */ + +/* ---------------------- GL_ARB_vertex_attrib_binding --------------------- */ + +#ifndef GL_ARB_vertex_attrib_binding +#define GL_ARB_vertex_attrib_binding 1 + +#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 + +typedef void (GLAPIENTRY * PFNGLBINDVERTEXBUFFERPROC) (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYBINDVERTEXBUFFEREXTPROC) (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC) (GLuint vaobj, GLuint attribindex, GLuint bindingindex); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBIFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC) (GLuint vaobj, GLuint bindingindex, GLuint divisor); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBBINDINGPROC) (GLuint attribindex, GLuint bindingindex); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXBINDINGDIVISORPROC) (GLuint bindingindex, GLuint divisor); + +#define glBindVertexBuffer GLEW_GET_FUN(__glewBindVertexBuffer) +#define glVertexArrayBindVertexBufferEXT GLEW_GET_FUN(__glewVertexArrayBindVertexBufferEXT) +#define glVertexArrayVertexAttribBindingEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribBindingEXT) +#define glVertexArrayVertexAttribFormatEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribFormatEXT) +#define glVertexArrayVertexAttribIFormatEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribIFormatEXT) +#define glVertexArrayVertexAttribLFormatEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribLFormatEXT) +#define glVertexArrayVertexBindingDivisorEXT GLEW_GET_FUN(__glewVertexArrayVertexBindingDivisorEXT) +#define glVertexAttribBinding GLEW_GET_FUN(__glewVertexAttribBinding) +#define glVertexAttribFormat GLEW_GET_FUN(__glewVertexAttribFormat) +#define glVertexAttribIFormat GLEW_GET_FUN(__glewVertexAttribIFormat) +#define glVertexAttribLFormat GLEW_GET_FUN(__glewVertexAttribLFormat) +#define glVertexBindingDivisor GLEW_GET_FUN(__glewVertexBindingDivisor) + +#define GLEW_ARB_vertex_attrib_binding GLEW_GET_VAR(__GLEW_ARB_vertex_attrib_binding) + +#endif /* GL_ARB_vertex_attrib_binding */ + +/* -------------------------- GL_ARB_vertex_blend -------------------------- */ + +#ifndef GL_ARB_vertex_blend +#define GL_ARB_vertex_blend 1 + +#define GL_MODELVIEW0_ARB 0x1700 +#define GL_MODELVIEW1_ARB 0x850A +#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_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 (GLAPIENTRY * PFNGLVERTEXBLENDARBPROC) (GLint count); +typedef void (GLAPIENTRY * PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, void *pointer); +typedef void (GLAPIENTRY * PFNGLWEIGHTBVARBPROC) (GLint size, GLbyte *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTDVARBPROC) (GLint size, GLdouble *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTFVARBPROC) (GLint size, GLfloat *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTIVARBPROC) (GLint size, GLint *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTSVARBPROC) (GLint size, GLshort *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTUBVARBPROC) (GLint size, GLubyte *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTUIVARBPROC) (GLint size, GLuint *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTUSVARBPROC) (GLint size, GLushort *weights); + +#define glVertexBlendARB GLEW_GET_FUN(__glewVertexBlendARB) +#define glWeightPointerARB GLEW_GET_FUN(__glewWeightPointerARB) +#define glWeightbvARB GLEW_GET_FUN(__glewWeightbvARB) +#define glWeightdvARB GLEW_GET_FUN(__glewWeightdvARB) +#define glWeightfvARB GLEW_GET_FUN(__glewWeightfvARB) +#define glWeightivARB GLEW_GET_FUN(__glewWeightivARB) +#define glWeightsvARB GLEW_GET_FUN(__glewWeightsvARB) +#define glWeightubvARB GLEW_GET_FUN(__glewWeightubvARB) +#define glWeightuivARB GLEW_GET_FUN(__glewWeightuivARB) +#define glWeightusvARB GLEW_GET_FUN(__glewWeightusvARB) + +#define GLEW_ARB_vertex_blend GLEW_GET_VAR(__GLEW_ARB_vertex_blend) + +#endif /* GL_ARB_vertex_blend */ + +/* ---------------------- GL_ARB_vertex_buffer_object ---------------------- */ + +#ifndef GL_ARB_vertex_buffer_object +#define GL_ARB_vertex_buffer_object 1 + +#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 ptrdiff_t GLintptrARB; +typedef ptrdiff_t GLsizeiptrARB; + +typedef void (GLAPIENTRY * PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const void *data, GLenum usage); +typedef void (GLAPIENTRY * PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const void *data); +typedef void (GLAPIENTRY * PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint* buffers); +typedef void (GLAPIENTRY * PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint* buffers); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, void** params); +typedef void (GLAPIENTRY * PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, void *data); +typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERARBPROC) (GLuint buffer); +typedef void * (GLAPIENTRY * PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access); +typedef GLboolean (GLAPIENTRY * PFNGLUNMAPBUFFERARBPROC) (GLenum target); + +#define glBindBufferARB GLEW_GET_FUN(__glewBindBufferARB) +#define glBufferDataARB GLEW_GET_FUN(__glewBufferDataARB) +#define glBufferSubDataARB GLEW_GET_FUN(__glewBufferSubDataARB) +#define glDeleteBuffersARB GLEW_GET_FUN(__glewDeleteBuffersARB) +#define glGenBuffersARB GLEW_GET_FUN(__glewGenBuffersARB) +#define glGetBufferParameterivARB GLEW_GET_FUN(__glewGetBufferParameterivARB) +#define glGetBufferPointervARB GLEW_GET_FUN(__glewGetBufferPointervARB) +#define glGetBufferSubDataARB GLEW_GET_FUN(__glewGetBufferSubDataARB) +#define glIsBufferARB GLEW_GET_FUN(__glewIsBufferARB) +#define glMapBufferARB GLEW_GET_FUN(__glewMapBufferARB) +#define glUnmapBufferARB GLEW_GET_FUN(__glewUnmapBufferARB) + +#define GLEW_ARB_vertex_buffer_object GLEW_GET_VAR(__GLEW_ARB_vertex_buffer_object) + +#endif /* GL_ARB_vertex_buffer_object */ + +/* ------------------------- GL_ARB_vertex_program ------------------------- */ + +#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_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 + +typedef void (GLAPIENTRY * PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program); +typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint* programs); +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); +typedef void (GLAPIENTRY * PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint* programs); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, void *string); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, void** pointer); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMARBPROC) (GLuint program); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const void *string); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer); + +#define glBindProgramARB GLEW_GET_FUN(__glewBindProgramARB) +#define glDeleteProgramsARB GLEW_GET_FUN(__glewDeleteProgramsARB) +#define glDisableVertexAttribArrayARB GLEW_GET_FUN(__glewDisableVertexAttribArrayARB) +#define glEnableVertexAttribArrayARB GLEW_GET_FUN(__glewEnableVertexAttribArrayARB) +#define glGenProgramsARB GLEW_GET_FUN(__glewGenProgramsARB) +#define glGetProgramEnvParameterdvARB GLEW_GET_FUN(__glewGetProgramEnvParameterdvARB) +#define glGetProgramEnvParameterfvARB GLEW_GET_FUN(__glewGetProgramEnvParameterfvARB) +#define glGetProgramLocalParameterdvARB GLEW_GET_FUN(__glewGetProgramLocalParameterdvARB) +#define glGetProgramLocalParameterfvARB GLEW_GET_FUN(__glewGetProgramLocalParameterfvARB) +#define glGetProgramStringARB GLEW_GET_FUN(__glewGetProgramStringARB) +#define glGetProgramivARB GLEW_GET_FUN(__glewGetProgramivARB) +#define glGetVertexAttribPointervARB GLEW_GET_FUN(__glewGetVertexAttribPointervARB) +#define glGetVertexAttribdvARB GLEW_GET_FUN(__glewGetVertexAttribdvARB) +#define glGetVertexAttribfvARB GLEW_GET_FUN(__glewGetVertexAttribfvARB) +#define glGetVertexAttribivARB GLEW_GET_FUN(__glewGetVertexAttribivARB) +#define glIsProgramARB GLEW_GET_FUN(__glewIsProgramARB) +#define glProgramEnvParameter4dARB GLEW_GET_FUN(__glewProgramEnvParameter4dARB) +#define glProgramEnvParameter4dvARB GLEW_GET_FUN(__glewProgramEnvParameter4dvARB) +#define glProgramEnvParameter4fARB GLEW_GET_FUN(__glewProgramEnvParameter4fARB) +#define glProgramEnvParameter4fvARB GLEW_GET_FUN(__glewProgramEnvParameter4fvARB) +#define glProgramLocalParameter4dARB GLEW_GET_FUN(__glewProgramLocalParameter4dARB) +#define glProgramLocalParameter4dvARB GLEW_GET_FUN(__glewProgramLocalParameter4dvARB) +#define glProgramLocalParameter4fARB GLEW_GET_FUN(__glewProgramLocalParameter4fARB) +#define glProgramLocalParameter4fvARB GLEW_GET_FUN(__glewProgramLocalParameter4fvARB) +#define glProgramStringARB GLEW_GET_FUN(__glewProgramStringARB) +#define glVertexAttrib1dARB GLEW_GET_FUN(__glewVertexAttrib1dARB) +#define glVertexAttrib1dvARB GLEW_GET_FUN(__glewVertexAttrib1dvARB) +#define glVertexAttrib1fARB GLEW_GET_FUN(__glewVertexAttrib1fARB) +#define glVertexAttrib1fvARB GLEW_GET_FUN(__glewVertexAttrib1fvARB) +#define glVertexAttrib1sARB GLEW_GET_FUN(__glewVertexAttrib1sARB) +#define glVertexAttrib1svARB GLEW_GET_FUN(__glewVertexAttrib1svARB) +#define glVertexAttrib2dARB GLEW_GET_FUN(__glewVertexAttrib2dARB) +#define glVertexAttrib2dvARB GLEW_GET_FUN(__glewVertexAttrib2dvARB) +#define glVertexAttrib2fARB GLEW_GET_FUN(__glewVertexAttrib2fARB) +#define glVertexAttrib2fvARB GLEW_GET_FUN(__glewVertexAttrib2fvARB) +#define glVertexAttrib2sARB GLEW_GET_FUN(__glewVertexAttrib2sARB) +#define glVertexAttrib2svARB GLEW_GET_FUN(__glewVertexAttrib2svARB) +#define glVertexAttrib3dARB GLEW_GET_FUN(__glewVertexAttrib3dARB) +#define glVertexAttrib3dvARB GLEW_GET_FUN(__glewVertexAttrib3dvARB) +#define glVertexAttrib3fARB GLEW_GET_FUN(__glewVertexAttrib3fARB) +#define glVertexAttrib3fvARB GLEW_GET_FUN(__glewVertexAttrib3fvARB) +#define glVertexAttrib3sARB GLEW_GET_FUN(__glewVertexAttrib3sARB) +#define glVertexAttrib3svARB GLEW_GET_FUN(__glewVertexAttrib3svARB) +#define glVertexAttrib4NbvARB GLEW_GET_FUN(__glewVertexAttrib4NbvARB) +#define glVertexAttrib4NivARB GLEW_GET_FUN(__glewVertexAttrib4NivARB) +#define glVertexAttrib4NsvARB GLEW_GET_FUN(__glewVertexAttrib4NsvARB) +#define glVertexAttrib4NubARB GLEW_GET_FUN(__glewVertexAttrib4NubARB) +#define glVertexAttrib4NubvARB GLEW_GET_FUN(__glewVertexAttrib4NubvARB) +#define glVertexAttrib4NuivARB GLEW_GET_FUN(__glewVertexAttrib4NuivARB) +#define glVertexAttrib4NusvARB GLEW_GET_FUN(__glewVertexAttrib4NusvARB) +#define glVertexAttrib4bvARB GLEW_GET_FUN(__glewVertexAttrib4bvARB) +#define glVertexAttrib4dARB GLEW_GET_FUN(__glewVertexAttrib4dARB) +#define glVertexAttrib4dvARB GLEW_GET_FUN(__glewVertexAttrib4dvARB) +#define glVertexAttrib4fARB GLEW_GET_FUN(__glewVertexAttrib4fARB) +#define glVertexAttrib4fvARB GLEW_GET_FUN(__glewVertexAttrib4fvARB) +#define glVertexAttrib4ivARB GLEW_GET_FUN(__glewVertexAttrib4ivARB) +#define glVertexAttrib4sARB GLEW_GET_FUN(__glewVertexAttrib4sARB) +#define glVertexAttrib4svARB GLEW_GET_FUN(__glewVertexAttrib4svARB) +#define glVertexAttrib4ubvARB GLEW_GET_FUN(__glewVertexAttrib4ubvARB) +#define glVertexAttrib4uivARB GLEW_GET_FUN(__glewVertexAttrib4uivARB) +#define glVertexAttrib4usvARB GLEW_GET_FUN(__glewVertexAttrib4usvARB) +#define glVertexAttribPointerARB GLEW_GET_FUN(__glewVertexAttribPointerARB) + +#define GLEW_ARB_vertex_program GLEW_GET_VAR(__GLEW_ARB_vertex_program) + +#endif /* GL_ARB_vertex_program */ + +/* -------------------------- GL_ARB_vertex_shader ------------------------- */ + +#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 (GLAPIENTRY * PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB* name); +typedef void (GLAPIENTRY * PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei* length, GLint *size, GLenum *type, GLcharARB *name); +typedef GLint (GLAPIENTRY * PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB* name); + +#define glBindAttribLocationARB GLEW_GET_FUN(__glewBindAttribLocationARB) +#define glGetActiveAttribARB GLEW_GET_FUN(__glewGetActiveAttribARB) +#define glGetAttribLocationARB GLEW_GET_FUN(__glewGetAttribLocationARB) + +#define GLEW_ARB_vertex_shader GLEW_GET_VAR(__GLEW_ARB_vertex_shader) + +#endif /* GL_ARB_vertex_shader */ + +/* ------------------- GL_ARB_vertex_type_10f_11f_11f_rev ------------------ */ + +#ifndef GL_ARB_vertex_type_10f_11f_11f_rev +#define GL_ARB_vertex_type_10f_11f_11f_rev 1 + +#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B + +#define GLEW_ARB_vertex_type_10f_11f_11f_rev GLEW_GET_VAR(__GLEW_ARB_vertex_type_10f_11f_11f_rev) + +#endif /* GL_ARB_vertex_type_10f_11f_11f_rev */ + +/* ------------------- GL_ARB_vertex_type_2_10_10_10_rev ------------------- */ + +#ifndef GL_ARB_vertex_type_2_10_10_10_rev +#define GL_ARB_vertex_type_2_10_10_10_rev 1 + +#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 +#define GL_INT_2_10_10_10_REV 0x8D9F + +typedef void (GLAPIENTRY * PFNGLCOLORP3UIPROC) (GLenum type, GLuint color); +typedef void (GLAPIENTRY * PFNGLCOLORP3UIVPROC) (GLenum type, const GLuint* color); +typedef void (GLAPIENTRY * PFNGLCOLORP4UIPROC) (GLenum type, GLuint color); +typedef void (GLAPIENTRY * PFNGLCOLORP4UIVPROC) (GLenum type, const GLuint* color); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP1UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP1UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP2UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP2UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP3UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP3UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP4UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP4UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLNORMALP3UIPROC) (GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLNORMALP3UIVPROC) (GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORP3UIPROC) (GLenum type, GLuint color); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORP3UIVPROC) (GLenum type, const GLuint* color); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP1UIPROC) (GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP1UIVPROC) (GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP2UIPROC) (GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP2UIVPROC) (GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP3UIPROC) (GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP3UIVPROC) (GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP4UIPROC) (GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP4UIVPROC) (GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP1UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP1UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP2UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP2UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP3UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP3UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP4UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP4UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXP2UIPROC) (GLenum type, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXP2UIVPROC) (GLenum type, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXP3UIPROC) (GLenum type, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXP3UIVPROC) (GLenum type, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXP4UIPROC) (GLenum type, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXP4UIVPROC) (GLenum type, const GLuint* value); + +#define glColorP3ui GLEW_GET_FUN(__glewColorP3ui) +#define glColorP3uiv GLEW_GET_FUN(__glewColorP3uiv) +#define glColorP4ui GLEW_GET_FUN(__glewColorP4ui) +#define glColorP4uiv GLEW_GET_FUN(__glewColorP4uiv) +#define glMultiTexCoordP1ui GLEW_GET_FUN(__glewMultiTexCoordP1ui) +#define glMultiTexCoordP1uiv GLEW_GET_FUN(__glewMultiTexCoordP1uiv) +#define glMultiTexCoordP2ui GLEW_GET_FUN(__glewMultiTexCoordP2ui) +#define glMultiTexCoordP2uiv GLEW_GET_FUN(__glewMultiTexCoordP2uiv) +#define glMultiTexCoordP3ui GLEW_GET_FUN(__glewMultiTexCoordP3ui) +#define glMultiTexCoordP3uiv GLEW_GET_FUN(__glewMultiTexCoordP3uiv) +#define glMultiTexCoordP4ui GLEW_GET_FUN(__glewMultiTexCoordP4ui) +#define glMultiTexCoordP4uiv GLEW_GET_FUN(__glewMultiTexCoordP4uiv) +#define glNormalP3ui GLEW_GET_FUN(__glewNormalP3ui) +#define glNormalP3uiv GLEW_GET_FUN(__glewNormalP3uiv) +#define glSecondaryColorP3ui GLEW_GET_FUN(__glewSecondaryColorP3ui) +#define glSecondaryColorP3uiv GLEW_GET_FUN(__glewSecondaryColorP3uiv) +#define glTexCoordP1ui GLEW_GET_FUN(__glewTexCoordP1ui) +#define glTexCoordP1uiv GLEW_GET_FUN(__glewTexCoordP1uiv) +#define glTexCoordP2ui GLEW_GET_FUN(__glewTexCoordP2ui) +#define glTexCoordP2uiv GLEW_GET_FUN(__glewTexCoordP2uiv) +#define glTexCoordP3ui GLEW_GET_FUN(__glewTexCoordP3ui) +#define glTexCoordP3uiv GLEW_GET_FUN(__glewTexCoordP3uiv) +#define glTexCoordP4ui GLEW_GET_FUN(__glewTexCoordP4ui) +#define glTexCoordP4uiv GLEW_GET_FUN(__glewTexCoordP4uiv) +#define glVertexAttribP1ui GLEW_GET_FUN(__glewVertexAttribP1ui) +#define glVertexAttribP1uiv GLEW_GET_FUN(__glewVertexAttribP1uiv) +#define glVertexAttribP2ui GLEW_GET_FUN(__glewVertexAttribP2ui) +#define glVertexAttribP2uiv GLEW_GET_FUN(__glewVertexAttribP2uiv) +#define glVertexAttribP3ui GLEW_GET_FUN(__glewVertexAttribP3ui) +#define glVertexAttribP3uiv GLEW_GET_FUN(__glewVertexAttribP3uiv) +#define glVertexAttribP4ui GLEW_GET_FUN(__glewVertexAttribP4ui) +#define glVertexAttribP4uiv GLEW_GET_FUN(__glewVertexAttribP4uiv) +#define glVertexP2ui GLEW_GET_FUN(__glewVertexP2ui) +#define glVertexP2uiv GLEW_GET_FUN(__glewVertexP2uiv) +#define glVertexP3ui GLEW_GET_FUN(__glewVertexP3ui) +#define glVertexP3uiv GLEW_GET_FUN(__glewVertexP3uiv) +#define glVertexP4ui GLEW_GET_FUN(__glewVertexP4ui) +#define glVertexP4uiv GLEW_GET_FUN(__glewVertexP4uiv) + +#define GLEW_ARB_vertex_type_2_10_10_10_rev GLEW_GET_VAR(__GLEW_ARB_vertex_type_2_10_10_10_rev) + +#endif /* GL_ARB_vertex_type_2_10_10_10_rev */ + +/* ------------------------- GL_ARB_viewport_array ------------------------- */ + +#ifndef GL_ARB_viewport_array +#define GL_ARB_viewport_array 1 + +#define GL_DEPTH_RANGE 0x0B70 +#define GL_VIEWPORT 0x0BA2 +#define GL_SCISSOR_BOX 0x0C10 +#define GL_SCISSOR_TEST 0x0C11 +#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 +#define GL_FIRST_VERTEX_CONVENTION 0x8E4D +#define GL_LAST_VERTEX_CONVENTION 0x8E4E +#define GL_PROVOKING_VERTEX 0x8E4F + +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEARRAYVPROC) (GLuint first, GLsizei count, const GLclampd * v); +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEINDEXEDPROC) (GLuint index, GLclampd n, GLclampd f); +typedef void (GLAPIENTRY * PFNGLGETDOUBLEI_VPROC) (GLenum target, GLuint index, GLdouble* data); +typedef void (GLAPIENTRY * PFNGLGETFLOATI_VPROC) (GLenum target, GLuint index, GLfloat* data); +typedef void (GLAPIENTRY * PFNGLSCISSORARRAYVPROC) (GLuint first, GLsizei count, const GLint * v); +typedef void (GLAPIENTRY * PFNGLSCISSORINDEXEDPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLSCISSORINDEXEDVPROC) (GLuint index, const GLint * v); +typedef void (GLAPIENTRY * PFNGLVIEWPORTARRAYVPROC) (GLuint first, GLsizei count, const GLfloat * v); +typedef void (GLAPIENTRY * PFNGLVIEWPORTINDEXEDFPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); +typedef void (GLAPIENTRY * PFNGLVIEWPORTINDEXEDFVPROC) (GLuint index, const GLfloat * v); + +#define glDepthRangeArrayv GLEW_GET_FUN(__glewDepthRangeArrayv) +#define glDepthRangeIndexed GLEW_GET_FUN(__glewDepthRangeIndexed) +#define glGetDoublei_v GLEW_GET_FUN(__glewGetDoublei_v) +#define glGetFloati_v GLEW_GET_FUN(__glewGetFloati_v) +#define glScissorArrayv GLEW_GET_FUN(__glewScissorArrayv) +#define glScissorIndexed GLEW_GET_FUN(__glewScissorIndexed) +#define glScissorIndexedv GLEW_GET_FUN(__glewScissorIndexedv) +#define glViewportArrayv GLEW_GET_FUN(__glewViewportArrayv) +#define glViewportIndexedf GLEW_GET_FUN(__glewViewportIndexedf) +#define glViewportIndexedfv GLEW_GET_FUN(__glewViewportIndexedfv) + +#define GLEW_ARB_viewport_array GLEW_GET_VAR(__GLEW_ARB_viewport_array) + +#endif /* GL_ARB_viewport_array */ + +/* --------------------------- GL_ARB_window_pos --------------------------- */ + +#ifndef GL_ARB_window_pos +#define GL_ARB_window_pos 1 + +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVARBPROC) (const GLdouble* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FVARBPROC) (const GLfloat* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IVARBPROC) (const GLint* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SVARBPROC) (const GLshort* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DVARBPROC) (const GLdouble* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FVARBPROC) (const GLfloat* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IVARBPROC) (const GLint* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVARBPROC) (const GLshort* p); + +#define glWindowPos2dARB GLEW_GET_FUN(__glewWindowPos2dARB) +#define glWindowPos2dvARB GLEW_GET_FUN(__glewWindowPos2dvARB) +#define glWindowPos2fARB GLEW_GET_FUN(__glewWindowPos2fARB) +#define glWindowPos2fvARB GLEW_GET_FUN(__glewWindowPos2fvARB) +#define glWindowPos2iARB GLEW_GET_FUN(__glewWindowPos2iARB) +#define glWindowPos2ivARB GLEW_GET_FUN(__glewWindowPos2ivARB) +#define glWindowPos2sARB GLEW_GET_FUN(__glewWindowPos2sARB) +#define glWindowPos2svARB GLEW_GET_FUN(__glewWindowPos2svARB) +#define glWindowPos3dARB GLEW_GET_FUN(__glewWindowPos3dARB) +#define glWindowPos3dvARB GLEW_GET_FUN(__glewWindowPos3dvARB) +#define glWindowPos3fARB GLEW_GET_FUN(__glewWindowPos3fARB) +#define glWindowPos3fvARB GLEW_GET_FUN(__glewWindowPos3fvARB) +#define glWindowPos3iARB GLEW_GET_FUN(__glewWindowPos3iARB) +#define glWindowPos3ivARB GLEW_GET_FUN(__glewWindowPos3ivARB) +#define glWindowPos3sARB GLEW_GET_FUN(__glewWindowPos3sARB) +#define glWindowPos3svARB GLEW_GET_FUN(__glewWindowPos3svARB) + +#define GLEW_ARB_window_pos GLEW_GET_VAR(__GLEW_ARB_window_pos) + +#endif /* GL_ARB_window_pos */ + +/* ----------------------- GL_ARM_mali_program_binary ---------------------- */ + +#ifndef GL_ARM_mali_program_binary +#define GL_ARM_mali_program_binary 1 + +#define GL_MALI_PROGRAM_BINARY_ARM 0x8F61 + +#define GLEW_ARM_mali_program_binary GLEW_GET_VAR(__GLEW_ARM_mali_program_binary) + +#endif /* GL_ARM_mali_program_binary */ + +/* ----------------------- GL_ARM_mali_shader_binary ----------------------- */ + +#ifndef GL_ARM_mali_shader_binary +#define GL_ARM_mali_shader_binary 1 + +#define GL_MALI_SHADER_BINARY_ARM 0x8F60 + +#define GLEW_ARM_mali_shader_binary GLEW_GET_VAR(__GLEW_ARM_mali_shader_binary) + +#endif /* GL_ARM_mali_shader_binary */ + +/* ------------------------------ GL_ARM_rgba8 ----------------------------- */ + +#ifndef GL_ARM_rgba8 +#define GL_ARM_rgba8 1 + +#define GL_RGBA8_OES 0x8058 + +#define GLEW_ARM_rgba8 GLEW_GET_VAR(__GLEW_ARM_rgba8) + +#endif /* GL_ARM_rgba8 */ + +/* -------------------- GL_ARM_shader_framebuffer_fetch -------------------- */ + +#ifndef GL_ARM_shader_framebuffer_fetch +#define GL_ARM_shader_framebuffer_fetch 1 + +#define GL_FETCH_PER_SAMPLE_ARM 0x8F65 +#define GL_FRAGMENT_SHADER_FRAMEBUFFER_FETCH_MRT_ARM 0x8F66 + +#define GLEW_ARM_shader_framebuffer_fetch GLEW_GET_VAR(__GLEW_ARM_shader_framebuffer_fetch) + +#endif /* GL_ARM_shader_framebuffer_fetch */ + +/* ------------- GL_ARM_shader_framebuffer_fetch_depth_stencil ------------- */ + +#ifndef GL_ARM_shader_framebuffer_fetch_depth_stencil +#define GL_ARM_shader_framebuffer_fetch_depth_stencil 1 + +#define GLEW_ARM_shader_framebuffer_fetch_depth_stencil GLEW_GET_VAR(__GLEW_ARM_shader_framebuffer_fetch_depth_stencil) + +#endif /* GL_ARM_shader_framebuffer_fetch_depth_stencil */ + +/* ------------------------- GL_ATIX_point_sprites ------------------------- */ + +#ifndef GL_ATIX_point_sprites +#define GL_ATIX_point_sprites 1 + +#define GL_TEXTURE_POINT_MODE_ATIX 0x60B0 +#define GL_TEXTURE_POINT_ONE_COORD_ATIX 0x60B1 +#define GL_TEXTURE_POINT_SPRITE_ATIX 0x60B2 +#define GL_POINT_SPRITE_CULL_MODE_ATIX 0x60B3 +#define GL_POINT_SPRITE_CULL_CENTER_ATIX 0x60B4 +#define GL_POINT_SPRITE_CULL_CLIP_ATIX 0x60B5 + +#define GLEW_ATIX_point_sprites GLEW_GET_VAR(__GLEW_ATIX_point_sprites) + +#endif /* GL_ATIX_point_sprites */ + +/* ---------------------- GL_ATIX_texture_env_combine3 --------------------- */ + +#ifndef GL_ATIX_texture_env_combine3 +#define GL_ATIX_texture_env_combine3 1 + +#define GL_MODULATE_ADD_ATIX 0x8744 +#define GL_MODULATE_SIGNED_ADD_ATIX 0x8745 +#define GL_MODULATE_SUBTRACT_ATIX 0x8746 + +#define GLEW_ATIX_texture_env_combine3 GLEW_GET_VAR(__GLEW_ATIX_texture_env_combine3) + +#endif /* GL_ATIX_texture_env_combine3 */ + +/* ----------------------- GL_ATIX_texture_env_route ----------------------- */ + +#ifndef GL_ATIX_texture_env_route +#define GL_ATIX_texture_env_route 1 + +#define GL_SECONDARY_COLOR_ATIX 0x8747 +#define GL_TEXTURE_OUTPUT_RGB_ATIX 0x8748 +#define GL_TEXTURE_OUTPUT_ALPHA_ATIX 0x8749 + +#define GLEW_ATIX_texture_env_route GLEW_GET_VAR(__GLEW_ATIX_texture_env_route) + +#endif /* GL_ATIX_texture_env_route */ + +/* ---------------- GL_ATIX_vertex_shader_output_point_size ---------------- */ + +#ifndef GL_ATIX_vertex_shader_output_point_size +#define GL_ATIX_vertex_shader_output_point_size 1 + +#define GL_OUTPUT_POINT_SIZE_ATIX 0x610E + +#define GLEW_ATIX_vertex_shader_output_point_size GLEW_GET_VAR(__GLEW_ATIX_vertex_shader_output_point_size) + +#endif /* GL_ATIX_vertex_shader_output_point_size */ + +/* -------------------------- GL_ATI_draw_buffers -------------------------- */ + +#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 (GLAPIENTRY * PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum* bufs); + +#define glDrawBuffersATI GLEW_GET_FUN(__glewDrawBuffersATI) + +#define GLEW_ATI_draw_buffers GLEW_GET_VAR(__GLEW_ATI_draw_buffers) + +#endif /* GL_ATI_draw_buffers */ + +/* -------------------------- GL_ATI_element_array ------------------------- */ + +#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 (GLAPIENTRY * PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count); +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count); +typedef void (GLAPIENTRY * PFNGLELEMENTPOINTERATIPROC) (GLenum type, const void *pointer); + +#define glDrawElementArrayATI GLEW_GET_FUN(__glewDrawElementArrayATI) +#define glDrawRangeElementArrayATI GLEW_GET_FUN(__glewDrawRangeElementArrayATI) +#define glElementPointerATI GLEW_GET_FUN(__glewElementPointerATI) + +#define GLEW_ATI_element_array GLEW_GET_VAR(__GLEW_ATI_element_array) + +#endif /* GL_ATI_element_array */ + +/* ------------------------- GL_ATI_envmap_bumpmap ------------------------- */ + +#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 +#define GL_BUMP_TEX_UNITS_ATI 0x8778 +#define GL_DUDV_ATI 0x8779 +#define GL_DU8DV8_ATI 0x877A +#define GL_BUMP_ENVMAP_ATI 0x877B +#define GL_BUMP_TARGET_ATI 0x877C + +typedef void (GLAPIENTRY * PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param); +typedef void (GLAPIENTRY * PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param); +typedef void (GLAPIENTRY * PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param); +typedef void (GLAPIENTRY * PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param); + +#define glGetTexBumpParameterfvATI GLEW_GET_FUN(__glewGetTexBumpParameterfvATI) +#define glGetTexBumpParameterivATI GLEW_GET_FUN(__glewGetTexBumpParameterivATI) +#define glTexBumpParameterfvATI GLEW_GET_FUN(__glewTexBumpParameterfvATI) +#define glTexBumpParameterivATI GLEW_GET_FUN(__glewTexBumpParameterivATI) + +#define GLEW_ATI_envmap_bumpmap GLEW_GET_VAR(__GLEW_ATI_envmap_bumpmap) + +#endif /* GL_ATI_envmap_bumpmap */ + +/* ------------------------- GL_ATI_fragment_shader ------------------------ */ + +#ifndef GL_ATI_fragment_shader +#define GL_ATI_fragment_shader 1 + +#define GL_2X_BIT_ATI 0x00000001 +#define GL_RED_BIT_ATI 0x00000001 +#define GL_4X_BIT_ATI 0x00000002 +#define GL_COMP_BIT_ATI 0x00000002 +#define GL_GREEN_BIT_ATI 0x00000002 +#define GL_8X_BIT_ATI 0x00000004 +#define GL_BLUE_BIT_ATI 0x00000004 +#define GL_NEGATE_BIT_ATI 0x00000004 +#define GL_BIAS_BIT_ATI 0x00000008 +#define GL_HALF_BIT_ATI 0x00000008 +#define GL_QUARTER_BIT_ATI 0x00000010 +#define GL_EIGHTH_BIT_ATI 0x00000020 +#define GL_SATURATE_BIT_ATI 0x00000040 +#define GL_FRAGMENT_SHADER_ATI 0x8920 +#define GL_REG_0_ATI 0x8921 +#define GL_REG_1_ATI 0x8922 +#define GL_REG_2_ATI 0x8923 +#define GL_REG_3_ATI 0x8924 +#define GL_REG_4_ATI 0x8925 +#define GL_REG_5_ATI 0x8926 +#define GL_CON_0_ATI 0x8941 +#define GL_CON_1_ATI 0x8942 +#define GL_CON_2_ATI 0x8943 +#define GL_CON_3_ATI 0x8944 +#define GL_CON_4_ATI 0x8945 +#define GL_CON_5_ATI 0x8946 +#define GL_CON_6_ATI 0x8947 +#define GL_CON_7_ATI 0x8948 +#define GL_MOV_ATI 0x8961 +#define GL_ADD_ATI 0x8963 +#define GL_MUL_ATI 0x8964 +#define GL_SUB_ATI 0x8965 +#define GL_DOT3_ATI 0x8966 +#define GL_DOT4_ATI 0x8967 +#define GL_MAD_ATI 0x8968 +#define GL_LERP_ATI 0x8969 +#define GL_CND_ATI 0x896A +#define GL_CND0_ATI 0x896B +#define GL_DOT2_ADD_ATI 0x896C +#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D +#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E +#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F +#define GL_NUM_PASSES_ATI 0x8970 +#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971 +#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972 +#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973 +#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974 +#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975 +#define GL_SWIZZLE_STR_ATI 0x8976 +#define GL_SWIZZLE_STQ_ATI 0x8977 +#define GL_SWIZZLE_STR_DR_ATI 0x8978 +#define GL_SWIZZLE_STQ_DQ_ATI 0x8979 +#define GL_SWIZZLE_STRQ_ATI 0x897A +#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B + +typedef void (GLAPIENTRY * PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +typedef void (GLAPIENTRY * PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +typedef void (GLAPIENTRY * 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 (GLAPIENTRY * PFNGLBEGINFRAGMENTSHADERATIPROC) (void); +typedef void (GLAPIENTRY * PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +typedef void (GLAPIENTRY * PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +typedef void (GLAPIENTRY * 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 (GLAPIENTRY * PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLENDFRAGMENTSHADERATIPROC) (void); +typedef GLuint (GLAPIENTRY * PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range); +typedef void (GLAPIENTRY * PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle); +typedef void (GLAPIENTRY * PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle); +typedef void (GLAPIENTRY * PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat* value); + +#define glAlphaFragmentOp1ATI GLEW_GET_FUN(__glewAlphaFragmentOp1ATI) +#define glAlphaFragmentOp2ATI GLEW_GET_FUN(__glewAlphaFragmentOp2ATI) +#define glAlphaFragmentOp3ATI GLEW_GET_FUN(__glewAlphaFragmentOp3ATI) +#define glBeginFragmentShaderATI GLEW_GET_FUN(__glewBeginFragmentShaderATI) +#define glBindFragmentShaderATI GLEW_GET_FUN(__glewBindFragmentShaderATI) +#define glColorFragmentOp1ATI GLEW_GET_FUN(__glewColorFragmentOp1ATI) +#define glColorFragmentOp2ATI GLEW_GET_FUN(__glewColorFragmentOp2ATI) +#define glColorFragmentOp3ATI GLEW_GET_FUN(__glewColorFragmentOp3ATI) +#define glDeleteFragmentShaderATI GLEW_GET_FUN(__glewDeleteFragmentShaderATI) +#define glEndFragmentShaderATI GLEW_GET_FUN(__glewEndFragmentShaderATI) +#define glGenFragmentShadersATI GLEW_GET_FUN(__glewGenFragmentShadersATI) +#define glPassTexCoordATI GLEW_GET_FUN(__glewPassTexCoordATI) +#define glSampleMapATI GLEW_GET_FUN(__glewSampleMapATI) +#define glSetFragmentShaderConstantATI GLEW_GET_FUN(__glewSetFragmentShaderConstantATI) + +#define GLEW_ATI_fragment_shader GLEW_GET_VAR(__GLEW_ATI_fragment_shader) + +#endif /* GL_ATI_fragment_shader */ + +/* ------------------------ GL_ATI_map_object_buffer ----------------------- */ + +#ifndef GL_ATI_map_object_buffer +#define GL_ATI_map_object_buffer 1 + +typedef void * (GLAPIENTRY * PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer); + +#define glMapObjectBufferATI GLEW_GET_FUN(__glewMapObjectBufferATI) +#define glUnmapObjectBufferATI GLEW_GET_FUN(__glewUnmapObjectBufferATI) + +#define GLEW_ATI_map_object_buffer GLEW_GET_VAR(__GLEW_ATI_map_object_buffer) + +#endif /* GL_ATI_map_object_buffer */ + +/* ----------------------------- GL_ATI_meminfo ---------------------------- */ + +#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 + +#define GLEW_ATI_meminfo GLEW_GET_VAR(__GLEW_ATI_meminfo) + +#endif /* GL_ATI_meminfo */ + +/* -------------------------- GL_ATI_pn_triangles -------------------------- */ + +#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 +#define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3 +#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4 +#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5 +#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 (GLAPIENTRY * PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param); + +#define glPNTrianglesfATI GLEW_GET_FUN(__glewPNTrianglesfATI) +#define glPNTrianglesiATI GLEW_GET_FUN(__glewPNTrianglesiATI) + +#define GLEW_ATI_pn_triangles GLEW_GET_VAR(__GLEW_ATI_pn_triangles) + +#endif /* GL_ATI_pn_triangles */ + +/* ------------------------ GL_ATI_separate_stencil ------------------------ */ + +#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 (GLAPIENTRY * PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +typedef void (GLAPIENTRY * PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); + +#define glStencilFuncSeparateATI GLEW_GET_FUN(__glewStencilFuncSeparateATI) +#define glStencilOpSeparateATI GLEW_GET_FUN(__glewStencilOpSeparateATI) + +#define GLEW_ATI_separate_stencil GLEW_GET_VAR(__GLEW_ATI_separate_stencil) + +#endif /* GL_ATI_separate_stencil */ + +/* ----------------------- GL_ATI_shader_texture_lod ----------------------- */ + +#ifndef GL_ATI_shader_texture_lod +#define GL_ATI_shader_texture_lod 1 + +#define GLEW_ATI_shader_texture_lod GLEW_GET_VAR(__GLEW_ATI_shader_texture_lod) + +#endif /* GL_ATI_shader_texture_lod */ + +/* ---------------------- GL_ATI_text_fragment_shader ---------------------- */ + +#ifndef GL_ATI_text_fragment_shader +#define GL_ATI_text_fragment_shader 1 + +#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200 + +#define GLEW_ATI_text_fragment_shader GLEW_GET_VAR(__GLEW_ATI_text_fragment_shader) + +#endif /* GL_ATI_text_fragment_shader */ + +/* --------------------- GL_ATI_texture_compression_3dc -------------------- */ + +#ifndef GL_ATI_texture_compression_3dc +#define GL_ATI_texture_compression_3dc 1 + +#define GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI 0x8837 + +#define GLEW_ATI_texture_compression_3dc GLEW_GET_VAR(__GLEW_ATI_texture_compression_3dc) + +#endif /* GL_ATI_texture_compression_3dc */ + +/* ---------------------- GL_ATI_texture_env_combine3 ---------------------- */ + +#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 + +#define GLEW_ATI_texture_env_combine3 GLEW_GET_VAR(__GLEW_ATI_texture_env_combine3) + +#endif /* GL_ATI_texture_env_combine3 */ + +/* -------------------------- GL_ATI_texture_float ------------------------- */ + +#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 + +#define GLEW_ATI_texture_float GLEW_GET_VAR(__GLEW_ATI_texture_float) + +#endif /* GL_ATI_texture_float */ + +/* ----------------------- GL_ATI_texture_mirror_once ---------------------- */ + +#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 + +#define GLEW_ATI_texture_mirror_once GLEW_GET_VAR(__GLEW_ATI_texture_mirror_once) + +#endif /* GL_ATI_texture_mirror_once */ + +/* ----------------------- GL_ATI_vertex_array_object ---------------------- */ + +#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 +#define GL_DISCARD_ATI 0x8763 +#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764 +#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765 +#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766 +#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767 + +typedef void (GLAPIENTRY * PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (GLAPIENTRY * PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer); +typedef GLuint (GLAPIENTRY * PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const void *pointer, GLenum usage); +typedef void (GLAPIENTRY * PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const void *pointer, GLenum preserve); +typedef void (GLAPIENTRY * PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); + +#define glArrayObjectATI GLEW_GET_FUN(__glewArrayObjectATI) +#define glFreeObjectBufferATI GLEW_GET_FUN(__glewFreeObjectBufferATI) +#define glGetArrayObjectfvATI GLEW_GET_FUN(__glewGetArrayObjectfvATI) +#define glGetArrayObjectivATI GLEW_GET_FUN(__glewGetArrayObjectivATI) +#define glGetObjectBufferfvATI GLEW_GET_FUN(__glewGetObjectBufferfvATI) +#define glGetObjectBufferivATI GLEW_GET_FUN(__glewGetObjectBufferivATI) +#define glGetVariantArrayObjectfvATI GLEW_GET_FUN(__glewGetVariantArrayObjectfvATI) +#define glGetVariantArrayObjectivATI GLEW_GET_FUN(__glewGetVariantArrayObjectivATI) +#define glIsObjectBufferATI GLEW_GET_FUN(__glewIsObjectBufferATI) +#define glNewObjectBufferATI GLEW_GET_FUN(__glewNewObjectBufferATI) +#define glUpdateObjectBufferATI GLEW_GET_FUN(__glewUpdateObjectBufferATI) +#define glVariantArrayObjectATI GLEW_GET_FUN(__glewVariantArrayObjectATI) + +#define GLEW_ATI_vertex_array_object GLEW_GET_VAR(__GLEW_ATI_vertex_array_object) + +#endif /* GL_ATI_vertex_array_object */ + +/* ------------------- GL_ATI_vertex_attrib_array_object ------------------- */ + +#ifndef GL_ATI_vertex_attrib_array_object +#define GL_ATI_vertex_attrib_array_object 1 + +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); + +#define glGetVertexAttribArrayObjectfvATI GLEW_GET_FUN(__glewGetVertexAttribArrayObjectfvATI) +#define glGetVertexAttribArrayObjectivATI GLEW_GET_FUN(__glewGetVertexAttribArrayObjectivATI) +#define glVertexAttribArrayObjectATI GLEW_GET_FUN(__glewVertexAttribArrayObjectATI) + +#define GLEW_ATI_vertex_attrib_array_object GLEW_GET_VAR(__GLEW_ATI_vertex_attrib_array_object) + +#endif /* GL_ATI_vertex_attrib_array_object */ + +/* ------------------------- GL_ATI_vertex_streams ------------------------- */ + +#ifndef GL_ATI_vertex_streams +#define GL_ATI_vertex_streams 1 + +#define GL_MAX_VERTEX_STREAMS_ATI 0x876B +#define GL_VERTEX_SOURCE_ATI 0x876C +#define GL_VERTEX_STREAM0_ATI 0x876D +#define GL_VERTEX_STREAM1_ATI 0x876E +#define GL_VERTEX_STREAM2_ATI 0x876F +#define GL_VERTEX_STREAM3_ATI 0x8770 +#define GL_VERTEX_STREAM4_ATI 0x8771 +#define GL_VERTEX_STREAM5_ATI 0x8772 +#define GL_VERTEX_STREAM6_ATI 0x8773 +#define GL_VERTEX_STREAM7_ATI 0x8774 + +typedef void (GLAPIENTRY * PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte x, GLbyte y, GLbyte z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords); + +#define glClientActiveVertexStreamATI GLEW_GET_FUN(__glewClientActiveVertexStreamATI) +#define glNormalStream3bATI GLEW_GET_FUN(__glewNormalStream3bATI) +#define glNormalStream3bvATI GLEW_GET_FUN(__glewNormalStream3bvATI) +#define glNormalStream3dATI GLEW_GET_FUN(__glewNormalStream3dATI) +#define glNormalStream3dvATI GLEW_GET_FUN(__glewNormalStream3dvATI) +#define glNormalStream3fATI GLEW_GET_FUN(__glewNormalStream3fATI) +#define glNormalStream3fvATI GLEW_GET_FUN(__glewNormalStream3fvATI) +#define glNormalStream3iATI GLEW_GET_FUN(__glewNormalStream3iATI) +#define glNormalStream3ivATI GLEW_GET_FUN(__glewNormalStream3ivATI) +#define glNormalStream3sATI GLEW_GET_FUN(__glewNormalStream3sATI) +#define glNormalStream3svATI GLEW_GET_FUN(__glewNormalStream3svATI) +#define glVertexBlendEnvfATI GLEW_GET_FUN(__glewVertexBlendEnvfATI) +#define glVertexBlendEnviATI GLEW_GET_FUN(__glewVertexBlendEnviATI) +#define glVertexStream1dATI GLEW_GET_FUN(__glewVertexStream1dATI) +#define glVertexStream1dvATI GLEW_GET_FUN(__glewVertexStream1dvATI) +#define glVertexStream1fATI GLEW_GET_FUN(__glewVertexStream1fATI) +#define glVertexStream1fvATI GLEW_GET_FUN(__glewVertexStream1fvATI) +#define glVertexStream1iATI GLEW_GET_FUN(__glewVertexStream1iATI) +#define glVertexStream1ivATI GLEW_GET_FUN(__glewVertexStream1ivATI) +#define glVertexStream1sATI GLEW_GET_FUN(__glewVertexStream1sATI) +#define glVertexStream1svATI GLEW_GET_FUN(__glewVertexStream1svATI) +#define glVertexStream2dATI GLEW_GET_FUN(__glewVertexStream2dATI) +#define glVertexStream2dvATI GLEW_GET_FUN(__glewVertexStream2dvATI) +#define glVertexStream2fATI GLEW_GET_FUN(__glewVertexStream2fATI) +#define glVertexStream2fvATI GLEW_GET_FUN(__glewVertexStream2fvATI) +#define glVertexStream2iATI GLEW_GET_FUN(__glewVertexStream2iATI) +#define glVertexStream2ivATI GLEW_GET_FUN(__glewVertexStream2ivATI) +#define glVertexStream2sATI GLEW_GET_FUN(__glewVertexStream2sATI) +#define glVertexStream2svATI GLEW_GET_FUN(__glewVertexStream2svATI) +#define glVertexStream3dATI GLEW_GET_FUN(__glewVertexStream3dATI) +#define glVertexStream3dvATI GLEW_GET_FUN(__glewVertexStream3dvATI) +#define glVertexStream3fATI GLEW_GET_FUN(__glewVertexStream3fATI) +#define glVertexStream3fvATI GLEW_GET_FUN(__glewVertexStream3fvATI) +#define glVertexStream3iATI GLEW_GET_FUN(__glewVertexStream3iATI) +#define glVertexStream3ivATI GLEW_GET_FUN(__glewVertexStream3ivATI) +#define glVertexStream3sATI GLEW_GET_FUN(__glewVertexStream3sATI) +#define glVertexStream3svATI GLEW_GET_FUN(__glewVertexStream3svATI) +#define glVertexStream4dATI GLEW_GET_FUN(__glewVertexStream4dATI) +#define glVertexStream4dvATI GLEW_GET_FUN(__glewVertexStream4dvATI) +#define glVertexStream4fATI GLEW_GET_FUN(__glewVertexStream4fATI) +#define glVertexStream4fvATI GLEW_GET_FUN(__glewVertexStream4fvATI) +#define glVertexStream4iATI GLEW_GET_FUN(__glewVertexStream4iATI) +#define glVertexStream4ivATI GLEW_GET_FUN(__glewVertexStream4ivATI) +#define glVertexStream4sATI GLEW_GET_FUN(__glewVertexStream4sATI) +#define glVertexStream4svATI GLEW_GET_FUN(__glewVertexStream4svATI) + +#define GLEW_ATI_vertex_streams GLEW_GET_VAR(__GLEW_ATI_vertex_streams) + +#endif /* GL_ATI_vertex_streams */ + +/* -------------------- GL_EGL_KHR_context_flush_control ------------------- */ + +#ifndef GL_EGL_KHR_context_flush_control +#define GL_EGL_KHR_context_flush_control 1 + +#define GLEW_EGL_KHR_context_flush_control GLEW_GET_VAR(__GLEW_EGL_KHR_context_flush_control) + +#endif /* GL_EGL_KHR_context_flush_control */ + +/* ---------------- GL_EGL_NV_robustness_video_memory_purge ---------------- */ + +#ifndef GL_EGL_NV_robustness_video_memory_purge +#define GL_EGL_NV_robustness_video_memory_purge 1 + +#define GL_EGL_GENERATE_RESET_ON_VIDEO_MEMORY_PURGE_NV 0x334C +#define GL_PURGED_CONTEXT_RESET_NV 0x92BB + +#define GLEW_EGL_NV_robustness_video_memory_purge GLEW_GET_VAR(__GLEW_EGL_NV_robustness_video_memory_purge) + +#endif /* GL_EGL_NV_robustness_video_memory_purge */ + +/* --------------------------- GL_EXT_422_pixels --------------------------- */ + +#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 + +#define GLEW_EXT_422_pixels GLEW_GET_VAR(__GLEW_EXT_422_pixels) + +#endif /* GL_EXT_422_pixels */ + +/* ---------------------------- GL_EXT_Cg_shader --------------------------- */ + +#ifndef GL_EXT_Cg_shader +#define GL_EXT_Cg_shader 1 + +#define GL_CG_VERTEX_SHADER_EXT 0x890E +#define GL_CG_FRAGMENT_SHADER_EXT 0x890F + +#define GLEW_EXT_Cg_shader GLEW_GET_VAR(__GLEW_EXT_Cg_shader) + +#endif /* GL_EXT_Cg_shader */ + +/* ------------------------- GL_EXT_EGL_image_array ------------------------ */ + +#ifndef GL_EXT_EGL_image_array +#define GL_EXT_EGL_image_array 1 + +#define GLEW_EXT_EGL_image_array GLEW_GET_VAR(__GLEW_EXT_EGL_image_array) + +#endif /* GL_EXT_EGL_image_array */ + +/* --------------------------- GL_EXT_YUV_target --------------------------- */ + +#ifndef GL_EXT_YUV_target +#define GL_EXT_YUV_target 1 + +#define GL_SAMPLER_EXTERNAL_2D_Y2Y_EXT 0x8BE7 + +#define GLEW_EXT_YUV_target GLEW_GET_VAR(__GLEW_EXT_YUV_target) + +#endif /* GL_EXT_YUV_target */ + +/* ------------------------------ GL_EXT_abgr ------------------------------ */ + +#ifndef GL_EXT_abgr +#define GL_EXT_abgr 1 + +#define GL_ABGR_EXT 0x8000 + +#define GLEW_EXT_abgr GLEW_GET_VAR(__GLEW_EXT_abgr) + +#endif /* GL_EXT_abgr */ + +/* -------------------------- GL_EXT_base_instance ------------------------- */ + +#ifndef GL_EXT_base_instance +#define GL_EXT_base_instance 1 + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEEXTPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance); + +#define glDrawArraysInstancedBaseInstanceEXT GLEW_GET_FUN(__glewDrawArraysInstancedBaseInstanceEXT) +#define glDrawElementsInstancedBaseInstanceEXT GLEW_GET_FUN(__glewDrawElementsInstancedBaseInstanceEXT) +#define glDrawElementsInstancedBaseVertexBaseInstanceEXT GLEW_GET_FUN(__glewDrawElementsInstancedBaseVertexBaseInstanceEXT) + +#define GLEW_EXT_base_instance GLEW_GET_VAR(__GLEW_EXT_base_instance) + +#endif /* GL_EXT_base_instance */ + +/* ------------------------------ GL_EXT_bgra ------------------------------ */ + +#ifndef GL_EXT_bgra +#define GL_EXT_bgra 1 + +#define GL_BGR_EXT 0x80E0 +#define GL_BGRA_EXT 0x80E1 + +#define GLEW_EXT_bgra GLEW_GET_VAR(__GLEW_EXT_bgra) + +#endif /* GL_EXT_bgra */ + +/* ------------------------ GL_EXT_bindable_uniform ------------------------ */ + +#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 GLint (GLAPIENTRY * PFNGLGETUNIFORMBUFFERSIZEEXTPROC) (GLuint program, GLint location); +typedef GLintptr (GLAPIENTRY * PFNGLGETUNIFORMOFFSETEXTPROC) (GLuint program, GLint location); +typedef void (GLAPIENTRY * PFNGLUNIFORMBUFFEREXTPROC) (GLuint program, GLint location, GLuint buffer); + +#define glGetUniformBufferSizeEXT GLEW_GET_FUN(__glewGetUniformBufferSizeEXT) +#define glGetUniformOffsetEXT GLEW_GET_FUN(__glewGetUniformOffsetEXT) +#define glUniformBufferEXT GLEW_GET_FUN(__glewUniformBufferEXT) + +#define GLEW_EXT_bindable_uniform GLEW_GET_VAR(__GLEW_EXT_bindable_uniform) + +#endif /* GL_EXT_bindable_uniform */ + +/* --------------------------- GL_EXT_blend_color -------------------------- */ + +#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 (GLAPIENTRY * PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); + +#define glBlendColorEXT GLEW_GET_FUN(__glewBlendColorEXT) + +#define GLEW_EXT_blend_color GLEW_GET_VAR(__GLEW_EXT_blend_color) + +#endif /* GL_EXT_blend_color */ + +/* --------------------- GL_EXT_blend_equation_separate -------------------- */ + +#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 (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha); + +#define glBlendEquationSeparateEXT GLEW_GET_FUN(__glewBlendEquationSeparateEXT) + +#define GLEW_EXT_blend_equation_separate GLEW_GET_VAR(__GLEW_EXT_blend_equation_separate) + +#endif /* GL_EXT_blend_equation_separate */ + +/* ----------------------- GL_EXT_blend_func_extended ---------------------- */ + +#ifndef GL_EXT_blend_func_extended +#define GL_EXT_blend_func_extended 1 + +#define GL_SRC_ALPHA_SATURATE_EXT 0x0308 +#define GL_SRC1_ALPHA_EXT 0x8589 +#define GL_SRC1_COLOR_EXT 0x88F9 +#define GL_ONE_MINUS_SRC1_COLOR_EXT 0x88FA +#define GL_ONE_MINUS_SRC1_ALPHA_EXT 0x88FB +#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS_EXT 0x88FC +#define GL_LOCATION_INDEX_EXT 0x930F + +typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONINDEXEDEXTPROC) (GLuint program, GLuint colorNumber, GLuint index, const GLchar * name); +typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATAINDEXEXTPROC) (GLuint program, const GLchar * name); +typedef GLint (GLAPIENTRY * PFNGLGETPROGRAMRESOURCELOCATIONINDEXEXTPROC) (GLuint program, GLenum programInterface, const GLchar* name); + +#define glBindFragDataLocationIndexedEXT GLEW_GET_FUN(__glewBindFragDataLocationIndexedEXT) +#define glGetFragDataIndexEXT GLEW_GET_FUN(__glewGetFragDataIndexEXT) +#define glGetProgramResourceLocationIndexEXT GLEW_GET_FUN(__glewGetProgramResourceLocationIndexEXT) + +#define GLEW_EXT_blend_func_extended GLEW_GET_VAR(__GLEW_EXT_blend_func_extended) + +#endif /* GL_EXT_blend_func_extended */ + +/* ----------------------- GL_EXT_blend_func_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 (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); + +#define glBlendFuncSeparateEXT GLEW_GET_FUN(__glewBlendFuncSeparateEXT) + +#define GLEW_EXT_blend_func_separate GLEW_GET_VAR(__GLEW_EXT_blend_func_separate) + +#endif /* GL_EXT_blend_func_separate */ + +/* ------------------------- GL_EXT_blend_logic_op ------------------------- */ + +#ifndef GL_EXT_blend_logic_op +#define GL_EXT_blend_logic_op 1 + +#define GLEW_EXT_blend_logic_op GLEW_GET_VAR(__GLEW_EXT_blend_logic_op) + +#endif /* GL_EXT_blend_logic_op */ + +/* -------------------------- GL_EXT_blend_minmax -------------------------- */ + +#ifndef GL_EXT_blend_minmax +#define GL_EXT_blend_minmax 1 + +#define GL_FUNC_ADD_EXT 0x8006 +#define GL_MIN_EXT 0x8007 +#define GL_MAX_EXT 0x8008 +#define GL_BLEND_EQUATION_EXT 0x8009 + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONEXTPROC) (GLenum mode); + +#define glBlendEquationEXT GLEW_GET_FUN(__glewBlendEquationEXT) + +#define GLEW_EXT_blend_minmax GLEW_GET_VAR(__GLEW_EXT_blend_minmax) + +#endif /* GL_EXT_blend_minmax */ + +/* ------------------------- GL_EXT_blend_subtract ------------------------- */ + +#ifndef GL_EXT_blend_subtract +#define GL_EXT_blend_subtract 1 + +#define GL_FUNC_SUBTRACT_EXT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B + +#define GLEW_EXT_blend_subtract GLEW_GET_VAR(__GLEW_EXT_blend_subtract) + +#endif /* GL_EXT_blend_subtract */ + +/* ------------------------- GL_EXT_buffer_storage ------------------------- */ + +#ifndef GL_EXT_buffer_storage +#define GL_EXT_buffer_storage 1 + +#define GL_MAP_READ_BIT 0x0001 +#define GL_MAP_WRITE_BIT 0x0002 +#define GL_MAP_PERSISTENT_BIT_EXT 0x0040 +#define GL_MAP_COHERENT_BIT_EXT 0x0080 +#define GL_DYNAMIC_STORAGE_BIT_EXT 0x0100 +#define GL_CLIENT_STORAGE_BIT_EXT 0x0200 +#define GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT_EXT 0x00004000 +#define GL_BUFFER_IMMUTABLE_STORAGE_EXT 0x821F +#define GL_BUFFER_STORAGE_FLAGS_EXT 0x8220 + +typedef void (GLAPIENTRY * PFNGLBUFFERSTORAGEEXTPROC) (GLenum target, GLsizeiptr size, const void *data, GLbitfield flags); +typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSTORAGEEXTPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags); + +#define glBufferStorageEXT GLEW_GET_FUN(__glewBufferStorageEXT) +#define glNamedBufferStorageEXT GLEW_GET_FUN(__glewNamedBufferStorageEXT) + +#define GLEW_EXT_buffer_storage GLEW_GET_VAR(__GLEW_EXT_buffer_storage) + +#endif /* GL_EXT_buffer_storage */ + +/* -------------------------- GL_EXT_clear_texture ------------------------- */ + +#ifndef GL_EXT_clear_texture +#define GL_EXT_clear_texture 1 + +typedef void (GLAPIENTRY * PFNGLCLEARTEXIMAGEEXTPROC) (GLuint texture, GLint level, GLenum format, GLenum type, const void *data); +typedef void (GLAPIENTRY * PFNGLCLEARTEXSUBIMAGEEXTPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data); + +#define glClearTexImageEXT GLEW_GET_FUN(__glewClearTexImageEXT) +#define glClearTexSubImageEXT GLEW_GET_FUN(__glewClearTexSubImageEXT) + +#define GLEW_EXT_clear_texture GLEW_GET_VAR(__GLEW_EXT_clear_texture) + +#endif /* GL_EXT_clear_texture */ + +/* ----------------------- GL_EXT_clip_cull_distance ----------------------- */ + +#ifndef GL_EXT_clip_cull_distance +#define GL_EXT_clip_cull_distance 1 + +#define GL_MAX_CLIP_DISTANCES_EXT 0x0D32 +#define GL_CLIP_DISTANCE0_EXT 0x3000 +#define GL_CLIP_DISTANCE1_EXT 0x3001 +#define GL_CLIP_DISTANCE2_EXT 0x3002 +#define GL_CLIP_DISTANCE3_EXT 0x3003 +#define GL_CLIP_DISTANCE4_EXT 0x3004 +#define GL_CLIP_DISTANCE5_EXT 0x3005 +#define GL_CLIP_DISTANCE6_EXT 0x3006 +#define GL_CLIP_DISTANCE7_EXT 0x3007 +#define GL_MAX_CULL_DISTANCES_EXT 0x82F9 +#define GL_MAX_COMBINED_CLIP_AND_CULL_DISTANCES_EXT 0x82FA + +#define GLEW_EXT_clip_cull_distance GLEW_GET_VAR(__GLEW_EXT_clip_cull_distance) + +#endif /* GL_EXT_clip_cull_distance */ + +/* ------------------------ GL_EXT_clip_volume_hint ------------------------ */ + +#ifndef GL_EXT_clip_volume_hint +#define GL_EXT_clip_volume_hint 1 + +#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0 + +#define GLEW_EXT_clip_volume_hint GLEW_GET_VAR(__GLEW_EXT_clip_volume_hint) + +#endif /* GL_EXT_clip_volume_hint */ + +/* ------------------------------ GL_EXT_cmyka ----------------------------- */ + +#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 + +#define GLEW_EXT_cmyka GLEW_GET_VAR(__GLEW_EXT_cmyka) + +#endif /* GL_EXT_cmyka */ + +/* ----------------------- GL_EXT_color_buffer_float ----------------------- */ + +#ifndef GL_EXT_color_buffer_float +#define GL_EXT_color_buffer_float 1 + +#define GLEW_EXT_color_buffer_float GLEW_GET_VAR(__GLEW_EXT_color_buffer_float) + +#endif /* GL_EXT_color_buffer_float */ + +/* --------------------- GL_EXT_color_buffer_half_float -------------------- */ + +#ifndef GL_EXT_color_buffer_half_float +#define GL_EXT_color_buffer_half_float 1 + +#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT 0x8211 +#define GL_R16F_EXT 0x822D +#define GL_RG16F_EXT 0x822F +#define GL_RGBA16F_EXT 0x881A +#define GL_RGB16F_EXT 0x881B +#define GL_UNSIGNED_NORMALIZED_EXT 0x8C17 + +#define GLEW_EXT_color_buffer_half_float GLEW_GET_VAR(__GLEW_EXT_color_buffer_half_float) + +#endif /* GL_EXT_color_buffer_half_float */ + +/* ------------------------- GL_EXT_color_subtable ------------------------- */ + +#ifndef GL_EXT_color_subtable +#define GL_EXT_color_subtable 1 + +typedef void (GLAPIENTRY * PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data); +typedef void (GLAPIENTRY * PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); + +#define glColorSubTableEXT GLEW_GET_FUN(__glewColorSubTableEXT) +#define glCopyColorSubTableEXT GLEW_GET_FUN(__glewCopyColorSubTableEXT) + +#define GLEW_EXT_color_subtable GLEW_GET_VAR(__GLEW_EXT_color_subtable) + +#endif /* GL_EXT_color_subtable */ + +/* ---------------------- GL_EXT_compiled_vertex_array --------------------- */ + +#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 (GLAPIENTRY * PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count); +typedef void (GLAPIENTRY * PFNGLUNLOCKARRAYSEXTPROC) (void); + +#define glLockArraysEXT GLEW_GET_FUN(__glewLockArraysEXT) +#define glUnlockArraysEXT GLEW_GET_FUN(__glewUnlockArraysEXT) + +#define GLEW_EXT_compiled_vertex_array GLEW_GET_VAR(__GLEW_EXT_compiled_vertex_array) + +#endif /* GL_EXT_compiled_vertex_array */ + +/* ---------------- GL_EXT_compressed_ETC1_RGB8_sub_texture ---------------- */ + +#ifndef GL_EXT_compressed_ETC1_RGB8_sub_texture +#define GL_EXT_compressed_ETC1_RGB8_sub_texture 1 + +#define GLEW_EXT_compressed_ETC1_RGB8_sub_texture GLEW_GET_VAR(__GLEW_EXT_compressed_ETC1_RGB8_sub_texture) + +#endif /* GL_EXT_compressed_ETC1_RGB8_sub_texture */ + +/* ----------------------- GL_EXT_conservative_depth ----------------------- */ + +#ifndef GL_EXT_conservative_depth +#define GL_EXT_conservative_depth 1 + +#define GLEW_EXT_conservative_depth GLEW_GET_VAR(__GLEW_EXT_conservative_depth) + +#endif /* GL_EXT_conservative_depth */ + +/* --------------------------- GL_EXT_convolution -------------------------- */ + +#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 (GLAPIENTRY * PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *image); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *image); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, void *image); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, void *row, void *column, void *span); +typedef void (GLAPIENTRY * PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *row, const void *column); + +#define glConvolutionFilter1DEXT GLEW_GET_FUN(__glewConvolutionFilter1DEXT) +#define glConvolutionFilter2DEXT GLEW_GET_FUN(__glewConvolutionFilter2DEXT) +#define glConvolutionParameterfEXT GLEW_GET_FUN(__glewConvolutionParameterfEXT) +#define glConvolutionParameterfvEXT GLEW_GET_FUN(__glewConvolutionParameterfvEXT) +#define glConvolutionParameteriEXT GLEW_GET_FUN(__glewConvolutionParameteriEXT) +#define glConvolutionParameterivEXT GLEW_GET_FUN(__glewConvolutionParameterivEXT) +#define glCopyConvolutionFilter1DEXT GLEW_GET_FUN(__glewCopyConvolutionFilter1DEXT) +#define glCopyConvolutionFilter2DEXT GLEW_GET_FUN(__glewCopyConvolutionFilter2DEXT) +#define glGetConvolutionFilterEXT GLEW_GET_FUN(__glewGetConvolutionFilterEXT) +#define glGetConvolutionParameterfvEXT GLEW_GET_FUN(__glewGetConvolutionParameterfvEXT) +#define glGetConvolutionParameterivEXT GLEW_GET_FUN(__glewGetConvolutionParameterivEXT) +#define glGetSeparableFilterEXT GLEW_GET_FUN(__glewGetSeparableFilterEXT) +#define glSeparableFilter2DEXT GLEW_GET_FUN(__glewSeparableFilter2DEXT) + +#define GLEW_EXT_convolution GLEW_GET_VAR(__GLEW_EXT_convolution) + +#endif /* GL_EXT_convolution */ + +/* ------------------------ GL_EXT_coordinate_frame ------------------------ */ + +#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 (GLAPIENTRY * PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, void *pointer); +typedef void (GLAPIENTRY * PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, void *pointer); + +#define glBinormalPointerEXT GLEW_GET_FUN(__glewBinormalPointerEXT) +#define glTangentPointerEXT GLEW_GET_FUN(__glewTangentPointerEXT) + +#define GLEW_EXT_coordinate_frame GLEW_GET_VAR(__GLEW_EXT_coordinate_frame) + +#endif /* GL_EXT_coordinate_frame */ + +/* --------------------------- GL_EXT_copy_image --------------------------- */ + +#ifndef GL_EXT_copy_image +#define GL_EXT_copy_image 1 + +typedef void (GLAPIENTRY * PFNGLCOPYIMAGESUBDATAEXTPROC) (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); + +#define glCopyImageSubDataEXT GLEW_GET_FUN(__glewCopyImageSubDataEXT) + +#define GLEW_EXT_copy_image GLEW_GET_VAR(__GLEW_EXT_copy_image) + +#endif /* GL_EXT_copy_image */ + +/* -------------------------- GL_EXT_copy_texture -------------------------- */ + +#ifndef GL_EXT_copy_texture +#define GL_EXT_copy_texture 1 + +typedef void (GLAPIENTRY * PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); + +#define glCopyTexImage1DEXT GLEW_GET_FUN(__glewCopyTexImage1DEXT) +#define glCopyTexImage2DEXT GLEW_GET_FUN(__glewCopyTexImage2DEXT) +#define glCopyTexSubImage1DEXT GLEW_GET_FUN(__glewCopyTexSubImage1DEXT) +#define glCopyTexSubImage2DEXT GLEW_GET_FUN(__glewCopyTexSubImage2DEXT) +#define glCopyTexSubImage3DEXT GLEW_GET_FUN(__glewCopyTexSubImage3DEXT) + +#define GLEW_EXT_copy_texture GLEW_GET_VAR(__GLEW_EXT_copy_texture) + +#endif /* GL_EXT_copy_texture */ + +/* --------------------------- GL_EXT_cull_vertex -------------------------- */ + +#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 (GLAPIENTRY * PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat* params); + +#define glCullParameterdvEXT GLEW_GET_FUN(__glewCullParameterdvEXT) +#define glCullParameterfvEXT GLEW_GET_FUN(__glewCullParameterfvEXT) + +#define GLEW_EXT_cull_vertex GLEW_GET_VAR(__GLEW_EXT_cull_vertex) + +#endif /* GL_EXT_cull_vertex */ + +/* --------------------------- GL_EXT_debug_label -------------------------- */ + +#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 (GLAPIENTRY * PFNGLGETOBJECTLABELEXTPROC) (GLenum type, GLuint object, GLsizei bufSize, GLsizei* length, GLchar *label); +typedef void (GLAPIENTRY * PFNGLLABELOBJECTEXTPROC) (GLenum type, GLuint object, GLsizei length, const GLchar* label); + +#define glGetObjectLabelEXT GLEW_GET_FUN(__glewGetObjectLabelEXT) +#define glLabelObjectEXT GLEW_GET_FUN(__glewLabelObjectEXT) + +#define GLEW_EXT_debug_label GLEW_GET_VAR(__GLEW_EXT_debug_label) + +#endif /* GL_EXT_debug_label */ + +/* -------------------------- GL_EXT_debug_marker -------------------------- */ + +#ifndef GL_EXT_debug_marker +#define GL_EXT_debug_marker 1 + +typedef void (GLAPIENTRY * PFNGLINSERTEVENTMARKEREXTPROC) (GLsizei length, const GLchar* marker); +typedef void (GLAPIENTRY * PFNGLPOPGROUPMARKEREXTPROC) (void); +typedef void (GLAPIENTRY * PFNGLPUSHGROUPMARKEREXTPROC) (GLsizei length, const GLchar* marker); + +#define glInsertEventMarkerEXT GLEW_GET_FUN(__glewInsertEventMarkerEXT) +#define glPopGroupMarkerEXT GLEW_GET_FUN(__glewPopGroupMarkerEXT) +#define glPushGroupMarkerEXT GLEW_GET_FUN(__glewPushGroupMarkerEXT) + +#define GLEW_EXT_debug_marker GLEW_GET_VAR(__GLEW_EXT_debug_marker) + +#endif /* GL_EXT_debug_marker */ + +/* ------------------------ GL_EXT_depth_bounds_test ----------------------- */ + +#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 (GLAPIENTRY * PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax); + +#define glDepthBoundsEXT GLEW_GET_FUN(__glewDepthBoundsEXT) + +#define GLEW_EXT_depth_bounds_test GLEW_GET_VAR(__GLEW_EXT_depth_bounds_test) + +#endif /* GL_EXT_depth_bounds_test */ + +/* ----------------------- GL_EXT_direct_state_access ---------------------- */ + +#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 (GLAPIENTRY * PFNGLBINDMULTITEXTUREEXTPROC) (GLenum texunit, GLenum target, GLuint texture); +typedef GLenum (GLAPIENTRY * PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC) (GLuint framebuffer, GLenum target); +typedef void (GLAPIENTRY * PFNGLCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * 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 *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * 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 *data); +typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); +typedef void (GLAPIENTRY * PFNGLDISABLECLIENTSTATEIEXTPROC) (GLenum array, GLuint index); +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC) (GLuint vaobj, GLuint index); +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXARRAYEXTPROC) (GLuint vaobj, GLenum array); +typedef void (GLAPIENTRY * PFNGLENABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLECLIENTSTATEIEXTPROC) (GLenum array, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXARRAYATTRIBEXTPROC) (GLuint vaobj, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXARRAYEXTPROC) (GLuint vaobj, GLenum array); +typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC) (GLuint framebuffer, GLsizei n, const GLenum* bufs); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERREADBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); +typedef void (GLAPIENTRY * PFNGLGENERATEMULTITEXMIPMAPEXTPROC) (GLenum texunit, GLenum target); +typedef void (GLAPIENTRY * PFNGLGENERATETEXTUREMIPMAPEXTPROC) (GLuint texture, GLenum target); +typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, void *img); +typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, void *img); +typedef void (GLAPIENTRY * PFNGLGETDOUBLEINDEXEDVEXTPROC) (GLenum target, GLuint index, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETDOUBLEI_VEXTPROC) (GLenum pname, GLuint index, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETFLOATINDEXEDVEXTPROC) (GLenum target, GLuint index, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETFLOATI_VEXTPROC) (GLenum pname, GLuint index, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, void *pixels); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC) (GLuint buffer, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPOINTERVEXTPROC) (GLuint buffer, GLenum pname, void** params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, void *data); +typedef void (GLAPIENTRY * PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum pname, void *string); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMIVEXTPROC) (GLuint program, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC) (GLuint renderbuffer, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETPOINTERINDEXEDVEXTPROC) (GLenum target, GLuint index, void** params); +typedef void (GLAPIENTRY * PFNGLGETPOINTERI_VEXTPROC) (GLenum pname, GLuint index, void** params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, void *pixels); +typedef void (GLAPIENTRY * PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYINTEGERVEXTPROC) (GLuint vaobj, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, void** param); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYPOINTERVEXTPROC) (GLuint vaobj, GLenum pname, void** param); +typedef void * (GLAPIENTRY * PFNGLMAPNAMEDBUFFEREXTPROC) (GLuint buffer, GLenum access); +typedef void * (GLAPIENTRY * PFNGLMAPNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); +typedef void (GLAPIENTRY * PFNGLMATRIXFRUSTUMEXTPROC) (GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f); +typedef void (GLAPIENTRY * PFNGLMATRIXLOADIDENTITYEXTPROC) (GLenum matrixMode); +typedef void (GLAPIENTRY * PFNGLMATRIXLOADTRANSPOSEDEXTPROC) (GLenum matrixMode, const GLdouble* m); +typedef void (GLAPIENTRY * PFNGLMATRIXLOADTRANSPOSEFEXTPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXLOADDEXTPROC) (GLenum matrixMode, const GLdouble* m); +typedef void (GLAPIENTRY * PFNGLMATRIXLOADFEXTPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXMULTTRANSPOSEDEXTPROC) (GLenum matrixMode, const GLdouble* m); +typedef void (GLAPIENTRY * PFNGLMATRIXMULTTRANSPOSEFEXTPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXMULTDEXTPROC) (GLenum matrixMode, const GLdouble* m); +typedef void (GLAPIENTRY * PFNGLMATRIXMULTFEXTPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXORTHOEXTPROC) (GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f); +typedef void (GLAPIENTRY * PFNGLMATRIXPOPEXTPROC) (GLenum matrixMode); +typedef void (GLAPIENTRY * PFNGLMATRIXPUSHEXTPROC) (GLenum matrixMode); +typedef void (GLAPIENTRY * PFNGLMATRIXROTATEDEXTPROC) (GLenum matrixMode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLMATRIXROTATEFEXTPROC) (GLenum matrixMode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLMATRIXSCALEDEXTPROC) (GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLMATRIXSCALEFEXTPROC) (GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLMATRIXTRANSLATEDEXTPROC) (GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLMATRIXTRANSLATEFEXTPROC) (GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLMULTITEXBUFFEREXTPROC) (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDPOINTEREXTPROC) (GLenum texunit, GLint size, GLenum type, GLsizei stride, const void *pointer); +typedef void (GLAPIENTRY * PFNGLMULTITEXENVFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXENVIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENDEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble param); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENFEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENIEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * 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 (GLAPIENTRY * PFNGLMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat* param); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* param); +typedef void (GLAPIENTRY * PFNGLMULTITEXRENDERBUFFEREXTPROC) (GLenum texunit, GLenum target, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * 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 (GLAPIENTRY * PFNGLNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLenum usage); +typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); +typedef void (GLAPIENTRY * PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC) (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC) (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLint* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum format, GLsizei len, const void *string); +typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC) (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat v0); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint v0); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIEXTPROC) (GLuint program, GLint location, GLuint v0); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); +typedef void (GLAPIENTRY * PFNGLTEXTUREBUFFEREXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * 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 (GLAPIENTRY * PFNGLTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERFEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLfloat* param); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint* param); +typedef void (GLAPIENTRY * PFNGLTEXTURERENDERBUFFEREXTPROC) (GLuint texture, GLenum target, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * 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 GLboolean (GLAPIENTRY * PFNGLUNMAPNAMEDBUFFEREXTPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYCOLOROFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYINDEXOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum texunit, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYNORMALOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBDIVISOREXTPROC) (GLuint vaobj, GLuint index, GLuint divisor); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); + +#define glBindMultiTextureEXT GLEW_GET_FUN(__glewBindMultiTextureEXT) +#define glCheckNamedFramebufferStatusEXT GLEW_GET_FUN(__glewCheckNamedFramebufferStatusEXT) +#define glClientAttribDefaultEXT GLEW_GET_FUN(__glewClientAttribDefaultEXT) +#define glCompressedMultiTexImage1DEXT GLEW_GET_FUN(__glewCompressedMultiTexImage1DEXT) +#define glCompressedMultiTexImage2DEXT GLEW_GET_FUN(__glewCompressedMultiTexImage2DEXT) +#define glCompressedMultiTexImage3DEXT GLEW_GET_FUN(__glewCompressedMultiTexImage3DEXT) +#define glCompressedMultiTexSubImage1DEXT GLEW_GET_FUN(__glewCompressedMultiTexSubImage1DEXT) +#define glCompressedMultiTexSubImage2DEXT GLEW_GET_FUN(__glewCompressedMultiTexSubImage2DEXT) +#define glCompressedMultiTexSubImage3DEXT GLEW_GET_FUN(__glewCompressedMultiTexSubImage3DEXT) +#define glCompressedTextureImage1DEXT GLEW_GET_FUN(__glewCompressedTextureImage1DEXT) +#define glCompressedTextureImage2DEXT GLEW_GET_FUN(__glewCompressedTextureImage2DEXT) +#define glCompressedTextureImage3DEXT GLEW_GET_FUN(__glewCompressedTextureImage3DEXT) +#define glCompressedTextureSubImage1DEXT GLEW_GET_FUN(__glewCompressedTextureSubImage1DEXT) +#define glCompressedTextureSubImage2DEXT GLEW_GET_FUN(__glewCompressedTextureSubImage2DEXT) +#define glCompressedTextureSubImage3DEXT GLEW_GET_FUN(__glewCompressedTextureSubImage3DEXT) +#define glCopyMultiTexImage1DEXT GLEW_GET_FUN(__glewCopyMultiTexImage1DEXT) +#define glCopyMultiTexImage2DEXT GLEW_GET_FUN(__glewCopyMultiTexImage2DEXT) +#define glCopyMultiTexSubImage1DEXT GLEW_GET_FUN(__glewCopyMultiTexSubImage1DEXT) +#define glCopyMultiTexSubImage2DEXT GLEW_GET_FUN(__glewCopyMultiTexSubImage2DEXT) +#define glCopyMultiTexSubImage3DEXT GLEW_GET_FUN(__glewCopyMultiTexSubImage3DEXT) +#define glCopyTextureImage1DEXT GLEW_GET_FUN(__glewCopyTextureImage1DEXT) +#define glCopyTextureImage2DEXT GLEW_GET_FUN(__glewCopyTextureImage2DEXT) +#define glCopyTextureSubImage1DEXT GLEW_GET_FUN(__glewCopyTextureSubImage1DEXT) +#define glCopyTextureSubImage2DEXT GLEW_GET_FUN(__glewCopyTextureSubImage2DEXT) +#define glCopyTextureSubImage3DEXT GLEW_GET_FUN(__glewCopyTextureSubImage3DEXT) +#define glDisableClientStateIndexedEXT GLEW_GET_FUN(__glewDisableClientStateIndexedEXT) +#define glDisableClientStateiEXT GLEW_GET_FUN(__glewDisableClientStateiEXT) +#define glDisableVertexArrayAttribEXT GLEW_GET_FUN(__glewDisableVertexArrayAttribEXT) +#define glDisableVertexArrayEXT GLEW_GET_FUN(__glewDisableVertexArrayEXT) +#define glEnableClientStateIndexedEXT GLEW_GET_FUN(__glewEnableClientStateIndexedEXT) +#define glEnableClientStateiEXT GLEW_GET_FUN(__glewEnableClientStateiEXT) +#define glEnableVertexArrayAttribEXT GLEW_GET_FUN(__glewEnableVertexArrayAttribEXT) +#define glEnableVertexArrayEXT GLEW_GET_FUN(__glewEnableVertexArrayEXT) +#define glFlushMappedNamedBufferRangeEXT GLEW_GET_FUN(__glewFlushMappedNamedBufferRangeEXT) +#define glFramebufferDrawBufferEXT GLEW_GET_FUN(__glewFramebufferDrawBufferEXT) +#define glFramebufferDrawBuffersEXT GLEW_GET_FUN(__glewFramebufferDrawBuffersEXT) +#define glFramebufferReadBufferEXT GLEW_GET_FUN(__glewFramebufferReadBufferEXT) +#define glGenerateMultiTexMipmapEXT GLEW_GET_FUN(__glewGenerateMultiTexMipmapEXT) +#define glGenerateTextureMipmapEXT GLEW_GET_FUN(__glewGenerateTextureMipmapEXT) +#define glGetCompressedMultiTexImageEXT GLEW_GET_FUN(__glewGetCompressedMultiTexImageEXT) +#define glGetCompressedTextureImageEXT GLEW_GET_FUN(__glewGetCompressedTextureImageEXT) +#define glGetDoubleIndexedvEXT GLEW_GET_FUN(__glewGetDoubleIndexedvEXT) +#define glGetDoublei_vEXT GLEW_GET_FUN(__glewGetDoublei_vEXT) +#define glGetFloatIndexedvEXT GLEW_GET_FUN(__glewGetFloatIndexedvEXT) +#define glGetFloati_vEXT GLEW_GET_FUN(__glewGetFloati_vEXT) +#define glGetFramebufferParameterivEXT GLEW_GET_FUN(__glewGetFramebufferParameterivEXT) +#define glGetMultiTexEnvfvEXT GLEW_GET_FUN(__glewGetMultiTexEnvfvEXT) +#define glGetMultiTexEnvivEXT GLEW_GET_FUN(__glewGetMultiTexEnvivEXT) +#define glGetMultiTexGendvEXT GLEW_GET_FUN(__glewGetMultiTexGendvEXT) +#define glGetMultiTexGenfvEXT GLEW_GET_FUN(__glewGetMultiTexGenfvEXT) +#define glGetMultiTexGenivEXT GLEW_GET_FUN(__glewGetMultiTexGenivEXT) +#define glGetMultiTexImageEXT GLEW_GET_FUN(__glewGetMultiTexImageEXT) +#define glGetMultiTexLevelParameterfvEXT GLEW_GET_FUN(__glewGetMultiTexLevelParameterfvEXT) +#define glGetMultiTexLevelParameterivEXT GLEW_GET_FUN(__glewGetMultiTexLevelParameterivEXT) +#define glGetMultiTexParameterIivEXT GLEW_GET_FUN(__glewGetMultiTexParameterIivEXT) +#define glGetMultiTexParameterIuivEXT GLEW_GET_FUN(__glewGetMultiTexParameterIuivEXT) +#define glGetMultiTexParameterfvEXT GLEW_GET_FUN(__glewGetMultiTexParameterfvEXT) +#define glGetMultiTexParameterivEXT GLEW_GET_FUN(__glewGetMultiTexParameterivEXT) +#define glGetNamedBufferParameterivEXT GLEW_GET_FUN(__glewGetNamedBufferParameterivEXT) +#define glGetNamedBufferPointervEXT GLEW_GET_FUN(__glewGetNamedBufferPointervEXT) +#define glGetNamedBufferSubDataEXT GLEW_GET_FUN(__glewGetNamedBufferSubDataEXT) +#define glGetNamedFramebufferAttachmentParameterivEXT GLEW_GET_FUN(__glewGetNamedFramebufferAttachmentParameterivEXT) +#define glGetNamedProgramLocalParameterIivEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterIivEXT) +#define glGetNamedProgramLocalParameterIuivEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterIuivEXT) +#define glGetNamedProgramLocalParameterdvEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterdvEXT) +#define glGetNamedProgramLocalParameterfvEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterfvEXT) +#define glGetNamedProgramStringEXT GLEW_GET_FUN(__glewGetNamedProgramStringEXT) +#define glGetNamedProgramivEXT GLEW_GET_FUN(__glewGetNamedProgramivEXT) +#define glGetNamedRenderbufferParameterivEXT GLEW_GET_FUN(__glewGetNamedRenderbufferParameterivEXT) +#define glGetPointerIndexedvEXT GLEW_GET_FUN(__glewGetPointerIndexedvEXT) +#define glGetPointeri_vEXT GLEW_GET_FUN(__glewGetPointeri_vEXT) +#define glGetTextureImageEXT GLEW_GET_FUN(__glewGetTextureImageEXT) +#define glGetTextureLevelParameterfvEXT GLEW_GET_FUN(__glewGetTextureLevelParameterfvEXT) +#define glGetTextureLevelParameterivEXT GLEW_GET_FUN(__glewGetTextureLevelParameterivEXT) +#define glGetTextureParameterIivEXT GLEW_GET_FUN(__glewGetTextureParameterIivEXT) +#define glGetTextureParameterIuivEXT GLEW_GET_FUN(__glewGetTextureParameterIuivEXT) +#define glGetTextureParameterfvEXT GLEW_GET_FUN(__glewGetTextureParameterfvEXT) +#define glGetTextureParameterivEXT GLEW_GET_FUN(__glewGetTextureParameterivEXT) +#define glGetVertexArrayIntegeri_vEXT GLEW_GET_FUN(__glewGetVertexArrayIntegeri_vEXT) +#define glGetVertexArrayIntegervEXT GLEW_GET_FUN(__glewGetVertexArrayIntegervEXT) +#define glGetVertexArrayPointeri_vEXT GLEW_GET_FUN(__glewGetVertexArrayPointeri_vEXT) +#define glGetVertexArrayPointervEXT GLEW_GET_FUN(__glewGetVertexArrayPointervEXT) +#define glMapNamedBufferEXT GLEW_GET_FUN(__glewMapNamedBufferEXT) +#define glMapNamedBufferRangeEXT GLEW_GET_FUN(__glewMapNamedBufferRangeEXT) +#define glMatrixFrustumEXT GLEW_GET_FUN(__glewMatrixFrustumEXT) +#define glMatrixLoadIdentityEXT GLEW_GET_FUN(__glewMatrixLoadIdentityEXT) +#define glMatrixLoadTransposedEXT GLEW_GET_FUN(__glewMatrixLoadTransposedEXT) +#define glMatrixLoadTransposefEXT GLEW_GET_FUN(__glewMatrixLoadTransposefEXT) +#define glMatrixLoaddEXT GLEW_GET_FUN(__glewMatrixLoaddEXT) +#define glMatrixLoadfEXT GLEW_GET_FUN(__glewMatrixLoadfEXT) +#define glMatrixMultTransposedEXT GLEW_GET_FUN(__glewMatrixMultTransposedEXT) +#define glMatrixMultTransposefEXT GLEW_GET_FUN(__glewMatrixMultTransposefEXT) +#define glMatrixMultdEXT GLEW_GET_FUN(__glewMatrixMultdEXT) +#define glMatrixMultfEXT GLEW_GET_FUN(__glewMatrixMultfEXT) +#define glMatrixOrthoEXT GLEW_GET_FUN(__glewMatrixOrthoEXT) +#define glMatrixPopEXT GLEW_GET_FUN(__glewMatrixPopEXT) +#define glMatrixPushEXT GLEW_GET_FUN(__glewMatrixPushEXT) +#define glMatrixRotatedEXT GLEW_GET_FUN(__glewMatrixRotatedEXT) +#define glMatrixRotatefEXT GLEW_GET_FUN(__glewMatrixRotatefEXT) +#define glMatrixScaledEXT GLEW_GET_FUN(__glewMatrixScaledEXT) +#define glMatrixScalefEXT GLEW_GET_FUN(__glewMatrixScalefEXT) +#define glMatrixTranslatedEXT GLEW_GET_FUN(__glewMatrixTranslatedEXT) +#define glMatrixTranslatefEXT GLEW_GET_FUN(__glewMatrixTranslatefEXT) +#define glMultiTexBufferEXT GLEW_GET_FUN(__glewMultiTexBufferEXT) +#define glMultiTexCoordPointerEXT GLEW_GET_FUN(__glewMultiTexCoordPointerEXT) +#define glMultiTexEnvfEXT GLEW_GET_FUN(__glewMultiTexEnvfEXT) +#define glMultiTexEnvfvEXT GLEW_GET_FUN(__glewMultiTexEnvfvEXT) +#define glMultiTexEnviEXT GLEW_GET_FUN(__glewMultiTexEnviEXT) +#define glMultiTexEnvivEXT GLEW_GET_FUN(__glewMultiTexEnvivEXT) +#define glMultiTexGendEXT GLEW_GET_FUN(__glewMultiTexGendEXT) +#define glMultiTexGendvEXT GLEW_GET_FUN(__glewMultiTexGendvEXT) +#define glMultiTexGenfEXT GLEW_GET_FUN(__glewMultiTexGenfEXT) +#define glMultiTexGenfvEXT GLEW_GET_FUN(__glewMultiTexGenfvEXT) +#define glMultiTexGeniEXT GLEW_GET_FUN(__glewMultiTexGeniEXT) +#define glMultiTexGenivEXT GLEW_GET_FUN(__glewMultiTexGenivEXT) +#define glMultiTexImage1DEXT GLEW_GET_FUN(__glewMultiTexImage1DEXT) +#define glMultiTexImage2DEXT GLEW_GET_FUN(__glewMultiTexImage2DEXT) +#define glMultiTexImage3DEXT GLEW_GET_FUN(__glewMultiTexImage3DEXT) +#define glMultiTexParameterIivEXT GLEW_GET_FUN(__glewMultiTexParameterIivEXT) +#define glMultiTexParameterIuivEXT GLEW_GET_FUN(__glewMultiTexParameterIuivEXT) +#define glMultiTexParameterfEXT GLEW_GET_FUN(__glewMultiTexParameterfEXT) +#define glMultiTexParameterfvEXT GLEW_GET_FUN(__glewMultiTexParameterfvEXT) +#define glMultiTexParameteriEXT GLEW_GET_FUN(__glewMultiTexParameteriEXT) +#define glMultiTexParameterivEXT GLEW_GET_FUN(__glewMultiTexParameterivEXT) +#define glMultiTexRenderbufferEXT GLEW_GET_FUN(__glewMultiTexRenderbufferEXT) +#define glMultiTexSubImage1DEXT GLEW_GET_FUN(__glewMultiTexSubImage1DEXT) +#define glMultiTexSubImage2DEXT GLEW_GET_FUN(__glewMultiTexSubImage2DEXT) +#define glMultiTexSubImage3DEXT GLEW_GET_FUN(__glewMultiTexSubImage3DEXT) +#define glNamedBufferDataEXT GLEW_GET_FUN(__glewNamedBufferDataEXT) +#define glNamedBufferSubDataEXT GLEW_GET_FUN(__glewNamedBufferSubDataEXT) +#define glNamedCopyBufferSubDataEXT GLEW_GET_FUN(__glewNamedCopyBufferSubDataEXT) +#define glNamedFramebufferRenderbufferEXT GLEW_GET_FUN(__glewNamedFramebufferRenderbufferEXT) +#define glNamedFramebufferTexture1DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture1DEXT) +#define glNamedFramebufferTexture2DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture2DEXT) +#define glNamedFramebufferTexture3DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture3DEXT) +#define glNamedFramebufferTextureEXT GLEW_GET_FUN(__glewNamedFramebufferTextureEXT) +#define glNamedFramebufferTextureFaceEXT GLEW_GET_FUN(__glewNamedFramebufferTextureFaceEXT) +#define glNamedFramebufferTextureLayerEXT GLEW_GET_FUN(__glewNamedFramebufferTextureLayerEXT) +#define glNamedProgramLocalParameter4dEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4dEXT) +#define glNamedProgramLocalParameter4dvEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4dvEXT) +#define glNamedProgramLocalParameter4fEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4fEXT) +#define glNamedProgramLocalParameter4fvEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4fvEXT) +#define glNamedProgramLocalParameterI4iEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4iEXT) +#define glNamedProgramLocalParameterI4ivEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4ivEXT) +#define glNamedProgramLocalParameterI4uiEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4uiEXT) +#define glNamedProgramLocalParameterI4uivEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4uivEXT) +#define glNamedProgramLocalParameters4fvEXT GLEW_GET_FUN(__glewNamedProgramLocalParameters4fvEXT) +#define glNamedProgramLocalParametersI4ivEXT GLEW_GET_FUN(__glewNamedProgramLocalParametersI4ivEXT) +#define glNamedProgramLocalParametersI4uivEXT GLEW_GET_FUN(__glewNamedProgramLocalParametersI4uivEXT) +#define glNamedProgramStringEXT GLEW_GET_FUN(__glewNamedProgramStringEXT) +#define glNamedRenderbufferStorageEXT GLEW_GET_FUN(__glewNamedRenderbufferStorageEXT) +#define glNamedRenderbufferStorageMultisampleCoverageEXT GLEW_GET_FUN(__glewNamedRenderbufferStorageMultisampleCoverageEXT) +#define glNamedRenderbufferStorageMultisampleEXT GLEW_GET_FUN(__glewNamedRenderbufferStorageMultisampleEXT) +#define glProgramUniform1fEXT GLEW_GET_FUN(__glewProgramUniform1fEXT) +#define glProgramUniform1fvEXT GLEW_GET_FUN(__glewProgramUniform1fvEXT) +#define glProgramUniform1iEXT GLEW_GET_FUN(__glewProgramUniform1iEXT) +#define glProgramUniform1ivEXT GLEW_GET_FUN(__glewProgramUniform1ivEXT) +#define glProgramUniform1uiEXT GLEW_GET_FUN(__glewProgramUniform1uiEXT) +#define glProgramUniform1uivEXT GLEW_GET_FUN(__glewProgramUniform1uivEXT) +#define glProgramUniform2fEXT GLEW_GET_FUN(__glewProgramUniform2fEXT) +#define glProgramUniform2fvEXT GLEW_GET_FUN(__glewProgramUniform2fvEXT) +#define glProgramUniform2iEXT GLEW_GET_FUN(__glewProgramUniform2iEXT) +#define glProgramUniform2ivEXT GLEW_GET_FUN(__glewProgramUniform2ivEXT) +#define glProgramUniform2uiEXT GLEW_GET_FUN(__glewProgramUniform2uiEXT) +#define glProgramUniform2uivEXT GLEW_GET_FUN(__glewProgramUniform2uivEXT) +#define glProgramUniform3fEXT GLEW_GET_FUN(__glewProgramUniform3fEXT) +#define glProgramUniform3fvEXT GLEW_GET_FUN(__glewProgramUniform3fvEXT) +#define glProgramUniform3iEXT GLEW_GET_FUN(__glewProgramUniform3iEXT) +#define glProgramUniform3ivEXT GLEW_GET_FUN(__glewProgramUniform3ivEXT) +#define glProgramUniform3uiEXT GLEW_GET_FUN(__glewProgramUniform3uiEXT) +#define glProgramUniform3uivEXT GLEW_GET_FUN(__glewProgramUniform3uivEXT) +#define glProgramUniform4fEXT GLEW_GET_FUN(__glewProgramUniform4fEXT) +#define glProgramUniform4fvEXT GLEW_GET_FUN(__glewProgramUniform4fvEXT) +#define glProgramUniform4iEXT GLEW_GET_FUN(__glewProgramUniform4iEXT) +#define glProgramUniform4ivEXT GLEW_GET_FUN(__glewProgramUniform4ivEXT) +#define glProgramUniform4uiEXT GLEW_GET_FUN(__glewProgramUniform4uiEXT) +#define glProgramUniform4uivEXT GLEW_GET_FUN(__glewProgramUniform4uivEXT) +#define glProgramUniformMatrix2fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2fvEXT) +#define glProgramUniformMatrix2x3fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2x3fvEXT) +#define glProgramUniformMatrix2x4fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2x4fvEXT) +#define glProgramUniformMatrix3fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3fvEXT) +#define glProgramUniformMatrix3x2fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3x2fvEXT) +#define glProgramUniformMatrix3x4fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3x4fvEXT) +#define glProgramUniformMatrix4fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4fvEXT) +#define glProgramUniformMatrix4x2fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4x2fvEXT) +#define glProgramUniformMatrix4x3fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4x3fvEXT) +#define glPushClientAttribDefaultEXT GLEW_GET_FUN(__glewPushClientAttribDefaultEXT) +#define glTextureBufferEXT GLEW_GET_FUN(__glewTextureBufferEXT) +#define glTextureImage1DEXT GLEW_GET_FUN(__glewTextureImage1DEXT) +#define glTextureImage2DEXT GLEW_GET_FUN(__glewTextureImage2DEXT) +#define glTextureImage3DEXT GLEW_GET_FUN(__glewTextureImage3DEXT) +#define glTextureParameterIivEXT GLEW_GET_FUN(__glewTextureParameterIivEXT) +#define glTextureParameterIuivEXT GLEW_GET_FUN(__glewTextureParameterIuivEXT) +#define glTextureParameterfEXT GLEW_GET_FUN(__glewTextureParameterfEXT) +#define glTextureParameterfvEXT GLEW_GET_FUN(__glewTextureParameterfvEXT) +#define glTextureParameteriEXT GLEW_GET_FUN(__glewTextureParameteriEXT) +#define glTextureParameterivEXT GLEW_GET_FUN(__glewTextureParameterivEXT) +#define glTextureRenderbufferEXT GLEW_GET_FUN(__glewTextureRenderbufferEXT) +#define glTextureSubImage1DEXT GLEW_GET_FUN(__glewTextureSubImage1DEXT) +#define glTextureSubImage2DEXT GLEW_GET_FUN(__glewTextureSubImage2DEXT) +#define glTextureSubImage3DEXT GLEW_GET_FUN(__glewTextureSubImage3DEXT) +#define glUnmapNamedBufferEXT GLEW_GET_FUN(__glewUnmapNamedBufferEXT) +#define glVertexArrayColorOffsetEXT GLEW_GET_FUN(__glewVertexArrayColorOffsetEXT) +#define glVertexArrayEdgeFlagOffsetEXT GLEW_GET_FUN(__glewVertexArrayEdgeFlagOffsetEXT) +#define glVertexArrayFogCoordOffsetEXT GLEW_GET_FUN(__glewVertexArrayFogCoordOffsetEXT) +#define glVertexArrayIndexOffsetEXT GLEW_GET_FUN(__glewVertexArrayIndexOffsetEXT) +#define glVertexArrayMultiTexCoordOffsetEXT GLEW_GET_FUN(__glewVertexArrayMultiTexCoordOffsetEXT) +#define glVertexArrayNormalOffsetEXT GLEW_GET_FUN(__glewVertexArrayNormalOffsetEXT) +#define glVertexArraySecondaryColorOffsetEXT GLEW_GET_FUN(__glewVertexArraySecondaryColorOffsetEXT) +#define glVertexArrayTexCoordOffsetEXT GLEW_GET_FUN(__glewVertexArrayTexCoordOffsetEXT) +#define glVertexArrayVertexAttribDivisorEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribDivisorEXT) +#define glVertexArrayVertexAttribIOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribIOffsetEXT) +#define glVertexArrayVertexAttribOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribOffsetEXT) +#define glVertexArrayVertexOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexOffsetEXT) + +#define GLEW_EXT_direct_state_access GLEW_GET_VAR(__GLEW_EXT_direct_state_access) + +#endif /* GL_EXT_direct_state_access */ + +/* ----------------------- GL_EXT_discard_framebuffer ---------------------- */ + +#ifndef GL_EXT_discard_framebuffer +#define GL_EXT_discard_framebuffer 1 + +#define GL_COLOR_EXT 0x1800 +#define GL_DEPTH_EXT 0x1801 +#define GL_STENCIL_EXT 0x1802 + +typedef void (GLAPIENTRY * PFNGLDISCARDFRAMEBUFFEREXTPROC) (GLenum target, GLsizei numAttachments, const GLenum* attachments); + +#define glDiscardFramebufferEXT GLEW_GET_FUN(__glewDiscardFramebufferEXT) + +#define GLEW_EXT_discard_framebuffer GLEW_GET_VAR(__GLEW_EXT_discard_framebuffer) + +#endif /* GL_EXT_discard_framebuffer */ + +/* -------------------------- GL_EXT_draw_buffers -------------------------- */ + +#ifndef GL_EXT_draw_buffers +#define GL_EXT_draw_buffers 1 + +#define GL_MAX_DRAW_BUFFERS_EXT 0x8824 +#define GL_DRAW_BUFFER0_EXT 0x8825 +#define GL_DRAW_BUFFER1_EXT 0x8826 +#define GL_DRAW_BUFFER2_EXT 0x8827 +#define GL_DRAW_BUFFER3_EXT 0x8828 +#define GL_DRAW_BUFFER4_EXT 0x8829 +#define GL_DRAW_BUFFER5_EXT 0x882A +#define GL_DRAW_BUFFER6_EXT 0x882B +#define GL_DRAW_BUFFER7_EXT 0x882C +#define GL_DRAW_BUFFER8_EXT 0x882D +#define GL_DRAW_BUFFER9_EXT 0x882E +#define GL_DRAW_BUFFER10_EXT 0x882F +#define GL_DRAW_BUFFER11_EXT 0x8830 +#define GL_DRAW_BUFFER12_EXT 0x8831 +#define GL_DRAW_BUFFER13_EXT 0x8832 +#define GL_DRAW_BUFFER14_EXT 0x8833 +#define GL_DRAW_BUFFER15_EXT 0x8834 +#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 + +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSEXTPROC) (GLsizei n, const GLenum* bufs); + +#define glDrawBuffersEXT GLEW_GET_FUN(__glewDrawBuffersEXT) + +#define GLEW_EXT_draw_buffers GLEW_GET_VAR(__GLEW_EXT_draw_buffers) + +#endif /* GL_EXT_draw_buffers */ + +/* -------------------------- GL_EXT_draw_buffers2 ------------------------- */ + +#ifndef GL_EXT_draw_buffers2 +#define GL_EXT_draw_buffers2 1 + +typedef void (GLAPIENTRY * PFNGLCOLORMASKINDEXEDEXTPROC) (GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +typedef void (GLAPIENTRY * PFNGLDISABLEINDEXEDEXTPROC) (GLenum target, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEINDEXEDEXTPROC) (GLenum target, GLuint index); +typedef void (GLAPIENTRY * PFNGLGETBOOLEANINDEXEDVEXTPROC) (GLenum value, GLuint index, GLboolean* data); +typedef void (GLAPIENTRY * PFNGLGETINTEGERINDEXEDVEXTPROC) (GLenum value, GLuint index, GLint* data); +typedef GLboolean (GLAPIENTRY * PFNGLISENABLEDINDEXEDEXTPROC) (GLenum target, GLuint index); + +#define glColorMaskIndexedEXT GLEW_GET_FUN(__glewColorMaskIndexedEXT) +#define glDisableIndexedEXT GLEW_GET_FUN(__glewDisableIndexedEXT) +#define glEnableIndexedEXT GLEW_GET_FUN(__glewEnableIndexedEXT) +#define glGetBooleanIndexedvEXT GLEW_GET_FUN(__glewGetBooleanIndexedvEXT) +#define glGetIntegerIndexedvEXT GLEW_GET_FUN(__glewGetIntegerIndexedvEXT) +#define glIsEnabledIndexedEXT GLEW_GET_FUN(__glewIsEnabledIndexedEXT) + +#define GLEW_EXT_draw_buffers2 GLEW_GET_VAR(__GLEW_EXT_draw_buffers2) + +#endif /* GL_EXT_draw_buffers2 */ + +/* ---------------------- GL_EXT_draw_buffers_indexed ---------------------- */ + +#ifndef GL_EXT_draw_buffers_indexed +#define GL_EXT_draw_buffers_indexed 1 + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEIEXTPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONIEXTPROC) (GLuint buf, GLenum mode); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEIEXTPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCIEXTPROC) (GLuint buf, GLenum src, GLenum dst); +typedef void (GLAPIENTRY * PFNGLCOLORMASKIEXTPROC) (GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +typedef void (GLAPIENTRY * PFNGLDISABLEIEXTPROC) (GLenum target, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEIEXTPROC) (GLenum target, GLuint index); +typedef GLboolean (GLAPIENTRY * PFNGLISENABLEDIEXTPROC) (GLenum target, GLuint index); + +#define glBlendEquationSeparateiEXT GLEW_GET_FUN(__glewBlendEquationSeparateiEXT) +#define glBlendEquationiEXT GLEW_GET_FUN(__glewBlendEquationiEXT) +#define glBlendFuncSeparateiEXT GLEW_GET_FUN(__glewBlendFuncSeparateiEXT) +#define glBlendFunciEXT GLEW_GET_FUN(__glewBlendFunciEXT) +#define glColorMaskiEXT GLEW_GET_FUN(__glewColorMaskiEXT) +#define glDisableiEXT GLEW_GET_FUN(__glewDisableiEXT) +#define glEnableiEXT GLEW_GET_FUN(__glewEnableiEXT) +#define glIsEnablediEXT GLEW_GET_FUN(__glewIsEnablediEXT) + +#define GLEW_EXT_draw_buffers_indexed GLEW_GET_VAR(__GLEW_EXT_draw_buffers_indexed) + +#endif /* GL_EXT_draw_buffers_indexed */ + +/* -------------------- GL_EXT_draw_elements_base_vertex ------------------- */ + +#ifndef GL_EXT_draw_elements_base_vertex +#define GL_EXT_draw_elements_base_vertex 1 + +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSBASEVERTEXEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex); +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSBASEVERTEXEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSBASEVERTEXEXTPROC) (GLenum mode, const GLsizei* count, GLenum type, const void *const *indices, GLsizei primcount, const GLint *basevertex); + +#define glDrawElementsBaseVertexEXT GLEW_GET_FUN(__glewDrawElementsBaseVertexEXT) +#define glDrawElementsInstancedBaseVertexEXT GLEW_GET_FUN(__glewDrawElementsInstancedBaseVertexEXT) +#define glDrawRangeElementsBaseVertexEXT GLEW_GET_FUN(__glewDrawRangeElementsBaseVertexEXT) +#define glMultiDrawElementsBaseVertexEXT GLEW_GET_FUN(__glewMultiDrawElementsBaseVertexEXT) + +#define GLEW_EXT_draw_elements_base_vertex GLEW_GET_VAR(__GLEW_EXT_draw_elements_base_vertex) + +#endif /* GL_EXT_draw_elements_base_vertex */ + +/* ------------------------- GL_EXT_draw_instanced ------------------------- */ + +#ifndef GL_EXT_draw_instanced +#define GL_EXT_draw_instanced 1 + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); + +#define glDrawArraysInstancedEXT GLEW_GET_FUN(__glewDrawArraysInstancedEXT) +#define glDrawElementsInstancedEXT GLEW_GET_FUN(__glewDrawElementsInstancedEXT) + +#define GLEW_EXT_draw_instanced GLEW_GET_VAR(__GLEW_EXT_draw_instanced) + +#endif /* GL_EXT_draw_instanced */ + +/* ----------------------- GL_EXT_draw_range_elements ---------------------- */ + +#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 (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices); + +#define glDrawRangeElementsEXT GLEW_GET_FUN(__glewDrawRangeElementsEXT) + +#define GLEW_EXT_draw_range_elements GLEW_GET_VAR(__GLEW_EXT_draw_range_elements) + +#endif /* GL_EXT_draw_range_elements */ + +/* ------------------------- GL_EXT_external_buffer ------------------------ */ + +#ifndef GL_EXT_external_buffer +#define GL_EXT_external_buffer 1 + +typedef void* GLeglClientBufferEXT; + +typedef void (GLAPIENTRY * PFNGLBUFFERSTORAGEEXTERNALEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLeglClientBufferEXT clientBuffer, GLbitfield flags); +typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSTORAGEEXTERNALEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLeglClientBufferEXT clientBuffer, GLbitfield flags); + +#define glBufferStorageExternalEXT GLEW_GET_FUN(__glewBufferStorageExternalEXT) +#define glNamedBufferStorageExternalEXT GLEW_GET_FUN(__glewNamedBufferStorageExternalEXT) + +#define GLEW_EXT_external_buffer GLEW_GET_VAR(__GLEW_EXT_external_buffer) + +#endif /* GL_EXT_external_buffer */ + +/* --------------------------- GL_EXT_float_blend -------------------------- */ + +#ifndef GL_EXT_float_blend +#define GL_EXT_float_blend 1 + +#define GLEW_EXT_float_blend GLEW_GET_VAR(__GLEW_EXT_float_blend) + +#endif /* GL_EXT_float_blend */ + +/* ---------------------------- GL_EXT_fog_coord --------------------------- */ + +#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 (GLAPIENTRY * PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const void *pointer); +typedef void (GLAPIENTRY * PFNGLFOGCOORDDEXTPROC) (GLdouble coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDFEXTPROC) (GLfloat coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord); + +#define glFogCoordPointerEXT GLEW_GET_FUN(__glewFogCoordPointerEXT) +#define glFogCoorddEXT GLEW_GET_FUN(__glewFogCoorddEXT) +#define glFogCoorddvEXT GLEW_GET_FUN(__glewFogCoorddvEXT) +#define glFogCoordfEXT GLEW_GET_FUN(__glewFogCoordfEXT) +#define glFogCoordfvEXT GLEW_GET_FUN(__glewFogCoordfvEXT) + +#define GLEW_EXT_fog_coord GLEW_GET_VAR(__GLEW_EXT_fog_coord) + +#endif /* GL_EXT_fog_coord */ + +/* --------------------------- GL_EXT_frag_depth --------------------------- */ + +#ifndef GL_EXT_frag_depth +#define GL_EXT_frag_depth 1 + +#define GLEW_EXT_frag_depth GLEW_GET_VAR(__GLEW_EXT_frag_depth) + +#endif /* GL_EXT_frag_depth */ + +/* ------------------------ GL_EXT_fragment_lighting ----------------------- */ + +#ifndef GL_EXT_fragment_lighting +#define GL_EXT_fragment_lighting 1 + +#define GL_FRAGMENT_LIGHTING_EXT 0x8400 +#define GL_FRAGMENT_COLOR_MATERIAL_EXT 0x8401 +#define GL_FRAGMENT_COLOR_MATERIAL_FACE_EXT 0x8402 +#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_EXT 0x8403 +#define GL_MAX_FRAGMENT_LIGHTS_EXT 0x8404 +#define GL_MAX_ACTIVE_LIGHTS_EXT 0x8405 +#define GL_CURRENT_RASTER_NORMAL_EXT 0x8406 +#define GL_LIGHT_ENV_MODE_EXT 0x8407 +#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_EXT 0x8408 +#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_EXT 0x8409 +#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_EXT 0x840A +#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_EXT 0x840B +#define GL_FRAGMENT_LIGHT0_EXT 0x840C +#define GL_FRAGMENT_LIGHT7_EXT 0x8413 + +typedef void (GLAPIENTRY * PFNGLFRAGMENTCOLORMATERIALEXTPROC) (GLenum face, GLenum mode); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFEXTPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFVEXTPROC) (GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIEXTPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIVEXTPROC) (GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFEXTPROC) (GLenum light, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFVEXTPROC) (GLenum light, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIEXTPROC) (GLenum light, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIVEXTPROC) (GLenum light, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFEXTPROC) (GLenum face, GLenum pname, const GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFVEXTPROC) (GLenum face, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALIEXTPROC) (GLenum face, GLenum pname, const GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALIVEXTPROC) (GLenum face, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTFVEXTPROC) (GLenum light, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTIVEXTPROC) (GLenum light, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALFVEXTPROC) (GLenum face, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALIVEXTPROC) (GLenum face, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLLIGHTENVIEXTPROC) (GLenum pname, GLint param); + +#define glFragmentColorMaterialEXT GLEW_GET_FUN(__glewFragmentColorMaterialEXT) +#define glFragmentLightModelfEXT GLEW_GET_FUN(__glewFragmentLightModelfEXT) +#define glFragmentLightModelfvEXT GLEW_GET_FUN(__glewFragmentLightModelfvEXT) +#define glFragmentLightModeliEXT GLEW_GET_FUN(__glewFragmentLightModeliEXT) +#define glFragmentLightModelivEXT GLEW_GET_FUN(__glewFragmentLightModelivEXT) +#define glFragmentLightfEXT GLEW_GET_FUN(__glewFragmentLightfEXT) +#define glFragmentLightfvEXT GLEW_GET_FUN(__glewFragmentLightfvEXT) +#define glFragmentLightiEXT GLEW_GET_FUN(__glewFragmentLightiEXT) +#define glFragmentLightivEXT GLEW_GET_FUN(__glewFragmentLightivEXT) +#define glFragmentMaterialfEXT GLEW_GET_FUN(__glewFragmentMaterialfEXT) +#define glFragmentMaterialfvEXT GLEW_GET_FUN(__glewFragmentMaterialfvEXT) +#define glFragmentMaterialiEXT GLEW_GET_FUN(__glewFragmentMaterialiEXT) +#define glFragmentMaterialivEXT GLEW_GET_FUN(__glewFragmentMaterialivEXT) +#define glGetFragmentLightfvEXT GLEW_GET_FUN(__glewGetFragmentLightfvEXT) +#define glGetFragmentLightivEXT GLEW_GET_FUN(__glewGetFragmentLightivEXT) +#define glGetFragmentMaterialfvEXT GLEW_GET_FUN(__glewGetFragmentMaterialfvEXT) +#define glGetFragmentMaterialivEXT GLEW_GET_FUN(__glewGetFragmentMaterialivEXT) +#define glLightEnviEXT GLEW_GET_FUN(__glewLightEnviEXT) + +#define GLEW_EXT_fragment_lighting GLEW_GET_VAR(__GLEW_EXT_fragment_lighting) + +#endif /* GL_EXT_fragment_lighting */ + +/* ------------------------ GL_EXT_framebuffer_blit ------------------------ */ + +#ifndef GL_EXT_framebuffer_blit +#define GL_EXT_framebuffer_blit 1 + +#define GL_DRAW_FRAMEBUFFER_BINDING_EXT 0x8CA6 +#define GL_READ_FRAMEBUFFER_EXT 0x8CA8 +#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9 +#define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA + +typedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); + +#define glBlitFramebufferEXT GLEW_GET_FUN(__glewBlitFramebufferEXT) + +#define GLEW_EXT_framebuffer_blit GLEW_GET_VAR(__GLEW_EXT_framebuffer_blit) + +#endif /* GL_EXT_framebuffer_blit */ + +/* --------------------- GL_EXT_framebuffer_multisample -------------------- */ + +#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 (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); + +#define glRenderbufferStorageMultisampleEXT GLEW_GET_FUN(__glewRenderbufferStorageMultisampleEXT) + +#define GLEW_EXT_framebuffer_multisample GLEW_GET_VAR(__GLEW_EXT_framebuffer_multisample) + +#endif /* GL_EXT_framebuffer_multisample */ + +/* --------------- GL_EXT_framebuffer_multisample_blit_scaled -------------- */ + +#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 + +#define GLEW_EXT_framebuffer_multisample_blit_scaled GLEW_GET_VAR(__GLEW_EXT_framebuffer_multisample_blit_scaled) + +#endif /* GL_EXT_framebuffer_multisample_blit_scaled */ + +/* ----------------------- GL_EXT_framebuffer_object ----------------------- */ + +#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 void (GLAPIENTRY * PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer); +typedef void (GLAPIENTRY * PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer); +typedef GLenum (GLAPIENTRY * PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint* framebuffers); +typedef void (GLAPIENTRY * PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint* renderbuffers); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +typedef void (GLAPIENTRY * PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint* framebuffers); +typedef void (GLAPIENTRY * PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint* renderbuffers); +typedef void (GLAPIENTRY * PFNGLGENERATEMIPMAPEXTPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer); +typedef GLboolean (GLAPIENTRY * PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); + +#define glBindFramebufferEXT GLEW_GET_FUN(__glewBindFramebufferEXT) +#define glBindRenderbufferEXT GLEW_GET_FUN(__glewBindRenderbufferEXT) +#define glCheckFramebufferStatusEXT GLEW_GET_FUN(__glewCheckFramebufferStatusEXT) +#define glDeleteFramebuffersEXT GLEW_GET_FUN(__glewDeleteFramebuffersEXT) +#define glDeleteRenderbuffersEXT GLEW_GET_FUN(__glewDeleteRenderbuffersEXT) +#define glFramebufferRenderbufferEXT GLEW_GET_FUN(__glewFramebufferRenderbufferEXT) +#define glFramebufferTexture1DEXT GLEW_GET_FUN(__glewFramebufferTexture1DEXT) +#define glFramebufferTexture2DEXT GLEW_GET_FUN(__glewFramebufferTexture2DEXT) +#define glFramebufferTexture3DEXT GLEW_GET_FUN(__glewFramebufferTexture3DEXT) +#define glGenFramebuffersEXT GLEW_GET_FUN(__glewGenFramebuffersEXT) +#define glGenRenderbuffersEXT GLEW_GET_FUN(__glewGenRenderbuffersEXT) +#define glGenerateMipmapEXT GLEW_GET_FUN(__glewGenerateMipmapEXT) +#define glGetFramebufferAttachmentParameterivEXT GLEW_GET_FUN(__glewGetFramebufferAttachmentParameterivEXT) +#define glGetRenderbufferParameterivEXT GLEW_GET_FUN(__glewGetRenderbufferParameterivEXT) +#define glIsFramebufferEXT GLEW_GET_FUN(__glewIsFramebufferEXT) +#define glIsRenderbufferEXT GLEW_GET_FUN(__glewIsRenderbufferEXT) +#define glRenderbufferStorageEXT GLEW_GET_FUN(__glewRenderbufferStorageEXT) + +#define GLEW_EXT_framebuffer_object GLEW_GET_VAR(__GLEW_EXT_framebuffer_object) + +#endif /* GL_EXT_framebuffer_object */ + +/* ------------------------ GL_EXT_framebuffer_sRGB ------------------------ */ + +#ifndef GL_EXT_framebuffer_sRGB +#define GL_EXT_framebuffer_sRGB 1 + +#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 +#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA + +#define GLEW_EXT_framebuffer_sRGB GLEW_GET_VAR(__GLEW_EXT_framebuffer_sRGB) + +#endif /* GL_EXT_framebuffer_sRGB */ + +/* ----------------------- GL_EXT_geometry_point_size ---------------------- */ + +#ifndef GL_EXT_geometry_point_size +#define GL_EXT_geometry_point_size 1 + +#define GL_GEOMETRY_SHADER_BIT_EXT 0x00000004 +#define GL_LINES_ADJACENCY_EXT 0xA +#define GL_LINE_STRIP_ADJACENCY_EXT 0xB +#define GL_TRIANGLES_ADJACENCY_EXT 0xC +#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0xD +#define GL_LAYER_PROVOKING_VERTEX_EXT 0x825E +#define GL_UNDEFINED_VERTEX_EXT 0x8260 +#define GL_GEOMETRY_SHADER_INVOCATIONS_EXT 0x887F +#define GL_GEOMETRY_LINKED_VERTICES_OUT_EXT 0x8916 +#define GL_GEOMETRY_LINKED_INPUT_TYPE_EXT 0x8917 +#define GL_GEOMETRY_LINKED_OUTPUT_TYPE_EXT 0x8918 +#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS_EXT 0x8A2C +#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8A32 +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 +#define GL_PRIMITIVES_GENERATED_EXT 0x8C87 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 +#define GL_GEOMETRY_SHADER_EXT 0x8DD9 +#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_FIRST_VERTEX_CONVENTION_EXT 0x8E4D +#define GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E +#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS_EXT 0x8E5A +#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS_EXT 0x90CD +#define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS_EXT 0x90D7 +#define GL_MAX_GEOMETRY_INPUT_COMPONENTS_EXT 0x9123 +#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS_EXT 0x9124 +#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS_EXT 0x92CF +#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS_EXT 0x92D5 +#define GL_REFERENCED_BY_GEOMETRY_SHADER_EXT 0x9309 +#define GL_FRAMEBUFFER_DEFAULT_LAYERS_EXT 0x9312 +#define GL_MAX_FRAMEBUFFER_LAYERS_EXT 0x9317 + +#define GLEW_EXT_geometry_point_size GLEW_GET_VAR(__GLEW_EXT_geometry_point_size) + +#endif /* GL_EXT_geometry_point_size */ + +/* ------------------------- GL_EXT_geometry_shader ------------------------ */ + +#ifndef GL_EXT_geometry_shader +#define GL_EXT_geometry_shader 1 + +#define GL_GEOMETRY_SHADER_BIT_EXT 0x00000004 +#define GL_LINES_ADJACENCY_EXT 0xA +#define GL_LINE_STRIP_ADJACENCY_EXT 0xB +#define GL_TRIANGLES_ADJACENCY_EXT 0xC +#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0xD +#define GL_LAYER_PROVOKING_VERTEX_EXT 0x825E +#define GL_UNDEFINED_VERTEX_EXT 0x8260 +#define GL_GEOMETRY_SHADER_INVOCATIONS_EXT 0x887F +#define GL_GEOMETRY_LINKED_VERTICES_OUT_EXT 0x8916 +#define GL_GEOMETRY_LINKED_INPUT_TYPE_EXT 0x8917 +#define GL_GEOMETRY_LINKED_OUTPUT_TYPE_EXT 0x8918 +#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS_EXT 0x8A2C +#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8A32 +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 +#define GL_PRIMITIVES_GENERATED_EXT 0x8C87 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 +#define GL_GEOMETRY_SHADER_EXT 0x8DD9 +#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_FIRST_VERTEX_CONVENTION_EXT 0x8E4D +#define GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E +#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS_EXT 0x8E5A +#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS_EXT 0x90CD +#define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS_EXT 0x90D7 +#define GL_MAX_GEOMETRY_INPUT_COMPONENTS_EXT 0x9123 +#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS_EXT 0x9124 +#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS_EXT 0x92CF +#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS_EXT 0x92D5 +#define GL_REFERENCED_BY_GEOMETRY_SHADER_EXT 0x9309 +#define GL_FRAMEBUFFER_DEFAULT_LAYERS_EXT 0x9312 +#define GL_MAX_FRAMEBUFFER_LAYERS_EXT 0x9317 + +#define GLEW_EXT_geometry_shader GLEW_GET_VAR(__GLEW_EXT_geometry_shader) + +#endif /* GL_EXT_geometry_shader */ + +/* ------------------------ GL_EXT_geometry_shader4 ------------------------ */ + +#ifndef GL_EXT_geometry_shader4 +#define GL_EXT_geometry_shader4 1 + +#define GL_LINES_ADJACENCY_EXT 0xA +#define GL_LINE_STRIP_ADJACENCY_EXT 0xB +#define GL_TRIANGLES_ADJACENCY_EXT 0xC +#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0xD +#define GL_PROGRAM_POINT_SIZE_EXT 0x8642 +#define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 +#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_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_VARYING_COMPONENTS_EXT 0x8DDD +#define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE +#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 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value); + +#define glFramebufferTextureEXT GLEW_GET_FUN(__glewFramebufferTextureEXT) +#define glFramebufferTextureFaceEXT GLEW_GET_FUN(__glewFramebufferTextureFaceEXT) +#define glProgramParameteriEXT GLEW_GET_FUN(__glewProgramParameteriEXT) + +#define GLEW_EXT_geometry_shader4 GLEW_GET_VAR(__GLEW_EXT_geometry_shader4) + +#endif /* GL_EXT_geometry_shader4 */ + +/* --------------------- GL_EXT_gpu_program_parameters --------------------- */ + +#ifndef GL_EXT_gpu_program_parameters +#define GL_EXT_gpu_program_parameters 1 + +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat* params); + +#define glProgramEnvParameters4fvEXT GLEW_GET_FUN(__glewProgramEnvParameters4fvEXT) +#define glProgramLocalParameters4fvEXT GLEW_GET_FUN(__glewProgramLocalParameters4fvEXT) + +#define GLEW_EXT_gpu_program_parameters GLEW_GET_VAR(__GLEW_EXT_gpu_program_parameters) + +#endif /* GL_EXT_gpu_program_parameters */ + +/* --------------------------- GL_EXT_gpu_shader4 -------------------------- */ + +#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 + +typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name); +typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATALOCATIONEXTPROC) (GLuint program, const GLchar *name); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMUIVEXTPROC) (GLuint program, GLint location, GLuint *params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIIVEXTPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIUIVEXTPROC) (GLuint index, GLenum pname, GLuint *params); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UIEXTPROC) (GLint location, GLuint v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UIEXTPROC) (GLint location, GLuint v0, GLuint v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IEXTPROC) (GLuint index, GLint x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IVEXTPROC) (GLuint index, const GLint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIEXTPROC) (GLuint index, GLuint x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IEXTPROC) (GLuint index, GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IVEXTPROC) (GLuint index, const GLint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIEXTPROC) (GLuint index, GLuint x, GLuint y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IEXTPROC) (GLuint index, GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IVEXTPROC) (GLuint index, const GLint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4BVEXTPROC) (GLuint index, const GLbyte *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IEXTPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IVEXTPROC) (GLuint index, const GLint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4SVEXTPROC) (GLuint index, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UBVEXTPROC) (GLuint index, const GLubyte *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4USVEXTPROC) (GLuint index, const GLushort *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); + +#define glBindFragDataLocationEXT GLEW_GET_FUN(__glewBindFragDataLocationEXT) +#define glGetFragDataLocationEXT GLEW_GET_FUN(__glewGetFragDataLocationEXT) +#define glGetUniformuivEXT GLEW_GET_FUN(__glewGetUniformuivEXT) +#define glGetVertexAttribIivEXT GLEW_GET_FUN(__glewGetVertexAttribIivEXT) +#define glGetVertexAttribIuivEXT GLEW_GET_FUN(__glewGetVertexAttribIuivEXT) +#define glUniform1uiEXT GLEW_GET_FUN(__glewUniform1uiEXT) +#define glUniform1uivEXT GLEW_GET_FUN(__glewUniform1uivEXT) +#define glUniform2uiEXT GLEW_GET_FUN(__glewUniform2uiEXT) +#define glUniform2uivEXT GLEW_GET_FUN(__glewUniform2uivEXT) +#define glUniform3uiEXT GLEW_GET_FUN(__glewUniform3uiEXT) +#define glUniform3uivEXT GLEW_GET_FUN(__glewUniform3uivEXT) +#define glUniform4uiEXT GLEW_GET_FUN(__glewUniform4uiEXT) +#define glUniform4uivEXT GLEW_GET_FUN(__glewUniform4uivEXT) +#define glVertexAttribI1iEXT GLEW_GET_FUN(__glewVertexAttribI1iEXT) +#define glVertexAttribI1ivEXT GLEW_GET_FUN(__glewVertexAttribI1ivEXT) +#define glVertexAttribI1uiEXT GLEW_GET_FUN(__glewVertexAttribI1uiEXT) +#define glVertexAttribI1uivEXT GLEW_GET_FUN(__glewVertexAttribI1uivEXT) +#define glVertexAttribI2iEXT GLEW_GET_FUN(__glewVertexAttribI2iEXT) +#define glVertexAttribI2ivEXT GLEW_GET_FUN(__glewVertexAttribI2ivEXT) +#define glVertexAttribI2uiEXT GLEW_GET_FUN(__glewVertexAttribI2uiEXT) +#define glVertexAttribI2uivEXT GLEW_GET_FUN(__glewVertexAttribI2uivEXT) +#define glVertexAttribI3iEXT GLEW_GET_FUN(__glewVertexAttribI3iEXT) +#define glVertexAttribI3ivEXT GLEW_GET_FUN(__glewVertexAttribI3ivEXT) +#define glVertexAttribI3uiEXT GLEW_GET_FUN(__glewVertexAttribI3uiEXT) +#define glVertexAttribI3uivEXT GLEW_GET_FUN(__glewVertexAttribI3uivEXT) +#define glVertexAttribI4bvEXT GLEW_GET_FUN(__glewVertexAttribI4bvEXT) +#define glVertexAttribI4iEXT GLEW_GET_FUN(__glewVertexAttribI4iEXT) +#define glVertexAttribI4ivEXT GLEW_GET_FUN(__glewVertexAttribI4ivEXT) +#define glVertexAttribI4svEXT GLEW_GET_FUN(__glewVertexAttribI4svEXT) +#define glVertexAttribI4ubvEXT GLEW_GET_FUN(__glewVertexAttribI4ubvEXT) +#define glVertexAttribI4uiEXT GLEW_GET_FUN(__glewVertexAttribI4uiEXT) +#define glVertexAttribI4uivEXT GLEW_GET_FUN(__glewVertexAttribI4uivEXT) +#define glVertexAttribI4usvEXT GLEW_GET_FUN(__glewVertexAttribI4usvEXT) +#define glVertexAttribIPointerEXT GLEW_GET_FUN(__glewVertexAttribIPointerEXT) + +#define GLEW_EXT_gpu_shader4 GLEW_GET_VAR(__GLEW_EXT_gpu_shader4) + +#endif /* GL_EXT_gpu_shader4 */ + +/* --------------------------- GL_EXT_gpu_shader5 -------------------------- */ + +#ifndef GL_EXT_gpu_shader5 +#define GL_EXT_gpu_shader5 1 + +#define GLEW_EXT_gpu_shader5 GLEW_GET_VAR(__GLEW_EXT_gpu_shader5) + +#endif /* GL_EXT_gpu_shader5 */ + +/* ---------------------------- GL_EXT_histogram --------------------------- */ + +#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 + +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); +typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (GLAPIENTRY * PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (GLAPIENTRY * PFNGLRESETHISTOGRAMEXTPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLRESETMINMAXEXTPROC) (GLenum target); + +#define glGetHistogramEXT GLEW_GET_FUN(__glewGetHistogramEXT) +#define glGetHistogramParameterfvEXT GLEW_GET_FUN(__glewGetHistogramParameterfvEXT) +#define glGetHistogramParameterivEXT GLEW_GET_FUN(__glewGetHistogramParameterivEXT) +#define glGetMinmaxEXT GLEW_GET_FUN(__glewGetMinmaxEXT) +#define glGetMinmaxParameterfvEXT GLEW_GET_FUN(__glewGetMinmaxParameterfvEXT) +#define glGetMinmaxParameterivEXT GLEW_GET_FUN(__glewGetMinmaxParameterivEXT) +#define glHistogramEXT GLEW_GET_FUN(__glewHistogramEXT) +#define glMinmaxEXT GLEW_GET_FUN(__glewMinmaxEXT) +#define glResetHistogramEXT GLEW_GET_FUN(__glewResetHistogramEXT) +#define glResetMinmaxEXT GLEW_GET_FUN(__glewResetMinmaxEXT) + +#define GLEW_EXT_histogram GLEW_GET_VAR(__GLEW_EXT_histogram) + +#endif /* GL_EXT_histogram */ + +/* ----------------------- GL_EXT_index_array_formats ---------------------- */ + +#ifndef GL_EXT_index_array_formats +#define GL_EXT_index_array_formats 1 + +#define GLEW_EXT_index_array_formats GLEW_GET_VAR(__GLEW_EXT_index_array_formats) + +#endif /* GL_EXT_index_array_formats */ + +/* --------------------------- GL_EXT_index_func --------------------------- */ + +#ifndef GL_EXT_index_func +#define GL_EXT_index_func 1 + +typedef void (GLAPIENTRY * PFNGLINDEXFUNCEXTPROC) (GLenum func, GLfloat ref); + +#define glIndexFuncEXT GLEW_GET_FUN(__glewIndexFuncEXT) + +#define GLEW_EXT_index_func GLEW_GET_VAR(__GLEW_EXT_index_func) + +#endif /* GL_EXT_index_func */ + +/* ------------------------- GL_EXT_index_material ------------------------- */ + +#ifndef GL_EXT_index_material +#define GL_EXT_index_material 1 + +typedef void (GLAPIENTRY * PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode); + +#define glIndexMaterialEXT GLEW_GET_FUN(__glewIndexMaterialEXT) + +#define GLEW_EXT_index_material GLEW_GET_VAR(__GLEW_EXT_index_material) + +#endif /* GL_EXT_index_material */ + +/* -------------------------- GL_EXT_index_texture ------------------------- */ + +#ifndef GL_EXT_index_texture +#define GL_EXT_index_texture 1 + +#define GLEW_EXT_index_texture GLEW_GET_VAR(__GLEW_EXT_index_texture) + +#endif /* GL_EXT_index_texture */ + +/* ------------------------ GL_EXT_instanced_arrays ------------------------ */ + +#ifndef GL_EXT_instanced_arrays +#define GL_EXT_instanced_arrays 1 + +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_EXT 0x88FE + +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISOREXTPROC) (GLuint index, GLuint divisor); + +#define glVertexAttribDivisorEXT GLEW_GET_FUN(__glewVertexAttribDivisorEXT) + +#define GLEW_EXT_instanced_arrays GLEW_GET_VAR(__GLEW_EXT_instanced_arrays) + +#endif /* GL_EXT_instanced_arrays */ + +/* -------------------------- GL_EXT_light_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 (GLAPIENTRY * PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode); +typedef void (GLAPIENTRY * PFNGLTEXTURELIGHTEXTPROC) (GLenum pname); +typedef void (GLAPIENTRY * PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode); + +#define glApplyTextureEXT GLEW_GET_FUN(__glewApplyTextureEXT) +#define glTextureLightEXT GLEW_GET_FUN(__glewTextureLightEXT) +#define glTextureMaterialEXT GLEW_GET_FUN(__glewTextureMaterialEXT) + +#define GLEW_EXT_light_texture GLEW_GET_VAR(__GLEW_EXT_light_texture) + +#endif /* GL_EXT_light_texture */ + +/* ------------------------ GL_EXT_map_buffer_range ------------------------ */ + +#ifndef GL_EXT_map_buffer_range +#define GL_EXT_map_buffer_range 1 + +#define GL_MAP_READ_BIT_EXT 0x0001 +#define GL_MAP_WRITE_BIT_EXT 0x0002 +#define GL_MAP_INVALIDATE_RANGE_BIT_EXT 0x0004 +#define GL_MAP_INVALIDATE_BUFFER_BIT_EXT 0x0008 +#define GL_MAP_FLUSH_EXPLICIT_BIT_EXT 0x0010 +#define GL_MAP_UNSYNCHRONIZED_BIT_EXT 0x0020 + +typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDBUFFERRANGEEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr length); +typedef void * (GLAPIENTRY * PFNGLMAPBUFFERRANGEEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); + +#define glFlushMappedBufferRangeEXT GLEW_GET_FUN(__glewFlushMappedBufferRangeEXT) +#define glMapBufferRangeEXT GLEW_GET_FUN(__glewMapBufferRangeEXT) + +#define GLEW_EXT_map_buffer_range GLEW_GET_VAR(__GLEW_EXT_map_buffer_range) + +#endif /* GL_EXT_map_buffer_range */ + +/* -------------------------- GL_EXT_memory_object ------------------------- */ + +#ifndef GL_EXT_memory_object +#define GL_EXT_memory_object 1 + +#define GL_UUID_SIZE_EXT 16 +#define GL_TEXTURE_TILING_EXT 0x9580 +#define GL_DEDICATED_MEMORY_OBJECT_EXT 0x9581 +#define GL_NUM_TILING_TYPES_EXT 0x9582 +#define GL_TILING_TYPES_EXT 0x9583 +#define GL_OPTIMAL_TILING_EXT 0x9584 +#define GL_LINEAR_TILING_EXT 0x9585 +#define GL_LAYOUT_GENERAL_EXT 0x958D +#define GL_LAYOUT_COLOR_ATTACHMENT_EXT 0x958E +#define GL_LAYOUT_DEPTH_STENCIL_ATTACHMENT_EXT 0x958F +#define GL_LAYOUT_DEPTH_STENCIL_READ_ONLY_EXT 0x9590 +#define GL_LAYOUT_SHADER_READ_ONLY_EXT 0x9591 +#define GL_LAYOUT_TRANSFER_SRC_EXT 0x9592 +#define GL_LAYOUT_TRANSFER_DST_EXT 0x9593 +#define GL_NUM_DEVICE_UUIDS_EXT 0x9596 +#define GL_DEVICE_UUID_EXT 0x9597 +#define GL_DRIVER_UUID_EXT 0x9598 +#define GL_PROTECTED_MEMORY_OBJECT_EXT 0x959B + +typedef void (GLAPIENTRY * PFNGLBUFFERSTORAGEMEMEXTPROC) (GLenum target, GLsizeiptr size, GLuint memory, GLuint64 offset); +typedef void (GLAPIENTRY * PFNGLCREATEMEMORYOBJECTSEXTPROC) (GLsizei n, GLuint* memoryObjects); +typedef void (GLAPIENTRY * PFNGLDELETEMEMORYOBJECTSEXTPROC) (GLsizei n, const GLuint* memoryObjects); +typedef void (GLAPIENTRY * PFNGLGETMEMORYOBJECTPARAMETERIVEXTPROC) (GLuint memoryObject, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETUNSIGNEDBYTEI_VEXTPROC) (GLenum target, GLuint index, GLubyte* data); +typedef void (GLAPIENTRY * PFNGLGETUNSIGNEDBYTEVEXTPROC) (GLenum pname, GLubyte* data); +typedef GLboolean (GLAPIENTRY * PFNGLISMEMORYOBJECTEXTPROC) (GLuint memoryObject); +typedef void (GLAPIENTRY * PFNGLMEMORYOBJECTPARAMETERIVEXTPROC) (GLuint memoryObject, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSTORAGEMEMEXTPROC) (GLuint buffer, GLsizeiptr size, GLuint memory, GLuint64 offset); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGEMEM1DEXTPROC) (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLuint memory, GLuint64 offset); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGEMEM2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGEMEM2DMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGEMEM3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGEMEM3DMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGEMEM1DEXTPROC) (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLuint memory, GLuint64 offset); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGEMEM2DEXTPROC) (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGEMEM2DMULTISAMPLEEXTPROC) (GLuint texture, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGEMEM3DEXTPROC) (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGEMEM3DMULTISAMPLEEXTPROC) (GLuint texture, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); + +#define glBufferStorageMemEXT GLEW_GET_FUN(__glewBufferStorageMemEXT) +#define glCreateMemoryObjectsEXT GLEW_GET_FUN(__glewCreateMemoryObjectsEXT) +#define glDeleteMemoryObjectsEXT GLEW_GET_FUN(__glewDeleteMemoryObjectsEXT) +#define glGetMemoryObjectParameterivEXT GLEW_GET_FUN(__glewGetMemoryObjectParameterivEXT) +#define glGetUnsignedBytei_vEXT GLEW_GET_FUN(__glewGetUnsignedBytei_vEXT) +#define glGetUnsignedBytevEXT GLEW_GET_FUN(__glewGetUnsignedBytevEXT) +#define glIsMemoryObjectEXT GLEW_GET_FUN(__glewIsMemoryObjectEXT) +#define glMemoryObjectParameterivEXT GLEW_GET_FUN(__glewMemoryObjectParameterivEXT) +#define glNamedBufferStorageMemEXT GLEW_GET_FUN(__glewNamedBufferStorageMemEXT) +#define glTexStorageMem1DEXT GLEW_GET_FUN(__glewTexStorageMem1DEXT) +#define glTexStorageMem2DEXT GLEW_GET_FUN(__glewTexStorageMem2DEXT) +#define glTexStorageMem2DMultisampleEXT GLEW_GET_FUN(__glewTexStorageMem2DMultisampleEXT) +#define glTexStorageMem3DEXT GLEW_GET_FUN(__glewTexStorageMem3DEXT) +#define glTexStorageMem3DMultisampleEXT GLEW_GET_FUN(__glewTexStorageMem3DMultisampleEXT) +#define glTextureStorageMem1DEXT GLEW_GET_FUN(__glewTextureStorageMem1DEXT) +#define glTextureStorageMem2DEXT GLEW_GET_FUN(__glewTextureStorageMem2DEXT) +#define glTextureStorageMem2DMultisampleEXT GLEW_GET_FUN(__glewTextureStorageMem2DMultisampleEXT) +#define glTextureStorageMem3DEXT GLEW_GET_FUN(__glewTextureStorageMem3DEXT) +#define glTextureStorageMem3DMultisampleEXT GLEW_GET_FUN(__glewTextureStorageMem3DMultisampleEXT) + +#define GLEW_EXT_memory_object GLEW_GET_VAR(__GLEW_EXT_memory_object) + +#endif /* GL_EXT_memory_object */ + +/* ------------------------ GL_EXT_memory_object_fd ------------------------ */ + +#ifndef GL_EXT_memory_object_fd +#define GL_EXT_memory_object_fd 1 + +#define GL_HANDLE_TYPE_OPAQUE_FD_EXT 0x9586 + +typedef void (GLAPIENTRY * PFNGLIMPORTMEMORYFDEXTPROC) (GLuint memory, GLuint64 size, GLenum handleType, GLint fd); + +#define glImportMemoryFdEXT GLEW_GET_FUN(__glewImportMemoryFdEXT) + +#define GLEW_EXT_memory_object_fd GLEW_GET_VAR(__GLEW_EXT_memory_object_fd) + +#endif /* GL_EXT_memory_object_fd */ + +/* ----------------------- GL_EXT_memory_object_win32 ---------------------- */ + +#ifndef GL_EXT_memory_object_win32 +#define GL_EXT_memory_object_win32 1 + +#define GL_LUID_SIZE_EXT 8 +#define GL_HANDLE_TYPE_OPAQUE_WIN32_EXT 0x9587 +#define GL_HANDLE_TYPE_OPAQUE_WIN32_KMT_EXT 0x9588 +#define GL_HANDLE_TYPE_D3D12_TILEPOOL_EXT 0x9589 +#define GL_HANDLE_TYPE_D3D12_RESOURCE_EXT 0x958A +#define GL_HANDLE_TYPE_D3D11_IMAGE_EXT 0x958B +#define GL_HANDLE_TYPE_D3D11_IMAGE_KMT_EXT 0x958C +#define GL_HANDLE_TYPE_D3D12_FENCE_EXT 0x9594 +#define GL_D3D12_FENCE_VALUE_EXT 0x9595 +#define GL_DEVICE_LUID_EXT 0x9599 +#define GL_DEVICE_NODE_MASK_EXT 0x959A + +typedef void (GLAPIENTRY * PFNGLIMPORTMEMORYWIN32HANDLEEXTPROC) (GLuint memory, GLuint64 size, GLenum handleType, void *handle); +typedef void (GLAPIENTRY * PFNGLIMPORTMEMORYWIN32NAMEEXTPROC) (GLuint memory, GLuint64 size, GLenum handleType, const void *name); + +#define glImportMemoryWin32HandleEXT GLEW_GET_FUN(__glewImportMemoryWin32HandleEXT) +#define glImportMemoryWin32NameEXT GLEW_GET_FUN(__glewImportMemoryWin32NameEXT) + +#define GLEW_EXT_memory_object_win32 GLEW_GET_VAR(__GLEW_EXT_memory_object_win32) + +#endif /* GL_EXT_memory_object_win32 */ + +/* ------------------------- GL_EXT_misc_attribute ------------------------- */ + +#ifndef GL_EXT_misc_attribute +#define GL_EXT_misc_attribute 1 + +#define GLEW_EXT_misc_attribute GLEW_GET_VAR(__GLEW_EXT_misc_attribute) + +#endif /* GL_EXT_misc_attribute */ + +/* ------------------------ GL_EXT_multi_draw_arrays ----------------------- */ + +#ifndef GL_EXT_multi_draw_arrays +#define GL_EXT_multi_draw_arrays 1 + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint* first, const GLsizei *count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, GLsizei* count, GLenum type, const void *const *indices, GLsizei primcount); + +#define glMultiDrawArraysEXT GLEW_GET_FUN(__glewMultiDrawArraysEXT) +#define glMultiDrawElementsEXT GLEW_GET_FUN(__glewMultiDrawElementsEXT) + +#define GLEW_EXT_multi_draw_arrays GLEW_GET_VAR(__GLEW_EXT_multi_draw_arrays) + +#endif /* GL_EXT_multi_draw_arrays */ + +/* ----------------------- GL_EXT_multi_draw_indirect ---------------------- */ + +#ifndef GL_EXT_multi_draw_indirect +#define GL_EXT_multi_draw_indirect 1 + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTEXTPROC) (GLenum mode, const void *indirect, GLsizei drawcount, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTEXTPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei drawcount, GLsizei stride); + +#define glMultiDrawArraysIndirectEXT GLEW_GET_FUN(__glewMultiDrawArraysIndirectEXT) +#define glMultiDrawElementsIndirectEXT GLEW_GET_FUN(__glewMultiDrawElementsIndirectEXT) + +#define GLEW_EXT_multi_draw_indirect GLEW_GET_VAR(__GLEW_EXT_multi_draw_indirect) + +#endif /* GL_EXT_multi_draw_indirect */ + +/* ------------------------ GL_EXT_multiple_textures ----------------------- */ + +#ifndef GL_EXT_multiple_textures +#define GL_EXT_multiple_textures 1 + +#define GLEW_EXT_multiple_textures GLEW_GET_VAR(__GLEW_EXT_multiple_textures) + +#endif /* GL_EXT_multiple_textures */ + +/* --------------------------- GL_EXT_multisample -------------------------- */ + +#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 (GLAPIENTRY * PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert); +typedef void (GLAPIENTRY * PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); + +#define glSampleMaskEXT GLEW_GET_FUN(__glewSampleMaskEXT) +#define glSamplePatternEXT GLEW_GET_FUN(__glewSamplePatternEXT) + +#define GLEW_EXT_multisample GLEW_GET_VAR(__GLEW_EXT_multisample) + +#endif /* GL_EXT_multisample */ + +/* -------------------- GL_EXT_multisample_compatibility ------------------- */ + +#ifndef GL_EXT_multisample_compatibility +#define GL_EXT_multisample_compatibility 1 + +#define GL_MULTISAMPLE_EXT 0x809D +#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F + +#define GLEW_EXT_multisample_compatibility GLEW_GET_VAR(__GLEW_EXT_multisample_compatibility) + +#endif /* GL_EXT_multisample_compatibility */ + +/* ----------------- GL_EXT_multisampled_render_to_texture ----------------- */ + +#ifndef GL_EXT_multisampled_render_to_texture +#define GL_EXT_multisampled_render_to_texture 1 + +#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 +#define GL_MAX_SAMPLES_EXT 0x8D57 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT 0x8D6C + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); + +#define glFramebufferTexture2DMultisampleEXT GLEW_GET_FUN(__glewFramebufferTexture2DMultisampleEXT) + +#define GLEW_EXT_multisampled_render_to_texture GLEW_GET_VAR(__GLEW_EXT_multisampled_render_to_texture) + +#endif /* GL_EXT_multisampled_render_to_texture */ + +/* ----------------- GL_EXT_multisampled_render_to_texture2 ---------------- */ + +#ifndef GL_EXT_multisampled_render_to_texture2 +#define GL_EXT_multisampled_render_to_texture2 1 + +#define GLEW_EXT_multisampled_render_to_texture2 GLEW_GET_VAR(__GLEW_EXT_multisampled_render_to_texture2) + +#endif /* GL_EXT_multisampled_render_to_texture2 */ + +/* --------------------- GL_EXT_multiview_draw_buffers --------------------- */ + +#ifndef GL_EXT_multiview_draw_buffers +#define GL_EXT_multiview_draw_buffers 1 + +#define GL_DRAW_BUFFER_EXT 0x0C01 +#define GL_READ_BUFFER_EXT 0x0C02 +#define GL_COLOR_ATTACHMENT_EXT 0x90F0 +#define GL_MULTIVIEW_EXT 0x90F1 +#define GL_MAX_MULTIVIEW_BUFFERS_EXT 0x90F2 + +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSINDEXEDEXTPROC) (GLint n, const GLenum* location, const GLint *indices); +typedef void (GLAPIENTRY * PFNGLGETINTEGERI_VEXTPROC) (GLenum target, GLuint index, GLint* data); +typedef void (GLAPIENTRY * PFNGLREADBUFFERINDEXEDEXTPROC) (GLenum src, GLint index); + +#define glDrawBuffersIndexedEXT GLEW_GET_FUN(__glewDrawBuffersIndexedEXT) +#define glGetIntegeri_vEXT GLEW_GET_FUN(__glewGetIntegeri_vEXT) +#define glReadBufferIndexedEXT GLEW_GET_FUN(__glewReadBufferIndexedEXT) + +#define GLEW_EXT_multiview_draw_buffers GLEW_GET_VAR(__GLEW_EXT_multiview_draw_buffers) + +#endif /* GL_EXT_multiview_draw_buffers */ + +/* ---------------------- GL_EXT_packed_depth_stencil ---------------------- */ + +#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 + +#define GLEW_EXT_packed_depth_stencil GLEW_GET_VAR(__GLEW_EXT_packed_depth_stencil) + +#endif /* GL_EXT_packed_depth_stencil */ + +/* -------------------------- GL_EXT_packed_float -------------------------- */ + +#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 + +#define GLEW_EXT_packed_float GLEW_GET_VAR(__GLEW_EXT_packed_float) + +#endif /* GL_EXT_packed_float */ + +/* -------------------------- GL_EXT_packed_pixels ------------------------- */ + +#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 + +#define GLEW_EXT_packed_pixels GLEW_GET_VAR(__GLEW_EXT_packed_pixels) + +#endif /* GL_EXT_packed_pixels */ + +/* ------------------------ GL_EXT_paletted_texture ------------------------ */ + +#ifndef GL_EXT_paletted_texture +#define GL_EXT_paletted_texture 1 + +#define GL_TEXTURE_1D 0x0DE0 +#define GL_TEXTURE_2D 0x0DE1 +#define GL_PROXY_TEXTURE_1D 0x8063 +#define GL_PROXY_TEXTURE_2D 0x8064 +#define GL_COLOR_TABLE_FORMAT_EXT 0x80D8 +#define GL_COLOR_TABLE_WIDTH_EXT 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE_EXT 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE_EXT 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE_EXT 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE_EXT 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE_EXT 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE_EXT 0x80DF +#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 +#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 +#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B + +typedef void (GLAPIENTRY * PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const void *data); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, void *data); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); + +#define glColorTableEXT GLEW_GET_FUN(__glewColorTableEXT) +#define glGetColorTableEXT GLEW_GET_FUN(__glewGetColorTableEXT) +#define glGetColorTableParameterfvEXT GLEW_GET_FUN(__glewGetColorTableParameterfvEXT) +#define glGetColorTableParameterivEXT GLEW_GET_FUN(__glewGetColorTableParameterivEXT) + +#define GLEW_EXT_paletted_texture GLEW_GET_VAR(__GLEW_EXT_paletted_texture) + +#endif /* GL_EXT_paletted_texture */ + +/* ----------------------- GL_EXT_pixel_buffer_object ---------------------- */ + +#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 + +#define GLEW_EXT_pixel_buffer_object GLEW_GET_VAR(__GLEW_EXT_pixel_buffer_object) + +#endif /* GL_EXT_pixel_buffer_object */ + +/* ------------------------- GL_EXT_pixel_transform ------------------------ */ + +#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 (GLAPIENTRY * PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, const GLfloat param); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, const GLint param); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint* params); + +#define glGetPixelTransformParameterfvEXT GLEW_GET_FUN(__glewGetPixelTransformParameterfvEXT) +#define glGetPixelTransformParameterivEXT GLEW_GET_FUN(__glewGetPixelTransformParameterivEXT) +#define glPixelTransformParameterfEXT GLEW_GET_FUN(__glewPixelTransformParameterfEXT) +#define glPixelTransformParameterfvEXT GLEW_GET_FUN(__glewPixelTransformParameterfvEXT) +#define glPixelTransformParameteriEXT GLEW_GET_FUN(__glewPixelTransformParameteriEXT) +#define glPixelTransformParameterivEXT GLEW_GET_FUN(__glewPixelTransformParameterivEXT) + +#define GLEW_EXT_pixel_transform GLEW_GET_VAR(__GLEW_EXT_pixel_transform) + +#endif /* GL_EXT_pixel_transform */ + +/* ------------------- GL_EXT_pixel_transform_color_table ------------------ */ + +#ifndef GL_EXT_pixel_transform_color_table +#define GL_EXT_pixel_transform_color_table 1 + +#define GLEW_EXT_pixel_transform_color_table GLEW_GET_VAR(__GLEW_EXT_pixel_transform_color_table) + +#endif /* GL_EXT_pixel_transform_color_table */ + +/* ------------------------ GL_EXT_point_parameters ------------------------ */ + +#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 (GLAPIENTRY * PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat* params); + +#define glPointParameterfEXT GLEW_GET_FUN(__glewPointParameterfEXT) +#define glPointParameterfvEXT GLEW_GET_FUN(__glewPointParameterfvEXT) + +#define GLEW_EXT_point_parameters GLEW_GET_VAR(__GLEW_EXT_point_parameters) + +#endif /* GL_EXT_point_parameters */ + +/* ------------------------- GL_EXT_polygon_offset ------------------------- */ + +#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 (GLAPIENTRY * PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias); + +#define glPolygonOffsetEXT GLEW_GET_FUN(__glewPolygonOffsetEXT) + +#define GLEW_EXT_polygon_offset GLEW_GET_VAR(__GLEW_EXT_polygon_offset) + +#endif /* GL_EXT_polygon_offset */ + +/* ---------------------- GL_EXT_polygon_offset_clamp ---------------------- */ + +#ifndef GL_EXT_polygon_offset_clamp +#define GL_EXT_polygon_offset_clamp 1 + +#define GL_POLYGON_OFFSET_CLAMP_EXT 0x8E1B + +typedef void (GLAPIENTRY * PFNGLPOLYGONOFFSETCLAMPEXTPROC) (GLfloat factor, GLfloat units, GLfloat clamp); + +#define glPolygonOffsetClampEXT GLEW_GET_FUN(__glewPolygonOffsetClampEXT) + +#define GLEW_EXT_polygon_offset_clamp GLEW_GET_VAR(__GLEW_EXT_polygon_offset_clamp) + +#endif /* GL_EXT_polygon_offset_clamp */ + +/* ----------------------- GL_EXT_post_depth_coverage ---------------------- */ + +#ifndef GL_EXT_post_depth_coverage +#define GL_EXT_post_depth_coverage 1 + +#define GLEW_EXT_post_depth_coverage GLEW_GET_VAR(__GLEW_EXT_post_depth_coverage) + +#endif /* GL_EXT_post_depth_coverage */ + +/* ------------------------ GL_EXT_provoking_vertex ------------------------ */ + +#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 (GLAPIENTRY * PFNGLPROVOKINGVERTEXEXTPROC) (GLenum mode); + +#define glProvokingVertexEXT GLEW_GET_FUN(__glewProvokingVertexEXT) + +#define GLEW_EXT_provoking_vertex GLEW_GET_VAR(__GLEW_EXT_provoking_vertex) + +#endif /* GL_EXT_provoking_vertex */ + +/* --------------------------- GL_EXT_pvrtc_sRGB --------------------------- */ + +#ifndef GL_EXT_pvrtc_sRGB +#define GL_EXT_pvrtc_sRGB 1 + +#define GL_COMPRESSED_SRGB_PVRTC_2BPPV1_EXT 0x8A54 +#define GL_COMPRESSED_SRGB_PVRTC_4BPPV1_EXT 0x8A55 +#define GL_COMPRESSED_SRGB_ALPHA_PVRTC_2BPPV1_EXT 0x8A56 +#define GL_COMPRESSED_SRGB_ALPHA_PVRTC_4BPPV1_EXT 0x8A57 + +#define GLEW_EXT_pvrtc_sRGB GLEW_GET_VAR(__GLEW_EXT_pvrtc_sRGB) + +#endif /* GL_EXT_pvrtc_sRGB */ + +/* ----------------------- GL_EXT_raster_multisample ----------------------- */ + +#ifndef GL_EXT_raster_multisample +#define GL_EXT_raster_multisample 1 + +#define GL_COLOR_SAMPLES_NV 0x8E20 +#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 +#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_TABLE_NV 0x9331 +#define GL_COVERAGE_MODULATION_NV 0x9332 +#define GL_COVERAGE_MODULATION_TABLE_SIZE_NV 0x9333 + +typedef void (GLAPIENTRY * PFNGLCOVERAGEMODULATIONNVPROC) (GLenum components); +typedef void (GLAPIENTRY * PFNGLCOVERAGEMODULATIONTABLENVPROC) (GLsizei n, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLGETCOVERAGEMODULATIONTABLENVPROC) (GLsizei bufsize, GLfloat* v); +typedef void (GLAPIENTRY * PFNGLRASTERSAMPLESEXTPROC) (GLuint samples, GLboolean fixedsamplelocations); + +#define glCoverageModulationNV GLEW_GET_FUN(__glewCoverageModulationNV) +#define glCoverageModulationTableNV GLEW_GET_FUN(__glewCoverageModulationTableNV) +#define glGetCoverageModulationTableNV GLEW_GET_FUN(__glewGetCoverageModulationTableNV) +#define glRasterSamplesEXT GLEW_GET_FUN(__glewRasterSamplesEXT) + +#define GLEW_EXT_raster_multisample GLEW_GET_VAR(__GLEW_EXT_raster_multisample) + +#endif /* GL_EXT_raster_multisample */ + +/* ------------------------ GL_EXT_read_format_bgra ------------------------ */ + +#ifndef GL_EXT_read_format_bgra +#define GL_EXT_read_format_bgra 1 + +#define GL_BGRA_EXT 0x80E1 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT 0x8365 +#define GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT 0x8366 + +#define GLEW_EXT_read_format_bgra GLEW_GET_VAR(__GLEW_EXT_read_format_bgra) + +#endif /* GL_EXT_read_format_bgra */ + +/* -------------------------- GL_EXT_render_snorm -------------------------- */ + +#ifndef GL_EXT_render_snorm +#define GL_EXT_render_snorm 1 + +#define GL_BYTE 0x1400 +#define GL_SHORT 0x1402 +#define GL_R8_SNORM 0x8F94 +#define GL_RG8_SNORM 0x8F95 +#define GL_RGBA8_SNORM 0x8F97 +#define GL_R16_SNORM_EXT 0x8F98 +#define GL_RG16_SNORM_EXT 0x8F99 +#define GL_RGBA16_SNORM_EXT 0x8F9B + +#define GLEW_EXT_render_snorm GLEW_GET_VAR(__GLEW_EXT_render_snorm) + +#endif /* GL_EXT_render_snorm */ + +/* ------------------------- GL_EXT_rescale_normal ------------------------- */ + +#ifndef GL_EXT_rescale_normal +#define GL_EXT_rescale_normal 1 + +#define GL_RESCALE_NORMAL_EXT 0x803A + +#define GLEW_EXT_rescale_normal GLEW_GET_VAR(__GLEW_EXT_rescale_normal) + +#endif /* GL_EXT_rescale_normal */ + +/* ------------------------------ GL_EXT_sRGB ------------------------------ */ + +#ifndef GL_EXT_sRGB +#define GL_EXT_sRGB 1 + +#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT 0x8210 +#define GL_SRGB_EXT 0x8C40 +#define GL_SRGB_ALPHA_EXT 0x8C42 +#define GL_SRGB8_ALPHA8_EXT 0x8C43 + +#define GLEW_EXT_sRGB GLEW_GET_VAR(__GLEW_EXT_sRGB) + +#endif /* GL_EXT_sRGB */ + +/* ----------------------- GL_EXT_sRGB_write_control ----------------------- */ + +#ifndef GL_EXT_sRGB_write_control +#define GL_EXT_sRGB_write_control 1 + +#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 + +#define GLEW_EXT_sRGB_write_control GLEW_GET_VAR(__GLEW_EXT_sRGB_write_control) + +#endif /* GL_EXT_sRGB_write_control */ + +/* -------------------------- GL_EXT_scene_marker -------------------------- */ + +#ifndef GL_EXT_scene_marker +#define GL_EXT_scene_marker 1 + +typedef void (GLAPIENTRY * PFNGLBEGINSCENEEXTPROC) (void); +typedef void (GLAPIENTRY * PFNGLENDSCENEEXTPROC) (void); + +#define glBeginSceneEXT GLEW_GET_FUN(__glewBeginSceneEXT) +#define glEndSceneEXT GLEW_GET_FUN(__glewEndSceneEXT) + +#define GLEW_EXT_scene_marker GLEW_GET_VAR(__GLEW_EXT_scene_marker) + +#endif /* GL_EXT_scene_marker */ + +/* ------------------------- GL_EXT_secondary_color ------------------------ */ + +#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 (GLAPIENTRY * PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer); + +#define glSecondaryColor3bEXT GLEW_GET_FUN(__glewSecondaryColor3bEXT) +#define glSecondaryColor3bvEXT GLEW_GET_FUN(__glewSecondaryColor3bvEXT) +#define glSecondaryColor3dEXT GLEW_GET_FUN(__glewSecondaryColor3dEXT) +#define glSecondaryColor3dvEXT GLEW_GET_FUN(__glewSecondaryColor3dvEXT) +#define glSecondaryColor3fEXT GLEW_GET_FUN(__glewSecondaryColor3fEXT) +#define glSecondaryColor3fvEXT GLEW_GET_FUN(__glewSecondaryColor3fvEXT) +#define glSecondaryColor3iEXT GLEW_GET_FUN(__glewSecondaryColor3iEXT) +#define glSecondaryColor3ivEXT GLEW_GET_FUN(__glewSecondaryColor3ivEXT) +#define glSecondaryColor3sEXT GLEW_GET_FUN(__glewSecondaryColor3sEXT) +#define glSecondaryColor3svEXT GLEW_GET_FUN(__glewSecondaryColor3svEXT) +#define glSecondaryColor3ubEXT GLEW_GET_FUN(__glewSecondaryColor3ubEXT) +#define glSecondaryColor3ubvEXT GLEW_GET_FUN(__glewSecondaryColor3ubvEXT) +#define glSecondaryColor3uiEXT GLEW_GET_FUN(__glewSecondaryColor3uiEXT) +#define glSecondaryColor3uivEXT GLEW_GET_FUN(__glewSecondaryColor3uivEXT) +#define glSecondaryColor3usEXT GLEW_GET_FUN(__glewSecondaryColor3usEXT) +#define glSecondaryColor3usvEXT GLEW_GET_FUN(__glewSecondaryColor3usvEXT) +#define glSecondaryColorPointerEXT GLEW_GET_FUN(__glewSecondaryColorPointerEXT) + +#define GLEW_EXT_secondary_color GLEW_GET_VAR(__GLEW_EXT_secondary_color) + +#endif /* GL_EXT_secondary_color */ + +/* ---------------------------- GL_EXT_semaphore --------------------------- */ + +#ifndef GL_EXT_semaphore +#define GL_EXT_semaphore 1 + +typedef void (GLAPIENTRY * PFNGLDELETESEMAPHORESEXTPROC) (GLsizei n, const GLuint* semaphores); +typedef void (GLAPIENTRY * PFNGLGENSEMAPHORESEXTPROC) (GLsizei n, GLuint* semaphores); +typedef void (GLAPIENTRY * PFNGLGETSEMAPHOREPARAMETERUI64VEXTPROC) (GLuint semaphore, GLenum pname, GLuint64* params); +typedef GLboolean (GLAPIENTRY * PFNGLISSEMAPHOREEXTPROC) (GLuint semaphore); +typedef void (GLAPIENTRY * PFNGLSEMAPHOREPARAMETERUI64VEXTPROC) (GLuint semaphore, GLenum pname, const GLuint64* params); +typedef void (GLAPIENTRY * PFNGLSIGNALSEMAPHOREEXTPROC) (GLuint semaphore, GLuint numBufferBarriers, const GLuint* buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *dstLayouts); +typedef void (GLAPIENTRY * PFNGLWAITSEMAPHOREEXTPROC) (GLuint semaphore, GLuint numBufferBarriers, const GLuint* buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *srcLayouts); + +#define glDeleteSemaphoresEXT GLEW_GET_FUN(__glewDeleteSemaphoresEXT) +#define glGenSemaphoresEXT GLEW_GET_FUN(__glewGenSemaphoresEXT) +#define glGetSemaphoreParameterui64vEXT GLEW_GET_FUN(__glewGetSemaphoreParameterui64vEXT) +#define glIsSemaphoreEXT GLEW_GET_FUN(__glewIsSemaphoreEXT) +#define glSemaphoreParameterui64vEXT GLEW_GET_FUN(__glewSemaphoreParameterui64vEXT) +#define glSignalSemaphoreEXT GLEW_GET_FUN(__glewSignalSemaphoreEXT) +#define glWaitSemaphoreEXT GLEW_GET_FUN(__glewWaitSemaphoreEXT) + +#define GLEW_EXT_semaphore GLEW_GET_VAR(__GLEW_EXT_semaphore) + +#endif /* GL_EXT_semaphore */ + +/* -------------------------- GL_EXT_semaphore_fd -------------------------- */ + +#ifndef GL_EXT_semaphore_fd +#define GL_EXT_semaphore_fd 1 + +typedef void (GLAPIENTRY * PFNGLIMPORTSEMAPHOREFDEXTPROC) (GLuint semaphore, GLenum handleType, GLint fd); + +#define glImportSemaphoreFdEXT GLEW_GET_FUN(__glewImportSemaphoreFdEXT) + +#define GLEW_EXT_semaphore_fd GLEW_GET_VAR(__GLEW_EXT_semaphore_fd) + +#endif /* GL_EXT_semaphore_fd */ + +/* ------------------------- GL_EXT_semaphore_win32 ------------------------ */ + +#ifndef GL_EXT_semaphore_win32 +#define GL_EXT_semaphore_win32 1 + +typedef void (GLAPIENTRY * PFNGLIMPORTSEMAPHOREWIN32HANDLEEXTPROC) (GLuint semaphore, GLenum handleType, void *handle); +typedef void (GLAPIENTRY * PFNGLIMPORTSEMAPHOREWIN32NAMEEXTPROC) (GLuint semaphore, GLenum handleType, const void *name); + +#define glImportSemaphoreWin32HandleEXT GLEW_GET_FUN(__glewImportSemaphoreWin32HandleEXT) +#define glImportSemaphoreWin32NameEXT GLEW_GET_FUN(__glewImportSemaphoreWin32NameEXT) + +#define GLEW_EXT_semaphore_win32 GLEW_GET_VAR(__GLEW_EXT_semaphore_win32) + +#endif /* GL_EXT_semaphore_win32 */ + +/* --------------------- GL_EXT_separate_shader_objects -------------------- */ + +#ifndef GL_EXT_separate_shader_objects +#define GL_EXT_separate_shader_objects 1 + +#define GL_ACTIVE_PROGRAM_EXT 0x8B8D + +typedef void (GLAPIENTRY * PFNGLACTIVEPROGRAMEXTPROC) (GLuint program); +typedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROGRAMEXTPROC) (GLenum type, const GLchar* string); +typedef void (GLAPIENTRY * PFNGLUSESHADERPROGRAMEXTPROC) (GLenum type, GLuint program); + +#define glActiveProgramEXT GLEW_GET_FUN(__glewActiveProgramEXT) +#define glCreateShaderProgramEXT GLEW_GET_FUN(__glewCreateShaderProgramEXT) +#define glUseShaderProgramEXT GLEW_GET_FUN(__glewUseShaderProgramEXT) + +#define GLEW_EXT_separate_shader_objects GLEW_GET_VAR(__GLEW_EXT_separate_shader_objects) + +#endif /* GL_EXT_separate_shader_objects */ + +/* --------------------- GL_EXT_separate_specular_color -------------------- */ + +#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 + +#define GLEW_EXT_separate_specular_color GLEW_GET_VAR(__GLEW_EXT_separate_specular_color) + +#endif /* GL_EXT_separate_specular_color */ + +/* -------------------- GL_EXT_shader_framebuffer_fetch -------------------- */ + +#ifndef GL_EXT_shader_framebuffer_fetch +#define GL_EXT_shader_framebuffer_fetch 1 + +#define GL_FRAGMENT_SHADER_DISCARDS_SAMPLES_EXT 0x8A52 + +#define GLEW_EXT_shader_framebuffer_fetch GLEW_GET_VAR(__GLEW_EXT_shader_framebuffer_fetch) + +#endif /* GL_EXT_shader_framebuffer_fetch */ + +/* ------------------------ GL_EXT_shader_group_vote ----------------------- */ + +#ifndef GL_EXT_shader_group_vote +#define GL_EXT_shader_group_vote 1 + +#define GLEW_EXT_shader_group_vote GLEW_GET_VAR(__GLEW_EXT_shader_group_vote) + +#endif /* GL_EXT_shader_group_vote */ + +/* ------------------- GL_EXT_shader_image_load_formatted ------------------ */ + +#ifndef GL_EXT_shader_image_load_formatted +#define GL_EXT_shader_image_load_formatted 1 + +#define GLEW_EXT_shader_image_load_formatted GLEW_GET_VAR(__GLEW_EXT_shader_image_load_formatted) + +#endif /* GL_EXT_shader_image_load_formatted */ + +/* --------------------- GL_EXT_shader_image_load_store -------------------- */ + +#ifndef GL_EXT_shader_image_load_store +#define GL_EXT_shader_image_load_store 1 + +#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_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_ALL_BARRIER_BITS_EXT 0xFFFFFFFF + +typedef void (GLAPIENTRY * PFNGLBINDIMAGETEXTUREEXTPROC) (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format); +typedef void (GLAPIENTRY * PFNGLMEMORYBARRIEREXTPROC) (GLbitfield barriers); + +#define glBindImageTextureEXT GLEW_GET_FUN(__glewBindImageTextureEXT) +#define glMemoryBarrierEXT GLEW_GET_FUN(__glewMemoryBarrierEXT) + +#define GLEW_EXT_shader_image_load_store GLEW_GET_VAR(__GLEW_EXT_shader_image_load_store) + +#endif /* GL_EXT_shader_image_load_store */ + +/* ------------------- GL_EXT_shader_implicit_conversions ------------------ */ + +#ifndef GL_EXT_shader_implicit_conversions +#define GL_EXT_shader_implicit_conversions 1 + +#define GLEW_EXT_shader_implicit_conversions GLEW_GET_VAR(__GLEW_EXT_shader_implicit_conversions) + +#endif /* GL_EXT_shader_implicit_conversions */ + +/* ----------------------- GL_EXT_shader_integer_mix ----------------------- */ + +#ifndef GL_EXT_shader_integer_mix +#define GL_EXT_shader_integer_mix 1 + +#define GLEW_EXT_shader_integer_mix GLEW_GET_VAR(__GLEW_EXT_shader_integer_mix) + +#endif /* GL_EXT_shader_integer_mix */ + +/* ------------------------ GL_EXT_shader_io_blocks ------------------------ */ + +#ifndef GL_EXT_shader_io_blocks +#define GL_EXT_shader_io_blocks 1 + +#define GLEW_EXT_shader_io_blocks GLEW_GET_VAR(__GLEW_EXT_shader_io_blocks) + +#endif /* GL_EXT_shader_io_blocks */ + +/* ------------- GL_EXT_shader_non_constant_global_initializers ------------ */ + +#ifndef GL_EXT_shader_non_constant_global_initializers +#define GL_EXT_shader_non_constant_global_initializers 1 + +#define GLEW_EXT_shader_non_constant_global_initializers GLEW_GET_VAR(__GLEW_EXT_shader_non_constant_global_initializers) + +#endif /* GL_EXT_shader_non_constant_global_initializers */ + +/* ------------------- GL_EXT_shader_pixel_local_storage ------------------- */ + +#ifndef GL_EXT_shader_pixel_local_storage +#define GL_EXT_shader_pixel_local_storage 1 + +#define GL_MAX_SHADER_PIXEL_LOCAL_STORAGE_FAST_SIZE_EXT 0x8F63 +#define GL_SHADER_PIXEL_LOCAL_STORAGE_EXT 0x8F64 +#define GL_MAX_SHADER_PIXEL_LOCAL_STORAGE_SIZE_EXT 0x8F67 + +#define GLEW_EXT_shader_pixel_local_storage GLEW_GET_VAR(__GLEW_EXT_shader_pixel_local_storage) + +#endif /* GL_EXT_shader_pixel_local_storage */ + +/* ------------------- GL_EXT_shader_pixel_local_storage2 ------------------ */ + +#ifndef GL_EXT_shader_pixel_local_storage2 +#define GL_EXT_shader_pixel_local_storage2 1 + +#define GL_MAX_SHADER_COMBINED_LOCAL_STORAGE_FAST_SIZE_EXT 0x9650 +#define GL_MAX_SHADER_COMBINED_LOCAL_STORAGE_SIZE_EXT 0x9651 +#define GL_FRAMEBUFFER_INCOMPLETE_INSUFFICIENT_SHADER_COMBINED_LOCAL_STORAGE_EXT 0x9652 + +typedef void (GLAPIENTRY * PFNGLCLEARPIXELLOCALSTORAGEUIEXTPROC) (GLsizei offset, GLsizei n, const GLuint* values); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERPIXELLOCALSTORAGESIZEEXTPROC) (GLuint target, GLsizei size); +typedef GLsizei (GLAPIENTRY * PFNGLGETFRAMEBUFFERPIXELLOCALSTORAGESIZEEXTPROC) (GLuint target); + +#define glClearPixelLocalStorageuiEXT GLEW_GET_FUN(__glewClearPixelLocalStorageuiEXT) +#define glFramebufferPixelLocalStorageSizeEXT GLEW_GET_FUN(__glewFramebufferPixelLocalStorageSizeEXT) +#define glGetFramebufferPixelLocalStorageSizeEXT GLEW_GET_FUN(__glewGetFramebufferPixelLocalStorageSizeEXT) + +#define GLEW_EXT_shader_pixel_local_storage2 GLEW_GET_VAR(__GLEW_EXT_shader_pixel_local_storage2) + +#endif /* GL_EXT_shader_pixel_local_storage2 */ + +/* ----------------------- GL_EXT_shader_texture_lod ----------------------- */ + +#ifndef GL_EXT_shader_texture_lod +#define GL_EXT_shader_texture_lod 1 + +#define GLEW_EXT_shader_texture_lod GLEW_GET_VAR(__GLEW_EXT_shader_texture_lod) + +#endif /* GL_EXT_shader_texture_lod */ + +/* -------------------------- GL_EXT_shadow_funcs -------------------------- */ + +#ifndef GL_EXT_shadow_funcs +#define GL_EXT_shadow_funcs 1 + +#define GLEW_EXT_shadow_funcs GLEW_GET_VAR(__GLEW_EXT_shadow_funcs) + +#endif /* GL_EXT_shadow_funcs */ + +/* ------------------------- GL_EXT_shadow_samplers ------------------------ */ + +#ifndef GL_EXT_shadow_samplers +#define GL_EXT_shadow_samplers 1 + +#define GL_TEXTURE_COMPARE_MODE_EXT 0x884C +#define GL_TEXTURE_COMPARE_FUNC_EXT 0x884D +#define GL_COMPARE_REF_TO_TEXTURE_EXT 0x884E +#define GL_SAMPLER_2D_SHADOW_EXT 0x8B62 + +#define GLEW_EXT_shadow_samplers GLEW_GET_VAR(__GLEW_EXT_shadow_samplers) + +#endif /* GL_EXT_shadow_samplers */ + +/* --------------------- GL_EXT_shared_texture_palette --------------------- */ + +#ifndef GL_EXT_shared_texture_palette +#define GL_EXT_shared_texture_palette 1 + +#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB + +#define GLEW_EXT_shared_texture_palette GLEW_GET_VAR(__GLEW_EXT_shared_texture_palette) + +#endif /* GL_EXT_shared_texture_palette */ + +/* ------------------------- GL_EXT_sparse_texture ------------------------- */ + +#ifndef GL_EXT_sparse_texture +#define GL_EXT_sparse_texture 1 + +#define GL_TEXTURE_2D 0x0DE1 +#define GL_TEXTURE_3D 0x806F +#define GL_TEXTURE_CUBE_MAP 0x8513 +#define GL_TEXTURE_2D_ARRAY 0x8C1A +#define GL_TEXTURE_CUBE_MAP_ARRAY_OES 0x9009 +#define GL_VIRTUAL_PAGE_SIZE_X_EXT 0x9195 +#define GL_VIRTUAL_PAGE_SIZE_Y_EXT 0x9196 +#define GL_VIRTUAL_PAGE_SIZE_Z_EXT 0x9197 +#define GL_MAX_SPARSE_TEXTURE_SIZE_EXT 0x9198 +#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_EXT 0x9199 +#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS_EXT 0x919A +#define GL_TEXTURE_SPARSE_EXT 0x91A6 +#define GL_VIRTUAL_PAGE_SIZE_INDEX_EXT 0x91A7 +#define GL_NUM_VIRTUAL_PAGE_SIZES_EXT 0x91A8 +#define GL_SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_EXT 0x91A9 +#define GL_NUM_SPARSE_LEVELS_EXT 0x91AA + +typedef void (GLAPIENTRY * PFNGLTEXPAGECOMMITMENTEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); +typedef void (GLAPIENTRY * PFNGLTEXTUREPAGECOMMITMENTEXTPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); + +#define glTexPageCommitmentEXT GLEW_GET_FUN(__glewTexPageCommitmentEXT) +#define glTexturePageCommitmentEXT GLEW_GET_FUN(__glewTexturePageCommitmentEXT) + +#define GLEW_EXT_sparse_texture GLEW_GET_VAR(__GLEW_EXT_sparse_texture) + +#endif /* GL_EXT_sparse_texture */ + +/* ------------------------- GL_EXT_sparse_texture2 ------------------------ */ + +#ifndef GL_EXT_sparse_texture2 +#define GL_EXT_sparse_texture2 1 + +#define GLEW_EXT_sparse_texture2 GLEW_GET_VAR(__GLEW_EXT_sparse_texture2) + +#endif /* GL_EXT_sparse_texture2 */ + +/* ------------------------ GL_EXT_stencil_clear_tag ----------------------- */ + +#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 + +#define GLEW_EXT_stencil_clear_tag GLEW_GET_VAR(__GLEW_EXT_stencil_clear_tag) + +#endif /* GL_EXT_stencil_clear_tag */ + +/* ------------------------ GL_EXT_stencil_two_side ------------------------ */ + +#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 (GLAPIENTRY * PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face); + +#define glActiveStencilFaceEXT GLEW_GET_FUN(__glewActiveStencilFaceEXT) + +#define GLEW_EXT_stencil_two_side GLEW_GET_VAR(__GLEW_EXT_stencil_two_side) + +#endif /* GL_EXT_stencil_two_side */ + +/* -------------------------- GL_EXT_stencil_wrap -------------------------- */ + +#ifndef GL_EXT_stencil_wrap +#define GL_EXT_stencil_wrap 1 + +#define GL_INCR_WRAP_EXT 0x8507 +#define GL_DECR_WRAP_EXT 0x8508 + +#define GLEW_EXT_stencil_wrap GLEW_GET_VAR(__GLEW_EXT_stencil_wrap) + +#endif /* GL_EXT_stencil_wrap */ + +/* --------------------------- GL_EXT_subtexture --------------------------- */ + +#ifndef GL_EXT_subtexture +#define GL_EXT_subtexture 1 + +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); + +#define glTexSubImage1DEXT GLEW_GET_FUN(__glewTexSubImage1DEXT) +#define glTexSubImage2DEXT GLEW_GET_FUN(__glewTexSubImage2DEXT) +#define glTexSubImage3DEXT GLEW_GET_FUN(__glewTexSubImage3DEXT) + +#define GLEW_EXT_subtexture GLEW_GET_VAR(__GLEW_EXT_subtexture) + +#endif /* GL_EXT_subtexture */ + +/* ----------------------------- GL_EXT_texture ---------------------------- */ + +#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 GLEW_EXT_texture GLEW_GET_VAR(__GLEW_EXT_texture) + +#endif /* GL_EXT_texture */ + +/* ---------------------------- GL_EXT_texture3D --------------------------- */ + +#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 (GLAPIENTRY * PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); + +#define glTexImage3DEXT GLEW_GET_FUN(__glewTexImage3DEXT) + +#define GLEW_EXT_texture3D GLEW_GET_VAR(__GLEW_EXT_texture3D) + +#endif /* GL_EXT_texture3D */ + +/* -------------------------- GL_EXT_texture_array ------------------------- */ + +#ifndef GL_EXT_texture_array +#define GL_EXT_texture_array 1 + +#define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E +#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF +#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 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); + +#define glFramebufferTextureLayerEXT GLEW_GET_FUN(__glewFramebufferTextureLayerEXT) + +#define GLEW_EXT_texture_array GLEW_GET_VAR(__GLEW_EXT_texture_array) + +#endif /* GL_EXT_texture_array */ + +/* ---------------------- GL_EXT_texture_buffer_object --------------------- */ + +#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 (GLAPIENTRY * PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer); + +#define glTexBufferEXT GLEW_GET_FUN(__glewTexBufferEXT) + +#define GLEW_EXT_texture_buffer_object GLEW_GET_VAR(__GLEW_EXT_texture_buffer_object) + +#endif /* GL_EXT_texture_buffer_object */ + +/* -------------- GL_EXT_texture_compression_astc_decode_mode -------------- */ + +#ifndef GL_EXT_texture_compression_astc_decode_mode +#define GL_EXT_texture_compression_astc_decode_mode 1 + +#define GL_TEXTURE_ASTC_DECODE_PRECISION_EXT 0x8F69 + +#define GLEW_EXT_texture_compression_astc_decode_mode GLEW_GET_VAR(__GLEW_EXT_texture_compression_astc_decode_mode) + +#endif /* GL_EXT_texture_compression_astc_decode_mode */ + +/* ----------- GL_EXT_texture_compression_astc_decode_mode_rgb9e5 ---------- */ + +#ifndef GL_EXT_texture_compression_astc_decode_mode_rgb9e5 +#define GL_EXT_texture_compression_astc_decode_mode_rgb9e5 1 + +#define GL_TEXTURE_ASTC_DECODE_PRECISION_EXT 0x8F69 + +#define GLEW_EXT_texture_compression_astc_decode_mode_rgb9e5 GLEW_GET_VAR(__GLEW_EXT_texture_compression_astc_decode_mode_rgb9e5) + +#endif /* GL_EXT_texture_compression_astc_decode_mode_rgb9e5 */ + +/* -------------------- GL_EXT_texture_compression_bptc -------------------- */ + +#ifndef GL_EXT_texture_compression_bptc +#define GL_EXT_texture_compression_bptc 1 + +#define GL_COMPRESSED_RGBA_BPTC_UNORM_EXT 0x8E8C +#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT 0x8E8D +#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT 0x8E8E +#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT 0x8E8F + +#define GLEW_EXT_texture_compression_bptc GLEW_GET_VAR(__GLEW_EXT_texture_compression_bptc) + +#endif /* GL_EXT_texture_compression_bptc */ + +/* -------------------- GL_EXT_texture_compression_dxt1 -------------------- */ + +#ifndef GL_EXT_texture_compression_dxt1 +#define GL_EXT_texture_compression_dxt1 1 + +#define GLEW_EXT_texture_compression_dxt1 GLEW_GET_VAR(__GLEW_EXT_texture_compression_dxt1) + +#endif /* GL_EXT_texture_compression_dxt1 */ + +/* -------------------- GL_EXT_texture_compression_latc -------------------- */ + +#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 + +#define GLEW_EXT_texture_compression_latc GLEW_GET_VAR(__GLEW_EXT_texture_compression_latc) + +#endif /* GL_EXT_texture_compression_latc */ + +/* -------------------- GL_EXT_texture_compression_rgtc -------------------- */ + +#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 + +#define GLEW_EXT_texture_compression_rgtc GLEW_GET_VAR(__GLEW_EXT_texture_compression_rgtc) + +#endif /* GL_EXT_texture_compression_rgtc */ + +/* -------------------- GL_EXT_texture_compression_s3tc -------------------- */ + +#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 + +#define GLEW_EXT_texture_compression_s3tc GLEW_GET_VAR(__GLEW_EXT_texture_compression_s3tc) + +#endif /* GL_EXT_texture_compression_s3tc */ + +/* ------------------------ GL_EXT_texture_cube_map ------------------------ */ + +#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 + +#define GLEW_EXT_texture_cube_map GLEW_GET_VAR(__GLEW_EXT_texture_cube_map) + +#endif /* GL_EXT_texture_cube_map */ + +/* --------------------- GL_EXT_texture_cube_map_array --------------------- */ + +#ifndef GL_EXT_texture_cube_map_array +#define GL_EXT_texture_cube_map_array 1 + +#define GL_TEXTURE_CUBE_MAP_ARRAY_EXT 0x9009 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_EXT 0x900A +#define GL_SAMPLER_CUBE_MAP_ARRAY_EXT 0x900C +#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_EXT 0x900D +#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_EXT 0x900E +#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_EXT 0x900F +#define GL_IMAGE_CUBE_MAP_ARRAY_EXT 0x9054 +#define GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x905F +#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x906A + +#define GLEW_EXT_texture_cube_map_array GLEW_GET_VAR(__GLEW_EXT_texture_cube_map_array) + +#endif /* GL_EXT_texture_cube_map_array */ + +/* ----------------------- GL_EXT_texture_edge_clamp ----------------------- */ + +#ifndef GL_EXT_texture_edge_clamp +#define GL_EXT_texture_edge_clamp 1 + +#define GL_CLAMP_TO_EDGE_EXT 0x812F + +#define GLEW_EXT_texture_edge_clamp GLEW_GET_VAR(__GLEW_EXT_texture_edge_clamp) + +#endif /* GL_EXT_texture_edge_clamp */ + +/* --------------------------- GL_EXT_texture_env -------------------------- */ + +#ifndef GL_EXT_texture_env +#define GL_EXT_texture_env 1 + +#define GLEW_EXT_texture_env GLEW_GET_VAR(__GLEW_EXT_texture_env) + +#endif /* GL_EXT_texture_env */ + +/* ------------------------- GL_EXT_texture_env_add ------------------------ */ + +#ifndef GL_EXT_texture_env_add +#define GL_EXT_texture_env_add 1 + +#define GLEW_EXT_texture_env_add GLEW_GET_VAR(__GLEW_EXT_texture_env_add) + +#endif /* GL_EXT_texture_env_add */ + +/* ----------------------- GL_EXT_texture_env_combine ---------------------- */ + +#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 + +#define GLEW_EXT_texture_env_combine GLEW_GET_VAR(__GLEW_EXT_texture_env_combine) + +#endif /* GL_EXT_texture_env_combine */ + +/* ------------------------ GL_EXT_texture_env_dot3 ------------------------ */ + +#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 + +#define GLEW_EXT_texture_env_dot3 GLEW_GET_VAR(__GLEW_EXT_texture_env_dot3) + +#endif /* GL_EXT_texture_env_dot3 */ + +/* ------------------- GL_EXT_texture_filter_anisotropic ------------------- */ + +#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 + +#define GLEW_EXT_texture_filter_anisotropic GLEW_GET_VAR(__GLEW_EXT_texture_filter_anisotropic) + +#endif /* GL_EXT_texture_filter_anisotropic */ + +/* ---------------------- GL_EXT_texture_filter_minmax --------------------- */ + +#ifndef GL_EXT_texture_filter_minmax +#define GL_EXT_texture_filter_minmax 1 + +#define GL_TEXTURE_REDUCTION_MODE_EXT 0x9366 +#define GL_WEIGHTED_AVERAGE_EXT 0x9367 + +#define GLEW_EXT_texture_filter_minmax GLEW_GET_VAR(__GLEW_EXT_texture_filter_minmax) + +#endif /* GL_EXT_texture_filter_minmax */ + +/* --------------------- GL_EXT_texture_format_BGRA8888 -------------------- */ + +#ifndef GL_EXT_texture_format_BGRA8888 +#define GL_EXT_texture_format_BGRA8888 1 + +#define GL_BGRA_EXT 0x80E1 + +#define GLEW_EXT_texture_format_BGRA8888 GLEW_GET_VAR(__GLEW_EXT_texture_format_BGRA8888) + +#endif /* GL_EXT_texture_format_BGRA8888 */ + +/* ------------------------- GL_EXT_texture_integer ------------------------ */ + +#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 (GLAPIENTRY * PFNGLCLEARCOLORIIEXTPROC) (GLint red, GLint green, GLint blue, GLint alpha); +typedef void (GLAPIENTRY * PFNGLCLEARCOLORIUIEXTPROC) (GLuint red, GLuint green, GLuint blue, GLuint alpha); +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint *params); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params); + +#define glClearColorIiEXT GLEW_GET_FUN(__glewClearColorIiEXT) +#define glClearColorIuiEXT GLEW_GET_FUN(__glewClearColorIuiEXT) +#define glGetTexParameterIivEXT GLEW_GET_FUN(__glewGetTexParameterIivEXT) +#define glGetTexParameterIuivEXT GLEW_GET_FUN(__glewGetTexParameterIuivEXT) +#define glTexParameterIivEXT GLEW_GET_FUN(__glewTexParameterIivEXT) +#define glTexParameterIuivEXT GLEW_GET_FUN(__glewTexParameterIuivEXT) + +#define GLEW_EXT_texture_integer GLEW_GET_VAR(__GLEW_EXT_texture_integer) + +#endif /* GL_EXT_texture_integer */ + +/* ------------------------ GL_EXT_texture_lod_bias ------------------------ */ + +#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 + +#define GLEW_EXT_texture_lod_bias GLEW_GET_VAR(__GLEW_EXT_texture_lod_bias) + +#endif /* GL_EXT_texture_lod_bias */ + +/* ---------------------- GL_EXT_texture_mirror_clamp ---------------------- */ + +#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 + +#define GLEW_EXT_texture_mirror_clamp GLEW_GET_VAR(__GLEW_EXT_texture_mirror_clamp) + +#endif /* GL_EXT_texture_mirror_clamp */ + +/* ------------------------- GL_EXT_texture_norm16 ------------------------- */ + +#ifndef GL_EXT_texture_norm16 +#define GL_EXT_texture_norm16 1 + +#define GL_RGB16_EXT 0x8054 +#define GL_RGBA16_EXT 0x805B +#define GL_R16_EXT 0x822A +#define GL_RG16_EXT 0x822C +#define GL_R16_SNORM_EXT 0x8F98 +#define GL_RG16_SNORM_EXT 0x8F99 +#define GL_RGB16_SNORM_EXT 0x8F9A +#define GL_RGBA16_SNORM_EXT 0x8F9B + +#define GLEW_EXT_texture_norm16 GLEW_GET_VAR(__GLEW_EXT_texture_norm16) + +#endif /* GL_EXT_texture_norm16 */ + +/* ------------------------- GL_EXT_texture_object ------------------------- */ + +#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 (GLAPIENTRY * PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint* textures, GLboolean* residences); +typedef void (GLAPIENTRY * PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture); +typedef void (GLAPIENTRY * PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint* textures); +typedef void (GLAPIENTRY * PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint* textures); +typedef GLboolean (GLAPIENTRY * PFNGLISTEXTUREEXTPROC) (GLuint texture); +typedef void (GLAPIENTRY * PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint* textures, const GLclampf* priorities); + +#define glAreTexturesResidentEXT GLEW_GET_FUN(__glewAreTexturesResidentEXT) +#define glBindTextureEXT GLEW_GET_FUN(__glewBindTextureEXT) +#define glDeleteTexturesEXT GLEW_GET_FUN(__glewDeleteTexturesEXT) +#define glGenTexturesEXT GLEW_GET_FUN(__glewGenTexturesEXT) +#define glIsTextureEXT GLEW_GET_FUN(__glewIsTextureEXT) +#define glPrioritizeTexturesEXT GLEW_GET_FUN(__glewPrioritizeTexturesEXT) + +#define GLEW_EXT_texture_object GLEW_GET_VAR(__GLEW_EXT_texture_object) + +#endif /* GL_EXT_texture_object */ + +/* --------------------- GL_EXT_texture_perturb_normal --------------------- */ + +#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 (GLAPIENTRY * PFNGLTEXTURENORMALEXTPROC) (GLenum mode); + +#define glTextureNormalEXT GLEW_GET_FUN(__glewTextureNormalEXT) + +#define GLEW_EXT_texture_perturb_normal GLEW_GET_VAR(__GLEW_EXT_texture_perturb_normal) + +#endif /* GL_EXT_texture_perturb_normal */ + +/* ------------------------ GL_EXT_texture_rectangle ----------------------- */ + +#ifndef GL_EXT_texture_rectangle +#define GL_EXT_texture_rectangle 1 + +#define GL_TEXTURE_RECTANGLE_EXT 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_EXT 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_EXT 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_EXT 0x84F8 + +#define GLEW_EXT_texture_rectangle GLEW_GET_VAR(__GLEW_EXT_texture_rectangle) + +#endif /* GL_EXT_texture_rectangle */ + +/* --------------------------- GL_EXT_texture_rg --------------------------- */ + +#ifndef GL_EXT_texture_rg +#define GL_EXT_texture_rg 1 + +#define GL_RED_EXT 0x1903 +#define GL_RG_EXT 0x8227 +#define GL_R8_EXT 0x8229 +#define GL_RG8_EXT 0x822B + +#define GLEW_EXT_texture_rg GLEW_GET_VAR(__GLEW_EXT_texture_rg) + +#endif /* GL_EXT_texture_rg */ + +/* -------------------------- GL_EXT_texture_sRGB -------------------------- */ + +#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 + +#define GLEW_EXT_texture_sRGB GLEW_GET_VAR(__GLEW_EXT_texture_sRGB) + +#endif /* GL_EXT_texture_sRGB */ + +/* ------------------------- GL_EXT_texture_sRGB_R8 ------------------------ */ + +#ifndef GL_EXT_texture_sRGB_R8 +#define GL_EXT_texture_sRGB_R8 1 + +#define GL_SR8_EXT 0x8FBD + +#define GLEW_EXT_texture_sRGB_R8 GLEW_GET_VAR(__GLEW_EXT_texture_sRGB_R8) + +#endif /* GL_EXT_texture_sRGB_R8 */ + +/* ------------------------ GL_EXT_texture_sRGB_RG8 ------------------------ */ + +#ifndef GL_EXT_texture_sRGB_RG8 +#define GL_EXT_texture_sRGB_RG8 1 + +#define GL_SRG8_EXT 0x8FBE + +#define GLEW_EXT_texture_sRGB_RG8 GLEW_GET_VAR(__GLEW_EXT_texture_sRGB_RG8) + +#endif /* GL_EXT_texture_sRGB_RG8 */ + +/* ----------------------- GL_EXT_texture_sRGB_decode ---------------------- */ + +#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 + +#define GLEW_EXT_texture_sRGB_decode GLEW_GET_VAR(__GLEW_EXT_texture_sRGB_decode) + +#endif /* GL_EXT_texture_sRGB_decode */ + +/* --------------------- GL_EXT_texture_shared_exponent -------------------- */ + +#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 + +#define GLEW_EXT_texture_shared_exponent GLEW_GET_VAR(__GLEW_EXT_texture_shared_exponent) + +#endif /* GL_EXT_texture_shared_exponent */ + +/* -------------------------- GL_EXT_texture_snorm ------------------------- */ + +#ifndef GL_EXT_texture_snorm +#define GL_EXT_texture_snorm 1 + +#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_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 GLEW_EXT_texture_snorm GLEW_GET_VAR(__GLEW_EXT_texture_snorm) + +#endif /* GL_EXT_texture_snorm */ + +/* ------------------------- GL_EXT_texture_storage ------------------------ */ + +#ifndef GL_EXT_texture_storage +#define GL_EXT_texture_storage 1 + +#define GL_ALPHA8_EXT 0x803C +#define GL_LUMINANCE8_EXT 0x8040 +#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 +#define GL_RGB10_EXT 0x8052 +#define GL_RGB10_A2_EXT 0x8059 +#define GL_R8_EXT 0x8229 +#define GL_RG8_EXT 0x822B +#define GL_R16F_EXT 0x822D +#define GL_R32F_EXT 0x822E +#define GL_RG16F_EXT 0x822F +#define GL_RG32F_EXT 0x8230 +#define GL_RGBA32F_EXT 0x8814 +#define GL_RGB32F_EXT 0x8815 +#define GL_ALPHA32F_EXT 0x8816 +#define GL_LUMINANCE32F_EXT 0x8818 +#define GL_LUMINANCE_ALPHA32F_EXT 0x8819 +#define GL_RGBA16F_EXT 0x881A +#define GL_RGB16F_EXT 0x881B +#define GL_ALPHA16F_EXT 0x881C +#define GL_LUMINANCE16F_EXT 0x881E +#define GL_LUMINANCE_ALPHA16F_EXT 0x881F +#define GL_RGB_RAW_422_APPLE 0x8A51 +#define GL_TEXTURE_IMMUTABLE_FORMAT_EXT 0x912F +#define GL_BGRA8_EXT 0x93A1 + +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE1DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); + +#define glTexStorage1DEXT GLEW_GET_FUN(__glewTexStorage1DEXT) +#define glTexStorage2DEXT GLEW_GET_FUN(__glewTexStorage2DEXT) +#define glTexStorage3DEXT GLEW_GET_FUN(__glewTexStorage3DEXT) +#define glTextureStorage1DEXT GLEW_GET_FUN(__glewTextureStorage1DEXT) +#define glTextureStorage2DEXT GLEW_GET_FUN(__glewTextureStorage2DEXT) +#define glTextureStorage3DEXT GLEW_GET_FUN(__glewTextureStorage3DEXT) + +#define GLEW_EXT_texture_storage GLEW_GET_VAR(__GLEW_EXT_texture_storage) + +#endif /* GL_EXT_texture_storage */ + +/* ------------------------- GL_EXT_texture_swizzle ------------------------ */ + +#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 + +#define GLEW_EXT_texture_swizzle GLEW_GET_VAR(__GLEW_EXT_texture_swizzle) + +#endif /* GL_EXT_texture_swizzle */ + +/* ------------------- GL_EXT_texture_type_2_10_10_10_REV ------------------ */ + +#ifndef GL_EXT_texture_type_2_10_10_10_REV +#define GL_EXT_texture_type_2_10_10_10_REV 1 + +#define GL_UNSIGNED_INT_2_10_10_10_REV_EXT 0x8368 + +#define GLEW_EXT_texture_type_2_10_10_10_REV GLEW_GET_VAR(__GLEW_EXT_texture_type_2_10_10_10_REV) + +#endif /* GL_EXT_texture_type_2_10_10_10_REV */ + +/* -------------------------- GL_EXT_texture_view -------------------------- */ + +#ifndef GL_EXT_texture_view +#define GL_EXT_texture_view 1 + +#define GL_TEXTURE_VIEW_MIN_LEVEL_EXT 0x82DB +#define GL_TEXTURE_VIEW_NUM_LEVELS_EXT 0x82DC +#define GL_TEXTURE_VIEW_MIN_LAYER_EXT 0x82DD +#define GL_TEXTURE_VIEW_NUM_LAYERS_EXT 0x82DE +#define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF + +typedef void (GLAPIENTRY * PFNGLTEXTUREVIEWEXTPROC) (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); + +#define glTextureViewEXT GLEW_GET_FUN(__glewTextureViewEXT) + +#define GLEW_EXT_texture_view GLEW_GET_VAR(__GLEW_EXT_texture_view) + +#endif /* GL_EXT_texture_view */ + +/* --------------------------- GL_EXT_timer_query -------------------------- */ + +#ifndef GL_EXT_timer_query +#define GL_EXT_timer_query 1 + +#define GL_TIME_ELAPSED_EXT 0x88BF + +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64EXT *params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64EXT *params); + +#define glGetQueryObjecti64vEXT GLEW_GET_FUN(__glewGetQueryObjecti64vEXT) +#define glGetQueryObjectui64vEXT GLEW_GET_FUN(__glewGetQueryObjectui64vEXT) + +#define GLEW_EXT_timer_query GLEW_GET_VAR(__GLEW_EXT_timer_query) + +#endif /* GL_EXT_timer_query */ + +/* ----------------------- GL_EXT_transform_feedback ----------------------- */ + +#ifndef GL_EXT_transform_feedback +#define GL_EXT_transform_feedback 1 + +#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT 0x8C76 +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT 0x8C7F +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT 0x8C80 +#define GL_TRANSFORM_FEEDBACK_VARYINGS_EXT 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT 0x8C85 +#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_INTERLEAVED_ATTRIBS_EXT 0x8C8C +#define GL_SEPARATE_ATTRIBS_EXT 0x8C8D +#define GL_TRANSFORM_FEEDBACK_BUFFER_EXT 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT 0x8C8F + +typedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKEXTPROC) (GLenum primitiveMode); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERBASEEXTPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLBINDBUFFEROFFSETEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGEEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKEXTPROC) (void); +typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei *size, GLenum *type, GLchar *name); +typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) (GLuint program, GLsizei count, const GLchar * const* varyings, GLenum bufferMode); + +#define glBeginTransformFeedbackEXT GLEW_GET_FUN(__glewBeginTransformFeedbackEXT) +#define glBindBufferBaseEXT GLEW_GET_FUN(__glewBindBufferBaseEXT) +#define glBindBufferOffsetEXT GLEW_GET_FUN(__glewBindBufferOffsetEXT) +#define glBindBufferRangeEXT GLEW_GET_FUN(__glewBindBufferRangeEXT) +#define glEndTransformFeedbackEXT GLEW_GET_FUN(__glewEndTransformFeedbackEXT) +#define glGetTransformFeedbackVaryingEXT GLEW_GET_FUN(__glewGetTransformFeedbackVaryingEXT) +#define glTransformFeedbackVaryingsEXT GLEW_GET_FUN(__glewTransformFeedbackVaryingsEXT) + +#define GLEW_EXT_transform_feedback GLEW_GET_VAR(__GLEW_EXT_transform_feedback) + +#endif /* GL_EXT_transform_feedback */ + +/* ------------------------- GL_EXT_unpack_subimage ------------------------ */ + +#ifndef GL_EXT_unpack_subimage +#define GL_EXT_unpack_subimage 1 + +#define GL_UNPACK_ROW_LENGTH_EXT 0x0CF2 +#define GL_UNPACK_SKIP_ROWS_EXT 0x0CF3 +#define GL_UNPACK_SKIP_PIXELS_EXT 0x0CF4 + +#define GLEW_EXT_unpack_subimage GLEW_GET_VAR(__GLEW_EXT_unpack_subimage) + +#endif /* GL_EXT_unpack_subimage */ + +/* -------------------------- GL_EXT_vertex_array -------------------------- */ + +#ifndef GL_EXT_vertex_array +#define GL_EXT_vertex_array 1 + +#define GL_DOUBLE_EXT 0x140A +#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 (GLAPIENTRY * PFNGLARRAYELEMENTEXTPROC) (GLint i); +typedef void (GLAPIENTRY * PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (GLAPIENTRY * PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean* pointer); +typedef void (GLAPIENTRY * PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const void *pointer); +typedef void (GLAPIENTRY * PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const void *pointer); +typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); + +#define glArrayElementEXT GLEW_GET_FUN(__glewArrayElementEXT) +#define glColorPointerEXT GLEW_GET_FUN(__glewColorPointerEXT) +#define glDrawArraysEXT GLEW_GET_FUN(__glewDrawArraysEXT) +#define glEdgeFlagPointerEXT GLEW_GET_FUN(__glewEdgeFlagPointerEXT) +#define glIndexPointerEXT GLEW_GET_FUN(__glewIndexPointerEXT) +#define glNormalPointerEXT GLEW_GET_FUN(__glewNormalPointerEXT) +#define glTexCoordPointerEXT GLEW_GET_FUN(__glewTexCoordPointerEXT) +#define glVertexPointerEXT GLEW_GET_FUN(__glewVertexPointerEXT) + +#define GLEW_EXT_vertex_array GLEW_GET_VAR(__GLEW_EXT_vertex_array) + +#endif /* GL_EXT_vertex_array */ + +/* ------------------------ GL_EXT_vertex_array_bgra ----------------------- */ + +#ifndef GL_EXT_vertex_array_bgra +#define GL_EXT_vertex_array_bgra 1 + +#define GL_BGRA 0x80E1 + +#define GLEW_EXT_vertex_array_bgra GLEW_GET_VAR(__GLEW_EXT_vertex_array_bgra) + +#endif /* GL_EXT_vertex_array_bgra */ + +/* ----------------------- GL_EXT_vertex_array_setXXX ---------------------- */ + +#ifndef GL_EXT_vertex_array_setXXX +#define GL_EXT_vertex_array_setXXX 1 + +typedef void (GLAPIENTRY * PFNGLBINDARRAYSETEXTPROC) (const void *arrayset); +typedef const void * (GLAPIENTRY * PFNGLCREATEARRAYSETEXTPROC) (void); +typedef void (GLAPIENTRY * PFNGLDELETEARRAYSETSEXTPROC) (GLsizei n, const void *arrayset[]); + +#define glBindArraySetEXT GLEW_GET_FUN(__glewBindArraySetEXT) +#define glCreateArraySetExt GLEW_GET_FUN(__glewCreateArraySetExt) +#define glDeleteArraySetsEXT GLEW_GET_FUN(__glewDeleteArraySetsEXT) + +#define GLEW_EXT_vertex_array_setXXX GLEW_GET_VAR(__GLEW_EXT_vertex_array_setXXX) + +#endif /* GL_EXT_vertex_array_setXXX */ + +/* ----------------------- GL_EXT_vertex_attrib_64bit ---------------------- */ + +#ifndef GL_EXT_vertex_attrib_64bit +#define GL_EXT_vertex_attrib_64bit 1 + +#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 +#define GL_DOUBLE_VEC2_EXT 0x8FFC +#define GL_DOUBLE_VEC3_EXT 0x8FFD +#define GL_DOUBLE_VEC4_EXT 0x8FFE + +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLDVEXTPROC) (GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DEXTPROC) (GLuint index, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DVEXTPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DEXTPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DVEXTPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DVEXTPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DVEXTPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); + +#define glGetVertexAttribLdvEXT GLEW_GET_FUN(__glewGetVertexAttribLdvEXT) +#define glVertexArrayVertexAttribLOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribLOffsetEXT) +#define glVertexAttribL1dEXT GLEW_GET_FUN(__glewVertexAttribL1dEXT) +#define glVertexAttribL1dvEXT GLEW_GET_FUN(__glewVertexAttribL1dvEXT) +#define glVertexAttribL2dEXT GLEW_GET_FUN(__glewVertexAttribL2dEXT) +#define glVertexAttribL2dvEXT GLEW_GET_FUN(__glewVertexAttribL2dvEXT) +#define glVertexAttribL3dEXT GLEW_GET_FUN(__glewVertexAttribL3dEXT) +#define glVertexAttribL3dvEXT GLEW_GET_FUN(__glewVertexAttribL3dvEXT) +#define glVertexAttribL4dEXT GLEW_GET_FUN(__glewVertexAttribL4dEXT) +#define glVertexAttribL4dvEXT GLEW_GET_FUN(__glewVertexAttribL4dvEXT) +#define glVertexAttribLPointerEXT GLEW_GET_FUN(__glewVertexAttribLPointerEXT) + +#define GLEW_EXT_vertex_attrib_64bit GLEW_GET_VAR(__GLEW_EXT_vertex_attrib_64bit) + +#endif /* GL_EXT_vertex_attrib_64bit */ + +/* -------------------------- GL_EXT_vertex_shader ------------------------- */ + +#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 +#define GL_OP_NEGATE_EXT 0x8783 +#define GL_OP_DOT3_EXT 0x8784 +#define GL_OP_DOT4_EXT 0x8785 +#define GL_OP_MUL_EXT 0x8786 +#define GL_OP_ADD_EXT 0x8787 +#define GL_OP_MADD_EXT 0x8788 +#define GL_OP_FRAC_EXT 0x8789 +#define GL_OP_MAX_EXT 0x878A +#define GL_OP_MIN_EXT 0x878B +#define GL_OP_SET_GE_EXT 0x878C +#define GL_OP_SET_LT_EXT 0x878D +#define GL_OP_CLAMP_EXT 0x878E +#define GL_OP_FLOOR_EXT 0x878F +#define GL_OP_ROUND_EXT 0x8790 +#define GL_OP_EXP_BASE_2_EXT 0x8791 +#define GL_OP_LOG_BASE_2_EXT 0x8792 +#define GL_OP_POWER_EXT 0x8793 +#define GL_OP_RECIP_EXT 0x8794 +#define GL_OP_RECIP_SQRT_EXT 0x8795 +#define GL_OP_SUB_EXT 0x8796 +#define GL_OP_CROSS_PRODUCT_EXT 0x8797 +#define GL_OP_MULTIPLY_MATRIX_EXT 0x8798 +#define GL_OP_MOV_EXT 0x8799 +#define GL_OUTPUT_VERTEX_EXT 0x879A +#define GL_OUTPUT_COLOR0_EXT 0x879B +#define GL_OUTPUT_COLOR1_EXT 0x879C +#define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D +#define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E +#define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F +#define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0 +#define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1 +#define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2 +#define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3 +#define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4 +#define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5 +#define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6 +#define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7 +#define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8 +#define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9 +#define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA +#define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB +#define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC +#define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD +#define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE +#define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF +#define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0 +#define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1 +#define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2 +#define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3 +#define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4 +#define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5 +#define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6 +#define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7 +#define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8 +#define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9 +#define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA +#define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB +#define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC +#define GL_OUTPUT_FOG_EXT 0x87BD +#define GL_SCALAR_EXT 0x87BE +#define GL_VECTOR_EXT 0x87BF +#define GL_MATRIX_EXT 0x87C0 +#define GL_VARIANT_EXT 0x87C1 +#define GL_INVARIANT_EXT 0x87C2 +#define GL_LOCAL_CONSTANT_EXT 0x87C3 +#define GL_LOCAL_EXT 0x87C4 +#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5 +#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6 +#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7 +#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8 +#define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9 +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CC +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CD +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE +#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF +#define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0 +#define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1 +#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2 +#define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3 +#define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4 +#define GL_X_EXT 0x87D5 +#define GL_Y_EXT 0x87D6 +#define GL_Z_EXT 0x87D7 +#define GL_W_EXT 0x87D8 +#define GL_NEGATIVE_X_EXT 0x87D9 +#define GL_NEGATIVE_Y_EXT 0x87DA +#define GL_NEGATIVE_Z_EXT 0x87DB +#define GL_NEGATIVE_W_EXT 0x87DC +#define GL_ZERO_EXT 0x87DD +#define GL_ONE_EXT 0x87DE +#define GL_NEGATIVE_ONE_EXT 0x87DF +#define GL_NORMALIZED_RANGE_EXT 0x87E0 +#define GL_FULL_RANGE_EXT 0x87E1 +#define GL_CURRENT_VERTEX_EXT 0x87E2 +#define GL_MVP_MATRIX_EXT 0x87E3 +#define GL_VARIANT_VALUE_EXT 0x87E4 +#define GL_VARIANT_DATATYPE_EXT 0x87E5 +#define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6 +#define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7 +#define GL_VARIANT_ARRAY_EXT 0x87E8 +#define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9 +#define GL_INVARIANT_VALUE_EXT 0x87EA +#define GL_INVARIANT_DATATYPE_EXT 0x87EB +#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC +#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED + +typedef void (GLAPIENTRY * PFNGLBEGINVERTEXSHADEREXTPROC) (void); +typedef GLuint (GLAPIENTRY * PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value); +typedef GLuint (GLAPIENTRY * PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value); +typedef GLuint (GLAPIENTRY * PFNGLBINDPARAMETEREXTPROC) (GLenum value); +typedef GLuint (GLAPIENTRY * PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value); +typedef GLuint (GLAPIENTRY * PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value); +typedef void (GLAPIENTRY * PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLENDVERTEXSHADEREXTPROC) (void); +typedef void (GLAPIENTRY * PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); +typedef GLuint (GLAPIENTRY * PFNGLGENSYMBOLSEXTPROC) (GLenum dataType, GLenum storageType, GLenum range, GLuint components); +typedef GLuint (GLAPIENTRY * PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range); +typedef void (GLAPIENTRY * PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (GLAPIENTRY * PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (GLAPIENTRY * PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (GLAPIENTRY * PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (GLAPIENTRY * PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (GLAPIENTRY * PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (GLAPIENTRY * PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (GLAPIENTRY * PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (GLAPIENTRY * PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (GLAPIENTRY * PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, void **data); +typedef void (GLAPIENTRY * PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); +typedef GLboolean (GLAPIENTRY * PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap); +typedef void (GLAPIENTRY * PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, void *addr); +typedef void (GLAPIENTRY * PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, void *addr); +typedef void (GLAPIENTRY * PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1); +typedef void (GLAPIENTRY * PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2); +typedef void (GLAPIENTRY * PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); +typedef void (GLAPIENTRY * PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +typedef void (GLAPIENTRY * PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, void *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTBVEXTPROC) (GLuint id, GLbyte *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTDVEXTPROC) (GLuint id, GLdouble *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTFVEXTPROC) (GLuint id, GLfloat *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTIVEXTPROC) (GLuint id, GLint *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTSVEXTPROC) (GLuint id, GLshort *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTUBVEXTPROC) (GLuint id, GLubyte *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTUIVEXTPROC) (GLuint id, GLuint *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTUSVEXTPROC) (GLuint id, GLushort *addr); +typedef void (GLAPIENTRY * PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); + +#define glBeginVertexShaderEXT GLEW_GET_FUN(__glewBeginVertexShaderEXT) +#define glBindLightParameterEXT GLEW_GET_FUN(__glewBindLightParameterEXT) +#define glBindMaterialParameterEXT GLEW_GET_FUN(__glewBindMaterialParameterEXT) +#define glBindParameterEXT GLEW_GET_FUN(__glewBindParameterEXT) +#define glBindTexGenParameterEXT GLEW_GET_FUN(__glewBindTexGenParameterEXT) +#define glBindTextureUnitParameterEXT GLEW_GET_FUN(__glewBindTextureUnitParameterEXT) +#define glBindVertexShaderEXT GLEW_GET_FUN(__glewBindVertexShaderEXT) +#define glDeleteVertexShaderEXT GLEW_GET_FUN(__glewDeleteVertexShaderEXT) +#define glDisableVariantClientStateEXT GLEW_GET_FUN(__glewDisableVariantClientStateEXT) +#define glEnableVariantClientStateEXT GLEW_GET_FUN(__glewEnableVariantClientStateEXT) +#define glEndVertexShaderEXT GLEW_GET_FUN(__glewEndVertexShaderEXT) +#define glExtractComponentEXT GLEW_GET_FUN(__glewExtractComponentEXT) +#define glGenSymbolsEXT GLEW_GET_FUN(__glewGenSymbolsEXT) +#define glGenVertexShadersEXT GLEW_GET_FUN(__glewGenVertexShadersEXT) +#define glGetInvariantBooleanvEXT GLEW_GET_FUN(__glewGetInvariantBooleanvEXT) +#define glGetInvariantFloatvEXT GLEW_GET_FUN(__glewGetInvariantFloatvEXT) +#define glGetInvariantIntegervEXT GLEW_GET_FUN(__glewGetInvariantIntegervEXT) +#define glGetLocalConstantBooleanvEXT GLEW_GET_FUN(__glewGetLocalConstantBooleanvEXT) +#define glGetLocalConstantFloatvEXT GLEW_GET_FUN(__glewGetLocalConstantFloatvEXT) +#define glGetLocalConstantIntegervEXT GLEW_GET_FUN(__glewGetLocalConstantIntegervEXT) +#define glGetVariantBooleanvEXT GLEW_GET_FUN(__glewGetVariantBooleanvEXT) +#define glGetVariantFloatvEXT GLEW_GET_FUN(__glewGetVariantFloatvEXT) +#define glGetVariantIntegervEXT GLEW_GET_FUN(__glewGetVariantIntegervEXT) +#define glGetVariantPointervEXT GLEW_GET_FUN(__glewGetVariantPointervEXT) +#define glInsertComponentEXT GLEW_GET_FUN(__glewInsertComponentEXT) +#define glIsVariantEnabledEXT GLEW_GET_FUN(__glewIsVariantEnabledEXT) +#define glSetInvariantEXT GLEW_GET_FUN(__glewSetInvariantEXT) +#define glSetLocalConstantEXT GLEW_GET_FUN(__glewSetLocalConstantEXT) +#define glShaderOp1EXT GLEW_GET_FUN(__glewShaderOp1EXT) +#define glShaderOp2EXT GLEW_GET_FUN(__glewShaderOp2EXT) +#define glShaderOp3EXT GLEW_GET_FUN(__glewShaderOp3EXT) +#define glSwizzleEXT GLEW_GET_FUN(__glewSwizzleEXT) +#define glVariantPointerEXT GLEW_GET_FUN(__glewVariantPointerEXT) +#define glVariantbvEXT GLEW_GET_FUN(__glewVariantbvEXT) +#define glVariantdvEXT GLEW_GET_FUN(__glewVariantdvEXT) +#define glVariantfvEXT GLEW_GET_FUN(__glewVariantfvEXT) +#define glVariantivEXT GLEW_GET_FUN(__glewVariantivEXT) +#define glVariantsvEXT GLEW_GET_FUN(__glewVariantsvEXT) +#define glVariantubvEXT GLEW_GET_FUN(__glewVariantubvEXT) +#define glVariantuivEXT GLEW_GET_FUN(__glewVariantuivEXT) +#define glVariantusvEXT GLEW_GET_FUN(__glewVariantusvEXT) +#define glWriteMaskEXT GLEW_GET_FUN(__glewWriteMaskEXT) + +#define GLEW_EXT_vertex_shader GLEW_GET_VAR(__GLEW_EXT_vertex_shader) + +#endif /* GL_EXT_vertex_shader */ + +/* ------------------------ GL_EXT_vertex_weighting ------------------------ */ + +#ifndef GL_EXT_vertex_weighting +#define GL_EXT_vertex_weighting 1 + +#define GL_MODELVIEW0_STACK_DEPTH_EXT 0x0BA3 +#define GL_MODELVIEW0_MATRIX_EXT 0x0BA6 +#define GL_MODELVIEW0_EXT 0x1700 +#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 +#define GL_MODELVIEW1_MATRIX_EXT 0x8506 +#define GL_VERTEX_WEIGHTING_EXT 0x8509 +#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 (GLAPIENTRY * PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, void *pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); +typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTFVEXTPROC) (GLfloat* weight); + +#define glVertexWeightPointerEXT GLEW_GET_FUN(__glewVertexWeightPointerEXT) +#define glVertexWeightfEXT GLEW_GET_FUN(__glewVertexWeightfEXT) +#define glVertexWeightfvEXT GLEW_GET_FUN(__glewVertexWeightfvEXT) + +#define GLEW_EXT_vertex_weighting GLEW_GET_VAR(__GLEW_EXT_vertex_weighting) + +#endif /* GL_EXT_vertex_weighting */ + +/* ------------------------ GL_EXT_win32_keyed_mutex ----------------------- */ + +#ifndef GL_EXT_win32_keyed_mutex +#define GL_EXT_win32_keyed_mutex 1 + +typedef GLboolean (GLAPIENTRY * PFNGLACQUIREKEYEDMUTEXWIN32EXTPROC) (GLuint memory, GLuint64 key, GLuint timeout); +typedef GLboolean (GLAPIENTRY * PFNGLRELEASEKEYEDMUTEXWIN32EXTPROC) (GLuint memory, GLuint64 key); + +#define glAcquireKeyedMutexWin32EXT GLEW_GET_FUN(__glewAcquireKeyedMutexWin32EXT) +#define glReleaseKeyedMutexWin32EXT GLEW_GET_FUN(__glewReleaseKeyedMutexWin32EXT) + +#define GLEW_EXT_win32_keyed_mutex GLEW_GET_VAR(__GLEW_EXT_win32_keyed_mutex) + +#endif /* GL_EXT_win32_keyed_mutex */ + +/* ------------------------ GL_EXT_window_rectangles ----------------------- */ + +#ifndef GL_EXT_window_rectangles +#define GL_EXT_window_rectangles 1 + +#define GL_INCLUSIVE_EXT 0x8F10 +#define GL_EXCLUSIVE_EXT 0x8F11 +#define GL_WINDOW_RECTANGLE_EXT 0x8F12 +#define GL_WINDOW_RECTANGLE_MODE_EXT 0x8F13 +#define GL_MAX_WINDOW_RECTANGLES_EXT 0x8F14 +#define GL_NUM_WINDOW_RECTANGLES_EXT 0x8F15 + +typedef void (GLAPIENTRY * PFNGLWINDOWRECTANGLESEXTPROC) (GLenum mode, GLsizei count, const GLint box[]); + +#define glWindowRectanglesEXT GLEW_GET_FUN(__glewWindowRectanglesEXT) + +#define GLEW_EXT_window_rectangles GLEW_GET_VAR(__GLEW_EXT_window_rectangles) + +#endif /* GL_EXT_window_rectangles */ + +/* ------------------------- GL_EXT_x11_sync_object ------------------------ */ + +#ifndef GL_EXT_x11_sync_object +#define GL_EXT_x11_sync_object 1 + +#define GL_SYNC_X11_FENCE_EXT 0x90E1 + +typedef GLsync (GLAPIENTRY * PFNGLIMPORTSYNCEXTPROC) (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags); + +#define glImportSyncEXT GLEW_GET_FUN(__glewImportSyncEXT) + +#define GLEW_EXT_x11_sync_object GLEW_GET_VAR(__GLEW_EXT_x11_sync_object) + +#endif /* GL_EXT_x11_sync_object */ + +/* ---------------------- GL_GREMEDY_frame_terminator ---------------------- */ + +#ifndef GL_GREMEDY_frame_terminator +#define GL_GREMEDY_frame_terminator 1 + +typedef void (GLAPIENTRY * PFNGLFRAMETERMINATORGREMEDYPROC) (void); + +#define glFrameTerminatorGREMEDY GLEW_GET_FUN(__glewFrameTerminatorGREMEDY) + +#define GLEW_GREMEDY_frame_terminator GLEW_GET_VAR(__GLEW_GREMEDY_frame_terminator) + +#endif /* GL_GREMEDY_frame_terminator */ + +/* ------------------------ GL_GREMEDY_string_marker ----------------------- */ + +#ifndef GL_GREMEDY_string_marker +#define GL_GREMEDY_string_marker 1 + +typedef void (GLAPIENTRY * PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const void *string); + +#define glStringMarkerGREMEDY GLEW_GET_FUN(__glewStringMarkerGREMEDY) + +#define GLEW_GREMEDY_string_marker GLEW_GET_VAR(__GLEW_GREMEDY_string_marker) + +#endif /* GL_GREMEDY_string_marker */ + +/* --------------------- GL_HP_convolution_border_modes -------------------- */ + +#ifndef GL_HP_convolution_border_modes +#define GL_HP_convolution_border_modes 1 + +#define GLEW_HP_convolution_border_modes GLEW_GET_VAR(__GLEW_HP_convolution_border_modes) + +#endif /* GL_HP_convolution_border_modes */ + +/* ------------------------- GL_HP_image_transform ------------------------- */ + +#ifndef GL_HP_image_transform +#define GL_HP_image_transform 1 + +typedef void (GLAPIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, const GLfloat param); +typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, const GLint param); +typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint* params); + +#define glGetImageTransformParameterfvHP GLEW_GET_FUN(__glewGetImageTransformParameterfvHP) +#define glGetImageTransformParameterivHP GLEW_GET_FUN(__glewGetImageTransformParameterivHP) +#define glImageTransformParameterfHP GLEW_GET_FUN(__glewImageTransformParameterfHP) +#define glImageTransformParameterfvHP GLEW_GET_FUN(__glewImageTransformParameterfvHP) +#define glImageTransformParameteriHP GLEW_GET_FUN(__glewImageTransformParameteriHP) +#define glImageTransformParameterivHP GLEW_GET_FUN(__glewImageTransformParameterivHP) + +#define GLEW_HP_image_transform GLEW_GET_VAR(__GLEW_HP_image_transform) + +#endif /* GL_HP_image_transform */ + +/* -------------------------- GL_HP_occlusion_test ------------------------- */ + +#ifndef GL_HP_occlusion_test +#define GL_HP_occlusion_test 1 + +#define GLEW_HP_occlusion_test GLEW_GET_VAR(__GLEW_HP_occlusion_test) + +#endif /* GL_HP_occlusion_test */ + +/* ------------------------- GL_HP_texture_lighting ------------------------ */ + +#ifndef GL_HP_texture_lighting +#define GL_HP_texture_lighting 1 + +#define GLEW_HP_texture_lighting GLEW_GET_VAR(__GLEW_HP_texture_lighting) + +#endif /* GL_HP_texture_lighting */ + +/* --------------------------- GL_IBM_cull_vertex -------------------------- */ + +#ifndef GL_IBM_cull_vertex +#define GL_IBM_cull_vertex 1 + +#define GL_CULL_VERTEX_IBM 103050 + +#define GLEW_IBM_cull_vertex GLEW_GET_VAR(__GLEW_IBM_cull_vertex) + +#endif /* GL_IBM_cull_vertex */ + +/* ---------------------- GL_IBM_multimode_draw_arrays --------------------- */ + +#ifndef GL_IBM_multimode_draw_arrays +#define GL_IBM_multimode_draw_arrays 1 + +typedef void (GLAPIENTRY * PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum* mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); +typedef void (GLAPIENTRY * PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum* mode, const GLsizei *count, GLenum type, const void *const *indices, GLsizei primcount, GLint modestride); + +#define glMultiModeDrawArraysIBM GLEW_GET_FUN(__glewMultiModeDrawArraysIBM) +#define glMultiModeDrawElementsIBM GLEW_GET_FUN(__glewMultiModeDrawElementsIBM) + +#define GLEW_IBM_multimode_draw_arrays GLEW_GET_VAR(__GLEW_IBM_multimode_draw_arrays) + +#endif /* GL_IBM_multimode_draw_arrays */ + +/* ------------------------- GL_IBM_rasterpos_clip ------------------------- */ + +#ifndef GL_IBM_rasterpos_clip +#define GL_IBM_rasterpos_clip 1 + +#define GL_RASTER_POSITION_UNCLIPPED_IBM 103010 + +#define GLEW_IBM_rasterpos_clip GLEW_GET_VAR(__GLEW_IBM_rasterpos_clip) + +#endif /* GL_IBM_rasterpos_clip */ + +/* --------------------------- GL_IBM_static_data -------------------------- */ + +#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 + +#define GLEW_IBM_static_data GLEW_GET_VAR(__GLEW_IBM_static_data) + +#endif /* GL_IBM_static_data */ + +/* --------------------- GL_IBM_texture_mirrored_repeat -------------------- */ + +#ifndef GL_IBM_texture_mirrored_repeat +#define GL_IBM_texture_mirrored_repeat 1 + +#define GL_MIRRORED_REPEAT_IBM 0x8370 + +#define GLEW_IBM_texture_mirrored_repeat GLEW_GET_VAR(__GLEW_IBM_texture_mirrored_repeat) + +#endif /* GL_IBM_texture_mirrored_repeat */ + +/* ----------------------- GL_IBM_vertex_array_lists ----------------------- */ + +#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 (GLAPIENTRY * PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const void** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const void** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const void** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void** pointer, GLint ptrstride); + +#define glColorPointerListIBM GLEW_GET_FUN(__glewColorPointerListIBM) +#define glEdgeFlagPointerListIBM GLEW_GET_FUN(__glewEdgeFlagPointerListIBM) +#define glFogCoordPointerListIBM GLEW_GET_FUN(__glewFogCoordPointerListIBM) +#define glIndexPointerListIBM GLEW_GET_FUN(__glewIndexPointerListIBM) +#define glNormalPointerListIBM GLEW_GET_FUN(__glewNormalPointerListIBM) +#define glSecondaryColorPointerListIBM GLEW_GET_FUN(__glewSecondaryColorPointerListIBM) +#define glTexCoordPointerListIBM GLEW_GET_FUN(__glewTexCoordPointerListIBM) +#define glVertexPointerListIBM GLEW_GET_FUN(__glewVertexPointerListIBM) + +#define GLEW_IBM_vertex_array_lists GLEW_GET_VAR(__GLEW_IBM_vertex_array_lists) + +#endif /* GL_IBM_vertex_array_lists */ + +/* -------------------------- GL_INGR_color_clamp -------------------------- */ + +#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 + +#define GLEW_INGR_color_clamp GLEW_GET_VAR(__GLEW_INGR_color_clamp) + +#endif /* GL_INGR_color_clamp */ + +/* ------------------------- GL_INGR_interlace_read ------------------------ */ + +#ifndef GL_INGR_interlace_read +#define GL_INGR_interlace_read 1 + +#define GL_INTERLACE_READ_INGR 0x8568 + +#define GLEW_INGR_interlace_read GLEW_GET_VAR(__GLEW_INGR_interlace_read) + +#endif /* GL_INGR_interlace_read */ + +/* ------------------ GL_INTEL_conservative_rasterization ------------------ */ + +#ifndef GL_INTEL_conservative_rasterization +#define GL_INTEL_conservative_rasterization 1 + +#define GL_CONSERVATIVE_RASTERIZATION_INTEL 0x83FE + +#define GLEW_INTEL_conservative_rasterization GLEW_GET_VAR(__GLEW_INTEL_conservative_rasterization) + +#endif /* GL_INTEL_conservative_rasterization */ + +/* ------------------- GL_INTEL_fragment_shader_ordering ------------------- */ + +#ifndef GL_INTEL_fragment_shader_ordering +#define GL_INTEL_fragment_shader_ordering 1 + +#define GLEW_INTEL_fragment_shader_ordering GLEW_GET_VAR(__GLEW_INTEL_fragment_shader_ordering) + +#endif /* GL_INTEL_fragment_shader_ordering */ + +/* ----------------------- GL_INTEL_framebuffer_CMAA ----------------------- */ + +#ifndef GL_INTEL_framebuffer_CMAA +#define GL_INTEL_framebuffer_CMAA 1 + +#define GLEW_INTEL_framebuffer_CMAA GLEW_GET_VAR(__GLEW_INTEL_framebuffer_CMAA) + +#endif /* GL_INTEL_framebuffer_CMAA */ + +/* -------------------------- GL_INTEL_map_texture ------------------------- */ + +#ifndef GL_INTEL_map_texture +#define GL_INTEL_map_texture 1 + +#define GL_LAYOUT_DEFAULT_INTEL 0 +#define GL_LAYOUT_LINEAR_INTEL 1 +#define GL_LAYOUT_LINEAR_CPU_CACHED_INTEL 2 +#define GL_TEXTURE_MEMORY_LAYOUT_INTEL 0x83FF + +typedef void * (GLAPIENTRY * PFNGLMAPTEXTURE2DINTELPROC) (GLuint texture, GLint level, GLbitfield access, GLint* stride, GLenum *layout); +typedef void (GLAPIENTRY * PFNGLSYNCTEXTUREINTELPROC) (GLuint texture); +typedef void (GLAPIENTRY * PFNGLUNMAPTEXTURE2DINTELPROC) (GLuint texture, GLint level); + +#define glMapTexture2DINTEL GLEW_GET_FUN(__glewMapTexture2DINTEL) +#define glSyncTextureINTEL GLEW_GET_FUN(__glewSyncTextureINTEL) +#define glUnmapTexture2DINTEL GLEW_GET_FUN(__glewUnmapTexture2DINTEL) + +#define GLEW_INTEL_map_texture GLEW_GET_VAR(__GLEW_INTEL_map_texture) + +#endif /* GL_INTEL_map_texture */ + +/* ------------------------ GL_INTEL_parallel_arrays ----------------------- */ + +#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 (GLAPIENTRY * PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer); +typedef void (GLAPIENTRY * PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const void** pointer); +typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer); + +#define glColorPointervINTEL GLEW_GET_FUN(__glewColorPointervINTEL) +#define glNormalPointervINTEL GLEW_GET_FUN(__glewNormalPointervINTEL) +#define glTexCoordPointervINTEL GLEW_GET_FUN(__glewTexCoordPointervINTEL) +#define glVertexPointervINTEL GLEW_GET_FUN(__glewVertexPointervINTEL) + +#define GLEW_INTEL_parallel_arrays GLEW_GET_VAR(__GLEW_INTEL_parallel_arrays) + +#endif /* GL_INTEL_parallel_arrays */ + +/* ----------------------- GL_INTEL_performance_query ---------------------- */ + +#ifndef GL_INTEL_performance_query +#define GL_INTEL_performance_query 1 + +#define GL_PERFQUERY_SINGLE_CONTEXT_INTEL 0x0000 +#define GL_PERFQUERY_GLOBAL_CONTEXT_INTEL 0x0001 +#define GL_PERFQUERY_DONOT_FLUSH_INTEL 0x83F9 +#define GL_PERFQUERY_FLUSH_INTEL 0x83FA +#define GL_PERFQUERY_WAIT_INTEL 0x83FB +#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 (GLAPIENTRY * PFNGLBEGINPERFQUERYINTELPROC) (GLuint queryHandle); +typedef void (GLAPIENTRY * PFNGLCREATEPERFQUERYINTELPROC) (GLuint queryId, GLuint* queryHandle); +typedef void (GLAPIENTRY * PFNGLDELETEPERFQUERYINTELPROC) (GLuint queryHandle); +typedef void (GLAPIENTRY * PFNGLENDPERFQUERYINTELPROC) (GLuint queryHandle); +typedef void (GLAPIENTRY * PFNGLGETFIRSTPERFQUERYIDINTELPROC) (GLuint* queryId); +typedef void (GLAPIENTRY * PFNGLGETNEXTPERFQUERYIDINTELPROC) (GLuint queryId, GLuint* nextQueryId); +typedef void (GLAPIENTRY * 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 (GLAPIENTRY * PFNGLGETPERFQUERYDATAINTELPROC) (GLuint queryHandle, GLuint flags, GLsizei dataSize, void *data, GLuint *bytesWritten); +typedef void (GLAPIENTRY * PFNGLGETPERFQUERYIDBYNAMEINTELPROC) (GLchar* queryName, GLuint *queryId); +typedef void (GLAPIENTRY * PFNGLGETPERFQUERYINFOINTELPROC) (GLuint queryId, GLuint queryNameLength, GLchar* queryName, GLuint *dataSize, GLuint *noCounters, GLuint *noInstances, GLuint *capsMask); + +#define glBeginPerfQueryINTEL GLEW_GET_FUN(__glewBeginPerfQueryINTEL) +#define glCreatePerfQueryINTEL GLEW_GET_FUN(__glewCreatePerfQueryINTEL) +#define glDeletePerfQueryINTEL GLEW_GET_FUN(__glewDeletePerfQueryINTEL) +#define glEndPerfQueryINTEL GLEW_GET_FUN(__glewEndPerfQueryINTEL) +#define glGetFirstPerfQueryIdINTEL GLEW_GET_FUN(__glewGetFirstPerfQueryIdINTEL) +#define glGetNextPerfQueryIdINTEL GLEW_GET_FUN(__glewGetNextPerfQueryIdINTEL) +#define glGetPerfCounterInfoINTEL GLEW_GET_FUN(__glewGetPerfCounterInfoINTEL) +#define glGetPerfQueryDataINTEL GLEW_GET_FUN(__glewGetPerfQueryDataINTEL) +#define glGetPerfQueryIdByNameINTEL GLEW_GET_FUN(__glewGetPerfQueryIdByNameINTEL) +#define glGetPerfQueryInfoINTEL GLEW_GET_FUN(__glewGetPerfQueryInfoINTEL) + +#define GLEW_INTEL_performance_query GLEW_GET_VAR(__GLEW_INTEL_performance_query) + +#endif /* GL_INTEL_performance_query */ + +/* ------------------------ GL_INTEL_texture_scissor ----------------------- */ + +#ifndef GL_INTEL_texture_scissor +#define GL_INTEL_texture_scissor 1 + +typedef void (GLAPIENTRY * PFNGLTEXSCISSORFUNCINTELPROC) (GLenum target, GLenum lfunc, GLenum hfunc); +typedef void (GLAPIENTRY * PFNGLTEXSCISSORINTELPROC) (GLenum target, GLclampf tlow, GLclampf thigh); + +#define glTexScissorFuncINTEL GLEW_GET_FUN(__glewTexScissorFuncINTEL) +#define glTexScissorINTEL GLEW_GET_FUN(__glewTexScissorINTEL) + +#define GLEW_INTEL_texture_scissor GLEW_GET_VAR(__GLEW_INTEL_texture_scissor) + +#endif /* GL_INTEL_texture_scissor */ + +/* --------------------- GL_KHR_blend_equation_advanced -------------------- */ + +#ifndef GL_KHR_blend_equation_advanced +#define GL_KHR_blend_equation_advanced 1 + +#define GL_BLEND_ADVANCED_COHERENT_KHR 0x9285 +#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 (GLAPIENTRY * PFNGLBLENDBARRIERKHRPROC) (void); + +#define glBlendBarrierKHR GLEW_GET_FUN(__glewBlendBarrierKHR) + +#define GLEW_KHR_blend_equation_advanced GLEW_GET_VAR(__GLEW_KHR_blend_equation_advanced) + +#endif /* GL_KHR_blend_equation_advanced */ + +/* ---------------- GL_KHR_blend_equation_advanced_coherent ---------------- */ + +#ifndef GL_KHR_blend_equation_advanced_coherent +#define GL_KHR_blend_equation_advanced_coherent 1 + +#define GLEW_KHR_blend_equation_advanced_coherent GLEW_GET_VAR(__GLEW_KHR_blend_equation_advanced_coherent) + +#endif /* GL_KHR_blend_equation_advanced_coherent */ + +/* ---------------------- GL_KHR_context_flush_control --------------------- */ + +#ifndef GL_KHR_context_flush_control +#define GL_KHR_context_flush_control 1 + +#define GLEW_KHR_context_flush_control GLEW_GET_VAR(__GLEW_KHR_context_flush_control) + +#endif /* GL_KHR_context_flush_control */ + +/* ------------------------------ GL_KHR_debug ----------------------------- */ + +#ifndef GL_KHR_debug +#define GL_KHR_debug 1 + +#define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002 +#define GL_STACK_OVERFLOW 0x0503 +#define GL_STACK_UNDERFLOW 0x0504 +#define GL_DEBUG_OUTPUT_SYNCHRONOUS 0x8242 +#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH 0x8243 +#define GL_DEBUG_CALLBACK_FUNCTION 0x8244 +#define GL_DEBUG_CALLBACK_USER_PARAM 0x8245 +#define GL_DEBUG_SOURCE_API 0x8246 +#define GL_DEBUG_SOURCE_WINDOW_SYSTEM 0x8247 +#define GL_DEBUG_SOURCE_SHADER_COMPILER 0x8248 +#define GL_DEBUG_SOURCE_THIRD_PARTY 0x8249 +#define GL_DEBUG_SOURCE_APPLICATION 0x824A +#define GL_DEBUG_SOURCE_OTHER 0x824B +#define GL_DEBUG_TYPE_ERROR 0x824C +#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR 0x824D +#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR 0x824E +#define GL_DEBUG_TYPE_PORTABILITY 0x824F +#define GL_DEBUG_TYPE_PERFORMANCE 0x8250 +#define GL_DEBUG_TYPE_OTHER 0x8251 +#define GL_DEBUG_TYPE_MARKER 0x8268 +#define GL_DEBUG_TYPE_PUSH_GROUP 0x8269 +#define GL_DEBUG_TYPE_POP_GROUP 0x826A +#define GL_DEBUG_SEVERITY_NOTIFICATION 0x826B +#define GL_MAX_DEBUG_GROUP_STACK_DEPTH 0x826C +#define GL_DEBUG_GROUP_STACK_DEPTH 0x826D +#define GL_BUFFER 0x82E0 +#define GL_SHADER 0x82E1 +#define GL_PROGRAM 0x82E2 +#define GL_QUERY 0x82E3 +#define GL_PROGRAM_PIPELINE 0x82E4 +#define GL_SAMPLER 0x82E6 +#define GL_DISPLAY_LIST 0x82E7 +#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 + +typedef void (GLAPIENTRY *GLDEBUGPROC)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, const void* userParam); + +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECALLBACKPROC) (GLDEBUGPROC callback, const void *userParam); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECONTROLPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEINSERTPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* buf); +typedef GLuint (GLAPIENTRY * PFNGLGETDEBUGMESSAGELOGPROC) (GLuint count, GLsizei bufSize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, GLchar* messageLog); +typedef void (GLAPIENTRY * PFNGLGETOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei* length, GLchar *label); +typedef void (GLAPIENTRY * PFNGLGETOBJECTPTRLABELPROC) (void* ptr, GLsizei bufSize, GLsizei* length, GLchar *label); +typedef void (GLAPIENTRY * PFNGLOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar* label); +typedef void (GLAPIENTRY * PFNGLOBJECTPTRLABELPROC) (void* ptr, GLsizei length, const GLchar* label); +typedef void (GLAPIENTRY * PFNGLPOPDEBUGGROUPPROC) (void); +typedef void (GLAPIENTRY * PFNGLPUSHDEBUGGROUPPROC) (GLenum source, GLuint id, GLsizei length, const GLchar * message); + +#define glDebugMessageCallback GLEW_GET_FUN(__glewDebugMessageCallback) +#define glDebugMessageControl GLEW_GET_FUN(__glewDebugMessageControl) +#define glDebugMessageInsert GLEW_GET_FUN(__glewDebugMessageInsert) +#define glGetDebugMessageLog GLEW_GET_FUN(__glewGetDebugMessageLog) +#define glGetObjectLabel GLEW_GET_FUN(__glewGetObjectLabel) +#define glGetObjectPtrLabel GLEW_GET_FUN(__glewGetObjectPtrLabel) +#define glObjectLabel GLEW_GET_FUN(__glewObjectLabel) +#define glObjectPtrLabel GLEW_GET_FUN(__glewObjectPtrLabel) +#define glPopDebugGroup GLEW_GET_FUN(__glewPopDebugGroup) +#define glPushDebugGroup GLEW_GET_FUN(__glewPushDebugGroup) + +#define GLEW_KHR_debug GLEW_GET_VAR(__GLEW_KHR_debug) + +#endif /* GL_KHR_debug */ + +/* ---------------------------- GL_KHR_no_error ---------------------------- */ + +#ifndef GL_KHR_no_error +#define GL_KHR_no_error 1 + +#define GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR 0x00000008 + +#define GLEW_KHR_no_error GLEW_GET_VAR(__GLEW_KHR_no_error) + +#endif /* GL_KHR_no_error */ + +/* --------------------- GL_KHR_parallel_shader_compile -------------------- */ + +#ifndef GL_KHR_parallel_shader_compile +#define GL_KHR_parallel_shader_compile 1 + +#define GL_MAX_SHADER_COMPILER_THREADS_KHR 0x91B0 +#define GL_COMPLETION_STATUS_KHR 0x91B1 + +typedef void (GLAPIENTRY * PFNGLMAXSHADERCOMPILERTHREADSKHRPROC) (GLuint count); + +#define glMaxShaderCompilerThreadsKHR GLEW_GET_FUN(__glewMaxShaderCompilerThreadsKHR) + +#define GLEW_KHR_parallel_shader_compile GLEW_GET_VAR(__GLEW_KHR_parallel_shader_compile) + +#endif /* GL_KHR_parallel_shader_compile */ + +/* ------------------ GL_KHR_robust_buffer_access_behavior ----------------- */ + +#ifndef GL_KHR_robust_buffer_access_behavior +#define GL_KHR_robust_buffer_access_behavior 1 + +#define GLEW_KHR_robust_buffer_access_behavior GLEW_GET_VAR(__GLEW_KHR_robust_buffer_access_behavior) + +#endif /* GL_KHR_robust_buffer_access_behavior */ + +/* --------------------------- GL_KHR_robustness --------------------------- */ + +#ifndef GL_KHR_robustness +#define GL_KHR_robustness 1 + +#define GL_CONTEXT_LOST 0x0507 +#define GL_LOSE_CONTEXT_ON_RESET 0x8252 +#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_NO_RESET_NOTIFICATION 0x8261 +#define GL_CONTEXT_ROBUST_ACCESS 0x90F3 + +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMFVPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMIVPROC) (GLuint program, GLint location, GLsizei bufSize, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMUIVPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint* params); +typedef void (GLAPIENTRY * PFNGLREADNPIXELSPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); + +#define glGetnUniformfv GLEW_GET_FUN(__glewGetnUniformfv) +#define glGetnUniformiv GLEW_GET_FUN(__glewGetnUniformiv) +#define glGetnUniformuiv GLEW_GET_FUN(__glewGetnUniformuiv) +#define glReadnPixels GLEW_GET_FUN(__glewReadnPixels) + +#define GLEW_KHR_robustness GLEW_GET_VAR(__GLEW_KHR_robustness) + +#endif /* GL_KHR_robustness */ + +/* ------------------ GL_KHR_texture_compression_astc_hdr ------------------ */ + +#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 + +#define GLEW_KHR_texture_compression_astc_hdr GLEW_GET_VAR(__GLEW_KHR_texture_compression_astc_hdr) + +#endif /* GL_KHR_texture_compression_astc_hdr */ + +/* ------------------ GL_KHR_texture_compression_astc_ldr ------------------ */ + +#ifndef GL_KHR_texture_compression_astc_ldr +#define GL_KHR_texture_compression_astc_ldr 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 + +#define GLEW_KHR_texture_compression_astc_ldr GLEW_GET_VAR(__GLEW_KHR_texture_compression_astc_ldr) + +#endif /* GL_KHR_texture_compression_astc_ldr */ + +/* --------------- GL_KHR_texture_compression_astc_sliced_3d --------------- */ + +#ifndef GL_KHR_texture_compression_astc_sliced_3d +#define GL_KHR_texture_compression_astc_sliced_3d 1 + +#define GLEW_KHR_texture_compression_astc_sliced_3d GLEW_GET_VAR(__GLEW_KHR_texture_compression_astc_sliced_3d) + +#endif /* GL_KHR_texture_compression_astc_sliced_3d */ + +/* -------------------------- GL_KTX_buffer_region ------------------------- */ + +#ifndef GL_KTX_buffer_region +#define GL_KTX_buffer_region 1 + +#define GL_KTX_FRONT_REGION 0x0 +#define GL_KTX_BACK_REGION 0x1 +#define GL_KTX_Z_REGION 0x2 +#define GL_KTX_STENCIL_REGION 0x3 + +typedef GLuint (GLAPIENTRY * PFNGLBUFFERREGIONENABLEDPROC) (void); +typedef void (GLAPIENTRY * PFNGLDELETEBUFFERREGIONPROC) (GLenum region); +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERREGIONPROC) (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height, GLint xDest, GLint yDest); +typedef GLuint (GLAPIENTRY * PFNGLNEWBUFFERREGIONPROC) (GLenum region); +typedef void (GLAPIENTRY * PFNGLREADBUFFERREGIONPROC) (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height); + +#define glBufferRegionEnabled GLEW_GET_FUN(__glewBufferRegionEnabled) +#define glDeleteBufferRegion GLEW_GET_FUN(__glewDeleteBufferRegion) +#define glDrawBufferRegion GLEW_GET_FUN(__glewDrawBufferRegion) +#define glNewBufferRegion GLEW_GET_FUN(__glewNewBufferRegion) +#define glReadBufferRegion GLEW_GET_FUN(__glewReadBufferRegion) + +#define GLEW_KTX_buffer_region GLEW_GET_VAR(__GLEW_KTX_buffer_region) + +#endif /* GL_KTX_buffer_region */ + +/* ------------------------- GL_MESAX_texture_stack ------------------------ */ + +#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 + +#define GLEW_MESAX_texture_stack GLEW_GET_VAR(__GLEW_MESAX_texture_stack) + +#endif /* GL_MESAX_texture_stack */ + +/* -------------------------- GL_MESA_pack_invert -------------------------- */ + +#ifndef GL_MESA_pack_invert +#define GL_MESA_pack_invert 1 + +#define GL_PACK_INVERT_MESA 0x8758 + +#define GLEW_MESA_pack_invert GLEW_GET_VAR(__GLEW_MESA_pack_invert) + +#endif /* GL_MESA_pack_invert */ + +/* ------------------------- GL_MESA_resize_buffers ------------------------ */ + +#ifndef GL_MESA_resize_buffers +#define GL_MESA_resize_buffers 1 + +typedef void (GLAPIENTRY * PFNGLRESIZEBUFFERSMESAPROC) (void); + +#define glResizeBuffersMESA GLEW_GET_FUN(__glewResizeBuffersMESA) + +#define GLEW_MESA_resize_buffers GLEW_GET_VAR(__GLEW_MESA_resize_buffers) + +#endif /* GL_MESA_resize_buffers */ + +/* -------------------- GL_MESA_shader_integer_functions ------------------- */ + +#ifndef GL_MESA_shader_integer_functions +#define GL_MESA_shader_integer_functions 1 + +#define GLEW_MESA_shader_integer_functions GLEW_GET_VAR(__GLEW_MESA_shader_integer_functions) + +#endif /* GL_MESA_shader_integer_functions */ + +/* --------------------------- GL_MESA_window_pos -------------------------- */ + +#ifndef GL_MESA_window_pos +#define GL_MESA_window_pos 1 + +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IVMESAPROC) (const GLint* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SVMESAPROC) (const GLshort* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IVMESAPROC) (const GLint* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVMESAPROC) (const GLshort* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4IVMESAPROC) (const GLint* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4SVMESAPROC) (const GLshort* p); + +#define glWindowPos2dMESA GLEW_GET_FUN(__glewWindowPos2dMESA) +#define glWindowPos2dvMESA GLEW_GET_FUN(__glewWindowPos2dvMESA) +#define glWindowPos2fMESA GLEW_GET_FUN(__glewWindowPos2fMESA) +#define glWindowPos2fvMESA GLEW_GET_FUN(__glewWindowPos2fvMESA) +#define glWindowPos2iMESA GLEW_GET_FUN(__glewWindowPos2iMESA) +#define glWindowPos2ivMESA GLEW_GET_FUN(__glewWindowPos2ivMESA) +#define glWindowPos2sMESA GLEW_GET_FUN(__glewWindowPos2sMESA) +#define glWindowPos2svMESA GLEW_GET_FUN(__glewWindowPos2svMESA) +#define glWindowPos3dMESA GLEW_GET_FUN(__glewWindowPos3dMESA) +#define glWindowPos3dvMESA GLEW_GET_FUN(__glewWindowPos3dvMESA) +#define glWindowPos3fMESA GLEW_GET_FUN(__glewWindowPos3fMESA) +#define glWindowPos3fvMESA GLEW_GET_FUN(__glewWindowPos3fvMESA) +#define glWindowPos3iMESA GLEW_GET_FUN(__glewWindowPos3iMESA) +#define glWindowPos3ivMESA GLEW_GET_FUN(__glewWindowPos3ivMESA) +#define glWindowPos3sMESA GLEW_GET_FUN(__glewWindowPos3sMESA) +#define glWindowPos3svMESA GLEW_GET_FUN(__glewWindowPos3svMESA) +#define glWindowPos4dMESA GLEW_GET_FUN(__glewWindowPos4dMESA) +#define glWindowPos4dvMESA GLEW_GET_FUN(__glewWindowPos4dvMESA) +#define glWindowPos4fMESA GLEW_GET_FUN(__glewWindowPos4fMESA) +#define glWindowPos4fvMESA GLEW_GET_FUN(__glewWindowPos4fvMESA) +#define glWindowPos4iMESA GLEW_GET_FUN(__glewWindowPos4iMESA) +#define glWindowPos4ivMESA GLEW_GET_FUN(__glewWindowPos4ivMESA) +#define glWindowPos4sMESA GLEW_GET_FUN(__glewWindowPos4sMESA) +#define glWindowPos4svMESA GLEW_GET_FUN(__glewWindowPos4svMESA) + +#define GLEW_MESA_window_pos GLEW_GET_VAR(__GLEW_MESA_window_pos) + +#endif /* GL_MESA_window_pos */ + +/* ------------------------- GL_MESA_ycbcr_texture ------------------------- */ + +#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 + +#define GLEW_MESA_ycbcr_texture GLEW_GET_VAR(__GLEW_MESA_ycbcr_texture) + +#endif /* GL_MESA_ycbcr_texture */ + +/* ----------- GL_NVX_blend_equation_advanced_multi_draw_buffers ----------- */ + +#ifndef GL_NVX_blend_equation_advanced_multi_draw_buffers +#define GL_NVX_blend_equation_advanced_multi_draw_buffers 1 + +#define GLEW_NVX_blend_equation_advanced_multi_draw_buffers GLEW_GET_VAR(__GLEW_NVX_blend_equation_advanced_multi_draw_buffers) + +#endif /* GL_NVX_blend_equation_advanced_multi_draw_buffers */ + +/* ----------------------- GL_NVX_conditional_render ----------------------- */ + +#ifndef GL_NVX_conditional_render +#define GL_NVX_conditional_render 1 + +typedef void (GLAPIENTRY * PFNGLBEGINCONDITIONALRENDERNVXPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLENDCONDITIONALRENDERNVXPROC) (void); + +#define glBeginConditionalRenderNVX GLEW_GET_FUN(__glewBeginConditionalRenderNVX) +#define glEndConditionalRenderNVX GLEW_GET_FUN(__glewEndConditionalRenderNVX) + +#define GLEW_NVX_conditional_render GLEW_GET_VAR(__GLEW_NVX_conditional_render) + +#endif /* GL_NVX_conditional_render */ + +/* ------------------------- GL_NVX_gpu_memory_info ------------------------ */ + +#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 + +#define GLEW_NVX_gpu_memory_info GLEW_GET_VAR(__GLEW_NVX_gpu_memory_info) + +#endif /* GL_NVX_gpu_memory_info */ + +/* ---------------------- GL_NVX_linked_gpu_multicast ---------------------- */ + +#ifndef GL_NVX_linked_gpu_multicast +#define GL_NVX_linked_gpu_multicast 1 + +#define GL_LGPU_SEPARATE_STORAGE_BIT_NVX 0x0800 +#define GL_MAX_LGPU_GPUS_NVX 0x92BA + +typedef void (GLAPIENTRY * PFNGLLGPUCOPYIMAGESUBDATANVXPROC) (GLuint sourceGpu, GLbitfield destinationGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srxY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); +typedef void (GLAPIENTRY * PFNGLLGPUINTERLOCKNVXPROC) (void); +typedef void (GLAPIENTRY * PFNGLLGPUNAMEDBUFFERSUBDATANVXPROC) (GLbitfield gpuMask, GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); + +#define glLGPUCopyImageSubDataNVX GLEW_GET_FUN(__glewLGPUCopyImageSubDataNVX) +#define glLGPUInterlockNVX GLEW_GET_FUN(__glewLGPUInterlockNVX) +#define glLGPUNamedBufferSubDataNVX GLEW_GET_FUN(__glewLGPUNamedBufferSubDataNVX) + +#define GLEW_NVX_linked_gpu_multicast GLEW_GET_VAR(__GLEW_NVX_linked_gpu_multicast) + +#endif /* GL_NVX_linked_gpu_multicast */ + +/* ------------------------ GL_NV_3dvision_settings ------------------------ */ + +#ifndef GL_NV_3dvision_settings +#define GL_NV_3dvision_settings 1 + +#define GL_3DVISION_STEREO_NV 0x90F4 +#define GL_STEREO_SEPARATION_NV 0x90F5 +#define GL_STEREO_CONVERGENCE_NV 0x90F6 +#define GL_STEREO_CUTOFF_NV 0x90F7 +#define GL_STEREO_PROJECTION_NV 0x90F8 +#define GL_STEREO_PROJECTION_PERSPECTIVE_NV 0x90F9 +#define GL_STEREO_PROJECTION_ORTHO_NV 0x90FA + +typedef void (GLAPIENTRY * PFNGLSTEREOPARAMETERFNVPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLSTEREOPARAMETERINVPROC) (GLenum pname, GLint param); + +#define glStereoParameterfNV GLEW_GET_FUN(__glewStereoParameterfNV) +#define glStereoParameteriNV GLEW_GET_FUN(__glewStereoParameteriNV) + +#define GLEW_NV_3dvision_settings GLEW_GET_VAR(__GLEW_NV_3dvision_settings) + +#endif /* GL_NV_3dvision_settings */ + +/* ------------------- GL_NV_EGL_stream_consumer_external ------------------ */ + +#ifndef GL_NV_EGL_stream_consumer_external +#define GL_NV_EGL_stream_consumer_external 1 + +#define GL_TEXTURE_EXTERNAL_OES 0x8D65 +#define GL_SAMPLER_EXTERNAL_OES 0x8D66 +#define GL_TEXTURE_BINDING_EXTERNAL_OES 0x8D67 +#define GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES 0x8D68 + +#define GLEW_NV_EGL_stream_consumer_external GLEW_GET_VAR(__GLEW_NV_EGL_stream_consumer_external) + +#endif /* GL_NV_EGL_stream_consumer_external */ + +/* ----------------- GL_NV_alpha_to_coverage_dither_control ---------------- */ + +#ifndef GL_NV_alpha_to_coverage_dither_control +#define GL_NV_alpha_to_coverage_dither_control 1 + +#define GL_ALPHA_TO_COVERAGE_DITHER_MODE_NV 0x92BF +#define GL_ALPHA_TO_COVERAGE_DITHER_DEFAULT_NV 0x934D +#define GL_ALPHA_TO_COVERAGE_DITHER_ENABLE_NV 0x934E +#define GL_ALPHA_TO_COVERAGE_DITHER_DISABLE_NV 0x934F + +#define GLEW_NV_alpha_to_coverage_dither_control GLEW_GET_VAR(__GLEW_NV_alpha_to_coverage_dither_control) + +#endif /* GL_NV_alpha_to_coverage_dither_control */ + +/* ------------------------------- GL_NV_bgr ------------------------------- */ + +#ifndef GL_NV_bgr +#define GL_NV_bgr 1 + +#define GL_BGR_NV 0x80E0 + +#define GLEW_NV_bgr GLEW_GET_VAR(__GLEW_NV_bgr) + +#endif /* GL_NV_bgr */ + +/* ------------------- GL_NV_bindless_multi_draw_indirect ------------------ */ + +#ifndef GL_NV_bindless_multi_draw_indirect +#define GL_NV_bindless_multi_draw_indirect 1 + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC) (GLenum mode, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); + +#define glMultiDrawArraysIndirectBindlessNV GLEW_GET_FUN(__glewMultiDrawArraysIndirectBindlessNV) +#define glMultiDrawElementsIndirectBindlessNV GLEW_GET_FUN(__glewMultiDrawElementsIndirectBindlessNV) + +#define GLEW_NV_bindless_multi_draw_indirect GLEW_GET_VAR(__GLEW_NV_bindless_multi_draw_indirect) + +#endif /* GL_NV_bindless_multi_draw_indirect */ + +/* ---------------- GL_NV_bindless_multi_draw_indirect_count --------------- */ + +#ifndef GL_NV_bindless_multi_draw_indirect_count +#define GL_NV_bindless_multi_draw_indirect_count 1 + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSCOUNTNVPROC) (GLenum mode, const void *indirect, GLintptr drawCount, GLsizei maxDrawCount, GLsizei stride, GLint vertexBufferCount); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSCOUNTNVPROC) (GLenum mode, GLenum type, const void *indirect, GLintptr drawCount, GLsizei maxDrawCount, GLsizei stride, GLint vertexBufferCount); + +#define glMultiDrawArraysIndirectBindlessCountNV GLEW_GET_FUN(__glewMultiDrawArraysIndirectBindlessCountNV) +#define glMultiDrawElementsIndirectBindlessCountNV GLEW_GET_FUN(__glewMultiDrawElementsIndirectBindlessCountNV) + +#define GLEW_NV_bindless_multi_draw_indirect_count GLEW_GET_VAR(__GLEW_NV_bindless_multi_draw_indirect_count) + +#endif /* GL_NV_bindless_multi_draw_indirect_count */ + +/* ------------------------- GL_NV_bindless_texture ------------------------ */ + +#ifndef GL_NV_bindless_texture +#define GL_NV_bindless_texture 1 + +typedef GLuint64 (GLAPIENTRY * PFNGLGETIMAGEHANDLENVPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); +typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTUREHANDLENVPROC) (GLuint texture); +typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTURESAMPLERHANDLENVPROC) (GLuint texture, GLuint sampler); +typedef GLboolean (GLAPIENTRY * PFNGLISIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle); +typedef GLboolean (GLAPIENTRY * PFNGLISTEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle, GLenum access); +typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC) (GLuint program, GLint location, GLuint64 value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* values); +typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64NVPROC) (GLint location, GLuint64 value); +typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64VNVPROC) (GLint location, GLsizei count, const GLuint64* value); + +#define glGetImageHandleNV GLEW_GET_FUN(__glewGetImageHandleNV) +#define glGetTextureHandleNV GLEW_GET_FUN(__glewGetTextureHandleNV) +#define glGetTextureSamplerHandleNV GLEW_GET_FUN(__glewGetTextureSamplerHandleNV) +#define glIsImageHandleResidentNV GLEW_GET_FUN(__glewIsImageHandleResidentNV) +#define glIsTextureHandleResidentNV GLEW_GET_FUN(__glewIsTextureHandleResidentNV) +#define glMakeImageHandleNonResidentNV GLEW_GET_FUN(__glewMakeImageHandleNonResidentNV) +#define glMakeImageHandleResidentNV GLEW_GET_FUN(__glewMakeImageHandleResidentNV) +#define glMakeTextureHandleNonResidentNV GLEW_GET_FUN(__glewMakeTextureHandleNonResidentNV) +#define glMakeTextureHandleResidentNV GLEW_GET_FUN(__glewMakeTextureHandleResidentNV) +#define glProgramUniformHandleui64NV GLEW_GET_FUN(__glewProgramUniformHandleui64NV) +#define glProgramUniformHandleui64vNV GLEW_GET_FUN(__glewProgramUniformHandleui64vNV) +#define glUniformHandleui64NV GLEW_GET_FUN(__glewUniformHandleui64NV) +#define glUniformHandleui64vNV GLEW_GET_FUN(__glewUniformHandleui64vNV) + +#define GLEW_NV_bindless_texture GLEW_GET_VAR(__GLEW_NV_bindless_texture) + +#endif /* GL_NV_bindless_texture */ + +/* --------------------- GL_NV_blend_equation_advanced --------------------- */ + +#ifndef GL_NV_blend_equation_advanced +#define GL_NV_blend_equation_advanced 1 + +#define GL_XOR_NV 0x1506 +#define GL_RED_NV 0x1903 +#define GL_GREEN_NV 0x1904 +#define GL_BLUE_NV 0x1905 +#define GL_BLEND_PREMULTIPLIED_SRC_NV 0x9280 +#define GL_BLEND_OVERLAP_NV 0x9281 +#define GL_UNCORRELATED_NV 0x9282 +#define GL_DISJOINT_NV 0x9283 +#define GL_CONJOINT_NV 0x9284 +#define GL_BLEND_ADVANCED_COHERENT_NV 0x9285 +#define GL_SRC_NV 0x9286 +#define GL_DST_NV 0x9287 +#define GL_SRC_OVER_NV 0x9288 +#define GL_DST_OVER_NV 0x9289 +#define GL_SRC_IN_NV 0x928A +#define GL_DST_IN_NV 0x928B +#define GL_SRC_OUT_NV 0x928C +#define GL_DST_OUT_NV 0x928D +#define GL_SRC_ATOP_NV 0x928E +#define GL_DST_ATOP_NV 0x928F +#define GL_PLUS_NV 0x9291 +#define GL_PLUS_DARKER_NV 0x9292 +#define GL_MULTIPLY_NV 0x9294 +#define GL_SCREEN_NV 0x9295 +#define GL_OVERLAY_NV 0x9296 +#define GL_DARKEN_NV 0x9297 +#define GL_LIGHTEN_NV 0x9298 +#define GL_COLORDODGE_NV 0x9299 +#define GL_COLORBURN_NV 0x929A +#define GL_HARDLIGHT_NV 0x929B +#define GL_SOFTLIGHT_NV 0x929C +#define GL_DIFFERENCE_NV 0x929E +#define GL_MINUS_NV 0x929F +#define GL_EXCLUSION_NV 0x92A0 +#define GL_CONTRAST_NV 0x92A1 +#define GL_INVERT_RGB_NV 0x92A3 +#define GL_LINEARDODGE_NV 0x92A4 +#define GL_LINEARBURN_NV 0x92A5 +#define GL_VIVIDLIGHT_NV 0x92A6 +#define GL_LINEARLIGHT_NV 0x92A7 +#define GL_PINLIGHT_NV 0x92A8 +#define GL_HARDMIX_NV 0x92A9 +#define GL_HSL_HUE_NV 0x92AD +#define GL_HSL_SATURATION_NV 0x92AE +#define GL_HSL_COLOR_NV 0x92AF +#define GL_HSL_LUMINOSITY_NV 0x92B0 +#define GL_PLUS_CLAMPED_NV 0x92B1 +#define GL_PLUS_CLAMPED_ALPHA_NV 0x92B2 +#define GL_MINUS_CLAMPED_NV 0x92B3 +#define GL_INVERT_OVG_NV 0x92B4 + +typedef void (GLAPIENTRY * PFNGLBLENDBARRIERNVPROC) (void); +typedef void (GLAPIENTRY * PFNGLBLENDPARAMETERINVPROC) (GLenum pname, GLint value); + +#define glBlendBarrierNV GLEW_GET_FUN(__glewBlendBarrierNV) +#define glBlendParameteriNV GLEW_GET_FUN(__glewBlendParameteriNV) + +#define GLEW_NV_blend_equation_advanced GLEW_GET_VAR(__GLEW_NV_blend_equation_advanced) + +#endif /* GL_NV_blend_equation_advanced */ + +/* ----------------- GL_NV_blend_equation_advanced_coherent ---------------- */ + +#ifndef GL_NV_blend_equation_advanced_coherent +#define GL_NV_blend_equation_advanced_coherent 1 + +#define GLEW_NV_blend_equation_advanced_coherent GLEW_GET_VAR(__GLEW_NV_blend_equation_advanced_coherent) + +#endif /* GL_NV_blend_equation_advanced_coherent */ + +/* ----------------------- GL_NV_blend_minmax_factor ----------------------- */ + +#ifndef GL_NV_blend_minmax_factor +#define GL_NV_blend_minmax_factor 1 + +#define GL_FACTOR_MIN_AMD 0x901C +#define GL_FACTOR_MAX_AMD 0x901D + +#define GLEW_NV_blend_minmax_factor GLEW_GET_VAR(__GLEW_NV_blend_minmax_factor) + +#endif /* GL_NV_blend_minmax_factor */ + +/* --------------------------- GL_NV_blend_square -------------------------- */ + +#ifndef GL_NV_blend_square +#define GL_NV_blend_square 1 + +#define GLEW_NV_blend_square GLEW_GET_VAR(__GLEW_NV_blend_square) + +#endif /* GL_NV_blend_square */ + +/* ----------------------- GL_NV_clip_space_w_scaling ---------------------- */ + +#ifndef GL_NV_clip_space_w_scaling +#define GL_NV_clip_space_w_scaling 1 + +#define GL_VIEWPORT_POSITION_W_SCALE_NV 0x937C +#define GL_VIEWPORT_POSITION_W_SCALE_X_COEFF_NV 0x937D +#define GL_VIEWPORT_POSITION_W_SCALE_Y_COEFF_NV 0x937E + +typedef void (GLAPIENTRY * PFNGLVIEWPORTPOSITIONWSCALENVPROC) (GLuint index, GLfloat xcoeff, GLfloat ycoeff); + +#define glViewportPositionWScaleNV GLEW_GET_FUN(__glewViewportPositionWScaleNV) + +#define GLEW_NV_clip_space_w_scaling GLEW_GET_VAR(__GLEW_NV_clip_space_w_scaling) + +#endif /* GL_NV_clip_space_w_scaling */ + +/* --------------------------- GL_NV_command_list -------------------------- */ + +#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 (GLAPIENTRY * PFNGLCALLCOMMANDLISTNVPROC) (GLuint list); +typedef void (GLAPIENTRY * PFNGLCOMMANDLISTSEGMENTSNVPROC) (GLuint list, GLuint segments); +typedef void (GLAPIENTRY * PFNGLCOMPILECOMMANDLISTNVPROC) (GLuint list); +typedef void (GLAPIENTRY * PFNGLCREATECOMMANDLISTSNVPROC) (GLsizei n, GLuint* lists); +typedef void (GLAPIENTRY * PFNGLCREATESTATESNVPROC) (GLsizei n, GLuint* states); +typedef void (GLAPIENTRY * PFNGLDELETECOMMANDLISTSNVPROC) (GLsizei n, const GLuint* lists); +typedef void (GLAPIENTRY * PFNGLDELETESTATESNVPROC) (GLsizei n, const GLuint* states); +typedef void (GLAPIENTRY * PFNGLDRAWCOMMANDSADDRESSNVPROC) (GLenum primitiveMode, const GLuint64* indirects, const GLsizei* sizes, GLuint count); +typedef void (GLAPIENTRY * PFNGLDRAWCOMMANDSNVPROC) (GLenum primitiveMode, GLuint buffer, const GLintptr* indirects, const GLsizei* sizes, GLuint count); +typedef void (GLAPIENTRY * PFNGLDRAWCOMMANDSSTATESADDRESSNVPROC) (const GLuint64* indirects, const GLsizei* sizes, const GLuint* states, const GLuint* fbos, GLuint count); +typedef void (GLAPIENTRY * PFNGLDRAWCOMMANDSSTATESNVPROC) (GLuint buffer, const GLintptr* indirects, const GLsizei* sizes, const GLuint* states, const GLuint* fbos, GLuint count); +typedef GLuint (GLAPIENTRY * PFNGLGETCOMMANDHEADERNVPROC) (GLenum tokenID, GLuint size); +typedef GLushort (GLAPIENTRY * PFNGLGETSTAGEINDEXNVPROC) (GLenum shadertype); +typedef GLboolean (GLAPIENTRY * PFNGLISCOMMANDLISTNVPROC) (GLuint list); +typedef GLboolean (GLAPIENTRY * PFNGLISSTATENVPROC) (GLuint state); +typedef void (GLAPIENTRY * PFNGLLISTDRAWCOMMANDSSTATESCLIENTNVPROC) (GLuint list, GLuint segment, const void** indirects, const GLsizei* sizes, const GLuint* states, const GLuint* fbos, GLuint count); +typedef void (GLAPIENTRY * PFNGLSTATECAPTURENVPROC) (GLuint state, GLenum mode); + +#define glCallCommandListNV GLEW_GET_FUN(__glewCallCommandListNV) +#define glCommandListSegmentsNV GLEW_GET_FUN(__glewCommandListSegmentsNV) +#define glCompileCommandListNV GLEW_GET_FUN(__glewCompileCommandListNV) +#define glCreateCommandListsNV GLEW_GET_FUN(__glewCreateCommandListsNV) +#define glCreateStatesNV GLEW_GET_FUN(__glewCreateStatesNV) +#define glDeleteCommandListsNV GLEW_GET_FUN(__glewDeleteCommandListsNV) +#define glDeleteStatesNV GLEW_GET_FUN(__glewDeleteStatesNV) +#define glDrawCommandsAddressNV GLEW_GET_FUN(__glewDrawCommandsAddressNV) +#define glDrawCommandsNV GLEW_GET_FUN(__glewDrawCommandsNV) +#define glDrawCommandsStatesAddressNV GLEW_GET_FUN(__glewDrawCommandsStatesAddressNV) +#define glDrawCommandsStatesNV GLEW_GET_FUN(__glewDrawCommandsStatesNV) +#define glGetCommandHeaderNV GLEW_GET_FUN(__glewGetCommandHeaderNV) +#define glGetStageIndexNV GLEW_GET_FUN(__glewGetStageIndexNV) +#define glIsCommandListNV GLEW_GET_FUN(__glewIsCommandListNV) +#define glIsStateNV GLEW_GET_FUN(__glewIsStateNV) +#define glListDrawCommandsStatesClientNV GLEW_GET_FUN(__glewListDrawCommandsStatesClientNV) +#define glStateCaptureNV GLEW_GET_FUN(__glewStateCaptureNV) + +#define GLEW_NV_command_list GLEW_GET_VAR(__GLEW_NV_command_list) + +#endif /* GL_NV_command_list */ + +/* ------------------------- GL_NV_compute_program5 ------------------------ */ + +#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 + +#define GLEW_NV_compute_program5 GLEW_GET_VAR(__GLEW_NV_compute_program5) + +#endif /* GL_NV_compute_program5 */ + +/* ------------------------ GL_NV_conditional_render ----------------------- */ + +#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 (GLAPIENTRY * PFNGLBEGINCONDITIONALRENDERNVPROC) (GLuint id, GLenum mode); +typedef void (GLAPIENTRY * PFNGLENDCONDITIONALRENDERNVPROC) (void); + +#define glBeginConditionalRenderNV GLEW_GET_FUN(__glewBeginConditionalRenderNV) +#define glEndConditionalRenderNV GLEW_GET_FUN(__glewEndConditionalRenderNV) + +#define GLEW_NV_conditional_render GLEW_GET_VAR(__GLEW_NV_conditional_render) + +#endif /* GL_NV_conditional_render */ + +/* ----------------------- GL_NV_conservative_raster ----------------------- */ + +#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 (GLAPIENTRY * PFNGLSUBPIXELPRECISIONBIASNVPROC) (GLuint xbits, GLuint ybits); + +#define glSubpixelPrecisionBiasNV GLEW_GET_FUN(__glewSubpixelPrecisionBiasNV) + +#define GLEW_NV_conservative_raster GLEW_GET_VAR(__GLEW_NV_conservative_raster) + +#endif /* GL_NV_conservative_raster */ + +/* -------------------- GL_NV_conservative_raster_dilate ------------------- */ + +#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 (GLAPIENTRY * PFNGLCONSERVATIVERASTERPARAMETERFNVPROC) (GLenum pname, GLfloat value); + +#define glConservativeRasterParameterfNV GLEW_GET_FUN(__glewConservativeRasterParameterfNV) + +#define GLEW_NV_conservative_raster_dilate GLEW_GET_VAR(__GLEW_NV_conservative_raster_dilate) + +#endif /* GL_NV_conservative_raster_dilate */ + +/* -------------- GL_NV_conservative_raster_pre_snap_triangles ------------- */ + +#ifndef GL_NV_conservative_raster_pre_snap_triangles +#define GL_NV_conservative_raster_pre_snap_triangles 1 + +#define GL_CONSERVATIVE_RASTER_MODE_NV 0x954D +#define GL_CONSERVATIVE_RASTER_MODE_POST_SNAP_NV 0x954E +#define GL_CONSERVATIVE_RASTER_MODE_PRE_SNAP_TRIANGLES_NV 0x954F + +typedef void (GLAPIENTRY * PFNGLCONSERVATIVERASTERPARAMETERINVPROC) (GLenum pname, GLint param); + +#define glConservativeRasterParameteriNV GLEW_GET_FUN(__glewConservativeRasterParameteriNV) + +#define GLEW_NV_conservative_raster_pre_snap_triangles GLEW_GET_VAR(__GLEW_NV_conservative_raster_pre_snap_triangles) + +#endif /* GL_NV_conservative_raster_pre_snap_triangles */ + +/* --------------------------- GL_NV_copy_buffer --------------------------- */ + +#ifndef GL_NV_copy_buffer +#define GL_NV_copy_buffer 1 + +#define GL_COPY_READ_BUFFER_NV 0x8F36 +#define GL_COPY_WRITE_BUFFER_NV 0x8F37 + +typedef void (GLAPIENTRY * PFNGLCOPYBUFFERSUBDATANVPROC) (GLenum readtarget, GLenum writetarget, GLintptr readoffset, GLintptr writeoffset, GLsizeiptr size); + +#define glCopyBufferSubDataNV GLEW_GET_FUN(__glewCopyBufferSubDataNV) + +#define GLEW_NV_copy_buffer GLEW_GET_VAR(__GLEW_NV_copy_buffer) + +#endif /* GL_NV_copy_buffer */ + +/* ----------------------- GL_NV_copy_depth_to_color ----------------------- */ + +#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 + +#define GLEW_NV_copy_depth_to_color GLEW_GET_VAR(__GLEW_NV_copy_depth_to_color) + +#endif /* GL_NV_copy_depth_to_color */ + +/* ---------------------------- GL_NV_copy_image --------------------------- */ + +#ifndef GL_NV_copy_image +#define GL_NV_copy_image 1 + +typedef void (GLAPIENTRY * 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); + +#define glCopyImageSubDataNV GLEW_GET_FUN(__glewCopyImageSubDataNV) + +#define GLEW_NV_copy_image GLEW_GET_VAR(__GLEW_NV_copy_image) + +#endif /* GL_NV_copy_image */ + +/* -------------------------- GL_NV_deep_texture3D ------------------------- */ + +#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 + +#define GLEW_NV_deep_texture3D GLEW_GET_VAR(__GLEW_NV_deep_texture3D) + +#endif /* GL_NV_deep_texture3D */ + +/* ------------------------ GL_NV_depth_buffer_float ----------------------- */ + +#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 (GLAPIENTRY * PFNGLCLEARDEPTHDNVPROC) (GLdouble depth); +typedef void (GLAPIENTRY * PFNGLDEPTHBOUNDSDNVPROC) (GLdouble zmin, GLdouble zmax); +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFar); + +#define glClearDepthdNV GLEW_GET_FUN(__glewClearDepthdNV) +#define glDepthBoundsdNV GLEW_GET_FUN(__glewDepthBoundsdNV) +#define glDepthRangedNV GLEW_GET_FUN(__glewDepthRangedNV) + +#define GLEW_NV_depth_buffer_float GLEW_GET_VAR(__GLEW_NV_depth_buffer_float) + +#endif /* GL_NV_depth_buffer_float */ + +/* --------------------------- GL_NV_depth_clamp --------------------------- */ + +#ifndef GL_NV_depth_clamp +#define GL_NV_depth_clamp 1 + +#define GL_DEPTH_CLAMP_NV 0x864F + +#define GLEW_NV_depth_clamp GLEW_GET_VAR(__GLEW_NV_depth_clamp) + +#endif /* GL_NV_depth_clamp */ + +/* ---------------------- GL_NV_depth_range_unclamped ---------------------- */ + +#ifndef GL_NV_depth_range_unclamped +#define GL_NV_depth_range_unclamped 1 + +#define GL_SAMPLE_COUNT_BITS_NV 0x8864 +#define GL_CURRENT_SAMPLE_COUNT_QUERY_NV 0x8865 +#define GL_QUERY_RESULT_NV 0x8866 +#define GL_QUERY_RESULT_AVAILABLE_NV 0x8867 +#define GL_SAMPLE_COUNT_NV 0x8914 + +#define GLEW_NV_depth_range_unclamped GLEW_GET_VAR(__GLEW_NV_depth_range_unclamped) + +#endif /* GL_NV_depth_range_unclamped */ + +/* --------------------------- GL_NV_draw_buffers -------------------------- */ + +#ifndef GL_NV_draw_buffers +#define GL_NV_draw_buffers 1 + +#define GL_MAX_DRAW_BUFFERS_NV 0x8824 +#define GL_DRAW_BUFFER0_NV 0x8825 +#define GL_DRAW_BUFFER1_NV 0x8826 +#define GL_DRAW_BUFFER2_NV 0x8827 +#define GL_DRAW_BUFFER3_NV 0x8828 +#define GL_DRAW_BUFFER4_NV 0x8829 +#define GL_DRAW_BUFFER5_NV 0x882A +#define GL_DRAW_BUFFER6_NV 0x882B +#define GL_DRAW_BUFFER7_NV 0x882C +#define GL_DRAW_BUFFER8_NV 0x882D +#define GL_DRAW_BUFFER9_NV 0x882E +#define GL_DRAW_BUFFER10_NV 0x882F +#define GL_DRAW_BUFFER11_NV 0x8830 +#define GL_DRAW_BUFFER12_NV 0x8831 +#define GL_DRAW_BUFFER13_NV 0x8832 +#define GL_DRAW_BUFFER14_NV 0x8833 +#define GL_DRAW_BUFFER15_NV 0x8834 +#define GL_COLOR_ATTACHMENT0_NV 0x8CE0 +#define GL_COLOR_ATTACHMENT1_NV 0x8CE1 +#define GL_COLOR_ATTACHMENT2_NV 0x8CE2 +#define GL_COLOR_ATTACHMENT3_NV 0x8CE3 +#define GL_COLOR_ATTACHMENT4_NV 0x8CE4 +#define GL_COLOR_ATTACHMENT5_NV 0x8CE5 +#define GL_COLOR_ATTACHMENT6_NV 0x8CE6 +#define GL_COLOR_ATTACHMENT7_NV 0x8CE7 +#define GL_COLOR_ATTACHMENT8_NV 0x8CE8 +#define GL_COLOR_ATTACHMENT9_NV 0x8CE9 +#define GL_COLOR_ATTACHMENT10_NV 0x8CEA +#define GL_COLOR_ATTACHMENT11_NV 0x8CEB +#define GL_COLOR_ATTACHMENT12_NV 0x8CEC +#define GL_COLOR_ATTACHMENT13_NV 0x8CED +#define GL_COLOR_ATTACHMENT14_NV 0x8CEE +#define GL_COLOR_ATTACHMENT15_NV 0x8CEF + +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSNVPROC) (GLsizei n, const GLenum* bufs); + +#define glDrawBuffersNV GLEW_GET_FUN(__glewDrawBuffersNV) + +#define GLEW_NV_draw_buffers GLEW_GET_VAR(__GLEW_NV_draw_buffers) + +#endif /* GL_NV_draw_buffers */ + +/* -------------------------- GL_NV_draw_instanced ------------------------- */ + +#ifndef GL_NV_draw_instanced +#define GL_NV_draw_instanced 1 + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDNVPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDNVPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); + +#define glDrawArraysInstancedNV GLEW_GET_FUN(__glewDrawArraysInstancedNV) +#define glDrawElementsInstancedNV GLEW_GET_FUN(__glewDrawElementsInstancedNV) + +#define GLEW_NV_draw_instanced GLEW_GET_VAR(__GLEW_NV_draw_instanced) + +#endif /* GL_NV_draw_instanced */ + +/* --------------------------- GL_NV_draw_texture -------------------------- */ + +#ifndef GL_NV_draw_texture +#define GL_NV_draw_texture 1 + +typedef void (GLAPIENTRY * PFNGLDRAWTEXTURENVPROC) (GLuint texture, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1); + +#define glDrawTextureNV GLEW_GET_FUN(__glewDrawTextureNV) + +#define GLEW_NV_draw_texture GLEW_GET_VAR(__GLEW_NV_draw_texture) + +#endif /* GL_NV_draw_texture */ + +/* ------------------------ GL_NV_draw_vulkan_image ------------------------ */ + +#ifndef GL_NV_draw_vulkan_image +#define GL_NV_draw_vulkan_image 1 + +typedef void (APIENTRY *GLVULKANPROCNV)(void); + +typedef void (GLAPIENTRY * PFNGLDRAWVKIMAGENVPROC) (GLuint64 vkImage, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1); +typedef GLVULKANPROCNV (GLAPIENTRY * PFNGLGETVKPROCADDRNVPROC) (const GLchar* name); +typedef void (GLAPIENTRY * PFNGLSIGNALVKFENCENVPROC) (GLuint64 vkFence); +typedef void (GLAPIENTRY * PFNGLSIGNALVKSEMAPHORENVPROC) (GLuint64 vkSemaphore); +typedef void (GLAPIENTRY * PFNGLWAITVKSEMAPHORENVPROC) (GLuint64 vkSemaphore); + +#define glDrawVkImageNV GLEW_GET_FUN(__glewDrawVkImageNV) +#define glGetVkProcAddrNV GLEW_GET_FUN(__glewGetVkProcAddrNV) +#define glSignalVkFenceNV GLEW_GET_FUN(__glewSignalVkFenceNV) +#define glSignalVkSemaphoreNV GLEW_GET_FUN(__glewSignalVkSemaphoreNV) +#define glWaitVkSemaphoreNV GLEW_GET_FUN(__glewWaitVkSemaphoreNV) + +#define GLEW_NV_draw_vulkan_image GLEW_GET_VAR(__GLEW_NV_draw_vulkan_image) + +#endif /* GL_NV_draw_vulkan_image */ + +/* ---------------------------- GL_NV_evaluators --------------------------- */ + +#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 (GLAPIENTRY * PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode); +typedef void (GLAPIENTRY * PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, void *points); +typedef void (GLAPIENTRY * PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const void *points); +typedef void (GLAPIENTRY * PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint* params); + +#define glEvalMapsNV GLEW_GET_FUN(__glewEvalMapsNV) +#define glGetMapAttribParameterfvNV GLEW_GET_FUN(__glewGetMapAttribParameterfvNV) +#define glGetMapAttribParameterivNV GLEW_GET_FUN(__glewGetMapAttribParameterivNV) +#define glGetMapControlPointsNV GLEW_GET_FUN(__glewGetMapControlPointsNV) +#define glGetMapParameterfvNV GLEW_GET_FUN(__glewGetMapParameterfvNV) +#define glGetMapParameterivNV GLEW_GET_FUN(__glewGetMapParameterivNV) +#define glMapControlPointsNV GLEW_GET_FUN(__glewMapControlPointsNV) +#define glMapParameterfvNV GLEW_GET_FUN(__glewMapParameterfvNV) +#define glMapParameterivNV GLEW_GET_FUN(__glewMapParameterivNV) + +#define GLEW_NV_evaluators GLEW_GET_VAR(__GLEW_NV_evaluators) + +#endif /* GL_NV_evaluators */ + +/* --------------------- GL_NV_explicit_attrib_location -------------------- */ + +#ifndef GL_NV_explicit_attrib_location +#define GL_NV_explicit_attrib_location 1 + +#define GLEW_NV_explicit_attrib_location GLEW_GET_VAR(__GLEW_NV_explicit_attrib_location) + +#endif /* GL_NV_explicit_attrib_location */ + +/* ----------------------- GL_NV_explicit_multisample ---------------------- */ + +#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 (GLAPIENTRY * PFNGLGETMULTISAMPLEFVNVPROC) (GLenum pname, GLuint index, GLfloat* val); +typedef void (GLAPIENTRY * PFNGLSAMPLEMASKINDEXEDNVPROC) (GLuint index, GLbitfield mask); +typedef void (GLAPIENTRY * PFNGLTEXRENDERBUFFERNVPROC) (GLenum target, GLuint renderbuffer); + +#define glGetMultisamplefvNV GLEW_GET_FUN(__glewGetMultisamplefvNV) +#define glSampleMaskIndexedNV GLEW_GET_FUN(__glewSampleMaskIndexedNV) +#define glTexRenderbufferNV GLEW_GET_FUN(__glewTexRenderbufferNV) + +#define GLEW_NV_explicit_multisample GLEW_GET_VAR(__GLEW_NV_explicit_multisample) + +#endif /* GL_NV_explicit_multisample */ + +/* ---------------------- GL_NV_fbo_color_attachments ---------------------- */ + +#ifndef GL_NV_fbo_color_attachments +#define GL_NV_fbo_color_attachments 1 + +#define GL_MAX_COLOR_ATTACHMENTS_NV 0x8CDF +#define GL_COLOR_ATTACHMENT0_NV 0x8CE0 +#define GL_COLOR_ATTACHMENT1_NV 0x8CE1 +#define GL_COLOR_ATTACHMENT2_NV 0x8CE2 +#define GL_COLOR_ATTACHMENT3_NV 0x8CE3 +#define GL_COLOR_ATTACHMENT4_NV 0x8CE4 +#define GL_COLOR_ATTACHMENT5_NV 0x8CE5 +#define GL_COLOR_ATTACHMENT6_NV 0x8CE6 +#define GL_COLOR_ATTACHMENT7_NV 0x8CE7 +#define GL_COLOR_ATTACHMENT8_NV 0x8CE8 +#define GL_COLOR_ATTACHMENT9_NV 0x8CE9 +#define GL_COLOR_ATTACHMENT10_NV 0x8CEA +#define GL_COLOR_ATTACHMENT11_NV 0x8CEB +#define GL_COLOR_ATTACHMENT12_NV 0x8CEC +#define GL_COLOR_ATTACHMENT13_NV 0x8CED +#define GL_COLOR_ATTACHMENT14_NV 0x8CEE +#define GL_COLOR_ATTACHMENT15_NV 0x8CEF + +#define GLEW_NV_fbo_color_attachments GLEW_GET_VAR(__GLEW_NV_fbo_color_attachments) + +#endif /* GL_NV_fbo_color_attachments */ + +/* ------------------------------ GL_NV_fence ------------------------------ */ + +#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 (GLAPIENTRY * PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint* fences); +typedef void (GLAPIENTRY * PFNGLFINISHFENCENVPROC) (GLuint fence); +typedef void (GLAPIENTRY * PFNGLGENFENCESNVPROC) (GLsizei n, GLuint* fences); +typedef void (GLAPIENTRY * PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISFENCENVPROC) (GLuint fence); +typedef void (GLAPIENTRY * PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); +typedef GLboolean (GLAPIENTRY * PFNGLTESTFENCENVPROC) (GLuint fence); + +#define glDeleteFencesNV GLEW_GET_FUN(__glewDeleteFencesNV) +#define glFinishFenceNV GLEW_GET_FUN(__glewFinishFenceNV) +#define glGenFencesNV GLEW_GET_FUN(__glewGenFencesNV) +#define glGetFenceivNV GLEW_GET_FUN(__glewGetFenceivNV) +#define glIsFenceNV GLEW_GET_FUN(__glewIsFenceNV) +#define glSetFenceNV GLEW_GET_FUN(__glewSetFenceNV) +#define glTestFenceNV GLEW_GET_FUN(__glewTestFenceNV) + +#define GLEW_NV_fence GLEW_GET_VAR(__GLEW_NV_fence) + +#endif /* GL_NV_fence */ + +/* -------------------------- GL_NV_fill_rectangle ------------------------- */ + +#ifndef GL_NV_fill_rectangle +#define GL_NV_fill_rectangle 1 + +#define GL_FILL_RECTANGLE_NV 0x933C + +#define GLEW_NV_fill_rectangle GLEW_GET_VAR(__GLEW_NV_fill_rectangle) + +#endif /* GL_NV_fill_rectangle */ + +/* --------------------------- GL_NV_float_buffer -------------------------- */ + +#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 +#define GL_FLOAT_RGBA_NV 0x8883 +#define GL_FLOAT_R16_NV 0x8884 +#define GL_FLOAT_R32_NV 0x8885 +#define GL_FLOAT_RG16_NV 0x8886 +#define GL_FLOAT_RG32_NV 0x8887 +#define GL_FLOAT_RGB16_NV 0x8888 +#define GL_FLOAT_RGB32_NV 0x8889 +#define GL_FLOAT_RGBA16_NV 0x888A +#define GL_FLOAT_RGBA32_NV 0x888B +#define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C +#define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D +#define GL_FLOAT_RGBA_MODE_NV 0x888E + +#define GLEW_NV_float_buffer GLEW_GET_VAR(__GLEW_NV_float_buffer) + +#endif /* GL_NV_float_buffer */ + +/* --------------------------- GL_NV_fog_distance -------------------------- */ + +#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 + +#define GLEW_NV_fog_distance GLEW_GET_VAR(__GLEW_NV_fog_distance) + +#endif /* GL_NV_fog_distance */ + +/* -------------------- GL_NV_fragment_coverage_to_color ------------------- */ + +#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 (GLAPIENTRY * PFNGLFRAGMENTCOVERAGECOLORNVPROC) (GLuint color); + +#define glFragmentCoverageColorNV GLEW_GET_FUN(__glewFragmentCoverageColorNV) + +#define GLEW_NV_fragment_coverage_to_color GLEW_GET_VAR(__GLEW_NV_fragment_coverage_to_color) + +#endif /* GL_NV_fragment_coverage_to_color */ + +/* ------------------------- GL_NV_fragment_program ------------------------ */ + +#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 (GLAPIENTRY * PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLdouble *params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, const GLdouble v[]); +typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, const GLfloat v[]); + +#define glGetProgramNamedParameterdvNV GLEW_GET_FUN(__glewGetProgramNamedParameterdvNV) +#define glGetProgramNamedParameterfvNV GLEW_GET_FUN(__glewGetProgramNamedParameterfvNV) +#define glProgramNamedParameter4dNV GLEW_GET_FUN(__glewProgramNamedParameter4dNV) +#define glProgramNamedParameter4dvNV GLEW_GET_FUN(__glewProgramNamedParameter4dvNV) +#define glProgramNamedParameter4fNV GLEW_GET_FUN(__glewProgramNamedParameter4fNV) +#define glProgramNamedParameter4fvNV GLEW_GET_FUN(__glewProgramNamedParameter4fvNV) + +#define GLEW_NV_fragment_program GLEW_GET_VAR(__GLEW_NV_fragment_program) + +#endif /* GL_NV_fragment_program */ + +/* ------------------------ GL_NV_fragment_program2 ------------------------ */ + +#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 + +#define GLEW_NV_fragment_program2 GLEW_GET_VAR(__GLEW_NV_fragment_program2) + +#endif /* GL_NV_fragment_program2 */ + +/* ------------------------ GL_NV_fragment_program4 ------------------------ */ + +#ifndef GL_NV_fragment_program4 +#define GL_NV_fragment_program4 1 + +#define GLEW_NV_fragment_program4 GLEW_GET_VAR(__GLEW_NV_fragment_program4) + +#endif /* GL_NV_fragment_program4 */ + +/* --------------------- GL_NV_fragment_program_option --------------------- */ + +#ifndef GL_NV_fragment_program_option +#define GL_NV_fragment_program_option 1 + +#define GLEW_NV_fragment_program_option GLEW_GET_VAR(__GLEW_NV_fragment_program_option) + +#endif /* GL_NV_fragment_program_option */ + +/* -------------------- GL_NV_fragment_shader_interlock -------------------- */ + +#ifndef GL_NV_fragment_shader_interlock +#define GL_NV_fragment_shader_interlock 1 + +#define GLEW_NV_fragment_shader_interlock GLEW_GET_VAR(__GLEW_NV_fragment_shader_interlock) + +#endif /* GL_NV_fragment_shader_interlock */ + +/* ------------------------- GL_NV_framebuffer_blit ------------------------ */ + +#ifndef GL_NV_framebuffer_blit +#define GL_NV_framebuffer_blit 1 + +#define GL_DRAW_FRAMEBUFFER_BINDING_NV 0x8CA6 +#define GL_READ_FRAMEBUFFER_NV 0x8CA8 +#define GL_DRAW_FRAMEBUFFER_NV 0x8CA9 +#define GL_READ_FRAMEBUFFER_BINDING_NV 0x8CAA + +typedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFERNVPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); + +#define glBlitFramebufferNV GLEW_GET_FUN(__glewBlitFramebufferNV) + +#define GLEW_NV_framebuffer_blit GLEW_GET_VAR(__GLEW_NV_framebuffer_blit) + +#endif /* GL_NV_framebuffer_blit */ + +/* -------------------- GL_NV_framebuffer_mixed_samples -------------------- */ + +#ifndef GL_NV_framebuffer_mixed_samples +#define GL_NV_framebuffer_mixed_samples 1 + +#define GL_COLOR_SAMPLES_NV 0x8E20 +#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 +#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_TABLE_NV 0x9331 +#define GL_COVERAGE_MODULATION_NV 0x9332 +#define GL_COVERAGE_MODULATION_TABLE_SIZE_NV 0x9333 + +#define GLEW_NV_framebuffer_mixed_samples GLEW_GET_VAR(__GLEW_NV_framebuffer_mixed_samples) + +#endif /* GL_NV_framebuffer_mixed_samples */ + +/* --------------------- GL_NV_framebuffer_multisample --------------------- */ + +#ifndef GL_NV_framebuffer_multisample +#define GL_NV_framebuffer_multisample 1 + +#define GL_RENDERBUFFER_SAMPLES_NV 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_NV 0x8D56 +#define GL_MAX_SAMPLES_NV 0x8D57 + +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLENVPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); + +#define glRenderbufferStorageMultisampleNV GLEW_GET_FUN(__glewRenderbufferStorageMultisampleNV) + +#define GLEW_NV_framebuffer_multisample GLEW_GET_VAR(__GLEW_NV_framebuffer_multisample) + +#endif /* GL_NV_framebuffer_multisample */ + +/* ----------------- GL_NV_framebuffer_multisample_coverage ---------------- */ + +#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 (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); + +#define glRenderbufferStorageMultisampleCoverageNV GLEW_GET_FUN(__glewRenderbufferStorageMultisampleCoverageNV) + +#define GLEW_NV_framebuffer_multisample_coverage GLEW_GET_VAR(__GLEW_NV_framebuffer_multisample_coverage) + +#endif /* GL_NV_framebuffer_multisample_coverage */ + +/* ----------------------- GL_NV_generate_mipmap_sRGB ---------------------- */ + +#ifndef GL_NV_generate_mipmap_sRGB +#define GL_NV_generate_mipmap_sRGB 1 + +#define GLEW_NV_generate_mipmap_sRGB GLEW_GET_VAR(__GLEW_NV_generate_mipmap_sRGB) + +#endif /* GL_NV_generate_mipmap_sRGB */ + +/* ------------------------ GL_NV_geometry_program4 ------------------------ */ + +#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 (GLAPIENTRY * PFNGLPROGRAMVERTEXLIMITNVPROC) (GLenum target, GLint limit); + +#define glProgramVertexLimitNV GLEW_GET_FUN(__glewProgramVertexLimitNV) + +#define GLEW_NV_geometry_program4 GLEW_GET_VAR(__GLEW_NV_geometry_program4) + +#endif /* GL_NV_geometry_program4 */ + +/* ------------------------- GL_NV_geometry_shader4 ------------------------ */ + +#ifndef GL_NV_geometry_shader4 +#define GL_NV_geometry_shader4 1 + +#define GLEW_NV_geometry_shader4 GLEW_GET_VAR(__GLEW_NV_geometry_shader4) + +#endif /* GL_NV_geometry_shader4 */ + +/* ------------------- GL_NV_geometry_shader_passthrough ------------------- */ + +#ifndef GL_NV_geometry_shader_passthrough +#define GL_NV_geometry_shader_passthrough 1 + +#define GLEW_NV_geometry_shader_passthrough GLEW_GET_VAR(__GLEW_NV_geometry_shader_passthrough) + +#endif /* GL_NV_geometry_shader_passthrough */ + +/* -------------------------- GL_NV_gpu_multicast -------------------------- */ + +#ifndef GL_NV_gpu_multicast +#define GL_NV_gpu_multicast 1 + +#define GL_PER_GPU_STORAGE_BIT_NV 0x0800 +#define GL_MULTICAST_GPUS_NV 0x92BA +#define GL_PER_GPU_STORAGE_NV 0x9548 +#define GL_MULTICAST_PROGRAMMABLE_SAMPLE_LOCATION_NV 0x9549 +#define GL_RENDER_GPU_MASK_NV 0x9558 + +typedef void (GLAPIENTRY * PFNGLMULTICASTBARRIERNVPROC) (void); +typedef void (GLAPIENTRY * PFNGLMULTICASTBLITFRAMEBUFFERNVPROC) (GLuint srcGpu, GLuint dstGpu, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +typedef void (GLAPIENTRY * PFNGLMULTICASTBUFFERSUBDATANVPROC) (GLbitfield gpuMask, GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); +typedef void (GLAPIENTRY * PFNGLMULTICASTCOPYBUFFERSUBDATANVPROC) (GLuint readGpu, GLbitfield writeGpuMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLMULTICASTCOPYIMAGESUBDATANVPROC) (GLuint srcGpu, GLbitfield dstGpuMask, 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 (GLAPIENTRY * PFNGLMULTICASTFRAMEBUFFERSAMPLELOCATIONSFVNVPROC) (GLuint gpu, GLuint framebuffer, GLuint start, GLsizei count, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLMULTICASTGETQUERYOBJECTI64VNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLint64* params); +typedef void (GLAPIENTRY * PFNGLMULTICASTGETQUERYOBJECTIVNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLMULTICASTGETQUERYOBJECTUI64VNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLuint64* params); +typedef void (GLAPIENTRY * PFNGLMULTICASTGETQUERYOBJECTUIVNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLMULTICASTWAITSYNCNVPROC) (GLuint signalGpu, GLbitfield waitGpuMask); +typedef void (GLAPIENTRY * PFNGLRENDERGPUMASKNVPROC) (GLbitfield mask); + +#define glMulticastBarrierNV GLEW_GET_FUN(__glewMulticastBarrierNV) +#define glMulticastBlitFramebufferNV GLEW_GET_FUN(__glewMulticastBlitFramebufferNV) +#define glMulticastBufferSubDataNV GLEW_GET_FUN(__glewMulticastBufferSubDataNV) +#define glMulticastCopyBufferSubDataNV GLEW_GET_FUN(__glewMulticastCopyBufferSubDataNV) +#define glMulticastCopyImageSubDataNV GLEW_GET_FUN(__glewMulticastCopyImageSubDataNV) +#define glMulticastFramebufferSampleLocationsfvNV GLEW_GET_FUN(__glewMulticastFramebufferSampleLocationsfvNV) +#define glMulticastGetQueryObjecti64vNV GLEW_GET_FUN(__glewMulticastGetQueryObjecti64vNV) +#define glMulticastGetQueryObjectivNV GLEW_GET_FUN(__glewMulticastGetQueryObjectivNV) +#define glMulticastGetQueryObjectui64vNV GLEW_GET_FUN(__glewMulticastGetQueryObjectui64vNV) +#define glMulticastGetQueryObjectuivNV GLEW_GET_FUN(__glewMulticastGetQueryObjectuivNV) +#define glMulticastWaitSyncNV GLEW_GET_FUN(__glewMulticastWaitSyncNV) +#define glRenderGpuMaskNV GLEW_GET_FUN(__glewRenderGpuMaskNV) + +#define GLEW_NV_gpu_multicast GLEW_GET_VAR(__GLEW_NV_gpu_multicast) + +#endif /* GL_NV_gpu_multicast */ + +/* --------------------------- GL_NV_gpu_program4 -------------------------- */ + +#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 +#define GL_PROGRAM_RESULT_COMPONENTS_NV 0x8907 +#define GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908 +#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 (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); + +#define glProgramEnvParameterI4iNV GLEW_GET_FUN(__glewProgramEnvParameterI4iNV) +#define glProgramEnvParameterI4ivNV GLEW_GET_FUN(__glewProgramEnvParameterI4ivNV) +#define glProgramEnvParameterI4uiNV GLEW_GET_FUN(__glewProgramEnvParameterI4uiNV) +#define glProgramEnvParameterI4uivNV GLEW_GET_FUN(__glewProgramEnvParameterI4uivNV) +#define glProgramEnvParametersI4ivNV GLEW_GET_FUN(__glewProgramEnvParametersI4ivNV) +#define glProgramEnvParametersI4uivNV GLEW_GET_FUN(__glewProgramEnvParametersI4uivNV) +#define glProgramLocalParameterI4iNV GLEW_GET_FUN(__glewProgramLocalParameterI4iNV) +#define glProgramLocalParameterI4ivNV GLEW_GET_FUN(__glewProgramLocalParameterI4ivNV) +#define glProgramLocalParameterI4uiNV GLEW_GET_FUN(__glewProgramLocalParameterI4uiNV) +#define glProgramLocalParameterI4uivNV GLEW_GET_FUN(__glewProgramLocalParameterI4uivNV) +#define glProgramLocalParametersI4ivNV GLEW_GET_FUN(__glewProgramLocalParametersI4ivNV) +#define glProgramLocalParametersI4uivNV GLEW_GET_FUN(__glewProgramLocalParametersI4uivNV) + +#define GLEW_NV_gpu_program4 GLEW_GET_VAR(__GLEW_NV_gpu_program4) + +#endif /* GL_NV_gpu_program4 */ + +/* --------------------------- GL_NV_gpu_program5 -------------------------- */ + +#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 +#define GL_FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV 0x8E5D +#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5E +#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5F + +#define GLEW_NV_gpu_program5 GLEW_GET_VAR(__GLEW_NV_gpu_program5) + +#endif /* GL_NV_gpu_program5 */ + +/* -------------------- GL_NV_gpu_program5_mem_extended -------------------- */ + +#ifndef GL_NV_gpu_program5_mem_extended +#define GL_NV_gpu_program5_mem_extended 1 + +#define GLEW_NV_gpu_program5_mem_extended GLEW_GET_VAR(__GLEW_NV_gpu_program5_mem_extended) + +#endif /* GL_NV_gpu_program5_mem_extended */ + +/* ------------------------- GL_NV_gpu_program_fp64 ------------------------ */ + +#ifndef GL_NV_gpu_program_fp64 +#define GL_NV_gpu_program_fp64 1 + +#define GLEW_NV_gpu_program_fp64 GLEW_GET_VAR(__GLEW_NV_gpu_program_fp64) + +#endif /* GL_NV_gpu_program_fp64 */ + +/* --------------------------- GL_NV_gpu_shader5 --------------------------- */ + +#ifndef GL_NV_gpu_shader5 +#define GL_NV_gpu_shader5 1 + +#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 (GLAPIENTRY * PFNGLGETUNIFORMI64VNVPROC) (GLuint program, GLint location, GLint64EXT* params); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLuint64EXT* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1I64NVPROC) (GLuint program, GLint location, GLint64EXT x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM1I64NVPROC) (GLint location, GLint64EXT x); +typedef void (GLAPIENTRY * PFNGLUNIFORM1I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UI64NVPROC) (GLint location, GLuint64EXT x); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y); +typedef void (GLAPIENTRY * PFNGLUNIFORM2I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (GLAPIENTRY * PFNGLUNIFORM3I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (GLAPIENTRY * PFNGLUNIFORM4I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); + +#define glGetUniformi64vNV GLEW_GET_FUN(__glewGetUniformi64vNV) +#define glGetUniformui64vNV GLEW_GET_FUN(__glewGetUniformui64vNV) +#define glProgramUniform1i64NV GLEW_GET_FUN(__glewProgramUniform1i64NV) +#define glProgramUniform1i64vNV GLEW_GET_FUN(__glewProgramUniform1i64vNV) +#define glProgramUniform1ui64NV GLEW_GET_FUN(__glewProgramUniform1ui64NV) +#define glProgramUniform1ui64vNV GLEW_GET_FUN(__glewProgramUniform1ui64vNV) +#define glProgramUniform2i64NV GLEW_GET_FUN(__glewProgramUniform2i64NV) +#define glProgramUniform2i64vNV GLEW_GET_FUN(__glewProgramUniform2i64vNV) +#define glProgramUniform2ui64NV GLEW_GET_FUN(__glewProgramUniform2ui64NV) +#define glProgramUniform2ui64vNV GLEW_GET_FUN(__glewProgramUniform2ui64vNV) +#define glProgramUniform3i64NV GLEW_GET_FUN(__glewProgramUniform3i64NV) +#define glProgramUniform3i64vNV GLEW_GET_FUN(__glewProgramUniform3i64vNV) +#define glProgramUniform3ui64NV GLEW_GET_FUN(__glewProgramUniform3ui64NV) +#define glProgramUniform3ui64vNV GLEW_GET_FUN(__glewProgramUniform3ui64vNV) +#define glProgramUniform4i64NV GLEW_GET_FUN(__glewProgramUniform4i64NV) +#define glProgramUniform4i64vNV GLEW_GET_FUN(__glewProgramUniform4i64vNV) +#define glProgramUniform4ui64NV GLEW_GET_FUN(__glewProgramUniform4ui64NV) +#define glProgramUniform4ui64vNV GLEW_GET_FUN(__glewProgramUniform4ui64vNV) +#define glUniform1i64NV GLEW_GET_FUN(__glewUniform1i64NV) +#define glUniform1i64vNV GLEW_GET_FUN(__glewUniform1i64vNV) +#define glUniform1ui64NV GLEW_GET_FUN(__glewUniform1ui64NV) +#define glUniform1ui64vNV GLEW_GET_FUN(__glewUniform1ui64vNV) +#define glUniform2i64NV GLEW_GET_FUN(__glewUniform2i64NV) +#define glUniform2i64vNV GLEW_GET_FUN(__glewUniform2i64vNV) +#define glUniform2ui64NV GLEW_GET_FUN(__glewUniform2ui64NV) +#define glUniform2ui64vNV GLEW_GET_FUN(__glewUniform2ui64vNV) +#define glUniform3i64NV GLEW_GET_FUN(__glewUniform3i64NV) +#define glUniform3i64vNV GLEW_GET_FUN(__glewUniform3i64vNV) +#define glUniform3ui64NV GLEW_GET_FUN(__glewUniform3ui64NV) +#define glUniform3ui64vNV GLEW_GET_FUN(__glewUniform3ui64vNV) +#define glUniform4i64NV GLEW_GET_FUN(__glewUniform4i64NV) +#define glUniform4i64vNV GLEW_GET_FUN(__glewUniform4i64vNV) +#define glUniform4ui64NV GLEW_GET_FUN(__glewUniform4ui64NV) +#define glUniform4ui64vNV GLEW_GET_FUN(__glewUniform4ui64vNV) + +#define GLEW_NV_gpu_shader5 GLEW_GET_VAR(__GLEW_NV_gpu_shader5) + +#endif /* GL_NV_gpu_shader5 */ + +/* ---------------------------- GL_NV_half_float --------------------------- */ + +#ifndef GL_NV_half_float +#define GL_NV_half_float 1 + +#define GL_HALF_FLOAT_NV 0x140B + +typedef unsigned short GLhalf; + +typedef void (GLAPIENTRY * PFNGLCOLOR3HNVPROC) (GLhalf red, GLhalf green, GLhalf blue); +typedef void (GLAPIENTRY * PFNGLCOLOR3HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLCOLOR4HNVPROC) (GLhalf red, GLhalf green, GLhalf blue, GLhalf alpha); +typedef void (GLAPIENTRY * PFNGLCOLOR4HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLFOGCOORDHNVPROC) (GLhalf fog); +typedef void (GLAPIENTRY * PFNGLFOGCOORDHVNVPROC) (const GLhalf* fog); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalf s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalf s, GLhalf t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalf s, GLhalf t, GLhalf r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalf s, GLhalf t, GLhalf r, GLhalf q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLNORMAL3HNVPROC) (GLhalf nx, GLhalf ny, GLhalf nz); +typedef void (GLAPIENTRY * PFNGLNORMAL3HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3HNVPROC) (GLhalf red, GLhalf green, GLhalf blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD1HNVPROC) (GLhalf s); +typedef void (GLAPIENTRY * PFNGLTEXCOORD1HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2HNVPROC) (GLhalf s, GLhalf t); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD3HNVPROC) (GLhalf s, GLhalf t, GLhalf r); +typedef void (GLAPIENTRY * PFNGLTEXCOORD3HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4HNVPROC) (GLhalf s, GLhalf t, GLhalf r, GLhalf q); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEX2HNVPROC) (GLhalf x, GLhalf y); +typedef void (GLAPIENTRY * PFNGLVERTEX2HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEX3HNVPROC) (GLhalf x, GLhalf y, GLhalf z); +typedef void (GLAPIENTRY * PFNGLVERTEX3HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEX4HNVPROC) (GLhalf x, GLhalf y, GLhalf z, GLhalf w); +typedef void (GLAPIENTRY * PFNGLVERTEX4HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalf x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalf x, GLhalf y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalf x, GLhalf y, GLhalf z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalf x, GLhalf y, GLhalf z, GLhalf w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTHNVPROC) (GLhalf weight); +typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalf* weight); + +#define glColor3hNV GLEW_GET_FUN(__glewColor3hNV) +#define glColor3hvNV GLEW_GET_FUN(__glewColor3hvNV) +#define glColor4hNV GLEW_GET_FUN(__glewColor4hNV) +#define glColor4hvNV GLEW_GET_FUN(__glewColor4hvNV) +#define glFogCoordhNV GLEW_GET_FUN(__glewFogCoordhNV) +#define glFogCoordhvNV GLEW_GET_FUN(__glewFogCoordhvNV) +#define glMultiTexCoord1hNV GLEW_GET_FUN(__glewMultiTexCoord1hNV) +#define glMultiTexCoord1hvNV GLEW_GET_FUN(__glewMultiTexCoord1hvNV) +#define glMultiTexCoord2hNV GLEW_GET_FUN(__glewMultiTexCoord2hNV) +#define glMultiTexCoord2hvNV GLEW_GET_FUN(__glewMultiTexCoord2hvNV) +#define glMultiTexCoord3hNV GLEW_GET_FUN(__glewMultiTexCoord3hNV) +#define glMultiTexCoord3hvNV GLEW_GET_FUN(__glewMultiTexCoord3hvNV) +#define glMultiTexCoord4hNV GLEW_GET_FUN(__glewMultiTexCoord4hNV) +#define glMultiTexCoord4hvNV GLEW_GET_FUN(__glewMultiTexCoord4hvNV) +#define glNormal3hNV GLEW_GET_FUN(__glewNormal3hNV) +#define glNormal3hvNV GLEW_GET_FUN(__glewNormal3hvNV) +#define glSecondaryColor3hNV GLEW_GET_FUN(__glewSecondaryColor3hNV) +#define glSecondaryColor3hvNV GLEW_GET_FUN(__glewSecondaryColor3hvNV) +#define glTexCoord1hNV GLEW_GET_FUN(__glewTexCoord1hNV) +#define glTexCoord1hvNV GLEW_GET_FUN(__glewTexCoord1hvNV) +#define glTexCoord2hNV GLEW_GET_FUN(__glewTexCoord2hNV) +#define glTexCoord2hvNV GLEW_GET_FUN(__glewTexCoord2hvNV) +#define glTexCoord3hNV GLEW_GET_FUN(__glewTexCoord3hNV) +#define glTexCoord3hvNV GLEW_GET_FUN(__glewTexCoord3hvNV) +#define glTexCoord4hNV GLEW_GET_FUN(__glewTexCoord4hNV) +#define glTexCoord4hvNV GLEW_GET_FUN(__glewTexCoord4hvNV) +#define glVertex2hNV GLEW_GET_FUN(__glewVertex2hNV) +#define glVertex2hvNV GLEW_GET_FUN(__glewVertex2hvNV) +#define glVertex3hNV GLEW_GET_FUN(__glewVertex3hNV) +#define glVertex3hvNV GLEW_GET_FUN(__glewVertex3hvNV) +#define glVertex4hNV GLEW_GET_FUN(__glewVertex4hNV) +#define glVertex4hvNV GLEW_GET_FUN(__glewVertex4hvNV) +#define glVertexAttrib1hNV GLEW_GET_FUN(__glewVertexAttrib1hNV) +#define glVertexAttrib1hvNV GLEW_GET_FUN(__glewVertexAttrib1hvNV) +#define glVertexAttrib2hNV GLEW_GET_FUN(__glewVertexAttrib2hNV) +#define glVertexAttrib2hvNV GLEW_GET_FUN(__glewVertexAttrib2hvNV) +#define glVertexAttrib3hNV GLEW_GET_FUN(__glewVertexAttrib3hNV) +#define glVertexAttrib3hvNV GLEW_GET_FUN(__glewVertexAttrib3hvNV) +#define glVertexAttrib4hNV GLEW_GET_FUN(__glewVertexAttrib4hNV) +#define glVertexAttrib4hvNV GLEW_GET_FUN(__glewVertexAttrib4hvNV) +#define glVertexAttribs1hvNV GLEW_GET_FUN(__glewVertexAttribs1hvNV) +#define glVertexAttribs2hvNV GLEW_GET_FUN(__glewVertexAttribs2hvNV) +#define glVertexAttribs3hvNV GLEW_GET_FUN(__glewVertexAttribs3hvNV) +#define glVertexAttribs4hvNV GLEW_GET_FUN(__glewVertexAttribs4hvNV) +#define glVertexWeighthNV GLEW_GET_FUN(__glewVertexWeighthNV) +#define glVertexWeighthvNV GLEW_GET_FUN(__glewVertexWeighthvNV) + +#define GLEW_NV_half_float GLEW_GET_VAR(__GLEW_NV_half_float) + +#endif /* GL_NV_half_float */ + +/* -------------------------- GL_NV_image_formats -------------------------- */ + +#ifndef GL_NV_image_formats +#define GL_NV_image_formats 1 + +#define GLEW_NV_image_formats GLEW_GET_VAR(__GLEW_NV_image_formats) + +#endif /* GL_NV_image_formats */ + +/* ------------------------- GL_NV_instanced_arrays ------------------------ */ + +#ifndef GL_NV_instanced_arrays +#define GL_NV_instanced_arrays 1 + +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_NV 0x88FE + +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORNVPROC) (GLuint index, GLuint divisor); + +#define glVertexAttribDivisorNV GLEW_GET_FUN(__glewVertexAttribDivisorNV) + +#define GLEW_NV_instanced_arrays GLEW_GET_VAR(__GLEW_NV_instanced_arrays) + +#endif /* GL_NV_instanced_arrays */ + +/* ------------------- GL_NV_internalformat_sample_query ------------------- */ + +#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 (GLAPIENTRY * PFNGLGETINTERNALFORMATSAMPLEIVNVPROC) (GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei bufSize, GLint* params); + +#define glGetInternalformatSampleivNV GLEW_GET_FUN(__glewGetInternalformatSampleivNV) + +#define GLEW_NV_internalformat_sample_query GLEW_GET_VAR(__GLEW_NV_internalformat_sample_query) + +#endif /* GL_NV_internalformat_sample_query */ + +/* ------------------------ GL_NV_light_max_exponent ----------------------- */ + +#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 + +#define GLEW_NV_light_max_exponent GLEW_GET_VAR(__GLEW_NV_light_max_exponent) + +#endif /* GL_NV_light_max_exponent */ + +/* ----------------------- GL_NV_multisample_coverage ---------------------- */ + +#ifndef GL_NV_multisample_coverage +#define GL_NV_multisample_coverage 1 + +#define GL_COLOR_SAMPLES_NV 0x8E20 + +#define GLEW_NV_multisample_coverage GLEW_GET_VAR(__GLEW_NV_multisample_coverage) + +#endif /* GL_NV_multisample_coverage */ + +/* --------------------- GL_NV_multisample_filter_hint --------------------- */ + +#ifndef GL_NV_multisample_filter_hint +#define GL_NV_multisample_filter_hint 1 + +#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534 + +#define GLEW_NV_multisample_filter_hint GLEW_GET_VAR(__GLEW_NV_multisample_filter_hint) + +#endif /* GL_NV_multisample_filter_hint */ + +/* ----------------------- GL_NV_non_square_matrices ----------------------- */ + +#ifndef GL_NV_non_square_matrices +#define GL_NV_non_square_matrices 1 + +#define GL_FLOAT_MAT2x3_NV 0x8B65 +#define GL_FLOAT_MAT2x4_NV 0x8B66 +#define GL_FLOAT_MAT3x2_NV 0x8B67 +#define GL_FLOAT_MAT3x4_NV 0x8B68 +#define GL_FLOAT_MAT4x2_NV 0x8B69 +#define GL_FLOAT_MAT4x3_NV 0x8B6A + +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X3FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X4FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X2FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X4FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X2FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X3FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); + +#define glUniformMatrix2x3fvNV GLEW_GET_FUN(__glewUniformMatrix2x3fvNV) +#define glUniformMatrix2x4fvNV GLEW_GET_FUN(__glewUniformMatrix2x4fvNV) +#define glUniformMatrix3x2fvNV GLEW_GET_FUN(__glewUniformMatrix3x2fvNV) +#define glUniformMatrix3x4fvNV GLEW_GET_FUN(__glewUniformMatrix3x4fvNV) +#define glUniformMatrix4x2fvNV GLEW_GET_FUN(__glewUniformMatrix4x2fvNV) +#define glUniformMatrix4x3fvNV GLEW_GET_FUN(__glewUniformMatrix4x3fvNV) + +#define GLEW_NV_non_square_matrices GLEW_GET_VAR(__GLEW_NV_non_square_matrices) + +#endif /* GL_NV_non_square_matrices */ + +/* ------------------------- GL_NV_occlusion_query ------------------------- */ + +#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 (GLAPIENTRY * PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLENDOCCLUSIONQUERYNVPROC) (void); +typedef void (GLAPIENTRY * PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id); + +#define glBeginOcclusionQueryNV GLEW_GET_FUN(__glewBeginOcclusionQueryNV) +#define glDeleteOcclusionQueriesNV GLEW_GET_FUN(__glewDeleteOcclusionQueriesNV) +#define glEndOcclusionQueryNV GLEW_GET_FUN(__glewEndOcclusionQueryNV) +#define glGenOcclusionQueriesNV GLEW_GET_FUN(__glewGenOcclusionQueriesNV) +#define glGetOcclusionQueryivNV GLEW_GET_FUN(__glewGetOcclusionQueryivNV) +#define glGetOcclusionQueryuivNV GLEW_GET_FUN(__glewGetOcclusionQueryuivNV) +#define glIsOcclusionQueryNV GLEW_GET_FUN(__glewIsOcclusionQueryNV) + +#define GLEW_NV_occlusion_query GLEW_GET_VAR(__GLEW_NV_occlusion_query) + +#endif /* GL_NV_occlusion_query */ + +/* -------------------------- GL_NV_pack_subimage -------------------------- */ + +#ifndef GL_NV_pack_subimage +#define GL_NV_pack_subimage 1 + +#define GL_PACK_ROW_LENGTH_NV 0x0D02 +#define GL_PACK_SKIP_ROWS_NV 0x0D03 +#define GL_PACK_SKIP_PIXELS_NV 0x0D04 + +#define GLEW_NV_pack_subimage GLEW_GET_VAR(__GLEW_NV_pack_subimage) + +#endif /* GL_NV_pack_subimage */ + +/* ----------------------- GL_NV_packed_depth_stencil ---------------------- */ + +#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 + +#define GLEW_NV_packed_depth_stencil GLEW_GET_VAR(__GLEW_NV_packed_depth_stencil) + +#endif /* GL_NV_packed_depth_stencil */ + +/* --------------------------- GL_NV_packed_float -------------------------- */ + +#ifndef GL_NV_packed_float +#define GL_NV_packed_float 1 + +#define GL_R11F_G11F_B10F_NV 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV_NV 0x8C3B + +#define GLEW_NV_packed_float GLEW_GET_VAR(__GLEW_NV_packed_float) + +#endif /* GL_NV_packed_float */ + +/* ----------------------- GL_NV_packed_float_linear ----------------------- */ + +#ifndef GL_NV_packed_float_linear +#define GL_NV_packed_float_linear 1 + +#define GL_R11F_G11F_B10F_NV 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV_NV 0x8C3B + +#define GLEW_NV_packed_float_linear GLEW_GET_VAR(__GLEW_NV_packed_float_linear) + +#endif /* GL_NV_packed_float_linear */ + +/* --------------------- GL_NV_parameter_buffer_object --------------------- */ + +#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 (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params); + +#define glProgramBufferParametersIivNV GLEW_GET_FUN(__glewProgramBufferParametersIivNV) +#define glProgramBufferParametersIuivNV GLEW_GET_FUN(__glewProgramBufferParametersIuivNV) +#define glProgramBufferParametersfvNV GLEW_GET_FUN(__glewProgramBufferParametersfvNV) + +#define GLEW_NV_parameter_buffer_object GLEW_GET_VAR(__GLEW_NV_parameter_buffer_object) + +#endif /* GL_NV_parameter_buffer_object */ + +/* --------------------- GL_NV_parameter_buffer_object2 -------------------- */ + +#ifndef GL_NV_parameter_buffer_object2 +#define GL_NV_parameter_buffer_object2 1 + +#define GLEW_NV_parameter_buffer_object2 GLEW_GET_VAR(__GLEW_NV_parameter_buffer_object2) + +#endif /* GL_NV_parameter_buffer_object2 */ + +/* -------------------------- GL_NV_path_rendering ------------------------- */ + +#ifndef GL_NV_path_rendering +#define GL_NV_path_rendering 1 + +#define GL_CLOSE_PATH_NV 0x00 +#define GL_BOLD_BIT_NV 0x01 +#define GL_GLYPH_WIDTH_BIT_NV 0x01 +#define GL_GLYPH_HEIGHT_BIT_NV 0x02 +#define GL_ITALIC_BIT_NV 0x02 +#define GL_MOVE_TO_NV 0x02 +#define GL_RELATIVE_MOVE_TO_NV 0x03 +#define GL_GLYPH_HORIZONTAL_BEARING_X_BIT_NV 0x04 +#define GL_LINE_TO_NV 0x04 +#define GL_RELATIVE_LINE_TO_NV 0x05 +#define GL_HORIZONTAL_LINE_TO_NV 0x06 +#define GL_RELATIVE_HORIZONTAL_LINE_TO_NV 0x07 +#define GL_GLYPH_HORIZONTAL_BEARING_Y_BIT_NV 0x08 +#define GL_VERTICAL_LINE_TO_NV 0x08 +#define GL_RELATIVE_VERTICAL_LINE_TO_NV 0x09 +#define GL_QUADRATIC_CURVE_TO_NV 0x0A +#define GL_RELATIVE_QUADRATIC_CURVE_TO_NV 0x0B +#define GL_CUBIC_CURVE_TO_NV 0x0C +#define GL_RELATIVE_CUBIC_CURVE_TO_NV 0x0D +#define GL_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0E +#define GL_RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0F +#define GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV 0x10 +#define GL_SMOOTH_CUBIC_CURVE_TO_NV 0x10 +#define GL_RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV 0x11 +#define GL_SMALL_CCW_ARC_TO_NV 0x12 +#define GL_RELATIVE_SMALL_CCW_ARC_TO_NV 0x13 +#define GL_SMALL_CW_ARC_TO_NV 0x14 +#define GL_RELATIVE_SMALL_CW_ARC_TO_NV 0x15 +#define GL_LARGE_CCW_ARC_TO_NV 0x16 +#define GL_RELATIVE_LARGE_CCW_ARC_TO_NV 0x17 +#define GL_LARGE_CW_ARC_TO_NV 0x18 +#define GL_RELATIVE_LARGE_CW_ARC_TO_NV 0x19 +#define GL_CONIC_CURVE_TO_NV 0x1A +#define GL_RELATIVE_CONIC_CURVE_TO_NV 0x1B +#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_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_RESTART_PATH_NV 0xF0 +#define GL_DUP_FIRST_CUBIC_CURVE_TO_NV 0xF2 +#define GL_DUP_LAST_CUBIC_CURVE_TO_NV 0xF4 +#define GL_RECT_NV 0xF6 +#define GL_RELATIVE_RECT_NV 0xF7 +#define GL_CIRCULAR_CCW_ARC_TO_NV 0xF8 +#define GL_CIRCULAR_CW_ARC_TO_NV 0xFA +#define GL_CIRCULAR_TANGENT_ARC_TO_NV 0xFC +#define GL_ARC_TO_NV 0xFE +#define GL_RELATIVE_ARC_TO_NV 0xFF +#define GL_GLYPH_HAS_KERNING_BIT_NV 0x100 +#define GL_PRIMARY_COLOR_NV 0x852C +#define GL_SECONDARY_COLOR_NV 0x852D +#define GL_PRIMARY_COLOR 0x8577 +#define GL_PATH_FORMAT_SVG_NV 0x9070 +#define GL_PATH_FORMAT_PS_NV 0x9071 +#define GL_STANDARD_FONT_NAME_NV 0x9072 +#define GL_SYSTEM_FONT_NAME_NV 0x9073 +#define GL_FILE_NAME_NV 0x9074 +#define GL_PATH_STROKE_WIDTH_NV 0x9075 +#define GL_PATH_END_CAPS_NV 0x9076 +#define GL_PATH_INITIAL_END_CAP_NV 0x9077 +#define GL_PATH_TERMINAL_END_CAP_NV 0x9078 +#define GL_PATH_JOIN_STYLE_NV 0x9079 +#define GL_PATH_MITER_LIMIT_NV 0x907A +#define GL_PATH_DASH_CAPS_NV 0x907B +#define GL_PATH_INITIAL_DASH_CAP_NV 0x907C +#define GL_PATH_TERMINAL_DASH_CAP_NV 0x907D +#define GL_PATH_DASH_OFFSET_NV 0x907E +#define GL_PATH_CLIENT_LENGTH_NV 0x907F +#define GL_PATH_FILL_MODE_NV 0x9080 +#define GL_PATH_FILL_MASK_NV 0x9081 +#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_STROKE_BOUND_NV 0x9086 +#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_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_AFFINE_3D_NV 0x9094 +#define GL_TRANSPOSE_AFFINE_2D_NV 0x9096 +#define GL_TRANSPOSE_AFFINE_3D_NV 0x9098 +#define GL_UTF8_NV 0x909A +#define GL_UTF16_NV 0x909B +#define GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV 0x909C +#define GL_PATH_COMMAND_COUNT_NV 0x909D +#define GL_PATH_COORD_COUNT_NV 0x909E +#define GL_PATH_DASH_ARRAY_COUNT_NV 0x909F +#define GL_PATH_COMPUTED_LENGTH_NV 0x90A0 +#define GL_PATH_FILL_BOUNDING_BOX_NV 0x90A1 +#define GL_PATH_STROKE_BOUNDING_BOX_NV 0x90A2 +#define GL_SQUARE_NV 0x90A3 +#define GL_ROUND_NV 0x90A4 +#define GL_TRIANGULAR_NV 0x90A5 +#define GL_BEVEL_NV 0x90A6 +#define GL_MITER_REVERT_NV 0x90A7 +#define GL_MITER_TRUNCATE_NV 0x90A8 +#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_DASH_OFFSET_RESET_NV 0x90B4 +#define GL_MOVE_TO_RESETS_NV 0x90B5 +#define GL_MOVE_TO_CONTINUES_NV 0x90B6 +#define GL_PATH_STENCIL_FUNC_NV 0x90B7 +#define GL_PATH_STENCIL_REF_NV 0x90B8 +#define GL_PATH_STENCIL_VALUE_MASK_NV 0x90B9 +#define GL_PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV 0x90BD +#define GL_PATH_STENCIL_DEPTH_OFFSET_UNITS_NV 0x90BE +#define GL_PATH_COVER_DEPTH_FUNC_NV 0x90BF +#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_STANDARD_FONT_FORMAT_NV 0x936C +#define GL_FRAGMENT_INPUT_NV 0x936D +#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_FONT_NUM_GLYPH_INDICES_BIT_NV 0x20000000 + +typedef void (GLAPIENTRY * PFNGLCOPYPATHNVPROC) (GLuint resultPath, GLuint srcPath); +typedef void (GLAPIENTRY * PFNGLCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +typedef void (GLAPIENTRY * PFNGLCOVERFILLPATHNVPROC) (GLuint path, GLenum coverMode); +typedef void (GLAPIENTRY * PFNGLCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +typedef void (GLAPIENTRY * PFNGLCOVERSTROKEPATHNVPROC) (GLuint path, GLenum coverMode); +typedef void (GLAPIENTRY * PFNGLDELETEPATHSNVPROC) (GLuint path, GLsizei range); +typedef GLuint (GLAPIENTRY * PFNGLGENPATHSNVPROC) (GLsizei range); +typedef void (GLAPIENTRY * PFNGLGETPATHCOLORGENFVNVPROC) (GLenum color, GLenum pname, GLfloat* value); +typedef void (GLAPIENTRY * PFNGLGETPATHCOLORGENIVNVPROC) (GLenum color, GLenum pname, GLint* value); +typedef void (GLAPIENTRY * PFNGLGETPATHCOMMANDSNVPROC) (GLuint path, GLubyte* commands); +typedef void (GLAPIENTRY * PFNGLGETPATHCOORDSNVPROC) (GLuint path, GLfloat* coords); +typedef void (GLAPIENTRY * PFNGLGETPATHDASHARRAYNVPROC) (GLuint path, GLfloat* dashArray); +typedef GLfloat (GLAPIENTRY * PFNGLGETPATHLENGTHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments); +typedef void (GLAPIENTRY * PFNGLGETPATHMETRICRANGENVPROC) (GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths, GLsizei stride, GLfloat* metrics); +typedef void (GLAPIENTRY * PFNGLGETPATHMETRICSNVPROC) (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLsizei stride, GLfloat *metrics); +typedef void (GLAPIENTRY * PFNGLGETPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, GLfloat* value); +typedef void (GLAPIENTRY * PFNGLGETPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, GLint* value); +typedef void (GLAPIENTRY * PFNGLGETPATHSPACINGNVPROC) (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing); +typedef void (GLAPIENTRY * PFNGLGETPATHTEXGENFVNVPROC) (GLenum texCoordSet, GLenum pname, GLfloat* value); +typedef void (GLAPIENTRY * PFNGLGETPATHTEXGENIVNVPROC) (GLenum texCoordSet, GLenum pname, GLint* value); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMRESOURCEFVNVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum* props, GLsizei bufSize, GLsizei *length, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLINTERPOLATEPATHSNVPROC) (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight); +typedef GLboolean (GLAPIENTRY * PFNGLISPATHNVPROC) (GLuint path); +typedef GLboolean (GLAPIENTRY * PFNGLISPOINTINFILLPATHNVPROC) (GLuint path, GLuint mask, GLfloat x, GLfloat y); +typedef GLboolean (GLAPIENTRY * PFNGLISPOINTINSTROKEPATHNVPROC) (GLuint path, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLMATRIXLOAD3X2FNVPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXLOAD3X3FNVPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXLOADTRANSPOSE3X3FNVPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXMULT3X2FNVPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXMULT3X3FNVPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXMULTTRANSPOSE3X3FNVPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLPATHCOLORGENNVPROC) (GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat* coeffs); +typedef void (GLAPIENTRY * PFNGLPATHCOMMANDSNVPROC) (GLuint path, GLsizei numCommands, const GLubyte* commands, GLsizei numCoords, GLenum coordType, const void*coords); +typedef void (GLAPIENTRY * PFNGLPATHCOORDSNVPROC) (GLuint path, GLsizei numCoords, GLenum coordType, const void *coords); +typedef void (GLAPIENTRY * PFNGLPATHCOVERDEPTHFUNCNVPROC) (GLenum zfunc); +typedef void (GLAPIENTRY * PFNGLPATHDASHARRAYNVPROC) (GLuint path, GLsizei dashCount, const GLfloat* dashArray); +typedef void (GLAPIENTRY * PFNGLPATHFOGGENNVPROC) (GLenum genMode); +typedef GLenum (GLAPIENTRY * PFNGLPATHGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +typedef GLenum (GLAPIENTRY * PFNGLPATHGLYPHINDEXRANGENVPROC) (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint baseAndCount[2]); +typedef void (GLAPIENTRY * PFNGLPATHGLYPHRANGENVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +typedef void (GLAPIENTRY * PFNGLPATHGLYPHSNVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const void*charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +typedef GLenum (GLAPIENTRY * PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void *fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +typedef void (GLAPIENTRY * PFNGLPATHPARAMETERFNVPROC) (GLuint path, GLenum pname, GLfloat value); +typedef void (GLAPIENTRY * PFNGLPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPATHPARAMETERINVPROC) (GLuint path, GLenum pname, GLint value); +typedef void (GLAPIENTRY * PFNGLPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPATHSTENCILDEPTHOFFSETNVPROC) (GLfloat factor, GLfloat units); +typedef void (GLAPIENTRY * PFNGLPATHSTENCILFUNCNVPROC) (GLenum func, GLint ref, GLuint mask); +typedef void (GLAPIENTRY * PFNGLPATHSTRINGNVPROC) (GLuint path, GLenum format, GLsizei length, const void *pathString); +typedef void (GLAPIENTRY * PFNGLPATHSUBCOMMANDSNVPROC) (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte* commands, GLsizei numCoords, GLenum coordType, const void*coords); +typedef void (GLAPIENTRY * PFNGLPATHSUBCOORDSNVPROC) (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void *coords); +typedef void (GLAPIENTRY * PFNGLPATHTEXGENNVPROC) (GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat* coeffs); +typedef GLboolean (GLAPIENTRY * PFNGLPOINTALONGPATHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat* x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY); +typedef void (GLAPIENTRY * PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC) (GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat* coeffs); +typedef void (GLAPIENTRY * PFNGLSTENCILFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues); +typedef void (GLAPIENTRY * PFNGLSTENCILFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask); +typedef void (GLAPIENTRY * PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues); +typedef void (GLAPIENTRY * PFNGLSTENCILSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask); +typedef void (GLAPIENTRY * PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +typedef void (GLAPIENTRY * PFNGLSTENCILTHENCOVERFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask, GLenum coverMode); +typedef void (GLAPIENTRY * PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +typedef void (GLAPIENTRY * PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask, GLenum coverMode); +typedef void (GLAPIENTRY * PFNGLTRANSFORMPATHNVPROC) (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat* transformValues); +typedef void (GLAPIENTRY * PFNGLWEIGHTPATHSNVPROC) (GLuint resultPath, GLsizei numPaths, const GLuint paths[], const GLfloat weights[]); + +#define glCopyPathNV GLEW_GET_FUN(__glewCopyPathNV) +#define glCoverFillPathInstancedNV GLEW_GET_FUN(__glewCoverFillPathInstancedNV) +#define glCoverFillPathNV GLEW_GET_FUN(__glewCoverFillPathNV) +#define glCoverStrokePathInstancedNV GLEW_GET_FUN(__glewCoverStrokePathInstancedNV) +#define glCoverStrokePathNV GLEW_GET_FUN(__glewCoverStrokePathNV) +#define glDeletePathsNV GLEW_GET_FUN(__glewDeletePathsNV) +#define glGenPathsNV GLEW_GET_FUN(__glewGenPathsNV) +#define glGetPathColorGenfvNV GLEW_GET_FUN(__glewGetPathColorGenfvNV) +#define glGetPathColorGenivNV GLEW_GET_FUN(__glewGetPathColorGenivNV) +#define glGetPathCommandsNV GLEW_GET_FUN(__glewGetPathCommandsNV) +#define glGetPathCoordsNV GLEW_GET_FUN(__glewGetPathCoordsNV) +#define glGetPathDashArrayNV GLEW_GET_FUN(__glewGetPathDashArrayNV) +#define glGetPathLengthNV GLEW_GET_FUN(__glewGetPathLengthNV) +#define glGetPathMetricRangeNV GLEW_GET_FUN(__glewGetPathMetricRangeNV) +#define glGetPathMetricsNV GLEW_GET_FUN(__glewGetPathMetricsNV) +#define glGetPathParameterfvNV GLEW_GET_FUN(__glewGetPathParameterfvNV) +#define glGetPathParameterivNV GLEW_GET_FUN(__glewGetPathParameterivNV) +#define glGetPathSpacingNV GLEW_GET_FUN(__glewGetPathSpacingNV) +#define glGetPathTexGenfvNV GLEW_GET_FUN(__glewGetPathTexGenfvNV) +#define glGetPathTexGenivNV GLEW_GET_FUN(__glewGetPathTexGenivNV) +#define glGetProgramResourcefvNV GLEW_GET_FUN(__glewGetProgramResourcefvNV) +#define glInterpolatePathsNV GLEW_GET_FUN(__glewInterpolatePathsNV) +#define glIsPathNV GLEW_GET_FUN(__glewIsPathNV) +#define glIsPointInFillPathNV GLEW_GET_FUN(__glewIsPointInFillPathNV) +#define glIsPointInStrokePathNV GLEW_GET_FUN(__glewIsPointInStrokePathNV) +#define glMatrixLoad3x2fNV GLEW_GET_FUN(__glewMatrixLoad3x2fNV) +#define glMatrixLoad3x3fNV GLEW_GET_FUN(__glewMatrixLoad3x3fNV) +#define glMatrixLoadTranspose3x3fNV GLEW_GET_FUN(__glewMatrixLoadTranspose3x3fNV) +#define glMatrixMult3x2fNV GLEW_GET_FUN(__glewMatrixMult3x2fNV) +#define glMatrixMult3x3fNV GLEW_GET_FUN(__glewMatrixMult3x3fNV) +#define glMatrixMultTranspose3x3fNV GLEW_GET_FUN(__glewMatrixMultTranspose3x3fNV) +#define glPathColorGenNV GLEW_GET_FUN(__glewPathColorGenNV) +#define glPathCommandsNV GLEW_GET_FUN(__glewPathCommandsNV) +#define glPathCoordsNV GLEW_GET_FUN(__glewPathCoordsNV) +#define glPathCoverDepthFuncNV GLEW_GET_FUN(__glewPathCoverDepthFuncNV) +#define glPathDashArrayNV GLEW_GET_FUN(__glewPathDashArrayNV) +#define glPathFogGenNV GLEW_GET_FUN(__glewPathFogGenNV) +#define glPathGlyphIndexArrayNV GLEW_GET_FUN(__glewPathGlyphIndexArrayNV) +#define glPathGlyphIndexRangeNV GLEW_GET_FUN(__glewPathGlyphIndexRangeNV) +#define glPathGlyphRangeNV GLEW_GET_FUN(__glewPathGlyphRangeNV) +#define glPathGlyphsNV GLEW_GET_FUN(__glewPathGlyphsNV) +#define glPathMemoryGlyphIndexArrayNV GLEW_GET_FUN(__glewPathMemoryGlyphIndexArrayNV) +#define glPathParameterfNV GLEW_GET_FUN(__glewPathParameterfNV) +#define glPathParameterfvNV GLEW_GET_FUN(__glewPathParameterfvNV) +#define glPathParameteriNV GLEW_GET_FUN(__glewPathParameteriNV) +#define glPathParameterivNV GLEW_GET_FUN(__glewPathParameterivNV) +#define glPathStencilDepthOffsetNV GLEW_GET_FUN(__glewPathStencilDepthOffsetNV) +#define glPathStencilFuncNV GLEW_GET_FUN(__glewPathStencilFuncNV) +#define glPathStringNV GLEW_GET_FUN(__glewPathStringNV) +#define glPathSubCommandsNV GLEW_GET_FUN(__glewPathSubCommandsNV) +#define glPathSubCoordsNV GLEW_GET_FUN(__glewPathSubCoordsNV) +#define glPathTexGenNV GLEW_GET_FUN(__glewPathTexGenNV) +#define glPointAlongPathNV GLEW_GET_FUN(__glewPointAlongPathNV) +#define glProgramPathFragmentInputGenNV GLEW_GET_FUN(__glewProgramPathFragmentInputGenNV) +#define glStencilFillPathInstancedNV GLEW_GET_FUN(__glewStencilFillPathInstancedNV) +#define glStencilFillPathNV GLEW_GET_FUN(__glewStencilFillPathNV) +#define glStencilStrokePathInstancedNV GLEW_GET_FUN(__glewStencilStrokePathInstancedNV) +#define glStencilStrokePathNV GLEW_GET_FUN(__glewStencilStrokePathNV) +#define glStencilThenCoverFillPathInstancedNV GLEW_GET_FUN(__glewStencilThenCoverFillPathInstancedNV) +#define glStencilThenCoverFillPathNV GLEW_GET_FUN(__glewStencilThenCoverFillPathNV) +#define glStencilThenCoverStrokePathInstancedNV GLEW_GET_FUN(__glewStencilThenCoverStrokePathInstancedNV) +#define glStencilThenCoverStrokePathNV GLEW_GET_FUN(__glewStencilThenCoverStrokePathNV) +#define glTransformPathNV GLEW_GET_FUN(__glewTransformPathNV) +#define glWeightPathsNV GLEW_GET_FUN(__glewWeightPathsNV) + +#define GLEW_NV_path_rendering GLEW_GET_VAR(__GLEW_NV_path_rendering) + +#endif /* GL_NV_path_rendering */ + +/* -------------------- GL_NV_path_rendering_shared_edge ------------------- */ + +#ifndef GL_NV_path_rendering_shared_edge +#define GL_NV_path_rendering_shared_edge 1 + +#define GL_SHARED_EDGE_NV 0xC0 + +#define GLEW_NV_path_rendering_shared_edge GLEW_GET_VAR(__GLEW_NV_path_rendering_shared_edge) + +#endif /* GL_NV_path_rendering_shared_edge */ + +/* ----------------------- GL_NV_pixel_buffer_object ----------------------- */ + +#ifndef GL_NV_pixel_buffer_object +#define GL_NV_pixel_buffer_object 1 + +#define GL_PIXEL_PACK_BUFFER_NV 0x88EB +#define GL_PIXEL_UNPACK_BUFFER_NV 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING_NV 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING_NV 0x88EF + +#define GLEW_NV_pixel_buffer_object GLEW_GET_VAR(__GLEW_NV_pixel_buffer_object) + +#endif /* GL_NV_pixel_buffer_object */ + +/* ------------------------- GL_NV_pixel_data_range ------------------------ */ + +#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 (GLAPIENTRY * PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, void *pointer); + +#define glFlushPixelDataRangeNV GLEW_GET_FUN(__glewFlushPixelDataRangeNV) +#define glPixelDataRangeNV GLEW_GET_FUN(__glewPixelDataRangeNV) + +#define GLEW_NV_pixel_data_range GLEW_GET_VAR(__GLEW_NV_pixel_data_range) + +#endif /* GL_NV_pixel_data_range */ + +/* ------------------------- GL_NV_platform_binary ------------------------- */ + +#ifndef GL_NV_platform_binary +#define GL_NV_platform_binary 1 + +#define GL_NVIDIA_PLATFORM_BINARY_NV 0x890B + +#define GLEW_NV_platform_binary GLEW_GET_VAR(__GLEW_NV_platform_binary) + +#endif /* GL_NV_platform_binary */ + +/* --------------------------- GL_NV_point_sprite -------------------------- */ + +#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 (GLAPIENTRY * PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint* params); + +#define glPointParameteriNV GLEW_GET_FUN(__glewPointParameteriNV) +#define glPointParameterivNV GLEW_GET_FUN(__glewPointParameterivNV) + +#define GLEW_NV_point_sprite GLEW_GET_VAR(__GLEW_NV_point_sprite) + +#endif /* GL_NV_point_sprite */ + +/* --------------------------- GL_NV_polygon_mode -------------------------- */ + +#ifndef GL_NV_polygon_mode +#define GL_NV_polygon_mode 1 + +#define GL_POLYGON_MODE_NV 0x0B40 +#define GL_POINT_NV 0x1B00 +#define GL_LINE_NV 0x1B01 +#define GL_FILL_NV 0x1B02 +#define GL_POLYGON_OFFSET_POINT_NV 0x2A01 +#define GL_POLYGON_OFFSET_LINE_NV 0x2A02 + +typedef void (GLAPIENTRY * PFNGLPOLYGONMODENVPROC) (GLenum face, GLenum mode); + +#define glPolygonModeNV GLEW_GET_FUN(__glewPolygonModeNV) + +#define GLEW_NV_polygon_mode GLEW_GET_VAR(__GLEW_NV_polygon_mode) + +#endif /* GL_NV_polygon_mode */ + +/* -------------------------- GL_NV_present_video -------------------------- */ + +#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 (GLAPIENTRY * PFNGLGETVIDEOI64VNVPROC) (GLuint video_slot, GLenum pname, GLint64EXT* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOIVNVPROC) (GLuint video_slot, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOUI64VNVPROC) (GLuint video_slot, GLenum pname, GLuint64EXT* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOUIVNVPROC) (GLuint video_slot, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * 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 (GLAPIENTRY * PFNGLPRESENTFRAMEKEYEDNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1); + +#define glGetVideoi64vNV GLEW_GET_FUN(__glewGetVideoi64vNV) +#define glGetVideoivNV GLEW_GET_FUN(__glewGetVideoivNV) +#define glGetVideoui64vNV GLEW_GET_FUN(__glewGetVideoui64vNV) +#define glGetVideouivNV GLEW_GET_FUN(__glewGetVideouivNV) +#define glPresentFrameDualFillNV GLEW_GET_FUN(__glewPresentFrameDualFillNV) +#define glPresentFrameKeyedNV GLEW_GET_FUN(__glewPresentFrameKeyedNV) + +#define GLEW_NV_present_video GLEW_GET_VAR(__GLEW_NV_present_video) + +#endif /* GL_NV_present_video */ + +/* ------------------------ GL_NV_primitive_restart ------------------------ */ + +#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 (GLAPIENTRY * PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index); +typedef void (GLAPIENTRY * PFNGLPRIMITIVERESTARTNVPROC) (void); + +#define glPrimitiveRestartIndexNV GLEW_GET_FUN(__glewPrimitiveRestartIndexNV) +#define glPrimitiveRestartNV GLEW_GET_FUN(__glewPrimitiveRestartNV) + +#define GLEW_NV_primitive_restart GLEW_GET_VAR(__GLEW_NV_primitive_restart) + +#endif /* GL_NV_primitive_restart */ + +/* ---------------------------- GL_NV_read_depth --------------------------- */ + +#ifndef GL_NV_read_depth +#define GL_NV_read_depth 1 + +#define GLEW_NV_read_depth GLEW_GET_VAR(__GLEW_NV_read_depth) + +#endif /* GL_NV_read_depth */ + +/* ------------------------ GL_NV_read_depth_stencil ----------------------- */ + +#ifndef GL_NV_read_depth_stencil +#define GL_NV_read_depth_stencil 1 + +#define GLEW_NV_read_depth_stencil GLEW_GET_VAR(__GLEW_NV_read_depth_stencil) + +#endif /* GL_NV_read_depth_stencil */ + +/* --------------------------- GL_NV_read_stencil -------------------------- */ + +#ifndef GL_NV_read_stencil +#define GL_NV_read_stencil 1 + +#define GLEW_NV_read_stencil GLEW_GET_VAR(__GLEW_NV_read_stencil) + +#endif /* GL_NV_read_stencil */ + +/* ------------------------ GL_NV_register_combiners ----------------------- */ + +#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_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 + +typedef void (GLAPIENTRY * PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (GLAPIENTRY * PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); +typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (GLAPIENTRY * PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint* params); + +#define glCombinerInputNV GLEW_GET_FUN(__glewCombinerInputNV) +#define glCombinerOutputNV GLEW_GET_FUN(__glewCombinerOutputNV) +#define glCombinerParameterfNV GLEW_GET_FUN(__glewCombinerParameterfNV) +#define glCombinerParameterfvNV GLEW_GET_FUN(__glewCombinerParameterfvNV) +#define glCombinerParameteriNV GLEW_GET_FUN(__glewCombinerParameteriNV) +#define glCombinerParameterivNV GLEW_GET_FUN(__glewCombinerParameterivNV) +#define glFinalCombinerInputNV GLEW_GET_FUN(__glewFinalCombinerInputNV) +#define glGetCombinerInputParameterfvNV GLEW_GET_FUN(__glewGetCombinerInputParameterfvNV) +#define glGetCombinerInputParameterivNV GLEW_GET_FUN(__glewGetCombinerInputParameterivNV) +#define glGetCombinerOutputParameterfvNV GLEW_GET_FUN(__glewGetCombinerOutputParameterfvNV) +#define glGetCombinerOutputParameterivNV GLEW_GET_FUN(__glewGetCombinerOutputParameterivNV) +#define glGetFinalCombinerInputParameterfvNV GLEW_GET_FUN(__glewGetFinalCombinerInputParameterfvNV) +#define glGetFinalCombinerInputParameterivNV GLEW_GET_FUN(__glewGetFinalCombinerInputParameterivNV) + +#define GLEW_NV_register_combiners GLEW_GET_VAR(__GLEW_NV_register_combiners) + +#endif /* GL_NV_register_combiners */ + +/* ----------------------- GL_NV_register_combiners2 ----------------------- */ + +#ifndef GL_NV_register_combiners2 +#define GL_NV_register_combiners2 1 + +#define GL_PER_STAGE_CONSTANTS_NV 0x8535 + +typedef void (GLAPIENTRY * PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat* params); + +#define glCombinerStageParameterfvNV GLEW_GET_FUN(__glewCombinerStageParameterfvNV) +#define glGetCombinerStageParameterfvNV GLEW_GET_FUN(__glewGetCombinerStageParameterfvNV) + +#define GLEW_NV_register_combiners2 GLEW_GET_VAR(__GLEW_NV_register_combiners2) + +#endif /* GL_NV_register_combiners2 */ + +/* ------------------ GL_NV_robustness_video_memory_purge ------------------ */ + +#ifndef GL_NV_robustness_video_memory_purge +#define GL_NV_robustness_video_memory_purge 1 + +#define GL_EGL_GENERATE_RESET_ON_VIDEO_MEMORY_PURGE_NV 0x334C +#define GL_PURGED_CONTEXT_RESET_NV 0x92BB + +#define GLEW_NV_robustness_video_memory_purge GLEW_GET_VAR(__GLEW_NV_robustness_video_memory_purge) + +#endif /* GL_NV_robustness_video_memory_purge */ + +/* --------------------------- GL_NV_sRGB_formats -------------------------- */ + +#ifndef GL_NV_sRGB_formats +#define GL_NV_sRGB_formats 1 + +#define GL_ETC1_SRGB8_NV 0x88EE +#define GL_SRGB8_NV 0x8C41 +#define GL_SLUMINANCE_ALPHA_NV 0x8C44 +#define GL_SLUMINANCE8_ALPHA8_NV 0x8C45 +#define GL_SLUMINANCE_NV 0x8C46 +#define GL_SLUMINANCE8_NV 0x8C47 +#define GL_COMPRESSED_SRGB_S3TC_DXT1_NV 0x8C4C +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_NV 0x8C4D +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_NV 0x8C4E +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_NV 0x8C4F + +#define GLEW_NV_sRGB_formats GLEW_GET_VAR(__GLEW_NV_sRGB_formats) + +#endif /* GL_NV_sRGB_formats */ + +/* ------------------------- GL_NV_sample_locations ------------------------ */ + +#ifndef GL_NV_sample_locations +#define GL_NV_sample_locations 1 + +#define GL_SAMPLE_LOCATION_NV 0x8E50 +#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_PROGRAMMABLE_SAMPLE_LOCATION_NV 0x9341 +#define GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_NV 0x9342 +#define GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_NV 0x9343 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERSAMPLELOCATIONSFVNVPROC) (GLenum target, GLuint start, GLsizei count, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNVPROC) (GLuint framebuffer, GLuint start, GLsizei count, const GLfloat* v); + +#define glFramebufferSampleLocationsfvNV GLEW_GET_FUN(__glewFramebufferSampleLocationsfvNV) +#define glNamedFramebufferSampleLocationsfvNV GLEW_GET_FUN(__glewNamedFramebufferSampleLocationsfvNV) + +#define GLEW_NV_sample_locations GLEW_GET_VAR(__GLEW_NV_sample_locations) + +#endif /* GL_NV_sample_locations */ + +/* ------------------ GL_NV_sample_mask_override_coverage ------------------ */ + +#ifndef GL_NV_sample_mask_override_coverage +#define GL_NV_sample_mask_override_coverage 1 + +#define GLEW_NV_sample_mask_override_coverage GLEW_GET_VAR(__GLEW_NV_sample_mask_override_coverage) + +#endif /* GL_NV_sample_mask_override_coverage */ + +/* ---------------------- GL_NV_shader_atomic_counters --------------------- */ + +#ifndef GL_NV_shader_atomic_counters +#define GL_NV_shader_atomic_counters 1 + +#define GLEW_NV_shader_atomic_counters GLEW_GET_VAR(__GLEW_NV_shader_atomic_counters) + +#endif /* GL_NV_shader_atomic_counters */ + +/* ----------------------- GL_NV_shader_atomic_float ----------------------- */ + +#ifndef GL_NV_shader_atomic_float +#define GL_NV_shader_atomic_float 1 + +#define GLEW_NV_shader_atomic_float GLEW_GET_VAR(__GLEW_NV_shader_atomic_float) + +#endif /* GL_NV_shader_atomic_float */ + +/* ---------------------- GL_NV_shader_atomic_float64 ---------------------- */ + +#ifndef GL_NV_shader_atomic_float64 +#define GL_NV_shader_atomic_float64 1 + +#define GLEW_NV_shader_atomic_float64 GLEW_GET_VAR(__GLEW_NV_shader_atomic_float64) + +#endif /* GL_NV_shader_atomic_float64 */ + +/* -------------------- GL_NV_shader_atomic_fp16_vector -------------------- */ + +#ifndef GL_NV_shader_atomic_fp16_vector +#define GL_NV_shader_atomic_fp16_vector 1 + +#define GLEW_NV_shader_atomic_fp16_vector GLEW_GET_VAR(__GLEW_NV_shader_atomic_fp16_vector) + +#endif /* GL_NV_shader_atomic_fp16_vector */ + +/* ----------------------- GL_NV_shader_atomic_int64 ----------------------- */ + +#ifndef GL_NV_shader_atomic_int64 +#define GL_NV_shader_atomic_int64 1 + +#define GLEW_NV_shader_atomic_int64 GLEW_GET_VAR(__GLEW_NV_shader_atomic_int64) + +#endif /* GL_NV_shader_atomic_int64 */ + +/* ------------------------ GL_NV_shader_buffer_load ----------------------- */ + +#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 (GLAPIENTRY * PFNGLGETBUFFERPARAMETERUI64VNVPROC) (GLenum target, GLenum pname, GLuint64EXT* params); +typedef void (GLAPIENTRY * PFNGLGETINTEGERUI64VNVPROC) (GLenum value, GLuint64EXT* result); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC) (GLuint buffer, GLenum pname, GLuint64EXT* params); +typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERRESIDENTNVPROC) (GLenum target); +typedef GLboolean (GLAPIENTRY * PFNGLISNAMEDBUFFERRESIDENTNVPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLMAKEBUFFERNONRESIDENTNVPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLMAKEBUFFERRESIDENTNVPROC) (GLenum target, GLenum access); +typedef void (GLAPIENTRY * PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLMAKENAMEDBUFFERRESIDENTNVPROC) (GLuint buffer, GLenum access); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMUI64NVPROC) (GLuint program, GLint location, GLuint64EXT value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMUI64NVPROC) (GLint location, GLuint64EXT value); +typedef void (GLAPIENTRY * PFNGLUNIFORMUI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); + +#define glGetBufferParameterui64vNV GLEW_GET_FUN(__glewGetBufferParameterui64vNV) +#define glGetIntegerui64vNV GLEW_GET_FUN(__glewGetIntegerui64vNV) +#define glGetNamedBufferParameterui64vNV GLEW_GET_FUN(__glewGetNamedBufferParameterui64vNV) +#define glIsBufferResidentNV GLEW_GET_FUN(__glewIsBufferResidentNV) +#define glIsNamedBufferResidentNV GLEW_GET_FUN(__glewIsNamedBufferResidentNV) +#define glMakeBufferNonResidentNV GLEW_GET_FUN(__glewMakeBufferNonResidentNV) +#define glMakeBufferResidentNV GLEW_GET_FUN(__glewMakeBufferResidentNV) +#define glMakeNamedBufferNonResidentNV GLEW_GET_FUN(__glewMakeNamedBufferNonResidentNV) +#define glMakeNamedBufferResidentNV GLEW_GET_FUN(__glewMakeNamedBufferResidentNV) +#define glProgramUniformui64NV GLEW_GET_FUN(__glewProgramUniformui64NV) +#define glProgramUniformui64vNV GLEW_GET_FUN(__glewProgramUniformui64vNV) +#define glUniformui64NV GLEW_GET_FUN(__glewUniformui64NV) +#define glUniformui64vNV GLEW_GET_FUN(__glewUniformui64vNV) + +#define GLEW_NV_shader_buffer_load GLEW_GET_VAR(__GLEW_NV_shader_buffer_load) + +#endif /* GL_NV_shader_buffer_load */ + +/* ---------------- GL_NV_shader_noperspective_interpolation --------------- */ + +#ifndef GL_NV_shader_noperspective_interpolation +#define GL_NV_shader_noperspective_interpolation 1 + +#define GLEW_NV_shader_noperspective_interpolation GLEW_GET_VAR(__GLEW_NV_shader_noperspective_interpolation) + +#endif /* GL_NV_shader_noperspective_interpolation */ + +/* ------------------- GL_NV_shader_storage_buffer_object ------------------ */ + +#ifndef GL_NV_shader_storage_buffer_object +#define GL_NV_shader_storage_buffer_object 1 + +#define GLEW_NV_shader_storage_buffer_object GLEW_GET_VAR(__GLEW_NV_shader_storage_buffer_object) + +#endif /* GL_NV_shader_storage_buffer_object */ + +/* ----------------------- GL_NV_shader_thread_group ----------------------- */ + +#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 + +#define GLEW_NV_shader_thread_group GLEW_GET_VAR(__GLEW_NV_shader_thread_group) + +#endif /* GL_NV_shader_thread_group */ + +/* ---------------------- GL_NV_shader_thread_shuffle ---------------------- */ + +#ifndef GL_NV_shader_thread_shuffle +#define GL_NV_shader_thread_shuffle 1 + +#define GLEW_NV_shader_thread_shuffle GLEW_GET_VAR(__GLEW_NV_shader_thread_shuffle) + +#endif /* GL_NV_shader_thread_shuffle */ + +/* ---------------------- GL_NV_shadow_samplers_array ---------------------- */ + +#ifndef GL_NV_shadow_samplers_array +#define GL_NV_shadow_samplers_array 1 + +#define GL_SAMPLER_2D_ARRAY_SHADOW_NV 0x8DC4 + +#define GLEW_NV_shadow_samplers_array GLEW_GET_VAR(__GLEW_NV_shadow_samplers_array) + +#endif /* GL_NV_shadow_samplers_array */ + +/* ----------------------- GL_NV_shadow_samplers_cube ---------------------- */ + +#ifndef GL_NV_shadow_samplers_cube +#define GL_NV_shadow_samplers_cube 1 + +#define GL_SAMPLER_CUBE_SHADOW_NV 0x8DC5 + +#define GLEW_NV_shadow_samplers_cube GLEW_GET_VAR(__GLEW_NV_shadow_samplers_cube) + +#endif /* GL_NV_shadow_samplers_cube */ + +/* ---------------------- GL_NV_stereo_view_rendering ---------------------- */ + +#ifndef GL_NV_stereo_view_rendering +#define GL_NV_stereo_view_rendering 1 + +#define GLEW_NV_stereo_view_rendering GLEW_GET_VAR(__GLEW_NV_stereo_view_rendering) + +#endif /* GL_NV_stereo_view_rendering */ + +/* ---------------------- GL_NV_tessellation_program5 ---------------------- */ + +#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 + +#define GLEW_NV_tessellation_program5 GLEW_GET_VAR(__GLEW_NV_tessellation_program5) + +#endif /* GL_NV_tessellation_program5 */ + +/* -------------------------- GL_NV_texgen_emboss -------------------------- */ + +#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 + +#define GLEW_NV_texgen_emboss GLEW_GET_VAR(__GLEW_NV_texgen_emboss) + +#endif /* GL_NV_texgen_emboss */ + +/* ------------------------ GL_NV_texgen_reflection ------------------------ */ + +#ifndef GL_NV_texgen_reflection +#define GL_NV_texgen_reflection 1 + +#define GL_NORMAL_MAP_NV 0x8511 +#define GL_REFLECTION_MAP_NV 0x8512 + +#define GLEW_NV_texgen_reflection GLEW_GET_VAR(__GLEW_NV_texgen_reflection) + +#endif /* GL_NV_texgen_reflection */ + +/* -------------------------- GL_NV_texture_array -------------------------- */ + +#ifndef GL_NV_texture_array +#define GL_NV_texture_array 1 + +#define GL_UNPACK_SKIP_IMAGES_NV 0x806D +#define GL_UNPACK_IMAGE_HEIGHT_NV 0x806E +#define GL_MAX_ARRAY_TEXTURE_LAYERS_NV 0x88FF +#define GL_TEXTURE_2D_ARRAY_NV 0x8C1A +#define GL_TEXTURE_BINDING_2D_ARRAY_NV 0x8C1D +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_NV 0x8CD4 +#define GL_SAMPLER_2D_ARRAY_NV 0x8DC1 + +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DNVPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DNVPROC) (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 (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE3DNVPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYERNVPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DNVPROC) (GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE3DNVPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); + +#define glCompressedTexImage3DNV GLEW_GET_FUN(__glewCompressedTexImage3DNV) +#define glCompressedTexSubImage3DNV GLEW_GET_FUN(__glewCompressedTexSubImage3DNV) +#define glCopyTexSubImage3DNV GLEW_GET_FUN(__glewCopyTexSubImage3DNV) +#define glFramebufferTextureLayerNV GLEW_GET_FUN(__glewFramebufferTextureLayerNV) +#define glTexImage3DNV GLEW_GET_FUN(__glewTexImage3DNV) +#define glTexSubImage3DNV GLEW_GET_FUN(__glewTexSubImage3DNV) + +#define GLEW_NV_texture_array GLEW_GET_VAR(__GLEW_NV_texture_array) + +#endif /* GL_NV_texture_array */ + +/* ------------------------- GL_NV_texture_barrier ------------------------- */ + +#ifndef GL_NV_texture_barrier +#define GL_NV_texture_barrier 1 + +typedef void (GLAPIENTRY * PFNGLTEXTUREBARRIERNVPROC) (void); + +#define glTextureBarrierNV GLEW_GET_FUN(__glewTextureBarrierNV) + +#define GLEW_NV_texture_barrier GLEW_GET_VAR(__GLEW_NV_texture_barrier) + +#endif /* GL_NV_texture_barrier */ + +/* ----------------------- GL_NV_texture_border_clamp ---------------------- */ + +#ifndef GL_NV_texture_border_clamp +#define GL_NV_texture_border_clamp 1 + +#define GL_TEXTURE_BORDER_COLOR_NV 0x1004 +#define GL_CLAMP_TO_BORDER_NV 0x812D + +#define GLEW_NV_texture_border_clamp GLEW_GET_VAR(__GLEW_NV_texture_border_clamp) + +#endif /* GL_NV_texture_border_clamp */ + +/* --------------------- GL_NV_texture_compression_latc -------------------- */ + +#ifndef GL_NV_texture_compression_latc +#define GL_NV_texture_compression_latc 1 + +#define GL_COMPRESSED_LUMINANCE_LATC1_NV 0x8C70 +#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_NV 0x8C71 +#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_NV 0x8C72 +#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_NV 0x8C73 + +#define GLEW_NV_texture_compression_latc GLEW_GET_VAR(__GLEW_NV_texture_compression_latc) + +#endif /* GL_NV_texture_compression_latc */ + +/* --------------------- GL_NV_texture_compression_s3tc -------------------- */ + +#ifndef GL_NV_texture_compression_s3tc +#define GL_NV_texture_compression_s3tc 1 + +#define GL_COMPRESSED_RGB_S3TC_DXT1_NV 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_NV 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_NV 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_NV 0x83F3 + +#define GLEW_NV_texture_compression_s3tc GLEW_GET_VAR(__GLEW_NV_texture_compression_s3tc) + +#endif /* GL_NV_texture_compression_s3tc */ + +/* ----------------- GL_NV_texture_compression_s3tc_update ----------------- */ + +#ifndef GL_NV_texture_compression_s3tc_update +#define GL_NV_texture_compression_s3tc_update 1 + +#define GLEW_NV_texture_compression_s3tc_update GLEW_GET_VAR(__GLEW_NV_texture_compression_s3tc_update) + +#endif /* GL_NV_texture_compression_s3tc_update */ + +/* --------------------- GL_NV_texture_compression_vtc --------------------- */ + +#ifndef GL_NV_texture_compression_vtc +#define GL_NV_texture_compression_vtc 1 + +#define GLEW_NV_texture_compression_vtc GLEW_GET_VAR(__GLEW_NV_texture_compression_vtc) + +#endif /* GL_NV_texture_compression_vtc */ + +/* ----------------------- GL_NV_texture_env_combine4 ---------------------- */ + +#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 + +#define GLEW_NV_texture_env_combine4 GLEW_GET_VAR(__GLEW_NV_texture_env_combine4) + +#endif /* GL_NV_texture_env_combine4 */ + +/* ---------------------- GL_NV_texture_expand_normal ---------------------- */ + +#ifndef GL_NV_texture_expand_normal +#define GL_NV_texture_expand_normal 1 + +#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F + +#define GLEW_NV_texture_expand_normal GLEW_GET_VAR(__GLEW_NV_texture_expand_normal) + +#endif /* GL_NV_texture_expand_normal */ + +/* ----------------------- GL_NV_texture_multisample ----------------------- */ + +#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 (GLAPIENTRY * PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); + +#define glTexImage2DMultisampleCoverageNV GLEW_GET_FUN(__glewTexImage2DMultisampleCoverageNV) +#define glTexImage3DMultisampleCoverageNV GLEW_GET_FUN(__glewTexImage3DMultisampleCoverageNV) +#define glTextureImage2DMultisampleCoverageNV GLEW_GET_FUN(__glewTextureImage2DMultisampleCoverageNV) +#define glTextureImage2DMultisampleNV GLEW_GET_FUN(__glewTextureImage2DMultisampleNV) +#define glTextureImage3DMultisampleCoverageNV GLEW_GET_FUN(__glewTextureImage3DMultisampleCoverageNV) +#define glTextureImage3DMultisampleNV GLEW_GET_FUN(__glewTextureImage3DMultisampleNV) + +#define GLEW_NV_texture_multisample GLEW_GET_VAR(__GLEW_NV_texture_multisample) + +#endif /* GL_NV_texture_multisample */ + +/* ---------------------- GL_NV_texture_npot_2D_mipmap --------------------- */ + +#ifndef GL_NV_texture_npot_2D_mipmap +#define GL_NV_texture_npot_2D_mipmap 1 + +#define GLEW_NV_texture_npot_2D_mipmap GLEW_GET_VAR(__GLEW_NV_texture_npot_2D_mipmap) + +#endif /* GL_NV_texture_npot_2D_mipmap */ + +/* ------------------------ GL_NV_texture_rectangle ------------------------ */ + +#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 + +#define GLEW_NV_texture_rectangle GLEW_GET_VAR(__GLEW_NV_texture_rectangle) + +#endif /* GL_NV_texture_rectangle */ + +/* ------------------- GL_NV_texture_rectangle_compressed ------------------ */ + +#ifndef GL_NV_texture_rectangle_compressed +#define GL_NV_texture_rectangle_compressed 1 + +#define GLEW_NV_texture_rectangle_compressed GLEW_GET_VAR(__GLEW_NV_texture_rectangle_compressed) + +#endif /* GL_NV_texture_rectangle_compressed */ + +/* -------------------------- GL_NV_texture_shader ------------------------- */ + +#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_2D_MATRIX_NV 0x86E1 +#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1 +#define GL_OFFSET_TEXTURE_2D_SCALE_NV 0x86E2 +#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2 +#define GL_OFFSET_TEXTURE_2D_BIAS_NV 0x86E3 +#define GL_OFFSET_TEXTURE_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 + +#define GLEW_NV_texture_shader GLEW_GET_VAR(__GLEW_NV_texture_shader) + +#endif /* GL_NV_texture_shader */ + +/* ------------------------- GL_NV_texture_shader2 ------------------------- */ + +#ifndef GL_NV_texture_shader2 +#define GL_NV_texture_shader2 1 + +#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_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF +#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 GLEW_NV_texture_shader2 GLEW_GET_VAR(__GLEW_NV_texture_shader2) + +#endif /* GL_NV_texture_shader2 */ + +/* ------------------------- GL_NV_texture_shader3 ------------------------- */ + +#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 + +#define GLEW_NV_texture_shader3 GLEW_GET_VAR(__GLEW_NV_texture_shader3) + +#endif /* GL_NV_texture_shader3 */ + +/* ------------------------ GL_NV_transform_feedback ----------------------- */ + +#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 + +typedef void (GLAPIENTRY * PFNGLACTIVEVARYINGNVPROC) (GLuint program, const GLchar *name); +typedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKNVPROC) (GLenum primitiveMode); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERBASENVPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLBINDBUFFEROFFSETNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGENVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKNVPROC) (void); +typedef void (GLAPIENTRY * PFNGLGETACTIVEVARYINGNVPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC) (GLuint program, GLuint index, GLint *location); +typedef GLint (GLAPIENTRY * PFNGLGETVARYINGLOCATIONNVPROC) (GLuint program, const GLchar *name); +typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) (GLuint count, const GLint *attribs, GLenum bufferMode); +typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode); + +#define glActiveVaryingNV GLEW_GET_FUN(__glewActiveVaryingNV) +#define glBeginTransformFeedbackNV GLEW_GET_FUN(__glewBeginTransformFeedbackNV) +#define glBindBufferBaseNV GLEW_GET_FUN(__glewBindBufferBaseNV) +#define glBindBufferOffsetNV GLEW_GET_FUN(__glewBindBufferOffsetNV) +#define glBindBufferRangeNV GLEW_GET_FUN(__glewBindBufferRangeNV) +#define glEndTransformFeedbackNV GLEW_GET_FUN(__glewEndTransformFeedbackNV) +#define glGetActiveVaryingNV GLEW_GET_FUN(__glewGetActiveVaryingNV) +#define glGetTransformFeedbackVaryingNV GLEW_GET_FUN(__glewGetTransformFeedbackVaryingNV) +#define glGetVaryingLocationNV GLEW_GET_FUN(__glewGetVaryingLocationNV) +#define glTransformFeedbackAttribsNV GLEW_GET_FUN(__glewTransformFeedbackAttribsNV) +#define glTransformFeedbackVaryingsNV GLEW_GET_FUN(__glewTransformFeedbackVaryingsNV) + +#define GLEW_NV_transform_feedback GLEW_GET_VAR(__GLEW_NV_transform_feedback) + +#endif /* GL_NV_transform_feedback */ + +/* ----------------------- GL_NV_transform_feedback2 ----------------------- */ + +#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 (GLAPIENTRY * PFNGLBINDTRANSFORMFEEDBACKNVPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETETRANSFORMFEEDBACKSNVPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKNVPROC) (GLenum mode, GLuint id); +typedef void (GLAPIENTRY * PFNGLGENTRANSFORMFEEDBACKSNVPROC) (GLsizei n, GLuint* ids); +typedef GLboolean (GLAPIENTRY * PFNGLISTRANSFORMFEEDBACKNVPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLPAUSETRANSFORMFEEDBACKNVPROC) (void); +typedef void (GLAPIENTRY * PFNGLRESUMETRANSFORMFEEDBACKNVPROC) (void); + +#define glBindTransformFeedbackNV GLEW_GET_FUN(__glewBindTransformFeedbackNV) +#define glDeleteTransformFeedbacksNV GLEW_GET_FUN(__glewDeleteTransformFeedbacksNV) +#define glDrawTransformFeedbackNV GLEW_GET_FUN(__glewDrawTransformFeedbackNV) +#define glGenTransformFeedbacksNV GLEW_GET_FUN(__glewGenTransformFeedbacksNV) +#define glIsTransformFeedbackNV GLEW_GET_FUN(__glewIsTransformFeedbackNV) +#define glPauseTransformFeedbackNV GLEW_GET_FUN(__glewPauseTransformFeedbackNV) +#define glResumeTransformFeedbackNV GLEW_GET_FUN(__glewResumeTransformFeedbackNV) + +#define GLEW_NV_transform_feedback2 GLEW_GET_VAR(__GLEW_NV_transform_feedback2) + +#endif /* GL_NV_transform_feedback2 */ + +/* ------------------ GL_NV_uniform_buffer_unified_memory ------------------ */ + +#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 + +#define GLEW_NV_uniform_buffer_unified_memory GLEW_GET_VAR(__GLEW_NV_uniform_buffer_unified_memory) + +#endif /* GL_NV_uniform_buffer_unified_memory */ + +/* -------------------------- GL_NV_vdpau_interop -------------------------- */ + +#ifndef GL_NV_vdpau_interop +#define GL_NV_vdpau_interop 1 + +#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 GLintptr GLvdpauSurfaceNV; + +typedef void (GLAPIENTRY * PFNGLVDPAUFININVPROC) (void); +typedef void (GLAPIENTRY * PFNGLVDPAUGETSURFACEIVNVPROC) (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei* length, GLint *values); +typedef void (GLAPIENTRY * PFNGLVDPAUINITNVPROC) (const void* vdpDevice, const void*getProcAddress); +typedef void (GLAPIENTRY * PFNGLVDPAUISSURFACENVPROC) (GLvdpauSurfaceNV surface); +typedef void (GLAPIENTRY * PFNGLVDPAUMAPSURFACESNVPROC) (GLsizei numSurfaces, const GLvdpauSurfaceNV* surfaces); +typedef GLvdpauSurfaceNV (GLAPIENTRY * PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC) (const void* vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +typedef GLvdpauSurfaceNV (GLAPIENTRY * PFNGLVDPAUREGISTERVIDEOSURFACENVPROC) (const void* vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +typedef void (GLAPIENTRY * PFNGLVDPAUSURFACEACCESSNVPROC) (GLvdpauSurfaceNV surface, GLenum access); +typedef void (GLAPIENTRY * PFNGLVDPAUUNMAPSURFACESNVPROC) (GLsizei numSurface, const GLvdpauSurfaceNV* surfaces); +typedef void (GLAPIENTRY * PFNGLVDPAUUNREGISTERSURFACENVPROC) (GLvdpauSurfaceNV surface); + +#define glVDPAUFiniNV GLEW_GET_FUN(__glewVDPAUFiniNV) +#define glVDPAUGetSurfaceivNV GLEW_GET_FUN(__glewVDPAUGetSurfaceivNV) +#define glVDPAUInitNV GLEW_GET_FUN(__glewVDPAUInitNV) +#define glVDPAUIsSurfaceNV GLEW_GET_FUN(__glewVDPAUIsSurfaceNV) +#define glVDPAUMapSurfacesNV GLEW_GET_FUN(__glewVDPAUMapSurfacesNV) +#define glVDPAURegisterOutputSurfaceNV GLEW_GET_FUN(__glewVDPAURegisterOutputSurfaceNV) +#define glVDPAURegisterVideoSurfaceNV GLEW_GET_FUN(__glewVDPAURegisterVideoSurfaceNV) +#define glVDPAUSurfaceAccessNV GLEW_GET_FUN(__glewVDPAUSurfaceAccessNV) +#define glVDPAUUnmapSurfacesNV GLEW_GET_FUN(__glewVDPAUUnmapSurfacesNV) +#define glVDPAUUnregisterSurfaceNV GLEW_GET_FUN(__glewVDPAUUnregisterSurfaceNV) + +#define GLEW_NV_vdpau_interop GLEW_GET_VAR(__GLEW_NV_vdpau_interop) + +#endif /* GL_NV_vdpau_interop */ + +/* ------------------------ GL_NV_vertex_array_range ----------------------- */ + +#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 (GLAPIENTRY * PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, void *pointer); + +#define glFlushVertexArrayRangeNV GLEW_GET_FUN(__glewFlushVertexArrayRangeNV) +#define glVertexArrayRangeNV GLEW_GET_FUN(__glewVertexArrayRangeNV) + +#define GLEW_NV_vertex_array_range GLEW_GET_VAR(__GLEW_NV_vertex_array_range) + +#endif /* GL_NV_vertex_array_range */ + +/* ----------------------- GL_NV_vertex_array_range2 ----------------------- */ + +#ifndef GL_NV_vertex_array_range2 +#define GL_NV_vertex_array_range2 1 + +#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533 + +#define GLEW_NV_vertex_array_range2 GLEW_GET_VAR(__GLEW_NV_vertex_array_range2) + +#endif /* GL_NV_vertex_array_range2 */ + +/* ------------------- GL_NV_vertex_attrib_integer_64bit ------------------- */ + +#ifndef GL_NV_vertex_attrib_integer_64bit +#define GL_NV_vertex_attrib_integer_64bit 1 + +#define GL_INT64_NV 0x140E +#define GL_UNSIGNED_INT64_NV 0x140F + +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLI64VNVPROC) (GLuint index, GLenum pname, GLint64EXT* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLUI64VNVPROC) (GLuint index, GLenum pname, GLuint64EXT* params); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1I64NVPROC) (GLuint index, GLint64EXT x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1I64VNVPROC) (GLuint index, const GLint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64NVPROC) (GLuint index, GLuint64EXT x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64VNVPROC) (GLuint index, const GLuint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2I64VNVPROC) (GLuint index, const GLint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2UI64VNVPROC) (GLuint index, const GLuint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3I64VNVPROC) (GLuint index, const GLint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3UI64VNVPROC) (GLuint index, const GLuint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4I64VNVPROC) (GLuint index, const GLint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4UI64VNVPROC) (GLuint index, const GLuint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride); + +#define glGetVertexAttribLi64vNV GLEW_GET_FUN(__glewGetVertexAttribLi64vNV) +#define glGetVertexAttribLui64vNV GLEW_GET_FUN(__glewGetVertexAttribLui64vNV) +#define glVertexAttribL1i64NV GLEW_GET_FUN(__glewVertexAttribL1i64NV) +#define glVertexAttribL1i64vNV GLEW_GET_FUN(__glewVertexAttribL1i64vNV) +#define glVertexAttribL1ui64NV GLEW_GET_FUN(__glewVertexAttribL1ui64NV) +#define glVertexAttribL1ui64vNV GLEW_GET_FUN(__glewVertexAttribL1ui64vNV) +#define glVertexAttribL2i64NV GLEW_GET_FUN(__glewVertexAttribL2i64NV) +#define glVertexAttribL2i64vNV GLEW_GET_FUN(__glewVertexAttribL2i64vNV) +#define glVertexAttribL2ui64NV GLEW_GET_FUN(__glewVertexAttribL2ui64NV) +#define glVertexAttribL2ui64vNV GLEW_GET_FUN(__glewVertexAttribL2ui64vNV) +#define glVertexAttribL3i64NV GLEW_GET_FUN(__glewVertexAttribL3i64NV) +#define glVertexAttribL3i64vNV GLEW_GET_FUN(__glewVertexAttribL3i64vNV) +#define glVertexAttribL3ui64NV GLEW_GET_FUN(__glewVertexAttribL3ui64NV) +#define glVertexAttribL3ui64vNV GLEW_GET_FUN(__glewVertexAttribL3ui64vNV) +#define glVertexAttribL4i64NV GLEW_GET_FUN(__glewVertexAttribL4i64NV) +#define glVertexAttribL4i64vNV GLEW_GET_FUN(__glewVertexAttribL4i64vNV) +#define glVertexAttribL4ui64NV GLEW_GET_FUN(__glewVertexAttribL4ui64NV) +#define glVertexAttribL4ui64vNV GLEW_GET_FUN(__glewVertexAttribL4ui64vNV) +#define glVertexAttribLFormatNV GLEW_GET_FUN(__glewVertexAttribLFormatNV) + +#define GLEW_NV_vertex_attrib_integer_64bit GLEW_GET_VAR(__GLEW_NV_vertex_attrib_integer_64bit) + +#endif /* GL_NV_vertex_attrib_integer_64bit */ + +/* ------------------- GL_NV_vertex_buffer_unified_memory ------------------ */ + +#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 (GLAPIENTRY * PFNGLBUFFERADDRESSRANGENVPROC) (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length); +typedef void (GLAPIENTRY * PFNGLCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLEDGEFLAGFORMATNVPROC) (GLsizei stride); +typedef void (GLAPIENTRY * PFNGLFOGCOORDFORMATNVPROC) (GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLGETINTEGERUI64I_VNVPROC) (GLenum value, GLuint index, GLuint64EXT result[]); +typedef void (GLAPIENTRY * PFNGLINDEXFORMATNVPROC) (GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLNORMALFORMATNVPROC) (GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLTEXCOORDFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLVERTEXFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); + +#define glBufferAddressRangeNV GLEW_GET_FUN(__glewBufferAddressRangeNV) +#define glColorFormatNV GLEW_GET_FUN(__glewColorFormatNV) +#define glEdgeFlagFormatNV GLEW_GET_FUN(__glewEdgeFlagFormatNV) +#define glFogCoordFormatNV GLEW_GET_FUN(__glewFogCoordFormatNV) +#define glGetIntegerui64i_vNV GLEW_GET_FUN(__glewGetIntegerui64i_vNV) +#define glIndexFormatNV GLEW_GET_FUN(__glewIndexFormatNV) +#define glNormalFormatNV GLEW_GET_FUN(__glewNormalFormatNV) +#define glSecondaryColorFormatNV GLEW_GET_FUN(__glewSecondaryColorFormatNV) +#define glTexCoordFormatNV GLEW_GET_FUN(__glewTexCoordFormatNV) +#define glVertexAttribFormatNV GLEW_GET_FUN(__glewVertexAttribFormatNV) +#define glVertexAttribIFormatNV GLEW_GET_FUN(__glewVertexAttribIFormatNV) +#define glVertexFormatNV GLEW_GET_FUN(__glewVertexFormatNV) + +#define GLEW_NV_vertex_buffer_unified_memory GLEW_GET_VAR(__GLEW_NV_vertex_buffer_unified_memory) + +#endif /* GL_NV_vertex_buffer_unified_memory */ + +/* -------------------------- GL_NV_vertex_program ------------------------- */ + +#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 (GLAPIENTRY * PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint* ids, GLboolean *residences); +typedef void (GLAPIENTRY * PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte* program); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, void** pointer); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMNVPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte* program); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLsizei num, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLsizei num, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei n, const GLubyte* v); + +#define glAreProgramsResidentNV GLEW_GET_FUN(__glewAreProgramsResidentNV) +#define glBindProgramNV GLEW_GET_FUN(__glewBindProgramNV) +#define glDeleteProgramsNV GLEW_GET_FUN(__glewDeleteProgramsNV) +#define glExecuteProgramNV GLEW_GET_FUN(__glewExecuteProgramNV) +#define glGenProgramsNV GLEW_GET_FUN(__glewGenProgramsNV) +#define glGetProgramParameterdvNV GLEW_GET_FUN(__glewGetProgramParameterdvNV) +#define glGetProgramParameterfvNV GLEW_GET_FUN(__glewGetProgramParameterfvNV) +#define glGetProgramStringNV GLEW_GET_FUN(__glewGetProgramStringNV) +#define glGetProgramivNV GLEW_GET_FUN(__glewGetProgramivNV) +#define glGetTrackMatrixivNV GLEW_GET_FUN(__glewGetTrackMatrixivNV) +#define glGetVertexAttribPointervNV GLEW_GET_FUN(__glewGetVertexAttribPointervNV) +#define glGetVertexAttribdvNV GLEW_GET_FUN(__glewGetVertexAttribdvNV) +#define glGetVertexAttribfvNV GLEW_GET_FUN(__glewGetVertexAttribfvNV) +#define glGetVertexAttribivNV GLEW_GET_FUN(__glewGetVertexAttribivNV) +#define glIsProgramNV GLEW_GET_FUN(__glewIsProgramNV) +#define glLoadProgramNV GLEW_GET_FUN(__glewLoadProgramNV) +#define glProgramParameter4dNV GLEW_GET_FUN(__glewProgramParameter4dNV) +#define glProgramParameter4dvNV GLEW_GET_FUN(__glewProgramParameter4dvNV) +#define glProgramParameter4fNV GLEW_GET_FUN(__glewProgramParameter4fNV) +#define glProgramParameter4fvNV GLEW_GET_FUN(__glewProgramParameter4fvNV) +#define glProgramParameters4dvNV GLEW_GET_FUN(__glewProgramParameters4dvNV) +#define glProgramParameters4fvNV GLEW_GET_FUN(__glewProgramParameters4fvNV) +#define glRequestResidentProgramsNV GLEW_GET_FUN(__glewRequestResidentProgramsNV) +#define glTrackMatrixNV GLEW_GET_FUN(__glewTrackMatrixNV) +#define glVertexAttrib1dNV GLEW_GET_FUN(__glewVertexAttrib1dNV) +#define glVertexAttrib1dvNV GLEW_GET_FUN(__glewVertexAttrib1dvNV) +#define glVertexAttrib1fNV GLEW_GET_FUN(__glewVertexAttrib1fNV) +#define glVertexAttrib1fvNV GLEW_GET_FUN(__glewVertexAttrib1fvNV) +#define glVertexAttrib1sNV GLEW_GET_FUN(__glewVertexAttrib1sNV) +#define glVertexAttrib1svNV GLEW_GET_FUN(__glewVertexAttrib1svNV) +#define glVertexAttrib2dNV GLEW_GET_FUN(__glewVertexAttrib2dNV) +#define glVertexAttrib2dvNV GLEW_GET_FUN(__glewVertexAttrib2dvNV) +#define glVertexAttrib2fNV GLEW_GET_FUN(__glewVertexAttrib2fNV) +#define glVertexAttrib2fvNV GLEW_GET_FUN(__glewVertexAttrib2fvNV) +#define glVertexAttrib2sNV GLEW_GET_FUN(__glewVertexAttrib2sNV) +#define glVertexAttrib2svNV GLEW_GET_FUN(__glewVertexAttrib2svNV) +#define glVertexAttrib3dNV GLEW_GET_FUN(__glewVertexAttrib3dNV) +#define glVertexAttrib3dvNV GLEW_GET_FUN(__glewVertexAttrib3dvNV) +#define glVertexAttrib3fNV GLEW_GET_FUN(__glewVertexAttrib3fNV) +#define glVertexAttrib3fvNV GLEW_GET_FUN(__glewVertexAttrib3fvNV) +#define glVertexAttrib3sNV GLEW_GET_FUN(__glewVertexAttrib3sNV) +#define glVertexAttrib3svNV GLEW_GET_FUN(__glewVertexAttrib3svNV) +#define glVertexAttrib4dNV GLEW_GET_FUN(__glewVertexAttrib4dNV) +#define glVertexAttrib4dvNV GLEW_GET_FUN(__glewVertexAttrib4dvNV) +#define glVertexAttrib4fNV GLEW_GET_FUN(__glewVertexAttrib4fNV) +#define glVertexAttrib4fvNV GLEW_GET_FUN(__glewVertexAttrib4fvNV) +#define glVertexAttrib4sNV GLEW_GET_FUN(__glewVertexAttrib4sNV) +#define glVertexAttrib4svNV GLEW_GET_FUN(__glewVertexAttrib4svNV) +#define glVertexAttrib4ubNV GLEW_GET_FUN(__glewVertexAttrib4ubNV) +#define glVertexAttrib4ubvNV GLEW_GET_FUN(__glewVertexAttrib4ubvNV) +#define glVertexAttribPointerNV GLEW_GET_FUN(__glewVertexAttribPointerNV) +#define glVertexAttribs1dvNV GLEW_GET_FUN(__glewVertexAttribs1dvNV) +#define glVertexAttribs1fvNV GLEW_GET_FUN(__glewVertexAttribs1fvNV) +#define glVertexAttribs1svNV GLEW_GET_FUN(__glewVertexAttribs1svNV) +#define glVertexAttribs2dvNV GLEW_GET_FUN(__glewVertexAttribs2dvNV) +#define glVertexAttribs2fvNV GLEW_GET_FUN(__glewVertexAttribs2fvNV) +#define glVertexAttribs2svNV GLEW_GET_FUN(__glewVertexAttribs2svNV) +#define glVertexAttribs3dvNV GLEW_GET_FUN(__glewVertexAttribs3dvNV) +#define glVertexAttribs3fvNV GLEW_GET_FUN(__glewVertexAttribs3fvNV) +#define glVertexAttribs3svNV GLEW_GET_FUN(__glewVertexAttribs3svNV) +#define glVertexAttribs4dvNV GLEW_GET_FUN(__glewVertexAttribs4dvNV) +#define glVertexAttribs4fvNV GLEW_GET_FUN(__glewVertexAttribs4fvNV) +#define glVertexAttribs4svNV GLEW_GET_FUN(__glewVertexAttribs4svNV) +#define glVertexAttribs4ubvNV GLEW_GET_FUN(__glewVertexAttribs4ubvNV) + +#define GLEW_NV_vertex_program GLEW_GET_VAR(__GLEW_NV_vertex_program) + +#endif /* GL_NV_vertex_program */ + +/* ------------------------ GL_NV_vertex_program1_1 ------------------------ */ + +#ifndef GL_NV_vertex_program1_1 +#define GL_NV_vertex_program1_1 1 + +#define GLEW_NV_vertex_program1_1 GLEW_GET_VAR(__GLEW_NV_vertex_program1_1) + +#endif /* GL_NV_vertex_program1_1 */ + +/* ------------------------- GL_NV_vertex_program2 ------------------------- */ + +#ifndef GL_NV_vertex_program2 +#define GL_NV_vertex_program2 1 + +#define GLEW_NV_vertex_program2 GLEW_GET_VAR(__GLEW_NV_vertex_program2) + +#endif /* GL_NV_vertex_program2 */ + +/* ---------------------- GL_NV_vertex_program2_option --------------------- */ + +#ifndef GL_NV_vertex_program2_option +#define GL_NV_vertex_program2_option 1 + +#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 +#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 + +#define GLEW_NV_vertex_program2_option GLEW_GET_VAR(__GLEW_NV_vertex_program2_option) + +#endif /* GL_NV_vertex_program2_option */ + +/* ------------------------- GL_NV_vertex_program3 ------------------------- */ + +#ifndef GL_NV_vertex_program3 +#define GL_NV_vertex_program3 1 + +#define MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C + +#define GLEW_NV_vertex_program3 GLEW_GET_VAR(__GLEW_NV_vertex_program3) + +#endif /* GL_NV_vertex_program3 */ + +/* ------------------------- GL_NV_vertex_program4 ------------------------- */ + +#ifndef GL_NV_vertex_program4 +#define GL_NV_vertex_program4 1 + +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD + +#define GLEW_NV_vertex_program4 GLEW_GET_VAR(__GLEW_NV_vertex_program4) + +#endif /* GL_NV_vertex_program4 */ + +/* -------------------------- GL_NV_video_capture -------------------------- */ + +#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 (GLAPIENTRY * PFNGLBEGINVIDEOCAPTURENVPROC) (GLuint video_capture_slot); +typedef void (GLAPIENTRY * PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset); +typedef void (GLAPIENTRY * PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture); +typedef void (GLAPIENTRY * PFNGLENDVIDEOCAPTURENVPROC) (GLuint video_capture_slot); +typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTUREIVNVPROC) (GLuint video_capture_slot, GLenum pname, GLint* params); +typedef GLenum (GLAPIENTRY * PFNGLVIDEOCAPTURENVPROC) (GLuint video_capture_slot, GLuint* sequence_num, GLuint64EXT *capture_time); +typedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint* params); + +#define glBeginVideoCaptureNV GLEW_GET_FUN(__glewBeginVideoCaptureNV) +#define glBindVideoCaptureStreamBufferNV GLEW_GET_FUN(__glewBindVideoCaptureStreamBufferNV) +#define glBindVideoCaptureStreamTextureNV GLEW_GET_FUN(__glewBindVideoCaptureStreamTextureNV) +#define glEndVideoCaptureNV GLEW_GET_FUN(__glewEndVideoCaptureNV) +#define glGetVideoCaptureStreamdvNV GLEW_GET_FUN(__glewGetVideoCaptureStreamdvNV) +#define glGetVideoCaptureStreamfvNV GLEW_GET_FUN(__glewGetVideoCaptureStreamfvNV) +#define glGetVideoCaptureStreamivNV GLEW_GET_FUN(__glewGetVideoCaptureStreamivNV) +#define glGetVideoCaptureivNV GLEW_GET_FUN(__glewGetVideoCaptureivNV) +#define glVideoCaptureNV GLEW_GET_FUN(__glewVideoCaptureNV) +#define glVideoCaptureStreamParameterdvNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterdvNV) +#define glVideoCaptureStreamParameterfvNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterfvNV) +#define glVideoCaptureStreamParameterivNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterivNV) + +#define GLEW_NV_video_capture GLEW_GET_VAR(__GLEW_NV_video_capture) + +#endif /* GL_NV_video_capture */ + +/* -------------------------- GL_NV_viewport_array ------------------------- */ + +#ifndef GL_NV_viewport_array +#define GL_NV_viewport_array 1 + +#define GL_DEPTH_RANGE 0x0B70 +#define GL_VIEWPORT 0x0BA2 +#define GL_SCISSOR_BOX 0x0C10 +#define GL_SCISSOR_TEST 0x0C11 +#define GL_MAX_VIEWPORTS_NV 0x825B +#define GL_VIEWPORT_SUBPIXEL_BITS_NV 0x825C +#define GL_VIEWPORT_BOUNDS_RANGE_NV 0x825D +#define GL_VIEWPORT_INDEX_PROVOKING_VERTEX_NV 0x825F + +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEARRAYFVNVPROC) (GLuint first, GLsizei count, const GLfloat * v); +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEINDEXEDFNVPROC) (GLuint index, GLfloat n, GLfloat f); +typedef void (GLAPIENTRY * PFNGLDISABLEINVPROC) (GLenum target, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEINVPROC) (GLenum target, GLuint index); +typedef void (GLAPIENTRY * PFNGLGETFLOATI_VNVPROC) (GLenum target, GLuint index, GLfloat* data); +typedef GLboolean (GLAPIENTRY * PFNGLISENABLEDINVPROC) (GLenum target, GLuint index); +typedef void (GLAPIENTRY * PFNGLSCISSORARRAYVNVPROC) (GLuint first, GLsizei count, const GLint * v); +typedef void (GLAPIENTRY * PFNGLSCISSORINDEXEDNVPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLSCISSORINDEXEDVNVPROC) (GLuint index, const GLint * v); +typedef void (GLAPIENTRY * PFNGLVIEWPORTARRAYVNVPROC) (GLuint first, GLsizei count, const GLfloat * v); +typedef void (GLAPIENTRY * PFNGLVIEWPORTINDEXEDFNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); +typedef void (GLAPIENTRY * PFNGLVIEWPORTINDEXEDFVNVPROC) (GLuint index, const GLfloat * v); + +#define glDepthRangeArrayfvNV GLEW_GET_FUN(__glewDepthRangeArrayfvNV) +#define glDepthRangeIndexedfNV GLEW_GET_FUN(__glewDepthRangeIndexedfNV) +#define glDisableiNV GLEW_GET_FUN(__glewDisableiNV) +#define glEnableiNV GLEW_GET_FUN(__glewEnableiNV) +#define glGetFloati_vNV GLEW_GET_FUN(__glewGetFloati_vNV) +#define glIsEnablediNV GLEW_GET_FUN(__glewIsEnablediNV) +#define glScissorArrayvNV GLEW_GET_FUN(__glewScissorArrayvNV) +#define glScissorIndexedNV GLEW_GET_FUN(__glewScissorIndexedNV) +#define glScissorIndexedvNV GLEW_GET_FUN(__glewScissorIndexedvNV) +#define glViewportArrayvNV GLEW_GET_FUN(__glewViewportArrayvNV) +#define glViewportIndexedfNV GLEW_GET_FUN(__glewViewportIndexedfNV) +#define glViewportIndexedfvNV GLEW_GET_FUN(__glewViewportIndexedfvNV) + +#define GLEW_NV_viewport_array GLEW_GET_VAR(__GLEW_NV_viewport_array) + +#endif /* GL_NV_viewport_array */ + +/* ------------------------- GL_NV_viewport_array2 ------------------------- */ + +#ifndef GL_NV_viewport_array2 +#define GL_NV_viewport_array2 1 + +#define GLEW_NV_viewport_array2 GLEW_GET_VAR(__GLEW_NV_viewport_array2) + +#endif /* GL_NV_viewport_array2 */ + +/* ------------------------- GL_NV_viewport_swizzle ------------------------ */ + +#ifndef GL_NV_viewport_swizzle +#define GL_NV_viewport_swizzle 1 + +#define GL_VIEWPORT_SWIZZLE_POSITIVE_X_NV 0x9350 +#define GL_VIEWPORT_SWIZZLE_NEGATIVE_X_NV 0x9351 +#define GL_VIEWPORT_SWIZZLE_POSITIVE_Y_NV 0x9352 +#define GL_VIEWPORT_SWIZZLE_NEGATIVE_Y_NV 0x9353 +#define GL_VIEWPORT_SWIZZLE_POSITIVE_Z_NV 0x9354 +#define GL_VIEWPORT_SWIZZLE_NEGATIVE_Z_NV 0x9355 +#define GL_VIEWPORT_SWIZZLE_POSITIVE_W_NV 0x9356 +#define GL_VIEWPORT_SWIZZLE_NEGATIVE_W_NV 0x9357 +#define GL_VIEWPORT_SWIZZLE_X_NV 0x9358 +#define GL_VIEWPORT_SWIZZLE_Y_NV 0x9359 +#define GL_VIEWPORT_SWIZZLE_Z_NV 0x935A +#define GL_VIEWPORT_SWIZZLE_W_NV 0x935B + +typedef void (GLAPIENTRY * PFNGLVIEWPORTSWIZZLENVPROC) (GLuint index, GLenum swizzlex, GLenum swizzley, GLenum swizzlez, GLenum swizzlew); + +#define glViewportSwizzleNV GLEW_GET_FUN(__glewViewportSwizzleNV) + +#define GLEW_NV_viewport_swizzle GLEW_GET_VAR(__GLEW_NV_viewport_swizzle) + +#endif /* GL_NV_viewport_swizzle */ + +/* ------------------------ GL_OES_byte_coordinates ------------------------ */ + +#ifndef GL_OES_byte_coordinates +#define GL_OES_byte_coordinates 1 + +#define GLEW_OES_byte_coordinates GLEW_GET_VAR(__GLEW_OES_byte_coordinates) + +#endif /* GL_OES_byte_coordinates */ + +/* ---------------------------- GL_OML_interlace --------------------------- */ + +#ifndef GL_OML_interlace +#define GL_OML_interlace 1 + +#define GL_INTERLACE_OML 0x8980 +#define GL_INTERLACE_READ_OML 0x8981 + +#define GLEW_OML_interlace GLEW_GET_VAR(__GLEW_OML_interlace) + +#endif /* GL_OML_interlace */ + +/* ---------------------------- GL_OML_resample ---------------------------- */ + +#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 + +#define GLEW_OML_resample GLEW_GET_VAR(__GLEW_OML_resample) + +#endif /* GL_OML_resample */ + +/* ---------------------------- GL_OML_subsample --------------------------- */ + +#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 + +#define GLEW_OML_subsample GLEW_GET_VAR(__GLEW_OML_subsample) + +#endif /* GL_OML_subsample */ + +/* ---------------------------- GL_OVR_multiview --------------------------- */ + +#ifndef GL_OVR_multiview +#define GL_OVR_multiview 1 + +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR 0x9630 +#define GL_MAX_VIEWS_OVR 0x9631 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR 0x9632 +#define GL_FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR 0x9633 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint baseViewIndex, GLsizei numViews); + +#define glFramebufferTextureMultiviewOVR GLEW_GET_FUN(__glewFramebufferTextureMultiviewOVR) + +#define GLEW_OVR_multiview GLEW_GET_VAR(__GLEW_OVR_multiview) + +#endif /* GL_OVR_multiview */ + +/* --------------------------- GL_OVR_multiview2 --------------------------- */ + +#ifndef GL_OVR_multiview2 +#define GL_OVR_multiview2 1 + +#define GLEW_OVR_multiview2 GLEW_GET_VAR(__GLEW_OVR_multiview2) + +#endif /* GL_OVR_multiview2 */ + +/* ------------ GL_OVR_multiview_multisampled_render_to_texture ------------ */ + +#ifndef GL_OVR_multiview_multisampled_render_to_texture +#define GL_OVR_multiview_multisampled_render_to_texture 1 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREMULTISAMPLEMULTIVIEWOVRPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLsizei samples, GLint baseViewIndex, GLsizei numViews); + +#define glFramebufferTextureMultisampleMultiviewOVR GLEW_GET_FUN(__glewFramebufferTextureMultisampleMultiviewOVR) + +#define GLEW_OVR_multiview_multisampled_render_to_texture GLEW_GET_VAR(__GLEW_OVR_multiview_multisampled_render_to_texture) + +#endif /* GL_OVR_multiview_multisampled_render_to_texture */ + +/* --------------------------- GL_PGI_misc_hints --------------------------- */ + +#ifndef GL_PGI_misc_hints +#define GL_PGI_misc_hints 1 + +#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 107000 +#define GL_CONSERVE_MEMORY_HINT_PGI 107005 +#define GL_RECLAIM_MEMORY_HINT_PGI 107006 +#define GL_NATIVE_GRAPHICS_HANDLE_PGI 107010 +#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 107011 +#define GL_NATIVE_GRAPHICS_END_HINT_PGI 107012 +#define GL_ALWAYS_FAST_HINT_PGI 107020 +#define GL_ALWAYS_SOFT_HINT_PGI 107021 +#define GL_ALLOW_DRAW_OBJ_HINT_PGI 107022 +#define GL_ALLOW_DRAW_WIN_HINT_PGI 107023 +#define GL_ALLOW_DRAW_FRG_HINT_PGI 107024 +#define GL_ALLOW_DRAW_MEM_HINT_PGI 107025 +#define GL_STRICT_DEPTHFUNC_HINT_PGI 107030 +#define GL_STRICT_LIGHTING_HINT_PGI 107031 +#define GL_STRICT_SCISSOR_HINT_PGI 107032 +#define GL_FULL_STIPPLE_HINT_PGI 107033 +#define GL_CLIP_NEAR_HINT_PGI 107040 +#define GL_CLIP_FAR_HINT_PGI 107041 +#define GL_WIDE_LINE_HINT_PGI 107042 +#define GL_BACK_NORMALS_HINT_PGI 107043 + +#define GLEW_PGI_misc_hints GLEW_GET_VAR(__GLEW_PGI_misc_hints) + +#endif /* GL_PGI_misc_hints */ + +/* -------------------------- GL_PGI_vertex_hints -------------------------- */ + +#ifndef GL_PGI_vertex_hints +#define GL_PGI_vertex_hints 1 + +#define GL_VERTEX23_BIT_PGI 0x00000004 +#define GL_VERTEX4_BIT_PGI 0x00000008 +#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_VERTEX_DATA_HINT_PGI 107050 +#define GL_VERTEX_CONSISTENT_HINT_PGI 107051 +#define GL_MATERIAL_SIDE_HINT_PGI 107052 +#define GL_MAX_VERTEX_HINT_PGI 107053 +#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 GLEW_PGI_vertex_hints GLEW_GET_VAR(__GLEW_PGI_vertex_hints) + +#endif /* GL_PGI_vertex_hints */ + +/* --------------------------- GL_QCOM_alpha_test -------------------------- */ + +#ifndef GL_QCOM_alpha_test +#define GL_QCOM_alpha_test 1 + +#define GL_ALPHA_TEST_QCOM 0x0BC0 +#define GL_ALPHA_TEST_FUNC_QCOM 0x0BC1 +#define GL_ALPHA_TEST_REF_QCOM 0x0BC2 + +typedef void (GLAPIENTRY * PFNGLALPHAFUNCQCOMPROC) (GLenum func, GLclampf ref); + +#define glAlphaFuncQCOM GLEW_GET_FUN(__glewAlphaFuncQCOM) + +#define GLEW_QCOM_alpha_test GLEW_GET_VAR(__GLEW_QCOM_alpha_test) + +#endif /* GL_QCOM_alpha_test */ + +/* ------------------------ GL_QCOM_binning_control ------------------------ */ + +#ifndef GL_QCOM_binning_control +#define GL_QCOM_binning_control 1 + +#define GL_DONT_CARE 0x1100 +#define GL_BINNING_CONTROL_HINT_QCOM 0x8FB0 +#define GL_CPU_OPTIMIZED_QCOM 0x8FB1 +#define GL_GPU_OPTIMIZED_QCOM 0x8FB2 +#define GL_RENDER_DIRECT_TO_FRAMEBUFFER_QCOM 0x8FB3 + +#define GLEW_QCOM_binning_control GLEW_GET_VAR(__GLEW_QCOM_binning_control) + +#endif /* GL_QCOM_binning_control */ + +/* ------------------------- GL_QCOM_driver_control ------------------------ */ + +#ifndef GL_QCOM_driver_control +#define GL_QCOM_driver_control 1 + +typedef void (GLAPIENTRY * PFNGLDISABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl); +typedef void (GLAPIENTRY * PFNGLENABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl); +typedef void (GLAPIENTRY * PFNGLGETDRIVERCONTROLSTRINGQCOMPROC) (GLuint driverControl, GLsizei bufSize, GLsizei* length, GLchar *driverControlString); +typedef void (GLAPIENTRY * PFNGLGETDRIVERCONTROLSQCOMPROC) (GLint* num, GLsizei size, GLuint *driverControls); + +#define glDisableDriverControlQCOM GLEW_GET_FUN(__glewDisableDriverControlQCOM) +#define glEnableDriverControlQCOM GLEW_GET_FUN(__glewEnableDriverControlQCOM) +#define glGetDriverControlStringQCOM GLEW_GET_FUN(__glewGetDriverControlStringQCOM) +#define glGetDriverControlsQCOM GLEW_GET_FUN(__glewGetDriverControlsQCOM) + +#define GLEW_QCOM_driver_control GLEW_GET_VAR(__GLEW_QCOM_driver_control) + +#endif /* GL_QCOM_driver_control */ + +/* -------------------------- GL_QCOM_extended_get ------------------------- */ + +#ifndef GL_QCOM_extended_get +#define GL_QCOM_extended_get 1 + +#define GL_TEXTURE_WIDTH_QCOM 0x8BD2 +#define GL_TEXTURE_HEIGHT_QCOM 0x8BD3 +#define GL_TEXTURE_DEPTH_QCOM 0x8BD4 +#define GL_TEXTURE_INTERNAL_FORMAT_QCOM 0x8BD5 +#define GL_TEXTURE_FORMAT_QCOM 0x8BD6 +#define GL_TEXTURE_TYPE_QCOM 0x8BD7 +#define GL_TEXTURE_IMAGE_VALID_QCOM 0x8BD8 +#define GL_TEXTURE_NUM_LEVELS_QCOM 0x8BD9 +#define GL_TEXTURE_TARGET_QCOM 0x8BDA +#define GL_TEXTURE_OBJECT_VALID_QCOM 0x8BDB +#define GL_STATE_RESTORE 0x8BDC + +typedef void (GLAPIENTRY * PFNGLEXTGETBUFFERPOINTERVQCOMPROC) (GLenum target, void** params); +typedef void (GLAPIENTRY * PFNGLEXTGETBUFFERSQCOMPROC) (GLuint* buffers, GLint maxBuffers, GLint* numBuffers); +typedef void (GLAPIENTRY * PFNGLEXTGETFRAMEBUFFERSQCOMPROC) (GLuint* framebuffers, GLint maxFramebuffers, GLint* numFramebuffers); +typedef void (GLAPIENTRY * PFNGLEXTGETRENDERBUFFERSQCOMPROC) (GLuint* renderbuffers, GLint maxRenderbuffers, GLint* numRenderbuffers); +typedef void (GLAPIENTRY * PFNGLEXTGETTEXLEVELPARAMETERIVQCOMPROC) (GLuint texture, GLenum face, GLint level, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLEXTGETTEXSUBIMAGEQCOMPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, void *texels); +typedef void (GLAPIENTRY * PFNGLEXTGETTEXTURESQCOMPROC) (GLuint* textures, GLint maxTextures, GLint* numTextures); +typedef void (GLAPIENTRY * PFNGLEXTTEXOBJECTSTATEOVERRIDEIQCOMPROC) (GLenum target, GLenum pname, GLint param); + +#define glExtGetBufferPointervQCOM GLEW_GET_FUN(__glewExtGetBufferPointervQCOM) +#define glExtGetBuffersQCOM GLEW_GET_FUN(__glewExtGetBuffersQCOM) +#define glExtGetFramebuffersQCOM GLEW_GET_FUN(__glewExtGetFramebuffersQCOM) +#define glExtGetRenderbuffersQCOM GLEW_GET_FUN(__glewExtGetRenderbuffersQCOM) +#define glExtGetTexLevelParameterivQCOM GLEW_GET_FUN(__glewExtGetTexLevelParameterivQCOM) +#define glExtGetTexSubImageQCOM GLEW_GET_FUN(__glewExtGetTexSubImageQCOM) +#define glExtGetTexturesQCOM GLEW_GET_FUN(__glewExtGetTexturesQCOM) +#define glExtTexObjectStateOverrideiQCOM GLEW_GET_FUN(__glewExtTexObjectStateOverrideiQCOM) + +#define GLEW_QCOM_extended_get GLEW_GET_VAR(__GLEW_QCOM_extended_get) + +#endif /* GL_QCOM_extended_get */ + +/* ------------------------- GL_QCOM_extended_get2 ------------------------- */ + +#ifndef GL_QCOM_extended_get2 +#define GL_QCOM_extended_get2 1 + +typedef void (GLAPIENTRY * PFNGLEXTGETPROGRAMBINARYSOURCEQCOMPROC) (GLuint program, GLenum shadertype, GLchar* source, GLint* length); +typedef void (GLAPIENTRY * PFNGLEXTGETPROGRAMSQCOMPROC) (GLuint* programs, GLint maxPrograms, GLint* numPrograms); +typedef void (GLAPIENTRY * PFNGLEXTGETSHADERSQCOMPROC) (GLuint* shaders, GLint maxShaders, GLint* numShaders); +typedef GLboolean (GLAPIENTRY * PFNGLEXTISPROGRAMBINARYQCOMPROC) (GLuint program); + +#define glExtGetProgramBinarySourceQCOM GLEW_GET_FUN(__glewExtGetProgramBinarySourceQCOM) +#define glExtGetProgramsQCOM GLEW_GET_FUN(__glewExtGetProgramsQCOM) +#define glExtGetShadersQCOM GLEW_GET_FUN(__glewExtGetShadersQCOM) +#define glExtIsProgramBinaryQCOM GLEW_GET_FUN(__glewExtIsProgramBinaryQCOM) + +#define GLEW_QCOM_extended_get2 GLEW_GET_VAR(__GLEW_QCOM_extended_get2) + +#endif /* GL_QCOM_extended_get2 */ + +/* ---------------------- GL_QCOM_framebuffer_foveated --------------------- */ + +#ifndef GL_QCOM_framebuffer_foveated +#define GL_QCOM_framebuffer_foveated 1 + +#define GL_FOVEATION_ENABLE_BIT_QCOM 0x1 +#define GL_FOVEATION_SCALED_BIN_METHOD_BIT_QCOM 0x2 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERFOVEATIONCONFIGQCOMPROC) (GLuint fbo, GLuint numLayers, GLuint focalPointsPerLayer, GLuint requestedFeatures, GLuint* providedFeatures); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERFOVEATIONPARAMETERSQCOMPROC) (GLuint fbo, GLuint layer, GLuint focalPoint, GLfloat focalX, GLfloat focalY, GLfloat gainX, GLfloat gainY, GLfloat foveaArea); + +#define glFramebufferFoveationConfigQCOM GLEW_GET_FUN(__glewFramebufferFoveationConfigQCOM) +#define glFramebufferFoveationParametersQCOM GLEW_GET_FUN(__glewFramebufferFoveationParametersQCOM) + +#define GLEW_QCOM_framebuffer_foveated GLEW_GET_VAR(__GLEW_QCOM_framebuffer_foveated) + +#endif /* GL_QCOM_framebuffer_foveated */ + +/* ---------------------- GL_QCOM_perfmon_global_mode ---------------------- */ + +#ifndef GL_QCOM_perfmon_global_mode +#define GL_QCOM_perfmon_global_mode 1 + +#define GL_PERFMON_GLOBAL_MODE_QCOM 0x8FA0 + +#define GLEW_QCOM_perfmon_global_mode GLEW_GET_VAR(__GLEW_QCOM_perfmon_global_mode) + +#endif /* GL_QCOM_perfmon_global_mode */ + +/* -------------- GL_QCOM_shader_framebuffer_fetch_noncoherent ------------- */ + +#ifndef GL_QCOM_shader_framebuffer_fetch_noncoherent +#define GL_QCOM_shader_framebuffer_fetch_noncoherent 1 + +#define GL_FRAMEBUFFER_FETCH_NONCOHERENT_QCOM 0x96A2 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERFETCHBARRIERQCOMPROC) (void); + +#define glFramebufferFetchBarrierQCOM GLEW_GET_FUN(__glewFramebufferFetchBarrierQCOM) + +#define GLEW_QCOM_shader_framebuffer_fetch_noncoherent GLEW_GET_VAR(__GLEW_QCOM_shader_framebuffer_fetch_noncoherent) + +#endif /* GL_QCOM_shader_framebuffer_fetch_noncoherent */ + +/* ------------------------ GL_QCOM_tiled_rendering ------------------------ */ + +#ifndef GL_QCOM_tiled_rendering +#define GL_QCOM_tiled_rendering 1 + +#define GL_COLOR_BUFFER_BIT0_QCOM 0x00000001 +#define GL_COLOR_BUFFER_BIT1_QCOM 0x00000002 +#define GL_COLOR_BUFFER_BIT2_QCOM 0x00000004 +#define GL_COLOR_BUFFER_BIT3_QCOM 0x00000008 +#define GL_COLOR_BUFFER_BIT4_QCOM 0x00000010 +#define GL_COLOR_BUFFER_BIT5_QCOM 0x00000020 +#define GL_COLOR_BUFFER_BIT6_QCOM 0x00000040 +#define GL_COLOR_BUFFER_BIT7_QCOM 0x00000080 +#define GL_DEPTH_BUFFER_BIT0_QCOM 0x00000100 +#define GL_DEPTH_BUFFER_BIT1_QCOM 0x00000200 +#define GL_DEPTH_BUFFER_BIT2_QCOM 0x00000400 +#define GL_DEPTH_BUFFER_BIT3_QCOM 0x00000800 +#define GL_DEPTH_BUFFER_BIT4_QCOM 0x00001000 +#define GL_DEPTH_BUFFER_BIT5_QCOM 0x00002000 +#define GL_DEPTH_BUFFER_BIT6_QCOM 0x00004000 +#define GL_DEPTH_BUFFER_BIT7_QCOM 0x00008000 +#define GL_STENCIL_BUFFER_BIT0_QCOM 0x00010000 +#define GL_STENCIL_BUFFER_BIT1_QCOM 0x00020000 +#define GL_STENCIL_BUFFER_BIT2_QCOM 0x00040000 +#define GL_STENCIL_BUFFER_BIT3_QCOM 0x00080000 +#define GL_STENCIL_BUFFER_BIT4_QCOM 0x00100000 +#define GL_STENCIL_BUFFER_BIT5_QCOM 0x00200000 +#define GL_STENCIL_BUFFER_BIT6_QCOM 0x00400000 +#define GL_STENCIL_BUFFER_BIT7_QCOM 0x00800000 +#define GL_MULTISAMPLE_BUFFER_BIT0_QCOM 0x01000000 +#define GL_MULTISAMPLE_BUFFER_BIT1_QCOM 0x02000000 +#define GL_MULTISAMPLE_BUFFER_BIT2_QCOM 0x04000000 +#define GL_MULTISAMPLE_BUFFER_BIT3_QCOM 0x08000000 +#define GL_MULTISAMPLE_BUFFER_BIT4_QCOM 0x10000000 +#define GL_MULTISAMPLE_BUFFER_BIT5_QCOM 0x20000000 +#define GL_MULTISAMPLE_BUFFER_BIT6_QCOM 0x40000000 +#define GL_MULTISAMPLE_BUFFER_BIT7_QCOM 0x80000000 + +typedef void (GLAPIENTRY * PFNGLENDTILINGQCOMPROC) (GLbitfield preserveMask); +typedef void (GLAPIENTRY * PFNGLSTARTTILINGQCOMPROC) (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask); + +#define glEndTilingQCOM GLEW_GET_FUN(__glewEndTilingQCOM) +#define glStartTilingQCOM GLEW_GET_FUN(__glewStartTilingQCOM) + +#define GLEW_QCOM_tiled_rendering GLEW_GET_VAR(__GLEW_QCOM_tiled_rendering) + +#endif /* GL_QCOM_tiled_rendering */ + +/* ---------------------- GL_QCOM_writeonly_rendering ---------------------- */ + +#ifndef GL_QCOM_writeonly_rendering +#define GL_QCOM_writeonly_rendering 1 + +#define GL_WRITEONLY_RENDERING_QCOM 0x8823 + +#define GLEW_QCOM_writeonly_rendering GLEW_GET_VAR(__GLEW_QCOM_writeonly_rendering) + +#endif /* GL_QCOM_writeonly_rendering */ + +/* ---------------------- GL_REGAL_ES1_0_compatibility --------------------- */ + +#ifndef GL_REGAL_ES1_0_compatibility +#define GL_REGAL_ES1_0_compatibility 1 + +typedef int GLclampx; + +typedef void (GLAPIENTRY * PFNGLALPHAFUNCXPROC) (GLenum func, GLclampx ref); +typedef void (GLAPIENTRY * PFNGLCLEARCOLORXPROC) (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha); +typedef void (GLAPIENTRY * PFNGLCLEARDEPTHXPROC) (GLclampx depth); +typedef void (GLAPIENTRY * PFNGLCOLOR4XPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEXPROC) (GLclampx zNear, GLclampx zFar); +typedef void (GLAPIENTRY * PFNGLFOGXPROC) (GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLFOGXVPROC) (GLenum pname, const GLfixed* params); +typedef void (GLAPIENTRY * PFNGLFRUSTUMFPROC) (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); +typedef void (GLAPIENTRY * PFNGLFRUSTUMXPROC) (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar); +typedef void (GLAPIENTRY * PFNGLLIGHTMODELXPROC) (GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLLIGHTMODELXVPROC) (GLenum pname, const GLfixed* params); +typedef void (GLAPIENTRY * PFNGLLIGHTXPROC) (GLenum light, GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLLIGHTXVPROC) (GLenum light, GLenum pname, const GLfixed* params); +typedef void (GLAPIENTRY * PFNGLLINEWIDTHXPROC) (GLfixed width); +typedef void (GLAPIENTRY * PFNGLLOADMATRIXXPROC) (const GLfixed* m); +typedef void (GLAPIENTRY * PFNGLMATERIALXPROC) (GLenum face, GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLMATERIALXVPROC) (GLenum face, GLenum pname, const GLfixed* params); +typedef void (GLAPIENTRY * PFNGLMULTMATRIXXPROC) (const GLfixed* m); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4XPROC) (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q); +typedef void (GLAPIENTRY * PFNGLNORMAL3XPROC) (GLfixed nx, GLfixed ny, GLfixed nz); +typedef void (GLAPIENTRY * PFNGLORTHOFPROC) (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); +typedef void (GLAPIENTRY * PFNGLORTHOXPROC) (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar); +typedef void (GLAPIENTRY * PFNGLPOINTSIZEXPROC) (GLfixed size); +typedef void (GLAPIENTRY * PFNGLPOLYGONOFFSETXPROC) (GLfixed factor, GLfixed units); +typedef void (GLAPIENTRY * PFNGLROTATEXPROC) (GLfixed angle, GLfixed x, GLfixed y, GLfixed z); +typedef void (GLAPIENTRY * PFNGLSAMPLECOVERAGEXPROC) (GLclampx value, GLboolean invert); +typedef void (GLAPIENTRY * PFNGLSCALEXPROC) (GLfixed x, GLfixed y, GLfixed z); +typedef void (GLAPIENTRY * PFNGLTEXENVXPROC) (GLenum target, GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLTEXENVXVPROC) (GLenum target, GLenum pname, const GLfixed* params); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERXPROC) (GLenum target, GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLTRANSLATEXPROC) (GLfixed x, GLfixed y, GLfixed z); + +#define glAlphaFuncx GLEW_GET_FUN(__glewAlphaFuncx) +#define glClearColorx GLEW_GET_FUN(__glewClearColorx) +#define glClearDepthx GLEW_GET_FUN(__glewClearDepthx) +#define glColor4x GLEW_GET_FUN(__glewColor4x) +#define glDepthRangex GLEW_GET_FUN(__glewDepthRangex) +#define glFogx GLEW_GET_FUN(__glewFogx) +#define glFogxv GLEW_GET_FUN(__glewFogxv) +#define glFrustumf GLEW_GET_FUN(__glewFrustumf) +#define glFrustumx GLEW_GET_FUN(__glewFrustumx) +#define glLightModelx GLEW_GET_FUN(__glewLightModelx) +#define glLightModelxv GLEW_GET_FUN(__glewLightModelxv) +#define glLightx GLEW_GET_FUN(__glewLightx) +#define glLightxv GLEW_GET_FUN(__glewLightxv) +#define glLineWidthx GLEW_GET_FUN(__glewLineWidthx) +#define glLoadMatrixx GLEW_GET_FUN(__glewLoadMatrixx) +#define glMaterialx GLEW_GET_FUN(__glewMaterialx) +#define glMaterialxv GLEW_GET_FUN(__glewMaterialxv) +#define glMultMatrixx GLEW_GET_FUN(__glewMultMatrixx) +#define glMultiTexCoord4x GLEW_GET_FUN(__glewMultiTexCoord4x) +#define glNormal3x GLEW_GET_FUN(__glewNormal3x) +#define glOrthof GLEW_GET_FUN(__glewOrthof) +#define glOrthox GLEW_GET_FUN(__glewOrthox) +#define glPointSizex GLEW_GET_FUN(__glewPointSizex) +#define glPolygonOffsetx GLEW_GET_FUN(__glewPolygonOffsetx) +#define glRotatex GLEW_GET_FUN(__glewRotatex) +#define glSampleCoveragex GLEW_GET_FUN(__glewSampleCoveragex) +#define glScalex GLEW_GET_FUN(__glewScalex) +#define glTexEnvx GLEW_GET_FUN(__glewTexEnvx) +#define glTexEnvxv GLEW_GET_FUN(__glewTexEnvxv) +#define glTexParameterx GLEW_GET_FUN(__glewTexParameterx) +#define glTranslatex GLEW_GET_FUN(__glewTranslatex) + +#define GLEW_REGAL_ES1_0_compatibility GLEW_GET_VAR(__GLEW_REGAL_ES1_0_compatibility) + +#endif /* GL_REGAL_ES1_0_compatibility */ + +/* ---------------------- GL_REGAL_ES1_1_compatibility --------------------- */ + +#ifndef GL_REGAL_ES1_1_compatibility +#define GL_REGAL_ES1_1_compatibility 1 + +typedef void (GLAPIENTRY * PFNGLCLIPPLANEFPROC) (GLenum plane, const GLfloat* equation); +typedef void (GLAPIENTRY * PFNGLCLIPPLANEXPROC) (GLenum plane, const GLfixed* equation); +typedef void (GLAPIENTRY * PFNGLGETCLIPPLANEFPROC) (GLenum pname, GLfloat eqn[4]); +typedef void (GLAPIENTRY * PFNGLGETCLIPPLANEXPROC) (GLenum pname, GLfixed eqn[4]); +typedef void (GLAPIENTRY * PFNGLGETFIXEDVPROC) (GLenum pname, GLfixed* params); +typedef void (GLAPIENTRY * PFNGLGETLIGHTXVPROC) (GLenum light, GLenum pname, GLfixed* params); +typedef void (GLAPIENTRY * PFNGLGETMATERIALXVPROC) (GLenum face, GLenum pname, GLfixed* params); +typedef void (GLAPIENTRY * PFNGLGETTEXENVXVPROC) (GLenum env, GLenum pname, GLfixed* params); +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERXVPROC) (GLenum target, GLenum pname, GLfixed* params); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERXPROC) (GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERXVPROC) (GLenum pname, const GLfixed* params); +typedef void (GLAPIENTRY * PFNGLPOINTSIZEPOINTEROESPROC) (GLenum type, GLsizei stride, const void *pointer); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERXVPROC) (GLenum target, GLenum pname, const GLfixed* params); + +#define glClipPlanef GLEW_GET_FUN(__glewClipPlanef) +#define glClipPlanex GLEW_GET_FUN(__glewClipPlanex) +#define glGetClipPlanef GLEW_GET_FUN(__glewGetClipPlanef) +#define glGetClipPlanex GLEW_GET_FUN(__glewGetClipPlanex) +#define glGetFixedv GLEW_GET_FUN(__glewGetFixedv) +#define glGetLightxv GLEW_GET_FUN(__glewGetLightxv) +#define glGetMaterialxv GLEW_GET_FUN(__glewGetMaterialxv) +#define glGetTexEnvxv GLEW_GET_FUN(__glewGetTexEnvxv) +#define glGetTexParameterxv GLEW_GET_FUN(__glewGetTexParameterxv) +#define glPointParameterx GLEW_GET_FUN(__glewPointParameterx) +#define glPointParameterxv GLEW_GET_FUN(__glewPointParameterxv) +#define glPointSizePointerOES GLEW_GET_FUN(__glewPointSizePointerOES) +#define glTexParameterxv GLEW_GET_FUN(__glewTexParameterxv) + +#define GLEW_REGAL_ES1_1_compatibility GLEW_GET_VAR(__GLEW_REGAL_ES1_1_compatibility) + +#endif /* GL_REGAL_ES1_1_compatibility */ + +/* ---------------------------- GL_REGAL_enable ---------------------------- */ + +#ifndef GL_REGAL_enable +#define GL_REGAL_enable 1 + +#define GL_ERROR_REGAL 0x9322 +#define GL_DEBUG_REGAL 0x9323 +#define GL_LOG_REGAL 0x9324 +#define GL_EMULATION_REGAL 0x9325 +#define GL_DRIVER_REGAL 0x9326 +#define GL_MISSING_REGAL 0x9360 +#define GL_TRACE_REGAL 0x9361 +#define GL_CACHE_REGAL 0x9362 +#define GL_CODE_REGAL 0x9363 +#define GL_STATISTICS_REGAL 0x9364 + +#define GLEW_REGAL_enable GLEW_GET_VAR(__GLEW_REGAL_enable) + +#endif /* GL_REGAL_enable */ + +/* ------------------------- GL_REGAL_error_string ------------------------- */ + +#ifndef GL_REGAL_error_string +#define GL_REGAL_error_string 1 + +typedef const GLchar* (GLAPIENTRY * PFNGLERRORSTRINGREGALPROC) (GLenum error); + +#define glErrorStringREGAL GLEW_GET_FUN(__glewErrorStringREGAL) + +#define GLEW_REGAL_error_string GLEW_GET_VAR(__GLEW_REGAL_error_string) + +#endif /* GL_REGAL_error_string */ + +/* ------------------------ GL_REGAL_extension_query ----------------------- */ + +#ifndef GL_REGAL_extension_query +#define GL_REGAL_extension_query 1 + +typedef GLboolean (GLAPIENTRY * PFNGLGETEXTENSIONREGALPROC) (const GLchar* ext); +typedef GLboolean (GLAPIENTRY * PFNGLISSUPPORTEDREGALPROC) (const GLchar* ext); + +#define glGetExtensionREGAL GLEW_GET_FUN(__glewGetExtensionREGAL) +#define glIsSupportedREGAL GLEW_GET_FUN(__glewIsSupportedREGAL) + +#define GLEW_REGAL_extension_query GLEW_GET_VAR(__GLEW_REGAL_extension_query) + +#endif /* GL_REGAL_extension_query */ + +/* ------------------------------ GL_REGAL_log ----------------------------- */ + +#ifndef GL_REGAL_log +#define GL_REGAL_log 1 + +#define GL_LOG_ERROR_REGAL 0x9319 +#define GL_LOG_WARNING_REGAL 0x931A +#define GL_LOG_INFO_REGAL 0x931B +#define GL_LOG_APP_REGAL 0x931C +#define GL_LOG_DRIVER_REGAL 0x931D +#define GL_LOG_INTERNAL_REGAL 0x931E +#define GL_LOG_DEBUG_REGAL 0x931F +#define GL_LOG_STATUS_REGAL 0x9320 +#define GL_LOG_HTTP_REGAL 0x9321 + +typedef void (APIENTRY *GLLOGPROCREGAL)(GLenum stream, GLsizei length, const GLchar *message, void *context); + +typedef void (GLAPIENTRY * PFNGLLOGMESSAGECALLBACKREGALPROC) (GLLOGPROCREGAL callback); + +#define glLogMessageCallbackREGAL GLEW_GET_FUN(__glewLogMessageCallbackREGAL) + +#define GLEW_REGAL_log GLEW_GET_VAR(__GLEW_REGAL_log) + +#endif /* GL_REGAL_log */ + +/* ------------------------- GL_REGAL_proc_address ------------------------- */ + +#ifndef GL_REGAL_proc_address +#define GL_REGAL_proc_address 1 + +typedef void * (GLAPIENTRY * PFNGLGETPROCADDRESSREGALPROC) (const GLchar *name); + +#define glGetProcAddressREGAL GLEW_GET_FUN(__glewGetProcAddressREGAL) + +#define GLEW_REGAL_proc_address GLEW_GET_VAR(__GLEW_REGAL_proc_address) + +#endif /* GL_REGAL_proc_address */ + +/* ----------------------- GL_REND_screen_coordinates ---------------------- */ + +#ifndef GL_REND_screen_coordinates +#define GL_REND_screen_coordinates 1 + +#define GL_SCREEN_COORDINATES_REND 0x8490 +#define GL_INVERTED_SCREEN_W_REND 0x8491 + +#define GLEW_REND_screen_coordinates GLEW_GET_VAR(__GLEW_REND_screen_coordinates) + +#endif /* GL_REND_screen_coordinates */ + +/* ------------------------------- GL_S3_s3tc ------------------------------ */ + +#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 + +#define GLEW_S3_s3tc GLEW_GET_VAR(__GLEW_S3_s3tc) + +#endif /* GL_S3_s3tc */ + +/* ------------------------- GL_SGIS_clip_band_hint ------------------------ */ + +#ifndef GL_SGIS_clip_band_hint +#define GL_SGIS_clip_band_hint 1 + +#define GLEW_SGIS_clip_band_hint GLEW_GET_VAR(__GLEW_SGIS_clip_band_hint) + +#endif /* GL_SGIS_clip_band_hint */ + +/* -------------------------- GL_SGIS_color_range -------------------------- */ + +#ifndef GL_SGIS_color_range +#define GL_SGIS_color_range 1 + +#define GL_EXTENDED_RANGE_SGIS 0x85A5 +#define GL_MIN_RED_SGIS 0x85A6 +#define GL_MAX_RED_SGIS 0x85A7 +#define GL_MIN_GREEN_SGIS 0x85A8 +#define GL_MAX_GREEN_SGIS 0x85A9 +#define GL_MIN_BLUE_SGIS 0x85AA +#define GL_MAX_BLUE_SGIS 0x85AB +#define GL_MIN_ALPHA_SGIS 0x85AC +#define GL_MAX_ALPHA_SGIS 0x85AD + +#define GLEW_SGIS_color_range GLEW_GET_VAR(__GLEW_SGIS_color_range) + +#endif /* GL_SGIS_color_range */ + +/* ------------------------- GL_SGIS_detail_texture ------------------------ */ + +#ifndef GL_SGIS_detail_texture +#define GL_SGIS_detail_texture 1 + +typedef void (GLAPIENTRY * PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat* points); +typedef void (GLAPIENTRY * PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat* points); + +#define glDetailTexFuncSGIS GLEW_GET_FUN(__glewDetailTexFuncSGIS) +#define glGetDetailTexFuncSGIS GLEW_GET_FUN(__glewGetDetailTexFuncSGIS) + +#define GLEW_SGIS_detail_texture GLEW_GET_VAR(__GLEW_SGIS_detail_texture) + +#endif /* GL_SGIS_detail_texture */ + +/* -------------------------- GL_SGIS_fog_function ------------------------- */ + +#ifndef GL_SGIS_fog_function +#define GL_SGIS_fog_function 1 + +typedef void (GLAPIENTRY * PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat* points); +typedef void (GLAPIENTRY * PFNGLGETFOGFUNCSGISPROC) (GLfloat* points); + +#define glFogFuncSGIS GLEW_GET_FUN(__glewFogFuncSGIS) +#define glGetFogFuncSGIS GLEW_GET_FUN(__glewGetFogFuncSGIS) + +#define GLEW_SGIS_fog_function GLEW_GET_VAR(__GLEW_SGIS_fog_function) + +#endif /* GL_SGIS_fog_function */ + +/* ------------------------ GL_SGIS_generate_mipmap ------------------------ */ + +#ifndef GL_SGIS_generate_mipmap +#define GL_SGIS_generate_mipmap 1 + +#define GL_GENERATE_MIPMAP_SGIS 0x8191 +#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 + +#define GLEW_SGIS_generate_mipmap GLEW_GET_VAR(__GLEW_SGIS_generate_mipmap) + +#endif /* GL_SGIS_generate_mipmap */ + +/* -------------------------- GL_SGIS_line_texgen -------------------------- */ + +#ifndef GL_SGIS_line_texgen +#define GL_SGIS_line_texgen 1 + +#define GLEW_SGIS_line_texgen GLEW_GET_VAR(__GLEW_SGIS_line_texgen) + +#endif /* GL_SGIS_line_texgen */ + +/* -------------------------- GL_SGIS_multisample -------------------------- */ + +#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 (GLAPIENTRY * PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert); +typedef void (GLAPIENTRY * PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); + +#define glSampleMaskSGIS GLEW_GET_FUN(__glewSampleMaskSGIS) +#define glSamplePatternSGIS GLEW_GET_FUN(__glewSamplePatternSGIS) + +#define GLEW_SGIS_multisample GLEW_GET_VAR(__GLEW_SGIS_multisample) + +#endif /* GL_SGIS_multisample */ + +/* -------------------------- GL_SGIS_multitexture ------------------------- */ + +#ifndef GL_SGIS_multitexture +#define GL_SGIS_multitexture 1 + +#define GL_SELECTED_TEXTURE_SGIS 0x83C0 +#define GL_SELECTED_TEXTURE_COORD_SET_SGIS 0x83C1 +#define GL_SELECTED_TEXTURE_TRANSFORM_SGIS 0x83C2 +#define GL_MAX_TEXTURES_SGIS 0x83C3 +#define GL_MAX_TEXTURE_COORD_SETS_SGIS 0x83C4 +#define GL_TEXTURE_COORD_SET_INTERLEAVE_FACTOR_SGIS 0x83C5 +#define GL_TEXTURE_ENV_COORD_SET_SGIS 0x83C6 +#define GL_TEXTURE0_SGIS 0x83C7 +#define GL_TEXTURE1_SGIS 0x83C8 +#define GL_TEXTURE2_SGIS 0x83C9 +#define GL_TEXTURE3_SGIS 0x83CA + +typedef void (GLAPIENTRY * PFNGLINTERLEAVEDTEXTURECOORDSETSSGISPROC) (GLint factor); +typedef void (GLAPIENTRY * PFNGLSELECTTEXTURECOORDSETSGISPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLSELECTTEXTURESGISPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLSELECTTEXTURETRANSFORMSGISPROC) (GLenum target); + +#define glInterleavedTextureCoordSetsSGIS GLEW_GET_FUN(__glewInterleavedTextureCoordSetsSGIS) +#define glSelectTextureCoordSetSGIS GLEW_GET_FUN(__glewSelectTextureCoordSetSGIS) +#define glSelectTextureSGIS GLEW_GET_FUN(__glewSelectTextureSGIS) +#define glSelectTextureTransformSGIS GLEW_GET_FUN(__glewSelectTextureTransformSGIS) + +#define GLEW_SGIS_multitexture GLEW_GET_VAR(__GLEW_SGIS_multitexture) + +#endif /* GL_SGIS_multitexture */ + +/* ------------------------- GL_SGIS_pixel_texture ------------------------- */ + +#ifndef GL_SGIS_pixel_texture +#define GL_SGIS_pixel_texture 1 + +#define GLEW_SGIS_pixel_texture GLEW_GET_VAR(__GLEW_SGIS_pixel_texture) + +#endif /* GL_SGIS_pixel_texture */ + +/* ----------------------- GL_SGIS_point_line_texgen ----------------------- */ + +#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 + +#define GLEW_SGIS_point_line_texgen GLEW_GET_VAR(__GLEW_SGIS_point_line_texgen) + +#endif /* GL_SGIS_point_line_texgen */ + +/* ----------------------- GL_SGIS_shared_multisample ---------------------- */ + +#ifndef GL_SGIS_shared_multisample +#define GL_SGIS_shared_multisample 1 + +typedef void (GLAPIENTRY * PFNGLMULTISAMPLESUBRECTPOSSGISPROC) (GLint x, GLint y); + +#define glMultisampleSubRectPosSGIS GLEW_GET_FUN(__glewMultisampleSubRectPosSGIS) + +#define GLEW_SGIS_shared_multisample GLEW_GET_VAR(__GLEW_SGIS_shared_multisample) + +#endif /* GL_SGIS_shared_multisample */ + +/* ------------------------ GL_SGIS_sharpen_texture ------------------------ */ + +#ifndef GL_SGIS_sharpen_texture +#define GL_SGIS_sharpen_texture 1 + +typedef void (GLAPIENTRY * PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat* points); +typedef void (GLAPIENTRY * PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat* points); + +#define glGetSharpenTexFuncSGIS GLEW_GET_FUN(__glewGetSharpenTexFuncSGIS) +#define glSharpenTexFuncSGIS GLEW_GET_FUN(__glewSharpenTexFuncSGIS) + +#define GLEW_SGIS_sharpen_texture GLEW_GET_VAR(__GLEW_SGIS_sharpen_texture) + +#endif /* GL_SGIS_sharpen_texture */ + +/* --------------------------- GL_SGIS_texture4D --------------------------- */ + +#ifndef GL_SGIS_texture4D +#define GL_SGIS_texture4D 1 + +typedef void (GLAPIENTRY * PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLenum format, GLenum type, const void *pixels); + +#define glTexImage4DSGIS GLEW_GET_FUN(__glewTexImage4DSGIS) +#define glTexSubImage4DSGIS GLEW_GET_FUN(__glewTexSubImage4DSGIS) + +#define GLEW_SGIS_texture4D GLEW_GET_VAR(__GLEW_SGIS_texture4D) + +#endif /* GL_SGIS_texture4D */ + +/* ---------------------- GL_SGIS_texture_border_clamp --------------------- */ + +#ifndef GL_SGIS_texture_border_clamp +#define GL_SGIS_texture_border_clamp 1 + +#define GL_CLAMP_TO_BORDER_SGIS 0x812D + +#define GLEW_SGIS_texture_border_clamp GLEW_GET_VAR(__GLEW_SGIS_texture_border_clamp) + +#endif /* GL_SGIS_texture_border_clamp */ + +/* ----------------------- GL_SGIS_texture_edge_clamp ---------------------- */ + +#ifndef GL_SGIS_texture_edge_clamp +#define GL_SGIS_texture_edge_clamp 1 + +#define GL_CLAMP_TO_EDGE_SGIS 0x812F + +#define GLEW_SGIS_texture_edge_clamp GLEW_GET_VAR(__GLEW_SGIS_texture_edge_clamp) + +#endif /* GL_SGIS_texture_edge_clamp */ + +/* ------------------------ GL_SGIS_texture_filter4 ------------------------ */ + +#ifndef GL_SGIS_texture_filter4 +#define GL_SGIS_texture_filter4 1 + +typedef void (GLAPIENTRY * PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat* weights); +typedef void (GLAPIENTRY * PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat* weights); + +#define glGetTexFilterFuncSGIS GLEW_GET_FUN(__glewGetTexFilterFuncSGIS) +#define glTexFilterFuncSGIS GLEW_GET_FUN(__glewTexFilterFuncSGIS) + +#define GLEW_SGIS_texture_filter4 GLEW_GET_VAR(__GLEW_SGIS_texture_filter4) + +#endif /* GL_SGIS_texture_filter4 */ + +/* -------------------------- GL_SGIS_texture_lod -------------------------- */ + +#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 + +#define GLEW_SGIS_texture_lod GLEW_GET_VAR(__GLEW_SGIS_texture_lod) + +#endif /* GL_SGIS_texture_lod */ + +/* ------------------------- GL_SGIS_texture_select ------------------------ */ + +#ifndef GL_SGIS_texture_select +#define GL_SGIS_texture_select 1 + +#define GLEW_SGIS_texture_select GLEW_GET_VAR(__GLEW_SGIS_texture_select) + +#endif /* GL_SGIS_texture_select */ + +/* ----------------------------- GL_SGIX_async ----------------------------- */ + +#ifndef GL_SGIX_async +#define GL_SGIX_async 1 + +#define GL_ASYNC_MARKER_SGIX 0x8329 + +typedef void (GLAPIENTRY * PFNGLASYNCMARKERSGIXPROC) (GLuint marker); +typedef void (GLAPIENTRY * PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range); +typedef GLint (GLAPIENTRY * PFNGLFINISHASYNCSGIXPROC) (GLuint* markerp); +typedef GLuint (GLAPIENTRY * PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range); +typedef GLboolean (GLAPIENTRY * PFNGLISASYNCMARKERSGIXPROC) (GLuint marker); +typedef GLint (GLAPIENTRY * PFNGLPOLLASYNCSGIXPROC) (GLuint* markerp); + +#define glAsyncMarkerSGIX GLEW_GET_FUN(__glewAsyncMarkerSGIX) +#define glDeleteAsyncMarkersSGIX GLEW_GET_FUN(__glewDeleteAsyncMarkersSGIX) +#define glFinishAsyncSGIX GLEW_GET_FUN(__glewFinishAsyncSGIX) +#define glGenAsyncMarkersSGIX GLEW_GET_FUN(__glewGenAsyncMarkersSGIX) +#define glIsAsyncMarkerSGIX GLEW_GET_FUN(__glewIsAsyncMarkerSGIX) +#define glPollAsyncSGIX GLEW_GET_FUN(__glewPollAsyncSGIX) + +#define GLEW_SGIX_async GLEW_GET_VAR(__GLEW_SGIX_async) + +#endif /* GL_SGIX_async */ + +/* ------------------------ GL_SGIX_async_histogram ------------------------ */ + +#ifndef GL_SGIX_async_histogram +#define GL_SGIX_async_histogram 1 + +#define GL_ASYNC_HISTOGRAM_SGIX 0x832C +#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D + +#define GLEW_SGIX_async_histogram GLEW_GET_VAR(__GLEW_SGIX_async_histogram) + +#endif /* GL_SGIX_async_histogram */ + +/* -------------------------- GL_SGIX_async_pixel -------------------------- */ + +#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 + +#define GLEW_SGIX_async_pixel GLEW_GET_VAR(__GLEW_SGIX_async_pixel) + +#endif /* GL_SGIX_async_pixel */ + +/* ----------------------- GL_SGIX_bali_g_instruments ---------------------- */ + +#ifndef GL_SGIX_bali_g_instruments +#define GL_SGIX_bali_g_instruments 1 + +#define GL_BALI_NUM_TRIS_CULLED_INSTRUMENT 0x6080 +#define GL_BALI_NUM_PRIMS_CLIPPED_INSTRUMENT 0x6081 +#define GL_BALI_NUM_PRIMS_REJECT_INSTRUMENT 0x6082 +#define GL_BALI_NUM_PRIMS_CLIP_RESULT_INSTRUMENT 0x6083 + +#define GLEW_SGIX_bali_g_instruments GLEW_GET_VAR(__GLEW_SGIX_bali_g_instruments) + +#endif /* GL_SGIX_bali_g_instruments */ + +/* ----------------------- GL_SGIX_bali_r_instruments ---------------------- */ + +#ifndef GL_SGIX_bali_r_instruments +#define GL_SGIX_bali_r_instruments 1 + +#define GL_BALI_FRAGMENTS_GENERATED_INSTRUMENT 0x6090 +#define GL_BALI_DEPTH_PASS_INSTRUMENT 0x6091 +#define GL_BALI_R_CHIP_COUNT 0x6092 + +#define GLEW_SGIX_bali_r_instruments GLEW_GET_VAR(__GLEW_SGIX_bali_r_instruments) + +#endif /* GL_SGIX_bali_r_instruments */ + +/* --------------------- GL_SGIX_bali_timer_instruments -------------------- */ + +#ifndef GL_SGIX_bali_timer_instruments +#define GL_SGIX_bali_timer_instruments 1 + +#define GLEW_SGIX_bali_timer_instruments GLEW_GET_VAR(__GLEW_SGIX_bali_timer_instruments) + +#endif /* GL_SGIX_bali_timer_instruments */ + +/* ----------------------- GL_SGIX_blend_alpha_minmax ---------------------- */ + +#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 + +#define GLEW_SGIX_blend_alpha_minmax GLEW_GET_VAR(__GLEW_SGIX_blend_alpha_minmax) + +#endif /* GL_SGIX_blend_alpha_minmax */ + +/* --------------------------- GL_SGIX_blend_cadd -------------------------- */ + +#ifndef GL_SGIX_blend_cadd +#define GL_SGIX_blend_cadd 1 + +#define GL_FUNC_COMPLEX_ADD_EXT 0x601C + +#define GLEW_SGIX_blend_cadd GLEW_GET_VAR(__GLEW_SGIX_blend_cadd) + +#endif /* GL_SGIX_blend_cadd */ + +/* ------------------------ GL_SGIX_blend_cmultiply ------------------------ */ + +#ifndef GL_SGIX_blend_cmultiply +#define GL_SGIX_blend_cmultiply 1 + +#define GL_FUNC_COMPLEX_MULTIPLY_EXT 0x601B + +#define GLEW_SGIX_blend_cmultiply GLEW_GET_VAR(__GLEW_SGIX_blend_cmultiply) + +#endif /* GL_SGIX_blend_cmultiply */ + +/* --------------------- GL_SGIX_calligraphic_fragment --------------------- */ + +#ifndef GL_SGIX_calligraphic_fragment +#define GL_SGIX_calligraphic_fragment 1 + +#define GLEW_SGIX_calligraphic_fragment GLEW_GET_VAR(__GLEW_SGIX_calligraphic_fragment) + +#endif /* GL_SGIX_calligraphic_fragment */ + +/* ---------------------------- GL_SGIX_clipmap ---------------------------- */ + +#ifndef GL_SGIX_clipmap +#define GL_SGIX_clipmap 1 + +#define GLEW_SGIX_clipmap GLEW_GET_VAR(__GLEW_SGIX_clipmap) + +#endif /* GL_SGIX_clipmap */ + +/* --------------------- GL_SGIX_color_matrix_accuracy --------------------- */ + +#ifndef GL_SGIX_color_matrix_accuracy +#define GL_SGIX_color_matrix_accuracy 1 + +#define GL_COLOR_MATRIX_HINT 0x8317 + +#define GLEW_SGIX_color_matrix_accuracy GLEW_GET_VAR(__GLEW_SGIX_color_matrix_accuracy) + +#endif /* GL_SGIX_color_matrix_accuracy */ + +/* --------------------- GL_SGIX_color_table_index_mode -------------------- */ + +#ifndef GL_SGIX_color_table_index_mode +#define GL_SGIX_color_table_index_mode 1 + +#define GLEW_SGIX_color_table_index_mode GLEW_GET_VAR(__GLEW_SGIX_color_table_index_mode) + +#endif /* GL_SGIX_color_table_index_mode */ + +/* ------------------------- GL_SGIX_complex_polar ------------------------- */ + +#ifndef GL_SGIX_complex_polar +#define GL_SGIX_complex_polar 1 + +#define GLEW_SGIX_complex_polar GLEW_GET_VAR(__GLEW_SGIX_complex_polar) + +#endif /* GL_SGIX_complex_polar */ + +/* ---------------------- GL_SGIX_convolution_accuracy --------------------- */ + +#ifndef GL_SGIX_convolution_accuracy +#define GL_SGIX_convolution_accuracy 1 + +#define GL_CONVOLUTION_HINT_SGIX 0x8316 + +#define GLEW_SGIX_convolution_accuracy GLEW_GET_VAR(__GLEW_SGIX_convolution_accuracy) + +#endif /* GL_SGIX_convolution_accuracy */ + +/* ---------------------------- GL_SGIX_cube_map --------------------------- */ + +#ifndef GL_SGIX_cube_map +#define GL_SGIX_cube_map 1 + +#define GL_ENV_MAP_SGIX 0x8340 +#define GL_CUBE_MAP_SGIX 0x8341 +#define GL_CUBE_MAP_ZP_SGIX 0x8342 +#define GL_CUBE_MAP_ZN_SGIX 0x8343 +#define GL_CUBE_MAP_XN_SGIX 0x8344 +#define GL_CUBE_MAP_XP_SGIX 0x8345 +#define GL_CUBE_MAP_YN_SGIX 0x8346 +#define GL_CUBE_MAP_YP_SGIX 0x8347 +#define GL_CUBE_MAP_BINDING_SGIX 0x8348 + +#define GLEW_SGIX_cube_map GLEW_GET_VAR(__GLEW_SGIX_cube_map) + +#endif /* GL_SGIX_cube_map */ + +/* ------------------------ GL_SGIX_cylinder_texgen ------------------------ */ + +#ifndef GL_SGIX_cylinder_texgen +#define GL_SGIX_cylinder_texgen 1 + +#define GLEW_SGIX_cylinder_texgen GLEW_GET_VAR(__GLEW_SGIX_cylinder_texgen) + +#endif /* GL_SGIX_cylinder_texgen */ + +/* ---------------------------- GL_SGIX_datapipe --------------------------- */ + +#ifndef GL_SGIX_datapipe +#define GL_SGIX_datapipe 1 + +#define GL_GEOMETRY_BIT 0x1 +#define GL_IMAGE_BIT 0x2 + +typedef void (GLAPIENTRY * PFNGLADDRESSSPACEPROC) (GLenum space, GLbitfield mask); +typedef GLint (GLAPIENTRY * PFNGLDATAPIPEPROC) (GLenum space); + +#define glAddressSpace GLEW_GET_FUN(__glewAddressSpace) +#define glDataPipe GLEW_GET_FUN(__glewDataPipe) + +#define GLEW_SGIX_datapipe GLEW_GET_VAR(__GLEW_SGIX_datapipe) + +#endif /* GL_SGIX_datapipe */ + +/* --------------------------- GL_SGIX_decimation -------------------------- */ + +#ifndef GL_SGIX_decimation +#define GL_SGIX_decimation 1 + +#define GLEW_SGIX_decimation GLEW_GET_VAR(__GLEW_SGIX_decimation) + +#endif /* GL_SGIX_decimation */ + +/* --------------------- GL_SGIX_depth_pass_instrument --------------------- */ + +#ifndef GL_SGIX_depth_pass_instrument +#define GL_SGIX_depth_pass_instrument 1 + +#define GL_DEPTH_PASS_INSTRUMENT_SGIX 0x8310 +#define GL_DEPTH_PASS_INSTRUMENT_COUNTERS_SGIX 0x8311 +#define GL_DEPTH_PASS_INSTRUMENT_MAX_SGIX 0x8312 + +#define GLEW_SGIX_depth_pass_instrument GLEW_GET_VAR(__GLEW_SGIX_depth_pass_instrument) + +#endif /* GL_SGIX_depth_pass_instrument */ + +/* ------------------------- GL_SGIX_depth_texture ------------------------- */ + +#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 + +#define GLEW_SGIX_depth_texture GLEW_GET_VAR(__GLEW_SGIX_depth_texture) + +#endif /* GL_SGIX_depth_texture */ + +/* ------------------------------ GL_SGIX_dvc ------------------------------ */ + +#ifndef GL_SGIX_dvc +#define GL_SGIX_dvc 1 + +#define GLEW_SGIX_dvc GLEW_GET_VAR(__GLEW_SGIX_dvc) + +#endif /* GL_SGIX_dvc */ + +/* -------------------------- GL_SGIX_flush_raster ------------------------- */ + +#ifndef GL_SGIX_flush_raster +#define GL_SGIX_flush_raster 1 + +typedef void (GLAPIENTRY * PFNGLFLUSHRASTERSGIXPROC) (void); + +#define glFlushRasterSGIX GLEW_GET_FUN(__glewFlushRasterSGIX) + +#define GLEW_SGIX_flush_raster GLEW_GET_VAR(__GLEW_SGIX_flush_raster) + +#endif /* GL_SGIX_flush_raster */ + +/* --------------------------- GL_SGIX_fog_blend --------------------------- */ + +#ifndef GL_SGIX_fog_blend +#define GL_SGIX_fog_blend 1 + +#define GL_FOG_BLEND_ALPHA_SGIX 0x81FE +#define GL_FOG_BLEND_COLOR_SGIX 0x81FF + +#define GLEW_SGIX_fog_blend GLEW_GET_VAR(__GLEW_SGIX_fog_blend) + +#endif /* GL_SGIX_fog_blend */ + +/* ---------------------- GL_SGIX_fog_factor_to_alpha ---------------------- */ + +#ifndef GL_SGIX_fog_factor_to_alpha +#define GL_SGIX_fog_factor_to_alpha 1 + +#define GLEW_SGIX_fog_factor_to_alpha GLEW_GET_VAR(__GLEW_SGIX_fog_factor_to_alpha) + +#endif /* GL_SGIX_fog_factor_to_alpha */ + +/* --------------------------- GL_SGIX_fog_layers -------------------------- */ + +#ifndef GL_SGIX_fog_layers +#define GL_SGIX_fog_layers 1 + +#define GL_FOG_TYPE_SGIX 0x8323 +#define GL_UNIFORM_SGIX 0x8324 +#define GL_LAYERED_SGIX 0x8325 +#define GL_FOG_GROUND_PLANE_SGIX 0x8326 +#define GL_FOG_LAYERS_POINTS_SGIX 0x8327 +#define GL_MAX_FOG_LAYERS_POINTS_SGIX 0x8328 + +typedef void (GLAPIENTRY * PFNGLFOGLAYERSSGIXPROC) (GLsizei n, const GLfloat* points); +typedef void (GLAPIENTRY * PFNGLGETFOGLAYERSSGIXPROC) (GLfloat* points); + +#define glFogLayersSGIX GLEW_GET_FUN(__glewFogLayersSGIX) +#define glGetFogLayersSGIX GLEW_GET_FUN(__glewGetFogLayersSGIX) + +#define GLEW_SGIX_fog_layers GLEW_GET_VAR(__GLEW_SGIX_fog_layers) + +#endif /* GL_SGIX_fog_layers */ + +/* --------------------------- GL_SGIX_fog_offset -------------------------- */ + +#ifndef GL_SGIX_fog_offset +#define GL_SGIX_fog_offset 1 + +#define GL_FOG_OFFSET_SGIX 0x8198 +#define GL_FOG_OFFSET_VALUE_SGIX 0x8199 + +#define GLEW_SGIX_fog_offset GLEW_GET_VAR(__GLEW_SGIX_fog_offset) + +#endif /* GL_SGIX_fog_offset */ + +/* --------------------------- GL_SGIX_fog_patchy -------------------------- */ + +#ifndef GL_SGIX_fog_patchy +#define GL_SGIX_fog_patchy 1 + +#define GLEW_SGIX_fog_patchy GLEW_GET_VAR(__GLEW_SGIX_fog_patchy) + +#endif /* GL_SGIX_fog_patchy */ + +/* --------------------------- GL_SGIX_fog_scale --------------------------- */ + +#ifndef GL_SGIX_fog_scale +#define GL_SGIX_fog_scale 1 + +#define GL_FOG_SCALE_SGIX 0x81FC +#define GL_FOG_SCALE_VALUE_SGIX 0x81FD + +#define GLEW_SGIX_fog_scale GLEW_GET_VAR(__GLEW_SGIX_fog_scale) + +#endif /* GL_SGIX_fog_scale */ + +/* -------------------------- GL_SGIX_fog_texture -------------------------- */ + +#ifndef GL_SGIX_fog_texture +#define GL_SGIX_fog_texture 1 + +typedef void (GLAPIENTRY * PFNGLTEXTUREFOGSGIXPROC) (GLenum pname); + +#define glTextureFogSGIX GLEW_GET_FUN(__glewTextureFogSGIX) + +#define GLEW_SGIX_fog_texture GLEW_GET_VAR(__GLEW_SGIX_fog_texture) + +#endif /* GL_SGIX_fog_texture */ + +/* -------------------- GL_SGIX_fragment_lighting_space -------------------- */ + +#ifndef GL_SGIX_fragment_lighting_space +#define GL_SGIX_fragment_lighting_space 1 + +#define GL_EYE_SPACE_SGIX 0x8436 +#define GL_TANGENT_SPACE_SGIX 0x8437 +#define GL_OBJECT_SPACE_SGIX 0x8438 +#define GL_FRAGMENT_LIGHT_SPACE_SGIX 0x843D + +#define GLEW_SGIX_fragment_lighting_space GLEW_GET_VAR(__GLEW_SGIX_fragment_lighting_space) + +#endif /* GL_SGIX_fragment_lighting_space */ + +/* ------------------- GL_SGIX_fragment_specular_lighting ------------------ */ + +#ifndef GL_SGIX_fragment_specular_lighting +#define GL_SGIX_fragment_specular_lighting 1 + +typedef void (GLAPIENTRY * PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, const GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, const GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum value, GLfloat* data); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum value, GLint* data); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat* data); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint* data); + +#define glFragmentColorMaterialSGIX GLEW_GET_FUN(__glewFragmentColorMaterialSGIX) +#define glFragmentLightModelfSGIX GLEW_GET_FUN(__glewFragmentLightModelfSGIX) +#define glFragmentLightModelfvSGIX GLEW_GET_FUN(__glewFragmentLightModelfvSGIX) +#define glFragmentLightModeliSGIX GLEW_GET_FUN(__glewFragmentLightModeliSGIX) +#define glFragmentLightModelivSGIX GLEW_GET_FUN(__glewFragmentLightModelivSGIX) +#define glFragmentLightfSGIX GLEW_GET_FUN(__glewFragmentLightfSGIX) +#define glFragmentLightfvSGIX GLEW_GET_FUN(__glewFragmentLightfvSGIX) +#define glFragmentLightiSGIX GLEW_GET_FUN(__glewFragmentLightiSGIX) +#define glFragmentLightivSGIX GLEW_GET_FUN(__glewFragmentLightivSGIX) +#define glFragmentMaterialfSGIX GLEW_GET_FUN(__glewFragmentMaterialfSGIX) +#define glFragmentMaterialfvSGIX GLEW_GET_FUN(__glewFragmentMaterialfvSGIX) +#define glFragmentMaterialiSGIX GLEW_GET_FUN(__glewFragmentMaterialiSGIX) +#define glFragmentMaterialivSGIX GLEW_GET_FUN(__glewFragmentMaterialivSGIX) +#define glGetFragmentLightfvSGIX GLEW_GET_FUN(__glewGetFragmentLightfvSGIX) +#define glGetFragmentLightivSGIX GLEW_GET_FUN(__glewGetFragmentLightivSGIX) +#define glGetFragmentMaterialfvSGIX GLEW_GET_FUN(__glewGetFragmentMaterialfvSGIX) +#define glGetFragmentMaterialivSGIX GLEW_GET_FUN(__glewGetFragmentMaterialivSGIX) + +#define GLEW_SGIX_fragment_specular_lighting GLEW_GET_VAR(__GLEW_SGIX_fragment_specular_lighting) + +#endif /* GL_SGIX_fragment_specular_lighting */ + +/* ---------------------- GL_SGIX_fragments_instrument --------------------- */ + +#ifndef GL_SGIX_fragments_instrument +#define GL_SGIX_fragments_instrument 1 + +#define GL_FRAGMENTS_INSTRUMENT_SGIX 0x8313 +#define GL_FRAGMENTS_INSTRUMENT_COUNTERS_SGIX 0x8314 +#define GL_FRAGMENTS_INSTRUMENT_MAX_SGIX 0x8315 + +#define GLEW_SGIX_fragments_instrument GLEW_GET_VAR(__GLEW_SGIX_fragments_instrument) + +#endif /* GL_SGIX_fragments_instrument */ + +/* --------------------------- GL_SGIX_framezoom --------------------------- */ + +#ifndef GL_SGIX_framezoom +#define GL_SGIX_framezoom 1 + +typedef void (GLAPIENTRY * PFNGLFRAMEZOOMSGIXPROC) (GLint factor); + +#define glFrameZoomSGIX GLEW_GET_FUN(__glewFrameZoomSGIX) + +#define GLEW_SGIX_framezoom GLEW_GET_VAR(__GLEW_SGIX_framezoom) + +#endif /* GL_SGIX_framezoom */ + +/* -------------------------- GL_SGIX_icc_texture -------------------------- */ + +#ifndef GL_SGIX_icc_texture +#define GL_SGIX_icc_texture 1 + +#define GL_RGB_ICC_SGIX 0x8460 +#define GL_RGBA_ICC_SGIX 0x8461 +#define GL_ALPHA_ICC_SGIX 0x8462 +#define GL_LUMINANCE_ICC_SGIX 0x8463 +#define GL_INTENSITY_ICC_SGIX 0x8464 +#define GL_LUMINANCE_ALPHA_ICC_SGIX 0x8465 +#define GL_R5_G6_B5_ICC_SGIX 0x8466 +#define GL_R5_G6_B5_A8_ICC_SGIX 0x8467 +#define GL_ALPHA16_ICC_SGIX 0x8468 +#define GL_LUMINANCE16_ICC_SGIX 0x8469 +#define GL_INTENSITY16_ICC_SGIX 0x846A +#define GL_LUMINANCE16_ALPHA8_ICC_SGIX 0x846B + +#define GLEW_SGIX_icc_texture GLEW_GET_VAR(__GLEW_SGIX_icc_texture) + +#endif /* GL_SGIX_icc_texture */ + +/* ------------------------ GL_SGIX_igloo_interface ------------------------ */ + +#ifndef GL_SGIX_igloo_interface +#define GL_SGIX_igloo_interface 1 + +#define GL_IGLOO_FULLSCREEN_SGIX 0x819E +#define GL_IGLOO_VIEWPORT_OFFSET_SGIX 0x819F +#define GL_IGLOO_SWAPTMESH_SGIX 0x81A0 +#define GL_IGLOO_COLORNORMAL_SGIX 0x81A1 +#define GL_IGLOO_IRISGL_MODE_SGIX 0x81A2 +#define GL_IGLOO_LMC_COLOR_SGIX 0x81A3 +#define GL_IGLOO_TMESHMODE_SGIX 0x81A4 +#define GL_LIGHT31 0xBEAD + +typedef void (GLAPIENTRY * PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, void *param); + +#define glIglooInterfaceSGIX GLEW_GET_FUN(__glewIglooInterfaceSGIX) + +#define GLEW_SGIX_igloo_interface GLEW_GET_VAR(__GLEW_SGIX_igloo_interface) + +#endif /* GL_SGIX_igloo_interface */ + +/* ----------------------- GL_SGIX_image_compression ----------------------- */ + +#ifndef GL_SGIX_image_compression +#define GL_SGIX_image_compression 1 + +#define GLEW_SGIX_image_compression GLEW_GET_VAR(__GLEW_SGIX_image_compression) + +#endif /* GL_SGIX_image_compression */ + +/* ---------------------- GL_SGIX_impact_pixel_texture --------------------- */ + +#ifndef GL_SGIX_impact_pixel_texture +#define GL_SGIX_impact_pixel_texture 1 + +#define GLEW_SGIX_impact_pixel_texture GLEW_GET_VAR(__GLEW_SGIX_impact_pixel_texture) + +#endif /* GL_SGIX_impact_pixel_texture */ + +/* ------------------------ GL_SGIX_instrument_error ----------------------- */ + +#ifndef GL_SGIX_instrument_error +#define GL_SGIX_instrument_error 1 + +#define GLEW_SGIX_instrument_error GLEW_GET_VAR(__GLEW_SGIX_instrument_error) + +#endif /* GL_SGIX_instrument_error */ + +/* --------------------------- GL_SGIX_interlace --------------------------- */ + +#ifndef GL_SGIX_interlace +#define GL_SGIX_interlace 1 + +#define GL_INTERLACE_SGIX 0x8094 + +#define GLEW_SGIX_interlace GLEW_GET_VAR(__GLEW_SGIX_interlace) + +#endif /* GL_SGIX_interlace */ + +/* ------------------------- GL_SGIX_ir_instrument1 ------------------------ */ + +#ifndef GL_SGIX_ir_instrument1 +#define GL_SGIX_ir_instrument1 1 + +#define GLEW_SGIX_ir_instrument1 GLEW_GET_VAR(__GLEW_SGIX_ir_instrument1) + +#endif /* GL_SGIX_ir_instrument1 */ + +/* ----------------------- GL_SGIX_line_quality_hint ----------------------- */ + +#ifndef GL_SGIX_line_quality_hint +#define GL_SGIX_line_quality_hint 1 + +#define GL_LINE_QUALITY_HINT_SGIX 0x835B + +#define GLEW_SGIX_line_quality_hint GLEW_GET_VAR(__GLEW_SGIX_line_quality_hint) + +#endif /* GL_SGIX_line_quality_hint */ + +/* ------------------------- GL_SGIX_list_priority ------------------------- */ + +#ifndef GL_SGIX_list_priority +#define GL_SGIX_list_priority 1 + +#define GLEW_SGIX_list_priority GLEW_GET_VAR(__GLEW_SGIX_list_priority) + +#endif /* GL_SGIX_list_priority */ + +/* ----------------------------- GL_SGIX_mpeg1 ----------------------------- */ + +#ifndef GL_SGIX_mpeg1 +#define GL_SGIX_mpeg1 1 + +typedef void (GLAPIENTRY * PFNGLALLOCMPEGPREDICTORSSGIXPROC) (GLsizei width, GLsizei height, GLsizei n, GLuint* predictors); +typedef void (GLAPIENTRY * PFNGLDELETEMPEGPREDICTORSSGIXPROC) (GLsizei n, GLuint* predictors); +typedef void (GLAPIENTRY * PFNGLGENMPEGPREDICTORSSGIXPROC) (GLsizei n, GLuint* predictors); +typedef void (GLAPIENTRY * PFNGLGETMPEGPARAMETERFVSGIXPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMPEGPARAMETERIVSGIXPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMPEGPREDICTORSGIXPROC) (GLenum target, GLenum format, GLenum type, void *pixels); +typedef void (GLAPIENTRY * PFNGLGETMPEGQUANTTABLEUBVPROC) (GLenum target, GLubyte* values); +typedef GLboolean (GLAPIENTRY * PFNGLISMPEGPREDICTORSGIXPROC) (GLuint predictor); +typedef void (GLAPIENTRY * PFNGLMPEGPREDICTORSGIXPROC) (GLenum target, GLenum format, GLenum type, void *pixels); +typedef void (GLAPIENTRY * PFNGLMPEGQUANTTABLEUBVPROC) (GLenum target, GLubyte* values); +typedef void (GLAPIENTRY * PFNGLSWAPMPEGPREDICTORSSGIXPROC) (GLenum target0, GLenum target1); + +#define glAllocMPEGPredictorsSGIX GLEW_GET_FUN(__glewAllocMPEGPredictorsSGIX) +#define glDeleteMPEGPredictorsSGIX GLEW_GET_FUN(__glewDeleteMPEGPredictorsSGIX) +#define glGenMPEGPredictorsSGIX GLEW_GET_FUN(__glewGenMPEGPredictorsSGIX) +#define glGetMPEGParameterfvSGIX GLEW_GET_FUN(__glewGetMPEGParameterfvSGIX) +#define glGetMPEGParameterivSGIX GLEW_GET_FUN(__glewGetMPEGParameterivSGIX) +#define glGetMPEGPredictorSGIX GLEW_GET_FUN(__glewGetMPEGPredictorSGIX) +#define glGetMPEGQuantTableubv GLEW_GET_FUN(__glewGetMPEGQuantTableubv) +#define glIsMPEGPredictorSGIX GLEW_GET_FUN(__glewIsMPEGPredictorSGIX) +#define glMPEGPredictorSGIX GLEW_GET_FUN(__glewMPEGPredictorSGIX) +#define glMPEGQuantTableubv GLEW_GET_FUN(__glewMPEGQuantTableubv) +#define glSwapMPEGPredictorsSGIX GLEW_GET_FUN(__glewSwapMPEGPredictorsSGIX) + +#define GLEW_SGIX_mpeg1 GLEW_GET_VAR(__GLEW_SGIX_mpeg1) + +#endif /* GL_SGIX_mpeg1 */ + +/* ----------------------------- GL_SGIX_mpeg2 ----------------------------- */ + +#ifndef GL_SGIX_mpeg2 +#define GL_SGIX_mpeg2 1 + +#define GLEW_SGIX_mpeg2 GLEW_GET_VAR(__GLEW_SGIX_mpeg2) + +#endif /* GL_SGIX_mpeg2 */ + +/* ------------------ GL_SGIX_nonlinear_lighting_pervertex ----------------- */ + +#ifndef GL_SGIX_nonlinear_lighting_pervertex +#define GL_SGIX_nonlinear_lighting_pervertex 1 + +typedef void (GLAPIENTRY * PFNGLGETNONLINLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLint* terms, GLfloat *data); +typedef void (GLAPIENTRY * PFNGLGETNONLINMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLint* terms, const GLfloat *data); +typedef void (GLAPIENTRY * PFNGLNONLINLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLint terms, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLNONLINMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLint terms, const GLfloat* params); + +#define glGetNonlinLightfvSGIX GLEW_GET_FUN(__glewGetNonlinLightfvSGIX) +#define glGetNonlinMaterialfvSGIX GLEW_GET_FUN(__glewGetNonlinMaterialfvSGIX) +#define glNonlinLightfvSGIX GLEW_GET_FUN(__glewNonlinLightfvSGIX) +#define glNonlinMaterialfvSGIX GLEW_GET_FUN(__glewNonlinMaterialfvSGIX) + +#define GLEW_SGIX_nonlinear_lighting_pervertex GLEW_GET_VAR(__GLEW_SGIX_nonlinear_lighting_pervertex) + +#endif /* GL_SGIX_nonlinear_lighting_pervertex */ + +/* --------------------------- GL_SGIX_nurbs_eval -------------------------- */ + +#ifndef GL_SGIX_nurbs_eval +#define GL_SGIX_nurbs_eval 1 + +#define GL_MAP1_VERTEX_3_NURBS_SGIX 0x81CB +#define GL_MAP1_VERTEX_4_NURBS_SGIX 0x81CC +#define GL_MAP1_INDEX_NURBS_SGIX 0x81CD +#define GL_MAP1_COLOR_4_NURBS_SGIX 0x81CE +#define GL_MAP1_NORMAL_NURBS_SGIX 0x81CF +#define GL_MAP1_TEXTURE_COORD_1_NURBS_SGIX 0x81E0 +#define GL_MAP1_TEXTURE_COORD_2_NURBS_SGIX 0x81E1 +#define GL_MAP1_TEXTURE_COORD_3_NURBS_SGIX 0x81E2 +#define GL_MAP1_TEXTURE_COORD_4_NURBS_SGIX 0x81E3 +#define GL_MAP2_VERTEX_3_NURBS_SGIX 0x81E4 +#define GL_MAP2_VERTEX_4_NURBS_SGIX 0x81E5 +#define GL_MAP2_INDEX_NURBS_SGIX 0x81E6 +#define GL_MAP2_COLOR_4_NURBS_SGIX 0x81E7 +#define GL_MAP2_NORMAL_NURBS_SGIX 0x81E8 +#define GL_MAP2_TEXTURE_COORD_1_NURBS_SGIX 0x81E9 +#define GL_MAP2_TEXTURE_COORD_2_NURBS_SGIX 0x81EA +#define GL_MAP2_TEXTURE_COORD_3_NURBS_SGIX 0x81EB +#define GL_MAP2_TEXTURE_COORD_4_NURBS_SGIX 0x81EC +#define GL_NURBS_KNOT_COUNT_SGIX 0x81ED +#define GL_NURBS_KNOT_VECTOR_SGIX 0x81EE + +#define GLEW_SGIX_nurbs_eval GLEW_GET_VAR(__GLEW_SGIX_nurbs_eval) + +#endif /* GL_SGIX_nurbs_eval */ + +/* ---------------------- GL_SGIX_occlusion_instrument --------------------- */ + +#ifndef GL_SGIX_occlusion_instrument +#define GL_SGIX_occlusion_instrument 1 + +#define GL_OCCLUSION_INSTRUMENT_SGIX 0x6060 + +#define GLEW_SGIX_occlusion_instrument GLEW_GET_VAR(__GLEW_SGIX_occlusion_instrument) + +#endif /* GL_SGIX_occlusion_instrument */ + +/* ------------------------- GL_SGIX_packed_6bytes ------------------------- */ + +#ifndef GL_SGIX_packed_6bytes +#define GL_SGIX_packed_6bytes 1 + +#define GLEW_SGIX_packed_6bytes GLEW_GET_VAR(__GLEW_SGIX_packed_6bytes) + +#endif /* GL_SGIX_packed_6bytes */ + +/* ------------------------- GL_SGIX_pixel_texture ------------------------- */ + +#ifndef GL_SGIX_pixel_texture +#define GL_SGIX_pixel_texture 1 + +typedef void (GLAPIENTRY * PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); + +#define glPixelTexGenSGIX GLEW_GET_FUN(__glewPixelTexGenSGIX) + +#define GLEW_SGIX_pixel_texture GLEW_GET_VAR(__GLEW_SGIX_pixel_texture) + +#endif /* GL_SGIX_pixel_texture */ + +/* ----------------------- GL_SGIX_pixel_texture_bits ---------------------- */ + +#ifndef GL_SGIX_pixel_texture_bits +#define GL_SGIX_pixel_texture_bits 1 + +#define GLEW_SGIX_pixel_texture_bits GLEW_GET_VAR(__GLEW_SGIX_pixel_texture_bits) + +#endif /* GL_SGIX_pixel_texture_bits */ + +/* ----------------------- GL_SGIX_pixel_texture_lod ----------------------- */ + +#ifndef GL_SGIX_pixel_texture_lod +#define GL_SGIX_pixel_texture_lod 1 + +#define GLEW_SGIX_pixel_texture_lod GLEW_GET_VAR(__GLEW_SGIX_pixel_texture_lod) + +#endif /* GL_SGIX_pixel_texture_lod */ + +/* -------------------------- GL_SGIX_pixel_tiles -------------------------- */ + +#ifndef GL_SGIX_pixel_tiles +#define GL_SGIX_pixel_tiles 1 + +#define GLEW_SGIX_pixel_tiles GLEW_GET_VAR(__GLEW_SGIX_pixel_tiles) + +#endif /* GL_SGIX_pixel_tiles */ + +/* ------------------------- GL_SGIX_polynomial_ffd ------------------------ */ + +#ifndef GL_SGIX_polynomial_ffd +#define GL_SGIX_polynomial_ffd 1 + +#define GL_TEXTURE_DEFORMATION_BIT_SGIX 0x1 +#define GL_GEOMETRY_DEFORMATION_BIT_SGIX 0x2 + +typedef void (GLAPIENTRY * PFNGLDEFORMSGIXPROC) (GLbitfield mask); +typedef void (GLAPIENTRY * PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mask); + +#define glDeformSGIX GLEW_GET_FUN(__glewDeformSGIX) +#define glLoadIdentityDeformationMapSGIX GLEW_GET_FUN(__glewLoadIdentityDeformationMapSGIX) + +#define GLEW_SGIX_polynomial_ffd GLEW_GET_VAR(__GLEW_SGIX_polynomial_ffd) + +#endif /* GL_SGIX_polynomial_ffd */ + +/* --------------------------- GL_SGIX_quad_mesh --------------------------- */ + +#ifndef GL_SGIX_quad_mesh +#define GL_SGIX_quad_mesh 1 + +typedef void (GLAPIENTRY * PFNGLMESHBREADTHSGIXPROC) (GLint breadth); +typedef void (GLAPIENTRY * PFNGLMESHSTRIDESGIXPROC) (GLint stride); + +#define glMeshBreadthSGIX GLEW_GET_FUN(__glewMeshBreadthSGIX) +#define glMeshStrideSGIX GLEW_GET_FUN(__glewMeshStrideSGIX) + +#define GLEW_SGIX_quad_mesh GLEW_GET_VAR(__GLEW_SGIX_quad_mesh) + +#endif /* GL_SGIX_quad_mesh */ + +/* ------------------------ GL_SGIX_reference_plane ------------------------ */ + +#ifndef GL_SGIX_reference_plane +#define GL_SGIX_reference_plane 1 + +typedef void (GLAPIENTRY * PFNGLREFERENCEPLANESGIXPROC) (const GLdouble* equation); + +#define glReferencePlaneSGIX GLEW_GET_FUN(__glewReferencePlaneSGIX) + +#define GLEW_SGIX_reference_plane GLEW_GET_VAR(__GLEW_SGIX_reference_plane) + +#endif /* GL_SGIX_reference_plane */ + +/* ---------------------------- GL_SGIX_resample --------------------------- */ + +#ifndef GL_SGIX_resample +#define GL_SGIX_resample 1 + +#define GL_PACK_RESAMPLE_SGIX 0x842E +#define GL_UNPACK_RESAMPLE_SGIX 0x842F +#define GL_RESAMPLE_DECIMATE_SGIX 0x8430 +#define GL_RESAMPLE_REPLICATE_SGIX 0x8433 +#define GL_RESAMPLE_ZERO_FILL_SGIX 0x8434 + +#define GLEW_SGIX_resample GLEW_GET_VAR(__GLEW_SGIX_resample) + +#endif /* GL_SGIX_resample */ + +/* ------------------------- GL_SGIX_scalebias_hint ------------------------ */ + +#ifndef GL_SGIX_scalebias_hint +#define GL_SGIX_scalebias_hint 1 + +#define GL_SCALEBIAS_HINT_SGIX 0x8322 + +#define GLEW_SGIX_scalebias_hint GLEW_GET_VAR(__GLEW_SGIX_scalebias_hint) + +#endif /* GL_SGIX_scalebias_hint */ + +/* ----------------------------- GL_SGIX_shadow ---------------------------- */ + +#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 + +#define GLEW_SGIX_shadow GLEW_GET_VAR(__GLEW_SGIX_shadow) + +#endif /* GL_SGIX_shadow */ + +/* ------------------------- GL_SGIX_shadow_ambient ------------------------ */ + +#ifndef GL_SGIX_shadow_ambient +#define GL_SGIX_shadow_ambient 1 + +#define GL_SHADOW_AMBIENT_SGIX 0x80BF + +#define GLEW_SGIX_shadow_ambient GLEW_GET_VAR(__GLEW_SGIX_shadow_ambient) + +#endif /* GL_SGIX_shadow_ambient */ + +/* ------------------------------ GL_SGIX_slim ----------------------------- */ + +#ifndef GL_SGIX_slim +#define GL_SGIX_slim 1 + +#define GL_PACK_MAX_COMPRESSED_SIZE_SGIX 0x831B +#define GL_SLIM8U_SGIX 0x831D +#define GL_SLIM10U_SGIX 0x831E +#define GL_SLIM12S_SGIX 0x831F + +#define GLEW_SGIX_slim GLEW_GET_VAR(__GLEW_SGIX_slim) + +#endif /* GL_SGIX_slim */ + +/* ------------------------ GL_SGIX_spotlight_cutoff ----------------------- */ + +#ifndef GL_SGIX_spotlight_cutoff +#define GL_SGIX_spotlight_cutoff 1 + +#define GL_SPOT_CUTOFF_DELTA_SGIX 0x8193 + +#define GLEW_SGIX_spotlight_cutoff GLEW_GET_VAR(__GLEW_SGIX_spotlight_cutoff) + +#endif /* GL_SGIX_spotlight_cutoff */ + +/* ----------------------------- GL_SGIX_sprite ---------------------------- */ + +#ifndef GL_SGIX_sprite +#define GL_SGIX_sprite 1 + +typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, GLint* params); + +#define glSpriteParameterfSGIX GLEW_GET_FUN(__glewSpriteParameterfSGIX) +#define glSpriteParameterfvSGIX GLEW_GET_FUN(__glewSpriteParameterfvSGIX) +#define glSpriteParameteriSGIX GLEW_GET_FUN(__glewSpriteParameteriSGIX) +#define glSpriteParameterivSGIX GLEW_GET_FUN(__glewSpriteParameterivSGIX) + +#define GLEW_SGIX_sprite GLEW_GET_VAR(__GLEW_SGIX_sprite) + +#endif /* GL_SGIX_sprite */ + +/* -------------------------- GL_SGIX_subdiv_patch ------------------------- */ + +#ifndef GL_SGIX_subdiv_patch +#define GL_SGIX_subdiv_patch 1 + +#define GLEW_SGIX_subdiv_patch GLEW_GET_VAR(__GLEW_SGIX_subdiv_patch) + +#endif /* GL_SGIX_subdiv_patch */ + +/* --------------------------- GL_SGIX_subsample --------------------------- */ + +#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 + +#define GLEW_SGIX_subsample GLEW_GET_VAR(__GLEW_SGIX_subsample) + +#endif /* GL_SGIX_subsample */ + +/* ----------------------- GL_SGIX_tag_sample_buffer ----------------------- */ + +#ifndef GL_SGIX_tag_sample_buffer +#define GL_SGIX_tag_sample_buffer 1 + +typedef void (GLAPIENTRY * PFNGLTAGSAMPLEBUFFERSGIXPROC) (void); + +#define glTagSampleBufferSGIX GLEW_GET_FUN(__glewTagSampleBufferSGIX) + +#define GLEW_SGIX_tag_sample_buffer GLEW_GET_VAR(__GLEW_SGIX_tag_sample_buffer) + +#endif /* GL_SGIX_tag_sample_buffer */ + +/* ------------------------ GL_SGIX_texture_add_env ------------------------ */ + +#ifndef GL_SGIX_texture_add_env +#define GL_SGIX_texture_add_env 1 + +#define GLEW_SGIX_texture_add_env GLEW_GET_VAR(__GLEW_SGIX_texture_add_env) + +#endif /* GL_SGIX_texture_add_env */ + +/* -------------------- GL_SGIX_texture_coordinate_clamp ------------------- */ + +#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 + +#define GLEW_SGIX_texture_coordinate_clamp GLEW_GET_VAR(__GLEW_SGIX_texture_coordinate_clamp) + +#endif /* GL_SGIX_texture_coordinate_clamp */ + +/* ------------------------ GL_SGIX_texture_lod_bias ----------------------- */ + +#ifndef GL_SGIX_texture_lod_bias +#define GL_SGIX_texture_lod_bias 1 + +#define GLEW_SGIX_texture_lod_bias GLEW_GET_VAR(__GLEW_SGIX_texture_lod_bias) + +#endif /* GL_SGIX_texture_lod_bias */ + +/* ------------------- GL_SGIX_texture_mipmap_anisotropic ------------------ */ + +#ifndef GL_SGIX_texture_mipmap_anisotropic +#define GL_SGIX_texture_mipmap_anisotropic 1 + +#define GL_TEXTURE_MIPMAP_ANISOTROPY_SGIX 0x832E +#define GL_MAX_MIPMAP_ANISOTROPY_SGIX 0x832F + +#define GLEW_SGIX_texture_mipmap_anisotropic GLEW_GET_VAR(__GLEW_SGIX_texture_mipmap_anisotropic) + +#endif /* GL_SGIX_texture_mipmap_anisotropic */ + +/* ---------------------- GL_SGIX_texture_multi_buffer --------------------- */ + +#ifndef GL_SGIX_texture_multi_buffer +#define GL_SGIX_texture_multi_buffer 1 + +#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E + +#define GLEW_SGIX_texture_multi_buffer GLEW_GET_VAR(__GLEW_SGIX_texture_multi_buffer) + +#endif /* GL_SGIX_texture_multi_buffer */ + +/* ------------------------- GL_SGIX_texture_phase ------------------------- */ + +#ifndef GL_SGIX_texture_phase +#define GL_SGIX_texture_phase 1 + +#define GL_PHASE_SGIX 0x832A + +#define GLEW_SGIX_texture_phase GLEW_GET_VAR(__GLEW_SGIX_texture_phase) + +#endif /* GL_SGIX_texture_phase */ + +/* ------------------------- GL_SGIX_texture_range ------------------------- */ + +#ifndef GL_SGIX_texture_range +#define GL_SGIX_texture_range 1 + +#define GL_RGB_SIGNED_SGIX 0x85E0 +#define GL_RGBA_SIGNED_SGIX 0x85E1 +#define GL_ALPHA_SIGNED_SGIX 0x85E2 +#define GL_LUMINANCE_SIGNED_SGIX 0x85E3 +#define GL_INTENSITY_SIGNED_SGIX 0x85E4 +#define GL_LUMINANCE_ALPHA_SIGNED_SGIX 0x85E5 +#define GL_RGB16_SIGNED_SGIX 0x85E6 +#define GL_RGBA16_SIGNED_SGIX 0x85E7 +#define GL_ALPHA16_SIGNED_SGIX 0x85E8 +#define GL_LUMINANCE16_SIGNED_SGIX 0x85E9 +#define GL_INTENSITY16_SIGNED_SGIX 0x85EA +#define GL_LUMINANCE16_ALPHA16_SIGNED_SGIX 0x85EB +#define GL_RGB_EXTENDED_RANGE_SGIX 0x85EC +#define GL_RGBA_EXTENDED_RANGE_SGIX 0x85ED +#define GL_ALPHA_EXTENDED_RANGE_SGIX 0x85EE +#define GL_LUMINANCE_EXTENDED_RANGE_SGIX 0x85EF +#define GL_INTENSITY_EXTENDED_RANGE_SGIX 0x85F0 +#define GL_LUMINANCE_ALPHA_EXTENDED_RANGE_SGIX 0x85F1 +#define GL_RGB16_EXTENDED_RANGE_SGIX 0x85F2 +#define GL_RGBA16_EXTENDED_RANGE_SGIX 0x85F3 +#define GL_ALPHA16_EXTENDED_RANGE_SGIX 0x85F4 +#define GL_LUMINANCE16_EXTENDED_RANGE_SGIX 0x85F5 +#define GL_INTENSITY16_EXTENDED_RANGE_SGIX 0x85F6 +#define GL_LUMINANCE16_ALPHA16_EXTENDED_RANGE_SGIX 0x85F7 +#define GL_MIN_LUMINANCE_SGIS 0x85F8 +#define GL_MAX_LUMINANCE_SGIS 0x85F9 +#define GL_MIN_INTENSITY_SGIS 0x85FA +#define GL_MAX_INTENSITY_SGIS 0x85FB + +#define GLEW_SGIX_texture_range GLEW_GET_VAR(__GLEW_SGIX_texture_range) + +#endif /* GL_SGIX_texture_range */ + +/* ----------------------- GL_SGIX_texture_scale_bias ---------------------- */ + +#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 + +#define GLEW_SGIX_texture_scale_bias GLEW_GET_VAR(__GLEW_SGIX_texture_scale_bias) + +#endif /* GL_SGIX_texture_scale_bias */ + +/* ---------------------- GL_SGIX_texture_supersample ---------------------- */ + +#ifndef GL_SGIX_texture_supersample +#define GL_SGIX_texture_supersample 1 + +#define GLEW_SGIX_texture_supersample GLEW_GET_VAR(__GLEW_SGIX_texture_supersample) + +#endif /* GL_SGIX_texture_supersample */ + +/* --------------------------- GL_SGIX_vector_ops -------------------------- */ + +#ifndef GL_SGIX_vector_ops +#define GL_SGIX_vector_ops 1 + +typedef void (GLAPIENTRY * PFNGLGETVECTOROPERATIONSGIXPROC) (GLenum operation); +typedef void (GLAPIENTRY * PFNGLVECTOROPERATIONSGIXPROC) (GLenum operation); + +#define glGetVectorOperationSGIX GLEW_GET_FUN(__glewGetVectorOperationSGIX) +#define glVectorOperationSGIX GLEW_GET_FUN(__glewVectorOperationSGIX) + +#define GLEW_SGIX_vector_ops GLEW_GET_VAR(__GLEW_SGIX_vector_ops) + +#endif /* GL_SGIX_vector_ops */ + +/* ---------------------- GL_SGIX_vertex_array_object ---------------------- */ + +#ifndef GL_SGIX_vertex_array_object +#define GL_SGIX_vertex_array_object 1 + +typedef GLboolean (GLAPIENTRY * PFNGLAREVERTEXARRAYSRESIDENTSGIXPROC) (GLsizei n, const GLuint* arrays, GLboolean* residences); +typedef void (GLAPIENTRY * PFNGLBINDVERTEXARRAYSGIXPROC) (GLuint array); +typedef void (GLAPIENTRY * PFNGLDELETEVERTEXARRAYSSGIXPROC) (GLsizei n, const GLuint* arrays); +typedef void (GLAPIENTRY * PFNGLGENVERTEXARRAYSSGIXPROC) (GLsizei n, GLuint* arrays); +typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXARRAYSGIXPROC) (GLuint array); +typedef void (GLAPIENTRY * PFNGLPRIORITIZEVERTEXARRAYSSGIXPROC) (GLsizei n, const GLuint* arrays, const GLclampf* priorities); + +#define glAreVertexArraysResidentSGIX GLEW_GET_FUN(__glewAreVertexArraysResidentSGIX) +#define glBindVertexArraySGIX GLEW_GET_FUN(__glewBindVertexArraySGIX) +#define glDeleteVertexArraysSGIX GLEW_GET_FUN(__glewDeleteVertexArraysSGIX) +#define glGenVertexArraysSGIX GLEW_GET_FUN(__glewGenVertexArraysSGIX) +#define glIsVertexArraySGIX GLEW_GET_FUN(__glewIsVertexArraySGIX) +#define glPrioritizeVertexArraysSGIX GLEW_GET_FUN(__glewPrioritizeVertexArraysSGIX) + +#define GLEW_SGIX_vertex_array_object GLEW_GET_VAR(__GLEW_SGIX_vertex_array_object) + +#endif /* GL_SGIX_vertex_array_object */ + +/* ------------------------- GL_SGIX_vertex_preclip ------------------------ */ + +#ifndef GL_SGIX_vertex_preclip +#define GL_SGIX_vertex_preclip 1 + +#define GL_VERTEX_PRECLIP_SGIX 0x83EE +#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF + +#define GLEW_SGIX_vertex_preclip GLEW_GET_VAR(__GLEW_SGIX_vertex_preclip) + +#endif /* GL_SGIX_vertex_preclip */ + +/* ---------------------- GL_SGIX_vertex_preclip_hint ---------------------- */ + +#ifndef GL_SGIX_vertex_preclip_hint +#define GL_SGIX_vertex_preclip_hint 1 + +#define GL_VERTEX_PRECLIP_SGIX 0x83EE +#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF + +#define GLEW_SGIX_vertex_preclip_hint GLEW_GET_VAR(__GLEW_SGIX_vertex_preclip_hint) + +#endif /* GL_SGIX_vertex_preclip_hint */ + +/* ----------------------------- GL_SGIX_ycrcb ----------------------------- */ + +#ifndef GL_SGIX_ycrcb +#define GL_SGIX_ycrcb 1 + +#define GLEW_SGIX_ycrcb GLEW_GET_VAR(__GLEW_SGIX_ycrcb) + +#endif /* GL_SGIX_ycrcb */ + +/* ------------------------ GL_SGIX_ycrcb_subsample ------------------------ */ + +#ifndef GL_SGIX_ycrcb_subsample +#define GL_SGIX_ycrcb_subsample 1 + +#define GLEW_SGIX_ycrcb_subsample GLEW_GET_VAR(__GLEW_SGIX_ycrcb_subsample) + +#endif /* GL_SGIX_ycrcb_subsample */ + +/* ----------------------------- GL_SGIX_ycrcba ---------------------------- */ + +#ifndef GL_SGIX_ycrcba +#define GL_SGIX_ycrcba 1 + +#define GL_YCRCB_SGIX 0x8318 +#define GL_YCRCBA_SGIX 0x8319 + +#define GLEW_SGIX_ycrcba GLEW_GET_VAR(__GLEW_SGIX_ycrcba) + +#endif /* GL_SGIX_ycrcba */ + +/* -------------------------- GL_SGI_color_matrix -------------------------- */ + +#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 + +#define GLEW_SGI_color_matrix GLEW_GET_VAR(__GLEW_SGI_color_matrix) + +#endif /* GL_SGI_color_matrix */ + +/* --------------------------- GL_SGI_color_table -------------------------- */ + +#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 (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *table); +typedef void (GLAPIENTRY * PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, void *table); + +#define glColorTableParameterfvSGI GLEW_GET_FUN(__glewColorTableParameterfvSGI) +#define glColorTableParameterivSGI GLEW_GET_FUN(__glewColorTableParameterivSGI) +#define glColorTableSGI GLEW_GET_FUN(__glewColorTableSGI) +#define glCopyColorTableSGI GLEW_GET_FUN(__glewCopyColorTableSGI) +#define glGetColorTableParameterfvSGI GLEW_GET_FUN(__glewGetColorTableParameterfvSGI) +#define glGetColorTableParameterivSGI GLEW_GET_FUN(__glewGetColorTableParameterivSGI) +#define glGetColorTableSGI GLEW_GET_FUN(__glewGetColorTableSGI) + +#define GLEW_SGI_color_table GLEW_GET_VAR(__GLEW_SGI_color_table) + +#endif /* GL_SGI_color_table */ + +/* ----------------------------- GL_SGI_complex ---------------------------- */ + +#ifndef GL_SGI_complex +#define GL_SGI_complex 1 + +#define GLEW_SGI_complex GLEW_GET_VAR(__GLEW_SGI_complex) + +#endif /* GL_SGI_complex */ + +/* -------------------------- GL_SGI_complex_type -------------------------- */ + +#ifndef GL_SGI_complex_type +#define GL_SGI_complex_type 1 + +#define GL_COMPLEX_UNSIGNED_BYTE_SGI 0x81BD +#define GL_COMPLEX_BYTE_SGI 0x81BE +#define GL_COMPLEX_UNSIGNED_SHORT_SGI 0x81BF +#define GL_COMPLEX_SHORT_SGI 0x81C0 +#define GL_COMPLEX_UNSIGNED_INT_SGI 0x81C1 +#define GL_COMPLEX_INT_SGI 0x81C2 +#define GL_COMPLEX_FLOAT_SGI 0x81C3 + +#define GLEW_SGI_complex_type GLEW_GET_VAR(__GLEW_SGI_complex_type) + +#endif /* GL_SGI_complex_type */ + +/* ------------------------------- GL_SGI_fft ------------------------------ */ + +#ifndef GL_SGI_fft +#define GL_SGI_fft 1 + +#define GL_PIXEL_TRANSFORM_OPERATOR_SGI 0x81C4 +#define GL_CONVOLUTION_SGI 0x81C5 +#define GL_FFT_1D_SGI 0x81C6 +#define GL_PIXEL_TRANSFORM_SGI 0x81C7 +#define GL_MAX_FFT_WIDTH_SGI 0x81C8 + +typedef void (GLAPIENTRY * PFNGLGETPIXELTRANSFORMPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETPIXELTRANSFORMPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERFSGIPROC) (GLenum target, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERISGIPROC) (GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMSGIPROC) (GLenum target); + +#define glGetPixelTransformParameterfvSGI GLEW_GET_FUN(__glewGetPixelTransformParameterfvSGI) +#define glGetPixelTransformParameterivSGI GLEW_GET_FUN(__glewGetPixelTransformParameterivSGI) +#define glPixelTransformParameterfSGI GLEW_GET_FUN(__glewPixelTransformParameterfSGI) +#define glPixelTransformParameterfvSGI GLEW_GET_FUN(__glewPixelTransformParameterfvSGI) +#define glPixelTransformParameteriSGI GLEW_GET_FUN(__glewPixelTransformParameteriSGI) +#define glPixelTransformParameterivSGI GLEW_GET_FUN(__glewPixelTransformParameterivSGI) +#define glPixelTransformSGI GLEW_GET_FUN(__glewPixelTransformSGI) + +#define GLEW_SGI_fft GLEW_GET_VAR(__GLEW_SGI_fft) + +#endif /* GL_SGI_fft */ + +/* ----------------------- GL_SGI_texture_color_table ---------------------- */ + +#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 + +#define GLEW_SGI_texture_color_table GLEW_GET_VAR(__GLEW_SGI_texture_color_table) + +#endif /* GL_SGI_texture_color_table */ + +/* ------------------------- GL_SUNX_constant_data ------------------------- */ + +#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 (GLAPIENTRY * PFNGLFINISHTEXTURESUNXPROC) (void); + +#define glFinishTextureSUNX GLEW_GET_FUN(__glewFinishTextureSUNX) + +#define GLEW_SUNX_constant_data GLEW_GET_VAR(__GLEW_SUNX_constant_data) + +#endif /* GL_SUNX_constant_data */ + +/* -------------------- GL_SUN_convolution_border_modes -------------------- */ + +#ifndef GL_SUN_convolution_border_modes +#define GL_SUN_convolution_border_modes 1 + +#define GL_WRAP_BORDER_SUN 0x81D4 + +#define GLEW_SUN_convolution_border_modes GLEW_GET_VAR(__GLEW_SUN_convolution_border_modes) + +#endif /* GL_SUN_convolution_border_modes */ + +/* -------------------------- GL_SUN_global_alpha -------------------------- */ + +#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 (GLAPIENTRY * PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor); + +#define glGlobalAlphaFactorbSUN GLEW_GET_FUN(__glewGlobalAlphaFactorbSUN) +#define glGlobalAlphaFactordSUN GLEW_GET_FUN(__glewGlobalAlphaFactordSUN) +#define glGlobalAlphaFactorfSUN GLEW_GET_FUN(__glewGlobalAlphaFactorfSUN) +#define glGlobalAlphaFactoriSUN GLEW_GET_FUN(__glewGlobalAlphaFactoriSUN) +#define glGlobalAlphaFactorsSUN GLEW_GET_FUN(__glewGlobalAlphaFactorsSUN) +#define glGlobalAlphaFactorubSUN GLEW_GET_FUN(__glewGlobalAlphaFactorubSUN) +#define glGlobalAlphaFactoruiSUN GLEW_GET_FUN(__glewGlobalAlphaFactoruiSUN) +#define glGlobalAlphaFactorusSUN GLEW_GET_FUN(__glewGlobalAlphaFactorusSUN) + +#define GLEW_SUN_global_alpha GLEW_GET_VAR(__GLEW_SUN_global_alpha) + +#endif /* GL_SUN_global_alpha */ + +/* --------------------------- GL_SUN_mesh_array --------------------------- */ + +#ifndef GL_SUN_mesh_array +#define GL_SUN_mesh_array 1 + +#define GL_QUAD_MESH_SUN 0x8614 +#define GL_TRIANGLE_MESH_SUN 0x8615 + +#define GLEW_SUN_mesh_array GLEW_GET_VAR(__GLEW_SUN_mesh_array) + +#endif /* GL_SUN_mesh_array */ + +/* ------------------------ GL_SUN_read_video_pixels ----------------------- */ + +#ifndef GL_SUN_read_video_pixels +#define GL_SUN_read_video_pixels 1 + +typedef void (GLAPIENTRY * PFNGLREADVIDEOPIXELSSUNPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels); + +#define glReadVideoPixelsSUN GLEW_GET_FUN(__glewReadVideoPixelsSUN) + +#define GLEW_SUN_read_video_pixels GLEW_GET_VAR(__GLEW_SUN_read_video_pixels) + +#endif /* GL_SUN_read_video_pixels */ + +/* --------------------------- GL_SUN_slice_accum -------------------------- */ + +#ifndef GL_SUN_slice_accum +#define GL_SUN_slice_accum 1 + +#define GL_SLICE_ACCUM_SUN 0x85CC + +#define GLEW_SUN_slice_accum GLEW_GET_VAR(__GLEW_SUN_slice_accum) + +#endif /* GL_SUN_slice_accum */ + +/* -------------------------- GL_SUN_triangle_list ------------------------- */ + +#ifndef GL_SUN_triangle_list +#define GL_SUN_triangle_list 1 + +#define GL_RESTART_SUN 0x01 +#define GL_REPLACE_MIDDLE_SUN 0x02 +#define GL_REPLACE_OLDEST_SUN 0x03 +#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 (GLAPIENTRY * PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const void *pointer); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte* code); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint* code); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort* code); + +#define glReplacementCodePointerSUN GLEW_GET_FUN(__glewReplacementCodePointerSUN) +#define glReplacementCodeubSUN GLEW_GET_FUN(__glewReplacementCodeubSUN) +#define glReplacementCodeubvSUN GLEW_GET_FUN(__glewReplacementCodeubvSUN) +#define glReplacementCodeuiSUN GLEW_GET_FUN(__glewReplacementCodeuiSUN) +#define glReplacementCodeuivSUN GLEW_GET_FUN(__glewReplacementCodeuivSUN) +#define glReplacementCodeusSUN GLEW_GET_FUN(__glewReplacementCodeusSUN) +#define glReplacementCodeusvSUN GLEW_GET_FUN(__glewReplacementCodeusvSUN) + +#define GLEW_SUN_triangle_list GLEW_GET_VAR(__GLEW_SUN_triangle_list) + +#endif /* GL_SUN_triangle_list */ + +/* ----------------------------- GL_SUN_vertex ----------------------------- */ + +#ifndef GL_SUN_vertex +#define GL_SUN_vertex 1 + +typedef void (GLAPIENTRY * PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat* c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* c, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte* c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte* c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *c, const GLfloat *v); +typedef void (GLAPIENTRY * 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 (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint* rc, const GLubyte *c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * 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 (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *tc, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *c, const GLfloat *v); +typedef void (GLAPIENTRY * 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 (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat* tc, const GLubyte *c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *v); +typedef void (GLAPIENTRY * 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 (GLAPIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat* tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat* tc, const GLfloat *v); + +#define glColor3fVertex3fSUN GLEW_GET_FUN(__glewColor3fVertex3fSUN) +#define glColor3fVertex3fvSUN GLEW_GET_FUN(__glewColor3fVertex3fvSUN) +#define glColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewColor4fNormal3fVertex3fSUN) +#define glColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewColor4fNormal3fVertex3fvSUN) +#define glColor4ubVertex2fSUN GLEW_GET_FUN(__glewColor4ubVertex2fSUN) +#define glColor4ubVertex2fvSUN GLEW_GET_FUN(__glewColor4ubVertex2fvSUN) +#define glColor4ubVertex3fSUN GLEW_GET_FUN(__glewColor4ubVertex3fSUN) +#define glColor4ubVertex3fvSUN GLEW_GET_FUN(__glewColor4ubVertex3fvSUN) +#define glNormal3fVertex3fSUN GLEW_GET_FUN(__glewNormal3fVertex3fSUN) +#define glNormal3fVertex3fvSUN GLEW_GET_FUN(__glewNormal3fVertex3fvSUN) +#define glReplacementCodeuiColor3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiColor3fVertex3fSUN) +#define glReplacementCodeuiColor3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiColor3fVertex3fvSUN) +#define glReplacementCodeuiColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4fNormal3fVertex3fSUN) +#define glReplacementCodeuiColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4fNormal3fVertex3fvSUN) +#define glReplacementCodeuiColor4ubVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4ubVertex3fSUN) +#define glReplacementCodeuiColor4ubVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4ubVertex3fvSUN) +#define glReplacementCodeuiNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiNormal3fVertex3fSUN) +#define glReplacementCodeuiNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiNormal3fVertex3fvSUN) +#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN) +#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN) +#define glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fNormal3fVertex3fSUN) +#define glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN) +#define glReplacementCodeuiTexCoord2fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fVertex3fSUN) +#define glReplacementCodeuiTexCoord2fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fVertex3fvSUN) +#define glReplacementCodeuiVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiVertex3fSUN) +#define glReplacementCodeuiVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiVertex3fvSUN) +#define glTexCoord2fColor3fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fColor3fVertex3fSUN) +#define glTexCoord2fColor3fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fColor3fVertex3fvSUN) +#define glTexCoord2fColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fColor4fNormal3fVertex3fSUN) +#define glTexCoord2fColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fColor4fNormal3fVertex3fvSUN) +#define glTexCoord2fColor4ubVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fColor4ubVertex3fSUN) +#define glTexCoord2fColor4ubVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fColor4ubVertex3fvSUN) +#define glTexCoord2fNormal3fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fNormal3fVertex3fSUN) +#define glTexCoord2fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fNormal3fVertex3fvSUN) +#define glTexCoord2fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fVertex3fSUN) +#define glTexCoord2fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fVertex3fvSUN) +#define glTexCoord4fColor4fNormal3fVertex4fSUN GLEW_GET_FUN(__glewTexCoord4fColor4fNormal3fVertex4fSUN) +#define glTexCoord4fColor4fNormal3fVertex4fvSUN GLEW_GET_FUN(__glewTexCoord4fColor4fNormal3fVertex4fvSUN) +#define glTexCoord4fVertex4fSUN GLEW_GET_FUN(__glewTexCoord4fVertex4fSUN) +#define glTexCoord4fVertex4fvSUN GLEW_GET_FUN(__glewTexCoord4fVertex4fvSUN) + +#define GLEW_SUN_vertex GLEW_GET_VAR(__GLEW_SUN_vertex) + +#endif /* GL_SUN_vertex */ + +/* -------------------------- GL_WIN_phong_shading ------------------------- */ + +#ifndef GL_WIN_phong_shading +#define GL_WIN_phong_shading 1 + +#define GL_PHONG_WIN 0x80EA +#define GL_PHONG_HINT_WIN 0x80EB + +#define GLEW_WIN_phong_shading GLEW_GET_VAR(__GLEW_WIN_phong_shading) + +#endif /* GL_WIN_phong_shading */ + +/* ------------------------- GL_WIN_scene_markerXXX ------------------------ */ + +#ifndef GL_WIN_scene_markerXXX +#define GL_WIN_scene_markerXXX 1 + +#define GLEW_WIN_scene_markerXXX GLEW_GET_VAR(__GLEW_WIN_scene_markerXXX) + +#endif /* GL_WIN_scene_markerXXX */ + +/* -------------------------- GL_WIN_specular_fog -------------------------- */ + +#ifndef GL_WIN_specular_fog +#define GL_WIN_specular_fog 1 + +#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC + +#define GLEW_WIN_specular_fog GLEW_GET_VAR(__GLEW_WIN_specular_fog) + +#endif /* GL_WIN_specular_fog */ + +/* ---------------------------- GL_WIN_swap_hint --------------------------- */ + +#ifndef GL_WIN_swap_hint +#define GL_WIN_swap_hint 1 + +typedef void (GLAPIENTRY * PFNGLADDSWAPHINTRECTWINPROC) (GLint x, GLint y, GLsizei width, GLsizei height); + +#define glAddSwapHintRectWIN GLEW_GET_FUN(__glewAddSwapHintRectWIN) + +#define GLEW_WIN_swap_hint GLEW_GET_VAR(__GLEW_WIN_swap_hint) + +#endif /* GL_WIN_swap_hint */ + +/* ------------------------------------------------------------------------- */ + + + +GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE3DPROC __glewCopyTexSubImage3D; +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSPROC __glewDrawRangeElements; +GLEW_FUN_EXPORT PFNGLTEXIMAGE3DPROC __glewTexImage3D; +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE3DPROC __glewTexSubImage3D; + +GLEW_FUN_EXPORT PFNGLACTIVETEXTUREPROC __glewActiveTexture; +GLEW_FUN_EXPORT PFNGLCLIENTACTIVETEXTUREPROC __glewClientActiveTexture; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE1DPROC __glewCompressedTexImage1D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE2DPROC __glewCompressedTexImage2D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE3DPROC __glewCompressedTexImage3D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC __glewCompressedTexSubImage1D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC __glewCompressedTexSubImage2D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC __glewCompressedTexSubImage3D; +GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXIMAGEPROC __glewGetCompressedTexImage; +GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXDPROC __glewLoadTransposeMatrixd; +GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXFPROC __glewLoadTransposeMatrixf; +GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXDPROC __glewMultTransposeMatrixd; +GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXFPROC __glewMultTransposeMatrixf; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DPROC __glewMultiTexCoord1d; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DVPROC __glewMultiTexCoord1dv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FPROC __glewMultiTexCoord1f; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FVPROC __glewMultiTexCoord1fv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IPROC __glewMultiTexCoord1i; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IVPROC __glewMultiTexCoord1iv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SPROC __glewMultiTexCoord1s; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SVPROC __glewMultiTexCoord1sv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DPROC __glewMultiTexCoord2d; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DVPROC __glewMultiTexCoord2dv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FPROC __glewMultiTexCoord2f; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FVPROC __glewMultiTexCoord2fv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IPROC __glewMultiTexCoord2i; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IVPROC __glewMultiTexCoord2iv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SPROC __glewMultiTexCoord2s; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SVPROC __glewMultiTexCoord2sv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DPROC __glewMultiTexCoord3d; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DVPROC __glewMultiTexCoord3dv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FPROC __glewMultiTexCoord3f; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FVPROC __glewMultiTexCoord3fv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IPROC __glewMultiTexCoord3i; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IVPROC __glewMultiTexCoord3iv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SPROC __glewMultiTexCoord3s; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SVPROC __glewMultiTexCoord3sv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DPROC __glewMultiTexCoord4d; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DVPROC __glewMultiTexCoord4dv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FPROC __glewMultiTexCoord4f; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FVPROC __glewMultiTexCoord4fv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IPROC __glewMultiTexCoord4i; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IVPROC __glewMultiTexCoord4iv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SPROC __glewMultiTexCoord4s; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SVPROC __glewMultiTexCoord4sv; +GLEW_FUN_EXPORT PFNGLSAMPLECOVERAGEPROC __glewSampleCoverage; + +GLEW_FUN_EXPORT PFNGLBLENDCOLORPROC __glewBlendColor; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONPROC __glewBlendEquation; +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEPROC __glewBlendFuncSeparate; +GLEW_FUN_EXPORT PFNGLFOGCOORDPOINTERPROC __glewFogCoordPointer; +GLEW_FUN_EXPORT PFNGLFOGCOORDDPROC __glewFogCoordd; +GLEW_FUN_EXPORT PFNGLFOGCOORDDVPROC __glewFogCoorddv; +GLEW_FUN_EXPORT PFNGLFOGCOORDFPROC __glewFogCoordf; +GLEW_FUN_EXPORT PFNGLFOGCOORDFVPROC __glewFogCoordfv; +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSPROC __glewMultiDrawArrays; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSPROC __glewMultiDrawElements; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFPROC __glewPointParameterf; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVPROC __glewPointParameterfv; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERIPROC __glewPointParameteri; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERIVPROC __glewPointParameteriv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BPROC __glewSecondaryColor3b; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BVPROC __glewSecondaryColor3bv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DPROC __glewSecondaryColor3d; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DVPROC __glewSecondaryColor3dv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FPROC __glewSecondaryColor3f; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FVPROC __glewSecondaryColor3fv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IPROC __glewSecondaryColor3i; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IVPROC __glewSecondaryColor3iv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SPROC __glewSecondaryColor3s; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SVPROC __glewSecondaryColor3sv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBPROC __glewSecondaryColor3ub; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBVPROC __glewSecondaryColor3ubv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIPROC __glewSecondaryColor3ui; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIVPROC __glewSecondaryColor3uiv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USPROC __glewSecondaryColor3us; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USVPROC __glewSecondaryColor3usv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTERPROC __glewSecondaryColorPointer; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DPROC __glewWindowPos2d; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DVPROC __glewWindowPos2dv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FPROC __glewWindowPos2f; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FVPROC __glewWindowPos2fv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IPROC __glewWindowPos2i; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IVPROC __glewWindowPos2iv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SPROC __glewWindowPos2s; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SVPROC __glewWindowPos2sv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DPROC __glewWindowPos3d; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DVPROC __glewWindowPos3dv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FPROC __glewWindowPos3f; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FVPROC __glewWindowPos3fv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IPROC __glewWindowPos3i; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IVPROC __glewWindowPos3iv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SPROC __glewWindowPos3s; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SVPROC __glewWindowPos3sv; + +GLEW_FUN_EXPORT PFNGLBEGINQUERYPROC __glewBeginQuery; +GLEW_FUN_EXPORT PFNGLBINDBUFFERPROC __glewBindBuffer; +GLEW_FUN_EXPORT PFNGLBUFFERDATAPROC __glewBufferData; +GLEW_FUN_EXPORT PFNGLBUFFERSUBDATAPROC __glewBufferSubData; +GLEW_FUN_EXPORT PFNGLDELETEBUFFERSPROC __glewDeleteBuffers; +GLEW_FUN_EXPORT PFNGLDELETEQUERIESPROC __glewDeleteQueries; +GLEW_FUN_EXPORT PFNGLENDQUERYPROC __glewEndQuery; +GLEW_FUN_EXPORT PFNGLGENBUFFERSPROC __glewGenBuffers; +GLEW_FUN_EXPORT PFNGLGENQUERIESPROC __glewGenQueries; +GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERIVPROC __glewGetBufferParameteriv; +GLEW_FUN_EXPORT PFNGLGETBUFFERPOINTERVPROC __glewGetBufferPointerv; +GLEW_FUN_EXPORT PFNGLGETBUFFERSUBDATAPROC __glewGetBufferSubData; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTIVPROC __glewGetQueryObjectiv; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUIVPROC __glewGetQueryObjectuiv; +GLEW_FUN_EXPORT PFNGLGETQUERYIVPROC __glewGetQueryiv; +GLEW_FUN_EXPORT PFNGLISBUFFERPROC __glewIsBuffer; +GLEW_FUN_EXPORT PFNGLISQUERYPROC __glewIsQuery; +GLEW_FUN_EXPORT PFNGLMAPBUFFERPROC __glewMapBuffer; +GLEW_FUN_EXPORT PFNGLUNMAPBUFFERPROC __glewUnmapBuffer; + +GLEW_FUN_EXPORT PFNGLATTACHSHADERPROC __glewAttachShader; +GLEW_FUN_EXPORT PFNGLBINDATTRIBLOCATIONPROC __glewBindAttribLocation; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEPROC __glewBlendEquationSeparate; +GLEW_FUN_EXPORT PFNGLCOMPILESHADERPROC __glewCompileShader; +GLEW_FUN_EXPORT PFNGLCREATEPROGRAMPROC __glewCreateProgram; +GLEW_FUN_EXPORT PFNGLCREATESHADERPROC __glewCreateShader; +GLEW_FUN_EXPORT PFNGLDELETEPROGRAMPROC __glewDeleteProgram; +GLEW_FUN_EXPORT PFNGLDELETESHADERPROC __glewDeleteShader; +GLEW_FUN_EXPORT PFNGLDETACHSHADERPROC __glewDetachShader; +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBARRAYPROC __glewDisableVertexAttribArray; +GLEW_FUN_EXPORT PFNGLDRAWBUFFERSPROC __glewDrawBuffers; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBARRAYPROC __glewEnableVertexAttribArray; +GLEW_FUN_EXPORT PFNGLGETACTIVEATTRIBPROC __glewGetActiveAttrib; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMPROC __glewGetActiveUniform; +GLEW_FUN_EXPORT PFNGLGETATTACHEDSHADERSPROC __glewGetAttachedShaders; +GLEW_FUN_EXPORT PFNGLGETATTRIBLOCATIONPROC __glewGetAttribLocation; +GLEW_FUN_EXPORT PFNGLGETPROGRAMINFOLOGPROC __glewGetProgramInfoLog; +GLEW_FUN_EXPORT PFNGLGETPROGRAMIVPROC __glewGetProgramiv; +GLEW_FUN_EXPORT PFNGLGETSHADERINFOLOGPROC __glewGetShaderInfoLog; +GLEW_FUN_EXPORT PFNGLGETSHADERSOURCEPROC __glewGetShaderSource; +GLEW_FUN_EXPORT PFNGLGETSHADERIVPROC __glewGetShaderiv; +GLEW_FUN_EXPORT PFNGLGETUNIFORMLOCATIONPROC __glewGetUniformLocation; +GLEW_FUN_EXPORT PFNGLGETUNIFORMFVPROC __glewGetUniformfv; +GLEW_FUN_EXPORT PFNGLGETUNIFORMIVPROC __glewGetUniformiv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVPROC __glewGetVertexAttribPointerv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVPROC __glewGetVertexAttribdv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVPROC __glewGetVertexAttribfv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVPROC __glewGetVertexAttribiv; +GLEW_FUN_EXPORT PFNGLISPROGRAMPROC __glewIsProgram; +GLEW_FUN_EXPORT PFNGLISSHADERPROC __glewIsShader; +GLEW_FUN_EXPORT PFNGLLINKPROGRAMPROC __glewLinkProgram; +GLEW_FUN_EXPORT PFNGLSHADERSOURCEPROC __glewShaderSource; +GLEW_FUN_EXPORT PFNGLSTENCILFUNCSEPARATEPROC __glewStencilFuncSeparate; +GLEW_FUN_EXPORT PFNGLSTENCILMASKSEPARATEPROC __glewStencilMaskSeparate; +GLEW_FUN_EXPORT PFNGLSTENCILOPSEPARATEPROC __glewStencilOpSeparate; +GLEW_FUN_EXPORT PFNGLUNIFORM1FPROC __glewUniform1f; +GLEW_FUN_EXPORT PFNGLUNIFORM1FVPROC __glewUniform1fv; +GLEW_FUN_EXPORT PFNGLUNIFORM1IPROC __glewUniform1i; +GLEW_FUN_EXPORT PFNGLUNIFORM1IVPROC __glewUniform1iv; +GLEW_FUN_EXPORT PFNGLUNIFORM2FPROC __glewUniform2f; +GLEW_FUN_EXPORT PFNGLUNIFORM2FVPROC __glewUniform2fv; +GLEW_FUN_EXPORT PFNGLUNIFORM2IPROC __glewUniform2i; +GLEW_FUN_EXPORT PFNGLUNIFORM2IVPROC __glewUniform2iv; +GLEW_FUN_EXPORT PFNGLUNIFORM3FPROC __glewUniform3f; +GLEW_FUN_EXPORT PFNGLUNIFORM3FVPROC __glewUniform3fv; +GLEW_FUN_EXPORT PFNGLUNIFORM3IPROC __glewUniform3i; +GLEW_FUN_EXPORT PFNGLUNIFORM3IVPROC __glewUniform3iv; +GLEW_FUN_EXPORT PFNGLUNIFORM4FPROC __glewUniform4f; +GLEW_FUN_EXPORT PFNGLUNIFORM4FVPROC __glewUniform4fv; +GLEW_FUN_EXPORT PFNGLUNIFORM4IPROC __glewUniform4i; +GLEW_FUN_EXPORT PFNGLUNIFORM4IVPROC __glewUniform4iv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2FVPROC __glewUniformMatrix2fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3FVPROC __glewUniformMatrix3fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4FVPROC __glewUniformMatrix4fv; +GLEW_FUN_EXPORT PFNGLUSEPROGRAMPROC __glewUseProgram; +GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMPROC __glewValidateProgram; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DPROC __glewVertexAttrib1d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVPROC __glewVertexAttrib1dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FPROC __glewVertexAttrib1f; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVPROC __glewVertexAttrib1fv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SPROC __glewVertexAttrib1s; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVPROC __glewVertexAttrib1sv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DPROC __glewVertexAttrib2d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVPROC __glewVertexAttrib2dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FPROC __glewVertexAttrib2f; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVPROC __glewVertexAttrib2fv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SPROC __glewVertexAttrib2s; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVPROC __glewVertexAttrib2sv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DPROC __glewVertexAttrib3d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVPROC __glewVertexAttrib3dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FPROC __glewVertexAttrib3f; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVPROC __glewVertexAttrib3fv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SPROC __glewVertexAttrib3s; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVPROC __glewVertexAttrib3sv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NBVPROC __glewVertexAttrib4Nbv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NIVPROC __glewVertexAttrib4Niv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NSVPROC __glewVertexAttrib4Nsv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBPROC __glewVertexAttrib4Nub; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBVPROC __glewVertexAttrib4Nubv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUIVPROC __glewVertexAttrib4Nuiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUSVPROC __glewVertexAttrib4Nusv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4BVPROC __glewVertexAttrib4bv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DPROC __glewVertexAttrib4d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVPROC __glewVertexAttrib4dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FPROC __glewVertexAttrib4f; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVPROC __glewVertexAttrib4fv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4IVPROC __glewVertexAttrib4iv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SPROC __glewVertexAttrib4s; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVPROC __glewVertexAttrib4sv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVPROC __glewVertexAttrib4ubv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UIVPROC __glewVertexAttrib4uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4USVPROC __glewVertexAttrib4usv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERPROC __glewVertexAttribPointer; + +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X3FVPROC __glewUniformMatrix2x3fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X4FVPROC __glewUniformMatrix2x4fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X2FVPROC __glewUniformMatrix3x2fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X4FVPROC __glewUniformMatrix3x4fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X2FVPROC __glewUniformMatrix4x2fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X3FVPROC __glewUniformMatrix4x3fv; + +GLEW_FUN_EXPORT PFNGLBEGINCONDITIONALRENDERPROC __glewBeginConditionalRender; +GLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKPROC __glewBeginTransformFeedback; +GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONPROC __glewBindFragDataLocation; +GLEW_FUN_EXPORT PFNGLCLAMPCOLORPROC __glewClampColor; +GLEW_FUN_EXPORT PFNGLCLEARBUFFERFIPROC __glewClearBufferfi; +GLEW_FUN_EXPORT PFNGLCLEARBUFFERFVPROC __glewClearBufferfv; +GLEW_FUN_EXPORT PFNGLCLEARBUFFERIVPROC __glewClearBufferiv; +GLEW_FUN_EXPORT PFNGLCLEARBUFFERUIVPROC __glewClearBufferuiv; +GLEW_FUN_EXPORT PFNGLCOLORMASKIPROC __glewColorMaski; +GLEW_FUN_EXPORT PFNGLDISABLEIPROC __glewDisablei; +GLEW_FUN_EXPORT PFNGLENABLEIPROC __glewEnablei; +GLEW_FUN_EXPORT PFNGLENDCONDITIONALRENDERPROC __glewEndConditionalRender; +GLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKPROC __glewEndTransformFeedback; +GLEW_FUN_EXPORT PFNGLGETBOOLEANI_VPROC __glewGetBooleani_v; +GLEW_FUN_EXPORT PFNGLGETFRAGDATALOCATIONPROC __glewGetFragDataLocation; +GLEW_FUN_EXPORT PFNGLGETSTRINGIPROC __glewGetStringi; +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIIVPROC __glewGetTexParameterIiv; +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIUIVPROC __glewGetTexParameterIuiv; +GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKVARYINGPROC __glewGetTransformFeedbackVarying; +GLEW_FUN_EXPORT PFNGLGETUNIFORMUIVPROC __glewGetUniformuiv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIIVPROC __glewGetVertexAttribIiv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIUIVPROC __glewGetVertexAttribIuiv; +GLEW_FUN_EXPORT PFNGLISENABLEDIPROC __glewIsEnabledi; +GLEW_FUN_EXPORT PFNGLTEXPARAMETERIIVPROC __glewTexParameterIiv; +GLEW_FUN_EXPORT PFNGLTEXPARAMETERIUIVPROC __glewTexParameterIuiv; +GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKVARYINGSPROC __glewTransformFeedbackVaryings; +GLEW_FUN_EXPORT PFNGLUNIFORM1UIPROC __glewUniform1ui; +GLEW_FUN_EXPORT PFNGLUNIFORM1UIVPROC __glewUniform1uiv; +GLEW_FUN_EXPORT PFNGLUNIFORM2UIPROC __glewUniform2ui; +GLEW_FUN_EXPORT PFNGLUNIFORM2UIVPROC __glewUniform2uiv; +GLEW_FUN_EXPORT PFNGLUNIFORM3UIPROC __glewUniform3ui; +GLEW_FUN_EXPORT PFNGLUNIFORM3UIVPROC __glewUniform3uiv; +GLEW_FUN_EXPORT PFNGLUNIFORM4UIPROC __glewUniform4ui; +GLEW_FUN_EXPORT PFNGLUNIFORM4UIVPROC __glewUniform4uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IPROC __glewVertexAttribI1i; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IVPROC __glewVertexAttribI1iv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIPROC __glewVertexAttribI1ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIVPROC __glewVertexAttribI1uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IPROC __glewVertexAttribI2i; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IVPROC __glewVertexAttribI2iv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIPROC __glewVertexAttribI2ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIVPROC __glewVertexAttribI2uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IPROC __glewVertexAttribI3i; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IVPROC __glewVertexAttribI3iv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIPROC __glewVertexAttribI3ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIVPROC __glewVertexAttribI3uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4BVPROC __glewVertexAttribI4bv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IPROC __glewVertexAttribI4i; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IVPROC __glewVertexAttribI4iv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4SVPROC __glewVertexAttribI4sv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UBVPROC __glewVertexAttribI4ubv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIPROC __glewVertexAttribI4ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIVPROC __glewVertexAttribI4uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4USVPROC __glewVertexAttribI4usv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIPOINTERPROC __glewVertexAttribIPointer; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDPROC __glewDrawArraysInstanced; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDPROC __glewDrawElementsInstanced; +GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTINDEXPROC __glewPrimitiveRestartIndex; +GLEW_FUN_EXPORT PFNGLTEXBUFFERPROC __glewTexBuffer; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREPROC __glewFramebufferTexture; +GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERI64VPROC __glewGetBufferParameteri64v; +GLEW_FUN_EXPORT PFNGLGETINTEGER64I_VPROC __glewGetInteger64i_v; + +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORPROC __glewVertexAttribDivisor; + +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEIPROC __glewBlendEquationSeparatei; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONIPROC __glewBlendEquationi; +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEIPROC __glewBlendFuncSeparatei; +GLEW_FUN_EXPORT PFNGLBLENDFUNCIPROC __glewBlendFunci; +GLEW_FUN_EXPORT PFNGLMINSAMPLESHADINGPROC __glewMinSampleShading; + +GLEW_FUN_EXPORT PFNGLGETGRAPHICSRESETSTATUSPROC __glewGetGraphicsResetStatus; +GLEW_FUN_EXPORT PFNGLGETNCOMPRESSEDTEXIMAGEPROC __glewGetnCompressedTexImage; +GLEW_FUN_EXPORT PFNGLGETNTEXIMAGEPROC __glewGetnTexImage; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMDVPROC __glewGetnUniformdv; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTCOUNTPROC __glewMultiDrawArraysIndirectCount; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTPROC __glewMultiDrawElementsIndirectCount; +GLEW_FUN_EXPORT PFNGLSPECIALIZESHADERPROC __glewSpecializeShader; + +GLEW_FUN_EXPORT PFNGLTBUFFERMASK3DFXPROC __glewTbufferMask3DFX; + +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECALLBACKAMDPROC __glewDebugMessageCallbackAMD; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEENABLEAMDPROC __glewDebugMessageEnableAMD; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEINSERTAMDPROC __glewDebugMessageInsertAMD; +GLEW_FUN_EXPORT PFNGLGETDEBUGMESSAGELOGAMDPROC __glewGetDebugMessageLogAMD; + +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONINDEXEDAMDPROC __glewBlendEquationIndexedAMD; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC __glewBlendEquationSeparateIndexedAMD; +GLEW_FUN_EXPORT PFNGLBLENDFUNCINDEXEDAMDPROC __glewBlendFuncIndexedAMD; +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC __glewBlendFuncSeparateIndexedAMD; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERSAMPLEPOSITIONSFVAMDPROC __glewFramebufferSamplePositionsfvAMD; +GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERPARAMETERFVAMDPROC __glewGetFramebufferParameterfvAMD; +GLEW_FUN_EXPORT PFNGLGETNAMEDFRAMEBUFFERPARAMETERFVAMDPROC __glewGetNamedFramebufferParameterfvAMD; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERSAMPLEPOSITIONSFVAMDPROC __glewNamedFramebufferSamplePositionsfvAMD; + +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPARAMETERIAMDPROC __glewVertexAttribParameteriAMD; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC __glewMultiDrawArraysIndirectAMD; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC __glewMultiDrawElementsIndirectAMD; + +GLEW_FUN_EXPORT PFNGLDELETENAMESAMDPROC __glewDeleteNamesAMD; +GLEW_FUN_EXPORT PFNGLGENNAMESAMDPROC __glewGenNamesAMD; +GLEW_FUN_EXPORT PFNGLISNAMEAMDPROC __glewIsNameAMD; + +GLEW_FUN_EXPORT PFNGLQUERYOBJECTPARAMETERUIAMDPROC __glewQueryObjectParameteruiAMD; + +GLEW_FUN_EXPORT PFNGLBEGINPERFMONITORAMDPROC __glewBeginPerfMonitorAMD; +GLEW_FUN_EXPORT PFNGLDELETEPERFMONITORSAMDPROC __glewDeletePerfMonitorsAMD; +GLEW_FUN_EXPORT PFNGLENDPERFMONITORAMDPROC __glewEndPerfMonitorAMD; +GLEW_FUN_EXPORT PFNGLGENPERFMONITORSAMDPROC __glewGenPerfMonitorsAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERDATAAMDPROC __glewGetPerfMonitorCounterDataAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERINFOAMDPROC __glewGetPerfMonitorCounterInfoAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC __glewGetPerfMonitorCounterStringAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERSAMDPROC __glewGetPerfMonitorCountersAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORGROUPSTRINGAMDPROC __glewGetPerfMonitorGroupStringAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORGROUPSAMDPROC __glewGetPerfMonitorGroupsAMD; +GLEW_FUN_EXPORT PFNGLSELECTPERFMONITORCOUNTERSAMDPROC __glewSelectPerfMonitorCountersAMD; + +GLEW_FUN_EXPORT PFNGLSETMULTISAMPLEFVAMDPROC __glewSetMultisamplefvAMD; + +GLEW_FUN_EXPORT PFNGLTEXSTORAGESPARSEAMDPROC __glewTexStorageSparseAMD; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGESPARSEAMDPROC __glewTextureStorageSparseAMD; + +GLEW_FUN_EXPORT PFNGLSTENCILOPVALUEAMDPROC __glewStencilOpValueAMD; + +GLEW_FUN_EXPORT PFNGLTESSELLATIONFACTORAMDPROC __glewTessellationFactorAMD; +GLEW_FUN_EXPORT PFNGLTESSELLATIONMODEAMDPROC __glewTessellationModeAMD; + +GLEW_FUN_EXPORT PFNGLBLITFRAMEBUFFERANGLEPROC __glewBlitFramebufferANGLE; + +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC __glewRenderbufferStorageMultisampleANGLE; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDANGLEPROC __glewDrawArraysInstancedANGLE; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDANGLEPROC __glewDrawElementsInstancedANGLE; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORANGLEPROC __glewVertexAttribDivisorANGLE; + +GLEW_FUN_EXPORT PFNGLBEGINQUERYANGLEPROC __glewBeginQueryANGLE; +GLEW_FUN_EXPORT PFNGLDELETEQUERIESANGLEPROC __glewDeleteQueriesANGLE; +GLEW_FUN_EXPORT PFNGLENDQUERYANGLEPROC __glewEndQueryANGLE; +GLEW_FUN_EXPORT PFNGLGENQUERIESANGLEPROC __glewGenQueriesANGLE; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTI64VANGLEPROC __glewGetQueryObjecti64vANGLE; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTIVANGLEPROC __glewGetQueryObjectivANGLE; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUI64VANGLEPROC __glewGetQueryObjectui64vANGLE; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUIVANGLEPROC __glewGetQueryObjectuivANGLE; +GLEW_FUN_EXPORT PFNGLGETQUERYIVANGLEPROC __glewGetQueryivANGLE; +GLEW_FUN_EXPORT PFNGLISQUERYANGLEPROC __glewIsQueryANGLE; +GLEW_FUN_EXPORT PFNGLQUERYCOUNTERANGLEPROC __glewQueryCounterANGLE; + +GLEW_FUN_EXPORT PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC __glewGetTranslatedShaderSourceANGLE; + +GLEW_FUN_EXPORT PFNGLCOPYTEXTURELEVELSAPPLEPROC __glewCopyTextureLevelsAPPLE; + +GLEW_FUN_EXPORT PFNGLDRAWELEMENTARRAYAPPLEPROC __glewDrawElementArrayAPPLE; +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC __glewDrawRangeElementArrayAPPLE; +GLEW_FUN_EXPORT PFNGLELEMENTPOINTERAPPLEPROC __glewElementPointerAPPLE; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC __glewMultiDrawElementArrayAPPLE; +GLEW_FUN_EXPORT PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC __glewMultiDrawRangeElementArrayAPPLE; + +GLEW_FUN_EXPORT PFNGLDELETEFENCESAPPLEPROC __glewDeleteFencesAPPLE; +GLEW_FUN_EXPORT PFNGLFINISHFENCEAPPLEPROC __glewFinishFenceAPPLE; +GLEW_FUN_EXPORT PFNGLFINISHOBJECTAPPLEPROC __glewFinishObjectAPPLE; +GLEW_FUN_EXPORT PFNGLGENFENCESAPPLEPROC __glewGenFencesAPPLE; +GLEW_FUN_EXPORT PFNGLISFENCEAPPLEPROC __glewIsFenceAPPLE; +GLEW_FUN_EXPORT PFNGLSETFENCEAPPLEPROC __glewSetFenceAPPLE; +GLEW_FUN_EXPORT PFNGLTESTFENCEAPPLEPROC __glewTestFenceAPPLE; +GLEW_FUN_EXPORT PFNGLTESTOBJECTAPPLEPROC __glewTestObjectAPPLE; + +GLEW_FUN_EXPORT PFNGLBUFFERPARAMETERIAPPLEPROC __glewBufferParameteriAPPLE; +GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC __glewFlushMappedBufferRangeAPPLE; + +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLEAPPLEPROC __glewRenderbufferStorageMultisampleAPPLE; +GLEW_FUN_EXPORT PFNGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLEPROC __glewResolveMultisampleFramebufferAPPLE; + +GLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERIVAPPLEPROC __glewGetObjectParameterivAPPLE; +GLEW_FUN_EXPORT PFNGLOBJECTPURGEABLEAPPLEPROC __glewObjectPurgeableAPPLE; +GLEW_FUN_EXPORT PFNGLOBJECTUNPURGEABLEAPPLEPROC __glewObjectUnpurgeableAPPLE; + +GLEW_FUN_EXPORT PFNGLCLIENTWAITSYNCAPPLEPROC __glewClientWaitSyncAPPLE; +GLEW_FUN_EXPORT PFNGLDELETESYNCAPPLEPROC __glewDeleteSyncAPPLE; +GLEW_FUN_EXPORT PFNGLFENCESYNCAPPLEPROC __glewFenceSyncAPPLE; +GLEW_FUN_EXPORT PFNGLGETINTEGER64VAPPLEPROC __glewGetInteger64vAPPLE; +GLEW_FUN_EXPORT PFNGLGETSYNCIVAPPLEPROC __glewGetSyncivAPPLE; +GLEW_FUN_EXPORT PFNGLISSYNCAPPLEPROC __glewIsSyncAPPLE; +GLEW_FUN_EXPORT PFNGLWAITSYNCAPPLEPROC __glewWaitSyncAPPLE; + +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC __glewGetTexParameterPointervAPPLE; +GLEW_FUN_EXPORT PFNGLTEXTURERANGEAPPLEPROC __glewTextureRangeAPPLE; + +GLEW_FUN_EXPORT PFNGLBINDVERTEXARRAYAPPLEPROC __glewBindVertexArrayAPPLE; +GLEW_FUN_EXPORT PFNGLDELETEVERTEXARRAYSAPPLEPROC __glewDeleteVertexArraysAPPLE; +GLEW_FUN_EXPORT PFNGLGENVERTEXARRAYSAPPLEPROC __glewGenVertexArraysAPPLE; +GLEW_FUN_EXPORT PFNGLISVERTEXARRAYAPPLEPROC __glewIsVertexArrayAPPLE; + +GLEW_FUN_EXPORT PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC __glewFlushVertexArrayRangeAPPLE; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYPARAMETERIAPPLEPROC __glewVertexArrayParameteriAPPLE; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYRANGEAPPLEPROC __glewVertexArrayRangeAPPLE; + +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBAPPLEPROC __glewDisableVertexAttribAPPLE; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBAPPLEPROC __glewEnableVertexAttribAPPLE; +GLEW_FUN_EXPORT PFNGLISVERTEXATTRIBENABLEDAPPLEPROC __glewIsVertexAttribEnabledAPPLE; +GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB1DAPPLEPROC __glewMapVertexAttrib1dAPPLE; +GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB1FAPPLEPROC __glewMapVertexAttrib1fAPPLE; +GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB2DAPPLEPROC __glewMapVertexAttrib2dAPPLE; +GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB2FAPPLEPROC __glewMapVertexAttrib2fAPPLE; + +GLEW_FUN_EXPORT PFNGLCLEARDEPTHFPROC __glewClearDepthf; +GLEW_FUN_EXPORT PFNGLDEPTHRANGEFPROC __glewDepthRangef; +GLEW_FUN_EXPORT PFNGLGETSHADERPRECISIONFORMATPROC __glewGetShaderPrecisionFormat; +GLEW_FUN_EXPORT PFNGLRELEASESHADERCOMPILERPROC __glewReleaseShaderCompiler; +GLEW_FUN_EXPORT PFNGLSHADERBINARYPROC __glewShaderBinary; + +GLEW_FUN_EXPORT PFNGLMEMORYBARRIERBYREGIONPROC __glewMemoryBarrierByRegion; + +GLEW_FUN_EXPORT PFNGLPRIMITIVEBOUNDINGBOXARBPROC __glewPrimitiveBoundingBoxARB; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC __glewDrawArraysInstancedBaseInstance; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC __glewDrawElementsInstancedBaseInstance; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC __glewDrawElementsInstancedBaseVertexBaseInstance; + +GLEW_FUN_EXPORT PFNGLGETIMAGEHANDLEARBPROC __glewGetImageHandleARB; +GLEW_FUN_EXPORT PFNGLGETTEXTUREHANDLEARBPROC __glewGetTextureHandleARB; +GLEW_FUN_EXPORT PFNGLGETTEXTURESAMPLERHANDLEARBPROC __glewGetTextureSamplerHandleARB; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLUI64VARBPROC __glewGetVertexAttribLui64vARB; +GLEW_FUN_EXPORT PFNGLISIMAGEHANDLERESIDENTARBPROC __glewIsImageHandleResidentARB; +GLEW_FUN_EXPORT PFNGLISTEXTUREHANDLERESIDENTARBPROC __glewIsTextureHandleResidentARB; +GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC __glewMakeImageHandleNonResidentARB; +GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLERESIDENTARBPROC __glewMakeImageHandleResidentARB; +GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC __glewMakeTextureHandleNonResidentARB; +GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLERESIDENTARBPROC __glewMakeTextureHandleResidentARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC __glewProgramUniformHandleui64ARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC __glewProgramUniformHandleui64vARB; +GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64ARBPROC __glewUniformHandleui64ARB; +GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64VARBPROC __glewUniformHandleui64vARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64ARBPROC __glewVertexAttribL1ui64ARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64VARBPROC __glewVertexAttribL1ui64vARB; + +GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONINDEXEDPROC __glewBindFragDataLocationIndexed; +GLEW_FUN_EXPORT PFNGLGETFRAGDATAINDEXPROC __glewGetFragDataIndex; + +GLEW_FUN_EXPORT PFNGLBUFFERSTORAGEPROC __glewBufferStorage; + +GLEW_FUN_EXPORT PFNGLCREATESYNCFROMCLEVENTARBPROC __glewCreateSyncFromCLeventARB; + +GLEW_FUN_EXPORT PFNGLCLEARBUFFERDATAPROC __glewClearBufferData; +GLEW_FUN_EXPORT PFNGLCLEARBUFFERSUBDATAPROC __glewClearBufferSubData; +GLEW_FUN_EXPORT PFNGLCLEARNAMEDBUFFERDATAEXTPROC __glewClearNamedBufferDataEXT; +GLEW_FUN_EXPORT PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC __glewClearNamedBufferSubDataEXT; + +GLEW_FUN_EXPORT PFNGLCLEARTEXIMAGEPROC __glewClearTexImage; +GLEW_FUN_EXPORT PFNGLCLEARTEXSUBIMAGEPROC __glewClearTexSubImage; + +GLEW_FUN_EXPORT PFNGLCLIPCONTROLPROC __glewClipControl; + +GLEW_FUN_EXPORT PFNGLCLAMPCOLORARBPROC __glewClampColorARB; + +GLEW_FUN_EXPORT PFNGLDISPATCHCOMPUTEPROC __glewDispatchCompute; +GLEW_FUN_EXPORT PFNGLDISPATCHCOMPUTEINDIRECTPROC __glewDispatchComputeIndirect; + +GLEW_FUN_EXPORT PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC __glewDispatchComputeGroupSizeARB; + +GLEW_FUN_EXPORT PFNGLCOPYBUFFERSUBDATAPROC __glewCopyBufferSubData; + +GLEW_FUN_EXPORT PFNGLCOPYIMAGESUBDATAPROC __glewCopyImageSubData; + +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECALLBACKARBPROC __glewDebugMessageCallbackARB; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECONTROLARBPROC __glewDebugMessageControlARB; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEINSERTARBPROC __glewDebugMessageInsertARB; +GLEW_FUN_EXPORT PFNGLGETDEBUGMESSAGELOGARBPROC __glewGetDebugMessageLogARB; + +GLEW_FUN_EXPORT PFNGLBINDTEXTUREUNITPROC __glewBindTextureUnit; +GLEW_FUN_EXPORT PFNGLBLITNAMEDFRAMEBUFFERPROC __glewBlitNamedFramebuffer; +GLEW_FUN_EXPORT PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC __glewCheckNamedFramebufferStatus; +GLEW_FUN_EXPORT PFNGLCLEARNAMEDBUFFERDATAPROC __glewClearNamedBufferData; +GLEW_FUN_EXPORT PFNGLCLEARNAMEDBUFFERSUBDATAPROC __glewClearNamedBufferSubData; +GLEW_FUN_EXPORT PFNGLCLEARNAMEDFRAMEBUFFERFIPROC __glewClearNamedFramebufferfi; +GLEW_FUN_EXPORT PFNGLCLEARNAMEDFRAMEBUFFERFVPROC __glewClearNamedFramebufferfv; +GLEW_FUN_EXPORT PFNGLCLEARNAMEDFRAMEBUFFERIVPROC __glewClearNamedFramebufferiv; +GLEW_FUN_EXPORT PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC __glewClearNamedFramebufferuiv; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC __glewCompressedTextureSubImage1D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC __glewCompressedTextureSubImage2D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC __glewCompressedTextureSubImage3D; +GLEW_FUN_EXPORT PFNGLCOPYNAMEDBUFFERSUBDATAPROC __glewCopyNamedBufferSubData; +GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE1DPROC __glewCopyTextureSubImage1D; +GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE2DPROC __glewCopyTextureSubImage2D; +GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE3DPROC __glewCopyTextureSubImage3D; +GLEW_FUN_EXPORT PFNGLCREATEBUFFERSPROC __glewCreateBuffers; +GLEW_FUN_EXPORT PFNGLCREATEFRAMEBUFFERSPROC __glewCreateFramebuffers; +GLEW_FUN_EXPORT PFNGLCREATEPROGRAMPIPELINESPROC __glewCreateProgramPipelines; +GLEW_FUN_EXPORT PFNGLCREATEQUERIESPROC __glewCreateQueries; +GLEW_FUN_EXPORT PFNGLCREATERENDERBUFFERSPROC __glewCreateRenderbuffers; +GLEW_FUN_EXPORT PFNGLCREATESAMPLERSPROC __glewCreateSamplers; +GLEW_FUN_EXPORT PFNGLCREATETEXTURESPROC __glewCreateTextures; +GLEW_FUN_EXPORT PFNGLCREATETRANSFORMFEEDBACKSPROC __glewCreateTransformFeedbacks; +GLEW_FUN_EXPORT PFNGLCREATEVERTEXARRAYSPROC __glewCreateVertexArrays; +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXARRAYATTRIBPROC __glewDisableVertexArrayAttrib; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXARRAYATTRIBPROC __glewEnableVertexArrayAttrib; +GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC __glewFlushMappedNamedBufferRange; +GLEW_FUN_EXPORT PFNGLGENERATETEXTUREMIPMAPPROC __glewGenerateTextureMipmap; +GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC __glewGetCompressedTextureImage; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPARAMETERI64VPROC __glewGetNamedBufferParameteri64v; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPARAMETERIVPROC __glewGetNamedBufferParameteriv; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPOINTERVPROC __glewGetNamedBufferPointerv; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERSUBDATAPROC __glewGetNamedBufferSubData; +GLEW_FUN_EXPORT PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC __glewGetNamedFramebufferAttachmentParameteriv; +GLEW_FUN_EXPORT PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC __glewGetNamedFramebufferParameteriv; +GLEW_FUN_EXPORT PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC __glewGetNamedRenderbufferParameteriv; +GLEW_FUN_EXPORT PFNGLGETQUERYBUFFEROBJECTI64VPROC __glewGetQueryBufferObjecti64v; +GLEW_FUN_EXPORT PFNGLGETQUERYBUFFEROBJECTIVPROC __glewGetQueryBufferObjectiv; +GLEW_FUN_EXPORT PFNGLGETQUERYBUFFEROBJECTUI64VPROC __glewGetQueryBufferObjectui64v; +GLEW_FUN_EXPORT PFNGLGETQUERYBUFFEROBJECTUIVPROC __glewGetQueryBufferObjectuiv; +GLEW_FUN_EXPORT PFNGLGETTEXTUREIMAGEPROC __glewGetTextureImage; +GLEW_FUN_EXPORT PFNGLGETTEXTURELEVELPARAMETERFVPROC __glewGetTextureLevelParameterfv; +GLEW_FUN_EXPORT PFNGLGETTEXTURELEVELPARAMETERIVPROC __glewGetTextureLevelParameteriv; +GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIIVPROC __glewGetTextureParameterIiv; +GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIUIVPROC __glewGetTextureParameterIuiv; +GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERFVPROC __glewGetTextureParameterfv; +GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIVPROC __glewGetTextureParameteriv; +GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKI64_VPROC __glewGetTransformFeedbacki64_v; +GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKI_VPROC __glewGetTransformFeedbacki_v; +GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKIVPROC __glewGetTransformFeedbackiv; +GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYINDEXED64IVPROC __glewGetVertexArrayIndexed64iv; +GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYINDEXEDIVPROC __glewGetVertexArrayIndexediv; +GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYIVPROC __glewGetVertexArrayiv; +GLEW_FUN_EXPORT PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC __glewInvalidateNamedFramebufferData; +GLEW_FUN_EXPORT PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC __glewInvalidateNamedFramebufferSubData; +GLEW_FUN_EXPORT PFNGLMAPNAMEDBUFFERPROC __glewMapNamedBuffer; +GLEW_FUN_EXPORT PFNGLMAPNAMEDBUFFERRANGEPROC __glewMapNamedBufferRange; +GLEW_FUN_EXPORT PFNGLNAMEDBUFFERDATAPROC __glewNamedBufferData; +GLEW_FUN_EXPORT PFNGLNAMEDBUFFERSTORAGEPROC __glewNamedBufferStorage; +GLEW_FUN_EXPORT PFNGLNAMEDBUFFERSUBDATAPROC __glewNamedBufferSubData; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC __glewNamedFramebufferDrawBuffer; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC __glewNamedFramebufferDrawBuffers; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC __glewNamedFramebufferParameteri; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC __glewNamedFramebufferReadBuffer; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC __glewNamedFramebufferRenderbuffer; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTUREPROC __glewNamedFramebufferTexture; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC __glewNamedFramebufferTextureLayer; +GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEPROC __glewNamedRenderbufferStorage; +GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC __glewNamedRenderbufferStorageMultisample; +GLEW_FUN_EXPORT PFNGLTEXTUREBUFFERPROC __glewTextureBuffer; +GLEW_FUN_EXPORT PFNGLTEXTUREBUFFERRANGEPROC __glewTextureBufferRange; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIIVPROC __glewTextureParameterIiv; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIUIVPROC __glewTextureParameterIuiv; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERFPROC __glewTextureParameterf; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERFVPROC __glewTextureParameterfv; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIPROC __glewTextureParameteri; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIVPROC __glewTextureParameteriv; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE1DPROC __glewTextureStorage1D; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE2DPROC __glewTextureStorage2D; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC __glewTextureStorage2DMultisample; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE3DPROC __glewTextureStorage3D; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC __glewTextureStorage3DMultisample; +GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE1DPROC __glewTextureSubImage1D; +GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE2DPROC __glewTextureSubImage2D; +GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE3DPROC __glewTextureSubImage3D; +GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC __glewTransformFeedbackBufferBase; +GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC __glewTransformFeedbackBufferRange; +GLEW_FUN_EXPORT PFNGLUNMAPNAMEDBUFFERPROC __glewUnmapNamedBuffer; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYATTRIBBINDINGPROC __glewVertexArrayAttribBinding; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYATTRIBFORMATPROC __glewVertexArrayAttribFormat; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYATTRIBIFORMATPROC __glewVertexArrayAttribIFormat; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYATTRIBLFORMATPROC __glewVertexArrayAttribLFormat; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYBINDINGDIVISORPROC __glewVertexArrayBindingDivisor; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYELEMENTBUFFERPROC __glewVertexArrayElementBuffer; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXBUFFERPROC __glewVertexArrayVertexBuffer; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXBUFFERSPROC __glewVertexArrayVertexBuffers; + +GLEW_FUN_EXPORT PFNGLDRAWBUFFERSARBPROC __glewDrawBuffersARB; + +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEIARBPROC __glewBlendEquationSeparateiARB; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONIARBPROC __glewBlendEquationiARB; +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEIARBPROC __glewBlendFuncSeparateiARB; +GLEW_FUN_EXPORT PFNGLBLENDFUNCIARBPROC __glewBlendFunciARB; + +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSBASEVERTEXPROC __glewDrawElementsBaseVertex; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC __glewDrawElementsInstancedBaseVertex; +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC __glewDrawRangeElementsBaseVertex; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC __glewMultiDrawElementsBaseVertex; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINDIRECTPROC __glewDrawArraysIndirect; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINDIRECTPROC __glewDrawElementsIndirect; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERPARAMETERIPROC __glewFramebufferParameteri; +GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERPARAMETERIVPROC __glewGetFramebufferParameteriv; +GLEW_FUN_EXPORT PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC __glewGetNamedFramebufferParameterivEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC __glewNamedFramebufferParameteriEXT; + +GLEW_FUN_EXPORT PFNGLBINDFRAMEBUFFERPROC __glewBindFramebuffer; +GLEW_FUN_EXPORT PFNGLBINDRENDERBUFFERPROC __glewBindRenderbuffer; +GLEW_FUN_EXPORT PFNGLBLITFRAMEBUFFERPROC __glewBlitFramebuffer; +GLEW_FUN_EXPORT PFNGLCHECKFRAMEBUFFERSTATUSPROC __glewCheckFramebufferStatus; +GLEW_FUN_EXPORT PFNGLDELETEFRAMEBUFFERSPROC __glewDeleteFramebuffers; +GLEW_FUN_EXPORT PFNGLDELETERENDERBUFFERSPROC __glewDeleteRenderbuffers; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERRENDERBUFFERPROC __glewFramebufferRenderbuffer; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE1DPROC __glewFramebufferTexture1D; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE2DPROC __glewFramebufferTexture2D; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE3DPROC __glewFramebufferTexture3D; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYERPROC __glewFramebufferTextureLayer; +GLEW_FUN_EXPORT PFNGLGENFRAMEBUFFERSPROC __glewGenFramebuffers; +GLEW_FUN_EXPORT PFNGLGENRENDERBUFFERSPROC __glewGenRenderbuffers; +GLEW_FUN_EXPORT PFNGLGENERATEMIPMAPPROC __glewGenerateMipmap; +GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC __glewGetFramebufferAttachmentParameteriv; +GLEW_FUN_EXPORT PFNGLGETRENDERBUFFERPARAMETERIVPROC __glewGetRenderbufferParameteriv; +GLEW_FUN_EXPORT PFNGLISFRAMEBUFFERPROC __glewIsFramebuffer; +GLEW_FUN_EXPORT PFNGLISRENDERBUFFERPROC __glewIsRenderbuffer; +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEPROC __glewRenderbufferStorage; +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC __glewRenderbufferStorageMultisample; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREARBPROC __glewFramebufferTextureARB; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREFACEARBPROC __glewFramebufferTextureFaceARB; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYERARBPROC __glewFramebufferTextureLayerARB; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIARBPROC __glewProgramParameteriARB; + +GLEW_FUN_EXPORT PFNGLGETPROGRAMBINARYPROC __glewGetProgramBinary; +GLEW_FUN_EXPORT PFNGLPROGRAMBINARYPROC __glewProgramBinary; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIPROC __glewProgramParameteri; + +GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC __glewGetCompressedTextureSubImage; +GLEW_FUN_EXPORT PFNGLGETTEXTURESUBIMAGEPROC __glewGetTextureSubImage; + +GLEW_FUN_EXPORT PFNGLSPECIALIZESHADERARBPROC __glewSpecializeShaderARB; + +GLEW_FUN_EXPORT PFNGLGETUNIFORMDVPROC __glewGetUniformdv; +GLEW_FUN_EXPORT PFNGLUNIFORM1DPROC __glewUniform1d; +GLEW_FUN_EXPORT PFNGLUNIFORM1DVPROC __glewUniform1dv; +GLEW_FUN_EXPORT PFNGLUNIFORM2DPROC __glewUniform2d; +GLEW_FUN_EXPORT PFNGLUNIFORM2DVPROC __glewUniform2dv; +GLEW_FUN_EXPORT PFNGLUNIFORM3DPROC __glewUniform3d; +GLEW_FUN_EXPORT PFNGLUNIFORM3DVPROC __glewUniform3dv; +GLEW_FUN_EXPORT PFNGLUNIFORM4DPROC __glewUniform4d; +GLEW_FUN_EXPORT PFNGLUNIFORM4DVPROC __glewUniform4dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2DVPROC __glewUniformMatrix2dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X3DVPROC __glewUniformMatrix2x3dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X4DVPROC __glewUniformMatrix2x4dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3DVPROC __glewUniformMatrix3dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X2DVPROC __glewUniformMatrix3x2dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X4DVPROC __glewUniformMatrix3x4dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4DVPROC __glewUniformMatrix4dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X2DVPROC __glewUniformMatrix4x2dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X3DVPROC __glewUniformMatrix4x3dv; + +GLEW_FUN_EXPORT PFNGLGETUNIFORMI64VARBPROC __glewGetUniformi64vARB; +GLEW_FUN_EXPORT PFNGLGETUNIFORMUI64VARBPROC __glewGetUniformui64vARB; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMI64VARBPROC __glewGetnUniformi64vARB; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMUI64VARBPROC __glewGetnUniformui64vARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1I64ARBPROC __glewProgramUniform1i64ARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1I64VARBPROC __glewProgramUniform1i64vARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UI64ARBPROC __glewProgramUniform1ui64ARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UI64VARBPROC __glewProgramUniform1ui64vARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2I64ARBPROC __glewProgramUniform2i64ARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2I64VARBPROC __glewProgramUniform2i64vARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UI64ARBPROC __glewProgramUniform2ui64ARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UI64VARBPROC __glewProgramUniform2ui64vARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3I64ARBPROC __glewProgramUniform3i64ARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3I64VARBPROC __glewProgramUniform3i64vARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UI64ARBPROC __glewProgramUniform3ui64ARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UI64VARBPROC __glewProgramUniform3ui64vARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4I64ARBPROC __glewProgramUniform4i64ARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4I64VARBPROC __glewProgramUniform4i64vARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UI64ARBPROC __glewProgramUniform4ui64ARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UI64VARBPROC __glewProgramUniform4ui64vARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1I64ARBPROC __glewUniform1i64ARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1I64VARBPROC __glewUniform1i64vARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1UI64ARBPROC __glewUniform1ui64ARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1UI64VARBPROC __glewUniform1ui64vARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2I64ARBPROC __glewUniform2i64ARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2I64VARBPROC __glewUniform2i64vARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2UI64ARBPROC __glewUniform2ui64ARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2UI64VARBPROC __glewUniform2ui64vARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3I64ARBPROC __glewUniform3i64ARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3I64VARBPROC __glewUniform3i64vARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3UI64ARBPROC __glewUniform3ui64ARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3UI64VARBPROC __glewUniform3ui64vARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4I64ARBPROC __glewUniform4i64ARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4I64VARBPROC __glewUniform4i64vARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4UI64ARBPROC __glewUniform4ui64ARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4UI64VARBPROC __glewUniform4ui64vARB; + +GLEW_FUN_EXPORT PFNGLCOLORSUBTABLEPROC __glewColorSubTable; +GLEW_FUN_EXPORT PFNGLCOLORTABLEPROC __glewColorTable; +GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERFVPROC __glewColorTableParameterfv; +GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERIVPROC __glewColorTableParameteriv; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER1DPROC __glewConvolutionFilter1D; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER2DPROC __glewConvolutionFilter2D; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFPROC __glewConvolutionParameterf; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFVPROC __glewConvolutionParameterfv; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIPROC __glewConvolutionParameteri; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIVPROC __glewConvolutionParameteriv; +GLEW_FUN_EXPORT PFNGLCOPYCOLORSUBTABLEPROC __glewCopyColorSubTable; +GLEW_FUN_EXPORT PFNGLCOPYCOLORTABLEPROC __glewCopyColorTable; +GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER1DPROC __glewCopyConvolutionFilter1D; +GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER2DPROC __glewCopyConvolutionFilter2D; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPROC __glewGetColorTable; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVPROC __glewGetColorTableParameterfv; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERIVPROC __glewGetColorTableParameteriv; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONFILTERPROC __glewGetConvolutionFilter; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERFVPROC __glewGetConvolutionParameterfv; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERIVPROC __glewGetConvolutionParameteriv; +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPROC __glewGetHistogram; +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERFVPROC __glewGetHistogramParameterfv; +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERIVPROC __glewGetHistogramParameteriv; +GLEW_FUN_EXPORT PFNGLGETMINMAXPROC __glewGetMinmax; +GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERFVPROC __glewGetMinmaxParameterfv; +GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERIVPROC __glewGetMinmaxParameteriv; +GLEW_FUN_EXPORT PFNGLGETSEPARABLEFILTERPROC __glewGetSeparableFilter; +GLEW_FUN_EXPORT PFNGLHISTOGRAMPROC __glewHistogram; +GLEW_FUN_EXPORT PFNGLMINMAXPROC __glewMinmax; +GLEW_FUN_EXPORT PFNGLRESETHISTOGRAMPROC __glewResetHistogram; +GLEW_FUN_EXPORT PFNGLRESETMINMAXPROC __glewResetMinmax; +GLEW_FUN_EXPORT PFNGLSEPARABLEFILTER2DPROC __glewSeparableFilter2D; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC __glewMultiDrawArraysIndirectCountARB; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC __glewMultiDrawElementsIndirectCountARB; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDARBPROC __glewDrawArraysInstancedARB; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDARBPROC __glewDrawElementsInstancedARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORARBPROC __glewVertexAttribDivisorARB; + +GLEW_FUN_EXPORT PFNGLGETINTERNALFORMATIVPROC __glewGetInternalformativ; + +GLEW_FUN_EXPORT PFNGLGETINTERNALFORMATI64VPROC __glewGetInternalformati64v; + +GLEW_FUN_EXPORT PFNGLINVALIDATEBUFFERDATAPROC __glewInvalidateBufferData; +GLEW_FUN_EXPORT PFNGLINVALIDATEBUFFERSUBDATAPROC __glewInvalidateBufferSubData; +GLEW_FUN_EXPORT PFNGLINVALIDATEFRAMEBUFFERPROC __glewInvalidateFramebuffer; +GLEW_FUN_EXPORT PFNGLINVALIDATESUBFRAMEBUFFERPROC __glewInvalidateSubFramebuffer; +GLEW_FUN_EXPORT PFNGLINVALIDATETEXIMAGEPROC __glewInvalidateTexImage; +GLEW_FUN_EXPORT PFNGLINVALIDATETEXSUBIMAGEPROC __glewInvalidateTexSubImage; + +GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDBUFFERRANGEPROC __glewFlushMappedBufferRange; +GLEW_FUN_EXPORT PFNGLMAPBUFFERRANGEPROC __glewMapBufferRange; + +GLEW_FUN_EXPORT PFNGLCURRENTPALETTEMATRIXARBPROC __glewCurrentPaletteMatrixARB; +GLEW_FUN_EXPORT PFNGLMATRIXINDEXPOINTERARBPROC __glewMatrixIndexPointerARB; +GLEW_FUN_EXPORT PFNGLMATRIXINDEXUBVARBPROC __glewMatrixIndexubvARB; +GLEW_FUN_EXPORT PFNGLMATRIXINDEXUIVARBPROC __glewMatrixIndexuivARB; +GLEW_FUN_EXPORT PFNGLMATRIXINDEXUSVARBPROC __glewMatrixIndexusvARB; + +GLEW_FUN_EXPORT PFNGLBINDBUFFERSBASEPROC __glewBindBuffersBase; +GLEW_FUN_EXPORT PFNGLBINDBUFFERSRANGEPROC __glewBindBuffersRange; +GLEW_FUN_EXPORT PFNGLBINDIMAGETEXTURESPROC __glewBindImageTextures; +GLEW_FUN_EXPORT PFNGLBINDSAMPLERSPROC __glewBindSamplers; +GLEW_FUN_EXPORT PFNGLBINDTEXTURESPROC __glewBindTextures; +GLEW_FUN_EXPORT PFNGLBINDVERTEXBUFFERSPROC __glewBindVertexBuffers; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTPROC __glewMultiDrawArraysIndirect; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTPROC __glewMultiDrawElementsIndirect; + +GLEW_FUN_EXPORT PFNGLSAMPLECOVERAGEARBPROC __glewSampleCoverageARB; + +GLEW_FUN_EXPORT PFNGLACTIVETEXTUREARBPROC __glewActiveTextureARB; +GLEW_FUN_EXPORT PFNGLCLIENTACTIVETEXTUREARBPROC __glewClientActiveTextureARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DARBPROC __glewMultiTexCoord1dARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DVARBPROC __glewMultiTexCoord1dvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FARBPROC __glewMultiTexCoord1fARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FVARBPROC __glewMultiTexCoord1fvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IARBPROC __glewMultiTexCoord1iARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IVARBPROC __glewMultiTexCoord1ivARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SARBPROC __glewMultiTexCoord1sARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SVARBPROC __glewMultiTexCoord1svARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DARBPROC __glewMultiTexCoord2dARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DVARBPROC __glewMultiTexCoord2dvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FARBPROC __glewMultiTexCoord2fARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FVARBPROC __glewMultiTexCoord2fvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IARBPROC __glewMultiTexCoord2iARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IVARBPROC __glewMultiTexCoord2ivARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SARBPROC __glewMultiTexCoord2sARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SVARBPROC __glewMultiTexCoord2svARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DARBPROC __glewMultiTexCoord3dARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DVARBPROC __glewMultiTexCoord3dvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FARBPROC __glewMultiTexCoord3fARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FVARBPROC __glewMultiTexCoord3fvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IARBPROC __glewMultiTexCoord3iARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IVARBPROC __glewMultiTexCoord3ivARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SARBPROC __glewMultiTexCoord3sARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SVARBPROC __glewMultiTexCoord3svARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DARBPROC __glewMultiTexCoord4dARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DVARBPROC __glewMultiTexCoord4dvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FARBPROC __glewMultiTexCoord4fARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FVARBPROC __glewMultiTexCoord4fvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IARBPROC __glewMultiTexCoord4iARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IVARBPROC __glewMultiTexCoord4ivARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SARBPROC __glewMultiTexCoord4sARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SVARBPROC __glewMultiTexCoord4svARB; + +GLEW_FUN_EXPORT PFNGLBEGINQUERYARBPROC __glewBeginQueryARB; +GLEW_FUN_EXPORT PFNGLDELETEQUERIESARBPROC __glewDeleteQueriesARB; +GLEW_FUN_EXPORT PFNGLENDQUERYARBPROC __glewEndQueryARB; +GLEW_FUN_EXPORT PFNGLGENQUERIESARBPROC __glewGenQueriesARB; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTIVARBPROC __glewGetQueryObjectivARB; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUIVARBPROC __glewGetQueryObjectuivARB; +GLEW_FUN_EXPORT PFNGLGETQUERYIVARBPROC __glewGetQueryivARB; +GLEW_FUN_EXPORT PFNGLISQUERYARBPROC __glewIsQueryARB; + +GLEW_FUN_EXPORT PFNGLMAXSHADERCOMPILERTHREADSARBPROC __glewMaxShaderCompilerThreadsARB; + +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFARBPROC __glewPointParameterfARB; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVARBPROC __glewPointParameterfvARB; + +GLEW_FUN_EXPORT PFNGLPOLYGONOFFSETCLAMPPROC __glewPolygonOffsetClamp; + +GLEW_FUN_EXPORT PFNGLGETPROGRAMINTERFACEIVPROC __glewGetProgramInterfaceiv; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCEINDEXPROC __glewGetProgramResourceIndex; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCELOCATIONPROC __glewGetProgramResourceLocation; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC __glewGetProgramResourceLocationIndex; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCENAMEPROC __glewGetProgramResourceName; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCEIVPROC __glewGetProgramResourceiv; + +GLEW_FUN_EXPORT PFNGLPROVOKINGVERTEXPROC __glewProvokingVertex; + +GLEW_FUN_EXPORT PFNGLGETGRAPHICSRESETSTATUSARBPROC __glewGetGraphicsResetStatusARB; +GLEW_FUN_EXPORT PFNGLGETNCOLORTABLEARBPROC __glewGetnColorTableARB; +GLEW_FUN_EXPORT PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC __glewGetnCompressedTexImageARB; +GLEW_FUN_EXPORT PFNGLGETNCONVOLUTIONFILTERARBPROC __glewGetnConvolutionFilterARB; +GLEW_FUN_EXPORT PFNGLGETNHISTOGRAMARBPROC __glewGetnHistogramARB; +GLEW_FUN_EXPORT PFNGLGETNMAPDVARBPROC __glewGetnMapdvARB; +GLEW_FUN_EXPORT PFNGLGETNMAPFVARBPROC __glewGetnMapfvARB; +GLEW_FUN_EXPORT PFNGLGETNMAPIVARBPROC __glewGetnMapivARB; +GLEW_FUN_EXPORT PFNGLGETNMINMAXARBPROC __glewGetnMinmaxARB; +GLEW_FUN_EXPORT PFNGLGETNPIXELMAPFVARBPROC __glewGetnPixelMapfvARB; +GLEW_FUN_EXPORT PFNGLGETNPIXELMAPUIVARBPROC __glewGetnPixelMapuivARB; +GLEW_FUN_EXPORT PFNGLGETNPIXELMAPUSVARBPROC __glewGetnPixelMapusvARB; +GLEW_FUN_EXPORT PFNGLGETNPOLYGONSTIPPLEARBPROC __glewGetnPolygonStippleARB; +GLEW_FUN_EXPORT PFNGLGETNSEPARABLEFILTERARBPROC __glewGetnSeparableFilterARB; +GLEW_FUN_EXPORT PFNGLGETNTEXIMAGEARBPROC __glewGetnTexImageARB; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMDVARBPROC __glewGetnUniformdvARB; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMFVARBPROC __glewGetnUniformfvARB; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMIVARBPROC __glewGetnUniformivARB; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMUIVARBPROC __glewGetnUniformuivARB; +GLEW_FUN_EXPORT PFNGLREADNPIXELSARBPROC __glewReadnPixelsARB; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC __glewFramebufferSampleLocationsfvARB; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC __glewNamedFramebufferSampleLocationsfvARB; + +GLEW_FUN_EXPORT PFNGLMINSAMPLESHADINGARBPROC __glewMinSampleShadingARB; + +GLEW_FUN_EXPORT PFNGLBINDSAMPLERPROC __glewBindSampler; +GLEW_FUN_EXPORT PFNGLDELETESAMPLERSPROC __glewDeleteSamplers; +GLEW_FUN_EXPORT PFNGLGENSAMPLERSPROC __glewGenSamplers; +GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERIIVPROC __glewGetSamplerParameterIiv; +GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERIUIVPROC __glewGetSamplerParameterIuiv; +GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERFVPROC __glewGetSamplerParameterfv; +GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERIVPROC __glewGetSamplerParameteriv; +GLEW_FUN_EXPORT PFNGLISSAMPLERPROC __glewIsSampler; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIIVPROC __glewSamplerParameterIiv; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIUIVPROC __glewSamplerParameterIuiv; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERFPROC __glewSamplerParameterf; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERFVPROC __glewSamplerParameterfv; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIPROC __glewSamplerParameteri; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIVPROC __glewSamplerParameteriv; + +GLEW_FUN_EXPORT PFNGLACTIVESHADERPROGRAMPROC __glewActiveShaderProgram; +GLEW_FUN_EXPORT PFNGLBINDPROGRAMPIPELINEPROC __glewBindProgramPipeline; +GLEW_FUN_EXPORT PFNGLCREATESHADERPROGRAMVPROC __glewCreateShaderProgramv; +GLEW_FUN_EXPORT PFNGLDELETEPROGRAMPIPELINESPROC __glewDeleteProgramPipelines; +GLEW_FUN_EXPORT PFNGLGENPROGRAMPIPELINESPROC __glewGenProgramPipelines; +GLEW_FUN_EXPORT PFNGLGETPROGRAMPIPELINEINFOLOGPROC __glewGetProgramPipelineInfoLog; +GLEW_FUN_EXPORT PFNGLGETPROGRAMPIPELINEIVPROC __glewGetProgramPipelineiv; +GLEW_FUN_EXPORT PFNGLISPROGRAMPIPELINEPROC __glewIsProgramPipeline; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1DPROC __glewProgramUniform1d; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1DVPROC __glewProgramUniform1dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FPROC __glewProgramUniform1f; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FVPROC __glewProgramUniform1fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IPROC __glewProgramUniform1i; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IVPROC __glewProgramUniform1iv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIPROC __glewProgramUniform1ui; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIVPROC __glewProgramUniform1uiv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2DPROC __glewProgramUniform2d; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2DVPROC __glewProgramUniform2dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FPROC __glewProgramUniform2f; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FVPROC __glewProgramUniform2fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IPROC __glewProgramUniform2i; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IVPROC __glewProgramUniform2iv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIPROC __glewProgramUniform2ui; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIVPROC __glewProgramUniform2uiv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3DPROC __glewProgramUniform3d; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3DVPROC __glewProgramUniform3dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FPROC __glewProgramUniform3f; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FVPROC __glewProgramUniform3fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IPROC __glewProgramUniform3i; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IVPROC __glewProgramUniform3iv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIPROC __glewProgramUniform3ui; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIVPROC __glewProgramUniform3uiv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4DPROC __glewProgramUniform4d; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4DVPROC __glewProgramUniform4dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FPROC __glewProgramUniform4f; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FVPROC __glewProgramUniform4fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IPROC __glewProgramUniform4i; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IVPROC __glewProgramUniform4iv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIPROC __glewProgramUniform4ui; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIVPROC __glewProgramUniform4uiv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2DVPROC __glewProgramUniformMatrix2dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2FVPROC __glewProgramUniformMatrix2fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC __glewProgramUniformMatrix2x3dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC __glewProgramUniformMatrix2x3fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC __glewProgramUniformMatrix2x4dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC __glewProgramUniformMatrix2x4fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3DVPROC __glewProgramUniformMatrix3dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3FVPROC __glewProgramUniformMatrix3fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC __glewProgramUniformMatrix3x2dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC __glewProgramUniformMatrix3x2fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC __glewProgramUniformMatrix3x4dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC __glewProgramUniformMatrix3x4fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4DVPROC __glewProgramUniformMatrix4dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4FVPROC __glewProgramUniformMatrix4fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC __glewProgramUniformMatrix4x2dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC __glewProgramUniformMatrix4x2fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC __glewProgramUniformMatrix4x3dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC __glewProgramUniformMatrix4x3fv; +GLEW_FUN_EXPORT PFNGLUSEPROGRAMSTAGESPROC __glewUseProgramStages; +GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMPIPELINEPROC __glewValidateProgramPipeline; + +GLEW_FUN_EXPORT PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC __glewGetActiveAtomicCounterBufferiv; + +GLEW_FUN_EXPORT PFNGLBINDIMAGETEXTUREPROC __glewBindImageTexture; +GLEW_FUN_EXPORT PFNGLMEMORYBARRIERPROC __glewMemoryBarrier; + +GLEW_FUN_EXPORT PFNGLATTACHOBJECTARBPROC __glewAttachObjectARB; +GLEW_FUN_EXPORT PFNGLCOMPILESHADERARBPROC __glewCompileShaderARB; +GLEW_FUN_EXPORT PFNGLCREATEPROGRAMOBJECTARBPROC __glewCreateProgramObjectARB; +GLEW_FUN_EXPORT PFNGLCREATESHADEROBJECTARBPROC __glewCreateShaderObjectARB; +GLEW_FUN_EXPORT PFNGLDELETEOBJECTARBPROC __glewDeleteObjectARB; +GLEW_FUN_EXPORT PFNGLDETACHOBJECTARBPROC __glewDetachObjectARB; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMARBPROC __glewGetActiveUniformARB; +GLEW_FUN_EXPORT PFNGLGETATTACHEDOBJECTSARBPROC __glewGetAttachedObjectsARB; +GLEW_FUN_EXPORT PFNGLGETHANDLEARBPROC __glewGetHandleARB; +GLEW_FUN_EXPORT PFNGLGETINFOLOGARBPROC __glewGetInfoLogARB; +GLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERFVARBPROC __glewGetObjectParameterfvARB; +GLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERIVARBPROC __glewGetObjectParameterivARB; +GLEW_FUN_EXPORT PFNGLGETSHADERSOURCEARBPROC __glewGetShaderSourceARB; +GLEW_FUN_EXPORT PFNGLGETUNIFORMLOCATIONARBPROC __glewGetUniformLocationARB; +GLEW_FUN_EXPORT PFNGLGETUNIFORMFVARBPROC __glewGetUniformfvARB; +GLEW_FUN_EXPORT PFNGLGETUNIFORMIVARBPROC __glewGetUniformivARB; +GLEW_FUN_EXPORT PFNGLLINKPROGRAMARBPROC __glewLinkProgramARB; +GLEW_FUN_EXPORT PFNGLSHADERSOURCEARBPROC __glewShaderSourceARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1FARBPROC __glewUniform1fARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1FVARBPROC __glewUniform1fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1IARBPROC __glewUniform1iARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1IVARBPROC __glewUniform1ivARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2FARBPROC __glewUniform2fARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2FVARBPROC __glewUniform2fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2IARBPROC __glewUniform2iARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2IVARBPROC __glewUniform2ivARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3FARBPROC __glewUniform3fARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3FVARBPROC __glewUniform3fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3IARBPROC __glewUniform3iARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3IVARBPROC __glewUniform3ivARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4FARBPROC __glewUniform4fARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4FVARBPROC __glewUniform4fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4IARBPROC __glewUniform4iARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4IVARBPROC __glewUniform4ivARB; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2FVARBPROC __glewUniformMatrix2fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3FVARBPROC __glewUniformMatrix3fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4FVARBPROC __glewUniformMatrix4fvARB; +GLEW_FUN_EXPORT PFNGLUSEPROGRAMOBJECTARBPROC __glewUseProgramObjectARB; +GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMARBPROC __glewValidateProgramARB; + +GLEW_FUN_EXPORT PFNGLSHADERSTORAGEBLOCKBINDINGPROC __glewShaderStorageBlockBinding; + +GLEW_FUN_EXPORT PFNGLGETACTIVESUBROUTINENAMEPROC __glewGetActiveSubroutineName; +GLEW_FUN_EXPORT PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC __glewGetActiveSubroutineUniformName; +GLEW_FUN_EXPORT PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC __glewGetActiveSubroutineUniformiv; +GLEW_FUN_EXPORT PFNGLGETPROGRAMSTAGEIVPROC __glewGetProgramStageiv; +GLEW_FUN_EXPORT PFNGLGETSUBROUTINEINDEXPROC __glewGetSubroutineIndex; +GLEW_FUN_EXPORT PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC __glewGetSubroutineUniformLocation; +GLEW_FUN_EXPORT PFNGLGETUNIFORMSUBROUTINEUIVPROC __glewGetUniformSubroutineuiv; +GLEW_FUN_EXPORT PFNGLUNIFORMSUBROUTINESUIVPROC __glewUniformSubroutinesuiv; + +GLEW_FUN_EXPORT PFNGLCOMPILESHADERINCLUDEARBPROC __glewCompileShaderIncludeARB; +GLEW_FUN_EXPORT PFNGLDELETENAMEDSTRINGARBPROC __glewDeleteNamedStringARB; +GLEW_FUN_EXPORT PFNGLGETNAMEDSTRINGARBPROC __glewGetNamedStringARB; +GLEW_FUN_EXPORT PFNGLGETNAMEDSTRINGIVARBPROC __glewGetNamedStringivARB; +GLEW_FUN_EXPORT PFNGLISNAMEDSTRINGARBPROC __glewIsNamedStringARB; +GLEW_FUN_EXPORT PFNGLNAMEDSTRINGARBPROC __glewNamedStringARB; + +GLEW_FUN_EXPORT PFNGLBUFFERPAGECOMMITMENTARBPROC __glewBufferPageCommitmentARB; + +GLEW_FUN_EXPORT PFNGLTEXPAGECOMMITMENTARBPROC __glewTexPageCommitmentARB; + +GLEW_FUN_EXPORT PFNGLCLIENTWAITSYNCPROC __glewClientWaitSync; +GLEW_FUN_EXPORT PFNGLDELETESYNCPROC __glewDeleteSync; +GLEW_FUN_EXPORT PFNGLFENCESYNCPROC __glewFenceSync; +GLEW_FUN_EXPORT PFNGLGETINTEGER64VPROC __glewGetInteger64v; +GLEW_FUN_EXPORT PFNGLGETSYNCIVPROC __glewGetSynciv; +GLEW_FUN_EXPORT PFNGLISSYNCPROC __glewIsSync; +GLEW_FUN_EXPORT PFNGLWAITSYNCPROC __glewWaitSync; + +GLEW_FUN_EXPORT PFNGLPATCHPARAMETERFVPROC __glewPatchParameterfv; +GLEW_FUN_EXPORT PFNGLPATCHPARAMETERIPROC __glewPatchParameteri; + +GLEW_FUN_EXPORT PFNGLTEXTUREBARRIERPROC __glewTextureBarrier; + +GLEW_FUN_EXPORT PFNGLTEXBUFFERARBPROC __glewTexBufferARB; + +GLEW_FUN_EXPORT PFNGLTEXBUFFERRANGEPROC __glewTexBufferRange; +GLEW_FUN_EXPORT PFNGLTEXTUREBUFFERRANGEEXTPROC __glewTextureBufferRangeEXT; + +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE1DARBPROC __glewCompressedTexImage1DARB; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE2DARBPROC __glewCompressedTexImage2DARB; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE3DARBPROC __glewCompressedTexImage3DARB; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC __glewCompressedTexSubImage1DARB; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC __glewCompressedTexSubImage2DARB; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC __glewCompressedTexSubImage3DARB; +GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXIMAGEARBPROC __glewGetCompressedTexImageARB; + +GLEW_FUN_EXPORT PFNGLGETMULTISAMPLEFVPROC __glewGetMultisamplefv; +GLEW_FUN_EXPORT PFNGLSAMPLEMASKIPROC __glewSampleMaski; +GLEW_FUN_EXPORT PFNGLTEXIMAGE2DMULTISAMPLEPROC __glewTexImage2DMultisample; +GLEW_FUN_EXPORT PFNGLTEXIMAGE3DMULTISAMPLEPROC __glewTexImage3DMultisample; + +GLEW_FUN_EXPORT PFNGLTEXSTORAGE1DPROC __glewTexStorage1D; +GLEW_FUN_EXPORT PFNGLTEXSTORAGE2DPROC __glewTexStorage2D; +GLEW_FUN_EXPORT PFNGLTEXSTORAGE3DPROC __glewTexStorage3D; + +GLEW_FUN_EXPORT PFNGLTEXSTORAGE2DMULTISAMPLEPROC __glewTexStorage2DMultisample; +GLEW_FUN_EXPORT PFNGLTEXSTORAGE3DMULTISAMPLEPROC __glewTexStorage3DMultisample; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC __glewTextureStorage2DMultisampleEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC __glewTextureStorage3DMultisampleEXT; + +GLEW_FUN_EXPORT PFNGLTEXTUREVIEWPROC __glewTextureView; + +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTI64VPROC __glewGetQueryObjecti64v; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUI64VPROC __glewGetQueryObjectui64v; +GLEW_FUN_EXPORT PFNGLQUERYCOUNTERPROC __glewQueryCounter; + +GLEW_FUN_EXPORT PFNGLBINDTRANSFORMFEEDBACKPROC __glewBindTransformFeedback; +GLEW_FUN_EXPORT PFNGLDELETETRANSFORMFEEDBACKSPROC __glewDeleteTransformFeedbacks; +GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKPROC __glewDrawTransformFeedback; +GLEW_FUN_EXPORT PFNGLGENTRANSFORMFEEDBACKSPROC __glewGenTransformFeedbacks; +GLEW_FUN_EXPORT PFNGLISTRANSFORMFEEDBACKPROC __glewIsTransformFeedback; +GLEW_FUN_EXPORT PFNGLPAUSETRANSFORMFEEDBACKPROC __glewPauseTransformFeedback; +GLEW_FUN_EXPORT PFNGLRESUMETRANSFORMFEEDBACKPROC __glewResumeTransformFeedback; + +GLEW_FUN_EXPORT PFNGLBEGINQUERYINDEXEDPROC __glewBeginQueryIndexed; +GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC __glewDrawTransformFeedbackStream; +GLEW_FUN_EXPORT PFNGLENDQUERYINDEXEDPROC __glewEndQueryIndexed; +GLEW_FUN_EXPORT PFNGLGETQUERYINDEXEDIVPROC __glewGetQueryIndexediv; + +GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC __glewDrawTransformFeedbackInstanced; +GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC __glewDrawTransformFeedbackStreamInstanced; + +GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXDARBPROC __glewLoadTransposeMatrixdARB; +GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXFARBPROC __glewLoadTransposeMatrixfARB; +GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXDARBPROC __glewMultTransposeMatrixdARB; +GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXFARBPROC __glewMultTransposeMatrixfARB; + +GLEW_FUN_EXPORT PFNGLBINDBUFFERBASEPROC __glewBindBufferBase; +GLEW_FUN_EXPORT PFNGLBINDBUFFERRANGEPROC __glewBindBufferRange; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC __glewGetActiveUniformBlockName; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMBLOCKIVPROC __glewGetActiveUniformBlockiv; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMNAMEPROC __glewGetActiveUniformName; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMSIVPROC __glewGetActiveUniformsiv; +GLEW_FUN_EXPORT PFNGLGETINTEGERI_VPROC __glewGetIntegeri_v; +GLEW_FUN_EXPORT PFNGLGETUNIFORMBLOCKINDEXPROC __glewGetUniformBlockIndex; +GLEW_FUN_EXPORT PFNGLGETUNIFORMINDICESPROC __glewGetUniformIndices; +GLEW_FUN_EXPORT PFNGLUNIFORMBLOCKBINDINGPROC __glewUniformBlockBinding; + +GLEW_FUN_EXPORT PFNGLBINDVERTEXARRAYPROC __glewBindVertexArray; +GLEW_FUN_EXPORT PFNGLDELETEVERTEXARRAYSPROC __glewDeleteVertexArrays; +GLEW_FUN_EXPORT PFNGLGENVERTEXARRAYSPROC __glewGenVertexArrays; +GLEW_FUN_EXPORT PFNGLISVERTEXARRAYPROC __glewIsVertexArray; + +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLDVPROC __glewGetVertexAttribLdv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DPROC __glewVertexAttribL1d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DVPROC __glewVertexAttribL1dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DPROC __glewVertexAttribL2d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DVPROC __glewVertexAttribL2dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DPROC __glewVertexAttribL3d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DVPROC __glewVertexAttribL3dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DPROC __glewVertexAttribL4d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DVPROC __glewVertexAttribL4dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLPOINTERPROC __glewVertexAttribLPointer; + +GLEW_FUN_EXPORT PFNGLBINDVERTEXBUFFERPROC __glewBindVertexBuffer; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYBINDVERTEXBUFFEREXTPROC __glewVertexArrayBindVertexBufferEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC __glewVertexArrayVertexAttribBindingEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBFORMATEXTPROC __glewVertexArrayVertexAttribFormatEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBIFORMATEXTPROC __glewVertexArrayVertexAttribIFormatEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC __glewVertexArrayVertexAttribLFormatEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC __glewVertexArrayVertexBindingDivisorEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBBINDINGPROC __glewVertexAttribBinding; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBFORMATPROC __glewVertexAttribFormat; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIFORMATPROC __glewVertexAttribIFormat; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLFORMATPROC __glewVertexAttribLFormat; +GLEW_FUN_EXPORT PFNGLVERTEXBINDINGDIVISORPROC __glewVertexBindingDivisor; + +GLEW_FUN_EXPORT PFNGLVERTEXBLENDARBPROC __glewVertexBlendARB; +GLEW_FUN_EXPORT PFNGLWEIGHTPOINTERARBPROC __glewWeightPointerARB; +GLEW_FUN_EXPORT PFNGLWEIGHTBVARBPROC __glewWeightbvARB; +GLEW_FUN_EXPORT PFNGLWEIGHTDVARBPROC __glewWeightdvARB; +GLEW_FUN_EXPORT PFNGLWEIGHTFVARBPROC __glewWeightfvARB; +GLEW_FUN_EXPORT PFNGLWEIGHTIVARBPROC __glewWeightivARB; +GLEW_FUN_EXPORT PFNGLWEIGHTSVARBPROC __glewWeightsvARB; +GLEW_FUN_EXPORT PFNGLWEIGHTUBVARBPROC __glewWeightubvARB; +GLEW_FUN_EXPORT PFNGLWEIGHTUIVARBPROC __glewWeightuivARB; +GLEW_FUN_EXPORT PFNGLWEIGHTUSVARBPROC __glewWeightusvARB; + +GLEW_FUN_EXPORT PFNGLBINDBUFFERARBPROC __glewBindBufferARB; +GLEW_FUN_EXPORT PFNGLBUFFERDATAARBPROC __glewBufferDataARB; +GLEW_FUN_EXPORT PFNGLBUFFERSUBDATAARBPROC __glewBufferSubDataARB; +GLEW_FUN_EXPORT PFNGLDELETEBUFFERSARBPROC __glewDeleteBuffersARB; +GLEW_FUN_EXPORT PFNGLGENBUFFERSARBPROC __glewGenBuffersARB; +GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERIVARBPROC __glewGetBufferParameterivARB; +GLEW_FUN_EXPORT PFNGLGETBUFFERPOINTERVARBPROC __glewGetBufferPointervARB; +GLEW_FUN_EXPORT PFNGLGETBUFFERSUBDATAARBPROC __glewGetBufferSubDataARB; +GLEW_FUN_EXPORT PFNGLISBUFFERARBPROC __glewIsBufferARB; +GLEW_FUN_EXPORT PFNGLMAPBUFFERARBPROC __glewMapBufferARB; +GLEW_FUN_EXPORT PFNGLUNMAPBUFFERARBPROC __glewUnmapBufferARB; + +GLEW_FUN_EXPORT PFNGLBINDPROGRAMARBPROC __glewBindProgramARB; +GLEW_FUN_EXPORT PFNGLDELETEPROGRAMSARBPROC __glewDeleteProgramsARB; +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBARRAYARBPROC __glewDisableVertexAttribArrayARB; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBARRAYARBPROC __glewEnableVertexAttribArrayARB; +GLEW_FUN_EXPORT PFNGLGENPROGRAMSARBPROC __glewGenProgramsARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMENVPARAMETERDVARBPROC __glewGetProgramEnvParameterdvARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMENVPARAMETERFVARBPROC __glewGetProgramEnvParameterfvARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC __glewGetProgramLocalParameterdvARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC __glewGetProgramLocalParameterfvARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMSTRINGARBPROC __glewGetProgramStringARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMIVARBPROC __glewGetProgramivARB; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVARBPROC __glewGetVertexAttribPointervARB; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVARBPROC __glewGetVertexAttribdvARB; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVARBPROC __glewGetVertexAttribfvARB; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVARBPROC __glewGetVertexAttribivARB; +GLEW_FUN_EXPORT PFNGLISPROGRAMARBPROC __glewIsProgramARB; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4DARBPROC __glewProgramEnvParameter4dARB; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4DVARBPROC __glewProgramEnvParameter4dvARB; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4FARBPROC __glewProgramEnvParameter4fARB; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4FVARBPROC __glewProgramEnvParameter4fvARB; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4DARBPROC __glewProgramLocalParameter4dARB; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4DVARBPROC __glewProgramLocalParameter4dvARB; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4FARBPROC __glewProgramLocalParameter4fARB; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4FVARBPROC __glewProgramLocalParameter4fvARB; +GLEW_FUN_EXPORT PFNGLPROGRAMSTRINGARBPROC __glewProgramStringARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DARBPROC __glewVertexAttrib1dARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVARBPROC __glewVertexAttrib1dvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FARBPROC __glewVertexAttrib1fARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVARBPROC __glewVertexAttrib1fvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SARBPROC __glewVertexAttrib1sARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVARBPROC __glewVertexAttrib1svARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DARBPROC __glewVertexAttrib2dARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVARBPROC __glewVertexAttrib2dvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FARBPROC __glewVertexAttrib2fARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVARBPROC __glewVertexAttrib2fvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SARBPROC __glewVertexAttrib2sARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVARBPROC __glewVertexAttrib2svARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DARBPROC __glewVertexAttrib3dARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVARBPROC __glewVertexAttrib3dvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FARBPROC __glewVertexAttrib3fARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVARBPROC __glewVertexAttrib3fvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SARBPROC __glewVertexAttrib3sARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVARBPROC __glewVertexAttrib3svARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NBVARBPROC __glewVertexAttrib4NbvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NIVARBPROC __glewVertexAttrib4NivARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NSVARBPROC __glewVertexAttrib4NsvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBARBPROC __glewVertexAttrib4NubARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBVARBPROC __glewVertexAttrib4NubvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUIVARBPROC __glewVertexAttrib4NuivARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUSVARBPROC __glewVertexAttrib4NusvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4BVARBPROC __glewVertexAttrib4bvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DARBPROC __glewVertexAttrib4dARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVARBPROC __glewVertexAttrib4dvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FARBPROC __glewVertexAttrib4fARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVARBPROC __glewVertexAttrib4fvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4IVARBPROC __glewVertexAttrib4ivARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SARBPROC __glewVertexAttrib4sARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVARBPROC __glewVertexAttrib4svARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVARBPROC __glewVertexAttrib4ubvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UIVARBPROC __glewVertexAttrib4uivARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4USVARBPROC __glewVertexAttrib4usvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERARBPROC __glewVertexAttribPointerARB; + +GLEW_FUN_EXPORT PFNGLBINDATTRIBLOCATIONARBPROC __glewBindAttribLocationARB; +GLEW_FUN_EXPORT PFNGLGETACTIVEATTRIBARBPROC __glewGetActiveAttribARB; +GLEW_FUN_EXPORT PFNGLGETATTRIBLOCATIONARBPROC __glewGetAttribLocationARB; + +GLEW_FUN_EXPORT PFNGLCOLORP3UIPROC __glewColorP3ui; +GLEW_FUN_EXPORT PFNGLCOLORP3UIVPROC __glewColorP3uiv; +GLEW_FUN_EXPORT PFNGLCOLORP4UIPROC __glewColorP4ui; +GLEW_FUN_EXPORT PFNGLCOLORP4UIVPROC __glewColorP4uiv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP1UIPROC __glewMultiTexCoordP1ui; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP1UIVPROC __glewMultiTexCoordP1uiv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP2UIPROC __glewMultiTexCoordP2ui; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP2UIVPROC __glewMultiTexCoordP2uiv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP3UIPROC __glewMultiTexCoordP3ui; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP3UIVPROC __glewMultiTexCoordP3uiv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP4UIPROC __glewMultiTexCoordP4ui; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP4UIVPROC __glewMultiTexCoordP4uiv; +GLEW_FUN_EXPORT PFNGLNORMALP3UIPROC __glewNormalP3ui; +GLEW_FUN_EXPORT PFNGLNORMALP3UIVPROC __glewNormalP3uiv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORP3UIPROC __glewSecondaryColorP3ui; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORP3UIVPROC __glewSecondaryColorP3uiv; +GLEW_FUN_EXPORT PFNGLTEXCOORDP1UIPROC __glewTexCoordP1ui; +GLEW_FUN_EXPORT PFNGLTEXCOORDP1UIVPROC __glewTexCoordP1uiv; +GLEW_FUN_EXPORT PFNGLTEXCOORDP2UIPROC __glewTexCoordP2ui; +GLEW_FUN_EXPORT PFNGLTEXCOORDP2UIVPROC __glewTexCoordP2uiv; +GLEW_FUN_EXPORT PFNGLTEXCOORDP3UIPROC __glewTexCoordP3ui; +GLEW_FUN_EXPORT PFNGLTEXCOORDP3UIVPROC __glewTexCoordP3uiv; +GLEW_FUN_EXPORT PFNGLTEXCOORDP4UIPROC __glewTexCoordP4ui; +GLEW_FUN_EXPORT PFNGLTEXCOORDP4UIVPROC __glewTexCoordP4uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP1UIPROC __glewVertexAttribP1ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP1UIVPROC __glewVertexAttribP1uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP2UIPROC __glewVertexAttribP2ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP2UIVPROC __glewVertexAttribP2uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP3UIPROC __glewVertexAttribP3ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP3UIVPROC __glewVertexAttribP3uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP4UIPROC __glewVertexAttribP4ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP4UIVPROC __glewVertexAttribP4uiv; +GLEW_FUN_EXPORT PFNGLVERTEXP2UIPROC __glewVertexP2ui; +GLEW_FUN_EXPORT PFNGLVERTEXP2UIVPROC __glewVertexP2uiv; +GLEW_FUN_EXPORT PFNGLVERTEXP3UIPROC __glewVertexP3ui; +GLEW_FUN_EXPORT PFNGLVERTEXP3UIVPROC __glewVertexP3uiv; +GLEW_FUN_EXPORT PFNGLVERTEXP4UIPROC __glewVertexP4ui; +GLEW_FUN_EXPORT PFNGLVERTEXP4UIVPROC __glewVertexP4uiv; + +GLEW_FUN_EXPORT PFNGLDEPTHRANGEARRAYVPROC __glewDepthRangeArrayv; +GLEW_FUN_EXPORT PFNGLDEPTHRANGEINDEXEDPROC __glewDepthRangeIndexed; +GLEW_FUN_EXPORT PFNGLGETDOUBLEI_VPROC __glewGetDoublei_v; +GLEW_FUN_EXPORT PFNGLGETFLOATI_VPROC __glewGetFloati_v; +GLEW_FUN_EXPORT PFNGLSCISSORARRAYVPROC __glewScissorArrayv; +GLEW_FUN_EXPORT PFNGLSCISSORINDEXEDPROC __glewScissorIndexed; +GLEW_FUN_EXPORT PFNGLSCISSORINDEXEDVPROC __glewScissorIndexedv; +GLEW_FUN_EXPORT PFNGLVIEWPORTARRAYVPROC __glewViewportArrayv; +GLEW_FUN_EXPORT PFNGLVIEWPORTINDEXEDFPROC __glewViewportIndexedf; +GLEW_FUN_EXPORT PFNGLVIEWPORTINDEXEDFVPROC __glewViewportIndexedfv; + +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DARBPROC __glewWindowPos2dARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DVARBPROC __glewWindowPos2dvARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FARBPROC __glewWindowPos2fARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FVARBPROC __glewWindowPos2fvARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IARBPROC __glewWindowPos2iARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IVARBPROC __glewWindowPos2ivARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SARBPROC __glewWindowPos2sARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SVARBPROC __glewWindowPos2svARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DARBPROC __glewWindowPos3dARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DVARBPROC __glewWindowPos3dvARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FARBPROC __glewWindowPos3fARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FVARBPROC __glewWindowPos3fvARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IARBPROC __glewWindowPos3iARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IVARBPROC __glewWindowPos3ivARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SARBPROC __glewWindowPos3sARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SVARBPROC __glewWindowPos3svARB; + +GLEW_FUN_EXPORT PFNGLDRAWBUFFERSATIPROC __glewDrawBuffersATI; + +GLEW_FUN_EXPORT PFNGLDRAWELEMENTARRAYATIPROC __glewDrawElementArrayATI; +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTARRAYATIPROC __glewDrawRangeElementArrayATI; +GLEW_FUN_EXPORT PFNGLELEMENTPOINTERATIPROC __glewElementPointerATI; + +GLEW_FUN_EXPORT PFNGLGETTEXBUMPPARAMETERFVATIPROC __glewGetTexBumpParameterfvATI; +GLEW_FUN_EXPORT PFNGLGETTEXBUMPPARAMETERIVATIPROC __glewGetTexBumpParameterivATI; +GLEW_FUN_EXPORT PFNGLTEXBUMPPARAMETERFVATIPROC __glewTexBumpParameterfvATI; +GLEW_FUN_EXPORT PFNGLTEXBUMPPARAMETERIVATIPROC __glewTexBumpParameterivATI; + +GLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP1ATIPROC __glewAlphaFragmentOp1ATI; +GLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP2ATIPROC __glewAlphaFragmentOp2ATI; +GLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP3ATIPROC __glewAlphaFragmentOp3ATI; +GLEW_FUN_EXPORT PFNGLBEGINFRAGMENTSHADERATIPROC __glewBeginFragmentShaderATI; +GLEW_FUN_EXPORT PFNGLBINDFRAGMENTSHADERATIPROC __glewBindFragmentShaderATI; +GLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP1ATIPROC __glewColorFragmentOp1ATI; +GLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP2ATIPROC __glewColorFragmentOp2ATI; +GLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP3ATIPROC __glewColorFragmentOp3ATI; +GLEW_FUN_EXPORT PFNGLDELETEFRAGMENTSHADERATIPROC __glewDeleteFragmentShaderATI; +GLEW_FUN_EXPORT PFNGLENDFRAGMENTSHADERATIPROC __glewEndFragmentShaderATI; +GLEW_FUN_EXPORT PFNGLGENFRAGMENTSHADERSATIPROC __glewGenFragmentShadersATI; +GLEW_FUN_EXPORT PFNGLPASSTEXCOORDATIPROC __glewPassTexCoordATI; +GLEW_FUN_EXPORT PFNGLSAMPLEMAPATIPROC __glewSampleMapATI; +GLEW_FUN_EXPORT PFNGLSETFRAGMENTSHADERCONSTANTATIPROC __glewSetFragmentShaderConstantATI; + +GLEW_FUN_EXPORT PFNGLMAPOBJECTBUFFERATIPROC __glewMapObjectBufferATI; +GLEW_FUN_EXPORT PFNGLUNMAPOBJECTBUFFERATIPROC __glewUnmapObjectBufferATI; + +GLEW_FUN_EXPORT PFNGLPNTRIANGLESFATIPROC __glewPNTrianglesfATI; +GLEW_FUN_EXPORT PFNGLPNTRIANGLESIATIPROC __glewPNTrianglesiATI; + +GLEW_FUN_EXPORT PFNGLSTENCILFUNCSEPARATEATIPROC __glewStencilFuncSeparateATI; +GLEW_FUN_EXPORT PFNGLSTENCILOPSEPARATEATIPROC __glewStencilOpSeparateATI; + +GLEW_FUN_EXPORT PFNGLARRAYOBJECTATIPROC __glewArrayObjectATI; +GLEW_FUN_EXPORT PFNGLFREEOBJECTBUFFERATIPROC __glewFreeObjectBufferATI; +GLEW_FUN_EXPORT PFNGLGETARRAYOBJECTFVATIPROC __glewGetArrayObjectfvATI; +GLEW_FUN_EXPORT PFNGLGETARRAYOBJECTIVATIPROC __glewGetArrayObjectivATI; +GLEW_FUN_EXPORT PFNGLGETOBJECTBUFFERFVATIPROC __glewGetObjectBufferfvATI; +GLEW_FUN_EXPORT PFNGLGETOBJECTBUFFERIVATIPROC __glewGetObjectBufferivATI; +GLEW_FUN_EXPORT PFNGLGETVARIANTARRAYOBJECTFVATIPROC __glewGetVariantArrayObjectfvATI; +GLEW_FUN_EXPORT PFNGLGETVARIANTARRAYOBJECTIVATIPROC __glewGetVariantArrayObjectivATI; +GLEW_FUN_EXPORT PFNGLISOBJECTBUFFERATIPROC __glewIsObjectBufferATI; +GLEW_FUN_EXPORT PFNGLNEWOBJECTBUFFERATIPROC __glewNewObjectBufferATI; +GLEW_FUN_EXPORT PFNGLUPDATEOBJECTBUFFERATIPROC __glewUpdateObjectBufferATI; +GLEW_FUN_EXPORT PFNGLVARIANTARRAYOBJECTATIPROC __glewVariantArrayObjectATI; + +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC __glewGetVertexAttribArrayObjectfvATI; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC __glewGetVertexAttribArrayObjectivATI; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBARRAYOBJECTATIPROC __glewVertexAttribArrayObjectATI; + +GLEW_FUN_EXPORT PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC __glewClientActiveVertexStreamATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3BATIPROC __glewNormalStream3bATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3BVATIPROC __glewNormalStream3bvATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3DATIPROC __glewNormalStream3dATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3DVATIPROC __glewNormalStream3dvATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3FATIPROC __glewNormalStream3fATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3FVATIPROC __glewNormalStream3fvATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3IATIPROC __glewNormalStream3iATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3IVATIPROC __glewNormalStream3ivATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3SATIPROC __glewNormalStream3sATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3SVATIPROC __glewNormalStream3svATI; +GLEW_FUN_EXPORT PFNGLVERTEXBLENDENVFATIPROC __glewVertexBlendEnvfATI; +GLEW_FUN_EXPORT PFNGLVERTEXBLENDENVIATIPROC __glewVertexBlendEnviATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1DATIPROC __glewVertexStream1dATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1DVATIPROC __glewVertexStream1dvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1FATIPROC __glewVertexStream1fATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1FVATIPROC __glewVertexStream1fvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1IATIPROC __glewVertexStream1iATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1IVATIPROC __glewVertexStream1ivATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1SATIPROC __glewVertexStream1sATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1SVATIPROC __glewVertexStream1svATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2DATIPROC __glewVertexStream2dATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2DVATIPROC __glewVertexStream2dvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2FATIPROC __glewVertexStream2fATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2FVATIPROC __glewVertexStream2fvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2IATIPROC __glewVertexStream2iATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2IVATIPROC __glewVertexStream2ivATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2SATIPROC __glewVertexStream2sATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2SVATIPROC __glewVertexStream2svATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3DATIPROC __glewVertexStream3dATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3DVATIPROC __glewVertexStream3dvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3FATIPROC __glewVertexStream3fATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3FVATIPROC __glewVertexStream3fvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3IATIPROC __glewVertexStream3iATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3IVATIPROC __glewVertexStream3ivATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3SATIPROC __glewVertexStream3sATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3SVATIPROC __glewVertexStream3svATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4DATIPROC __glewVertexStream4dATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4DVATIPROC __glewVertexStream4dvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4FATIPROC __glewVertexStream4fATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4FVATIPROC __glewVertexStream4fvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4IATIPROC __glewVertexStream4iATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4IVATIPROC __glewVertexStream4ivATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4SATIPROC __glewVertexStream4sATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4SVATIPROC __glewVertexStream4svATI; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEEXTPROC __glewDrawArraysInstancedBaseInstanceEXT; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEEXTPROC __glewDrawElementsInstancedBaseInstanceEXT; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEEXTPROC __glewDrawElementsInstancedBaseVertexBaseInstanceEXT; + +GLEW_FUN_EXPORT PFNGLGETUNIFORMBUFFERSIZEEXTPROC __glewGetUniformBufferSizeEXT; +GLEW_FUN_EXPORT PFNGLGETUNIFORMOFFSETEXTPROC __glewGetUniformOffsetEXT; +GLEW_FUN_EXPORT PFNGLUNIFORMBUFFEREXTPROC __glewUniformBufferEXT; + +GLEW_FUN_EXPORT PFNGLBLENDCOLOREXTPROC __glewBlendColorEXT; + +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEEXTPROC __glewBlendEquationSeparateEXT; + +GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONINDEXEDEXTPROC __glewBindFragDataLocationIndexedEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGDATAINDEXEXTPROC __glewGetFragDataIndexEXT; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCELOCATIONINDEXEXTPROC __glewGetProgramResourceLocationIndexEXT; + +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEEXTPROC __glewBlendFuncSeparateEXT; + +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONEXTPROC __glewBlendEquationEXT; + +GLEW_FUN_EXPORT PFNGLBUFFERSTORAGEEXTPROC __glewBufferStorageEXT; +GLEW_FUN_EXPORT PFNGLNAMEDBUFFERSTORAGEEXTPROC __glewNamedBufferStorageEXT; + +GLEW_FUN_EXPORT PFNGLCLEARTEXIMAGEEXTPROC __glewClearTexImageEXT; +GLEW_FUN_EXPORT PFNGLCLEARTEXSUBIMAGEEXTPROC __glewClearTexSubImageEXT; + +GLEW_FUN_EXPORT PFNGLCOLORSUBTABLEEXTPROC __glewColorSubTableEXT; +GLEW_FUN_EXPORT PFNGLCOPYCOLORSUBTABLEEXTPROC __glewCopyColorSubTableEXT; + +GLEW_FUN_EXPORT PFNGLLOCKARRAYSEXTPROC __glewLockArraysEXT; +GLEW_FUN_EXPORT PFNGLUNLOCKARRAYSEXTPROC __glewUnlockArraysEXT; + +GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER1DEXTPROC __glewConvolutionFilter1DEXT; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER2DEXTPROC __glewConvolutionFilter2DEXT; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFEXTPROC __glewConvolutionParameterfEXT; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFVEXTPROC __glewConvolutionParameterfvEXT; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIEXTPROC __glewConvolutionParameteriEXT; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIVEXTPROC __glewConvolutionParameterivEXT; +GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC __glewCopyConvolutionFilter1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC __glewCopyConvolutionFilter2DEXT; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONFILTEREXTPROC __glewGetConvolutionFilterEXT; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC __glewGetConvolutionParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC __glewGetConvolutionParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETSEPARABLEFILTEREXTPROC __glewGetSeparableFilterEXT; +GLEW_FUN_EXPORT PFNGLSEPARABLEFILTER2DEXTPROC __glewSeparableFilter2DEXT; + +GLEW_FUN_EXPORT PFNGLBINORMALPOINTEREXTPROC __glewBinormalPointerEXT; +GLEW_FUN_EXPORT PFNGLTANGENTPOINTEREXTPROC __glewTangentPointerEXT; + +GLEW_FUN_EXPORT PFNGLCOPYIMAGESUBDATAEXTPROC __glewCopyImageSubDataEXT; + +GLEW_FUN_EXPORT PFNGLCOPYTEXIMAGE1DEXTPROC __glewCopyTexImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXIMAGE2DEXTPROC __glewCopyTexImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE1DEXTPROC __glewCopyTexSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE2DEXTPROC __glewCopyTexSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE3DEXTPROC __glewCopyTexSubImage3DEXT; + +GLEW_FUN_EXPORT PFNGLCULLPARAMETERDVEXTPROC __glewCullParameterdvEXT; +GLEW_FUN_EXPORT PFNGLCULLPARAMETERFVEXTPROC __glewCullParameterfvEXT; + +GLEW_FUN_EXPORT PFNGLGETOBJECTLABELEXTPROC __glewGetObjectLabelEXT; +GLEW_FUN_EXPORT PFNGLLABELOBJECTEXTPROC __glewLabelObjectEXT; + +GLEW_FUN_EXPORT PFNGLINSERTEVENTMARKEREXTPROC __glewInsertEventMarkerEXT; +GLEW_FUN_EXPORT PFNGLPOPGROUPMARKEREXTPROC __glewPopGroupMarkerEXT; +GLEW_FUN_EXPORT PFNGLPUSHGROUPMARKEREXTPROC __glewPushGroupMarkerEXT; + +GLEW_FUN_EXPORT PFNGLDEPTHBOUNDSEXTPROC __glewDepthBoundsEXT; + +GLEW_FUN_EXPORT PFNGLBINDMULTITEXTUREEXTPROC __glewBindMultiTextureEXT; +GLEW_FUN_EXPORT PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC __glewCheckNamedFramebufferStatusEXT; +GLEW_FUN_EXPORT PFNGLCLIENTATTRIBDEFAULTEXTPROC __glewClientAttribDefaultEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC __glewCompressedMultiTexImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC __glewCompressedMultiTexImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC __glewCompressedMultiTexImage3DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC __glewCompressedMultiTexSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC __glewCompressedMultiTexSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC __glewCompressedMultiTexSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC __glewCompressedTextureImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC __glewCompressedTextureImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC __glewCompressedTextureImage3DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC __glewCompressedTextureSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC __glewCompressedTextureSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC __glewCompressedTextureSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLCOPYMULTITEXIMAGE1DEXTPROC __glewCopyMultiTexImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYMULTITEXIMAGE2DEXTPROC __glewCopyMultiTexImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC __glewCopyMultiTexSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC __glewCopyMultiTexSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC __glewCopyMultiTexSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXTUREIMAGE1DEXTPROC __glewCopyTextureImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXTUREIMAGE2DEXTPROC __glewCopyTextureImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC __glewCopyTextureSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC __glewCopyTextureSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC __glewCopyTextureSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC __glewDisableClientStateIndexedEXT; +GLEW_FUN_EXPORT PFNGLDISABLECLIENTSTATEIEXTPROC __glewDisableClientStateiEXT; +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC __glewDisableVertexArrayAttribEXT; +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXARRAYEXTPROC __glewDisableVertexArrayEXT; +GLEW_FUN_EXPORT PFNGLENABLECLIENTSTATEINDEXEDEXTPROC __glewEnableClientStateIndexedEXT; +GLEW_FUN_EXPORT PFNGLENABLECLIENTSTATEIEXTPROC __glewEnableClientStateiEXT; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXARRAYATTRIBEXTPROC __glewEnableVertexArrayAttribEXT; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXARRAYEXTPROC __glewEnableVertexArrayEXT; +GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC __glewFlushMappedNamedBufferRangeEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC __glewFramebufferDrawBufferEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC __glewFramebufferDrawBuffersEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERREADBUFFEREXTPROC __glewFramebufferReadBufferEXT; +GLEW_FUN_EXPORT PFNGLGENERATEMULTITEXMIPMAPEXTPROC __glewGenerateMultiTexMipmapEXT; +GLEW_FUN_EXPORT PFNGLGENERATETEXTUREMIPMAPEXTPROC __glewGenerateTextureMipmapEXT; +GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC __glewGetCompressedMultiTexImageEXT; +GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC __glewGetCompressedTextureImageEXT; +GLEW_FUN_EXPORT PFNGLGETDOUBLEINDEXEDVEXTPROC __glewGetDoubleIndexedvEXT; +GLEW_FUN_EXPORT PFNGLGETDOUBLEI_VEXTPROC __glewGetDoublei_vEXT; +GLEW_FUN_EXPORT PFNGLGETFLOATINDEXEDVEXTPROC __glewGetFloatIndexedvEXT; +GLEW_FUN_EXPORT PFNGLGETFLOATI_VEXTPROC __glewGetFloati_vEXT; +GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC __glewGetFramebufferParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXENVFVEXTPROC __glewGetMultiTexEnvfvEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXENVIVEXTPROC __glewGetMultiTexEnvivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXGENDVEXTPROC __glewGetMultiTexGendvEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXGENFVEXTPROC __glewGetMultiTexGenfvEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXGENIVEXTPROC __glewGetMultiTexGenivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXIMAGEEXTPROC __glewGetMultiTexImageEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC __glewGetMultiTexLevelParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC __glewGetMultiTexLevelParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERIIVEXTPROC __glewGetMultiTexParameterIivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERIUIVEXTPROC __glewGetMultiTexParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERFVEXTPROC __glewGetMultiTexParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERIVEXTPROC __glewGetMultiTexParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC __glewGetNamedBufferParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPOINTERVEXTPROC __glewGetNamedBufferPointervEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERSUBDATAEXTPROC __glewGetNamedBufferSubDataEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetNamedFramebufferAttachmentParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC __glewGetNamedProgramLocalParameterIivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC __glewGetNamedProgramLocalParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC __glewGetNamedProgramLocalParameterdvEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC __glewGetNamedProgramLocalParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMSTRINGEXTPROC __glewGetNamedProgramStringEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMIVEXTPROC __glewGetNamedProgramivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC __glewGetNamedRenderbufferParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETPOINTERINDEXEDVEXTPROC __glewGetPointerIndexedvEXT; +GLEW_FUN_EXPORT PFNGLGETPOINTERI_VEXTPROC __glewGetPointeri_vEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTUREIMAGEEXTPROC __glewGetTextureImageEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC __glewGetTextureLevelParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC __glewGetTextureLevelParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIIVEXTPROC __glewGetTextureParameterIivEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIUIVEXTPROC __glewGetTextureParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERFVEXTPROC __glewGetTextureParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIVEXTPROC __glewGetTextureParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC __glewGetVertexArrayIntegeri_vEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYINTEGERVEXTPROC __glewGetVertexArrayIntegervEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC __glewGetVertexArrayPointeri_vEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYPOINTERVEXTPROC __glewGetVertexArrayPointervEXT; +GLEW_FUN_EXPORT PFNGLMAPNAMEDBUFFEREXTPROC __glewMapNamedBufferEXT; +GLEW_FUN_EXPORT PFNGLMAPNAMEDBUFFERRANGEEXTPROC __glewMapNamedBufferRangeEXT; +GLEW_FUN_EXPORT PFNGLMATRIXFRUSTUMEXTPROC __glewMatrixFrustumEXT; +GLEW_FUN_EXPORT PFNGLMATRIXLOADIDENTITYEXTPROC __glewMatrixLoadIdentityEXT; +GLEW_FUN_EXPORT PFNGLMATRIXLOADTRANSPOSEDEXTPROC __glewMatrixLoadTransposedEXT; +GLEW_FUN_EXPORT PFNGLMATRIXLOADTRANSPOSEFEXTPROC __glewMatrixLoadTransposefEXT; +GLEW_FUN_EXPORT PFNGLMATRIXLOADDEXTPROC __glewMatrixLoaddEXT; +GLEW_FUN_EXPORT PFNGLMATRIXLOADFEXTPROC __glewMatrixLoadfEXT; +GLEW_FUN_EXPORT PFNGLMATRIXMULTTRANSPOSEDEXTPROC __glewMatrixMultTransposedEXT; +GLEW_FUN_EXPORT PFNGLMATRIXMULTTRANSPOSEFEXTPROC __glewMatrixMultTransposefEXT; +GLEW_FUN_EXPORT PFNGLMATRIXMULTDEXTPROC __glewMatrixMultdEXT; +GLEW_FUN_EXPORT PFNGLMATRIXMULTFEXTPROC __glewMatrixMultfEXT; +GLEW_FUN_EXPORT PFNGLMATRIXORTHOEXTPROC __glewMatrixOrthoEXT; +GLEW_FUN_EXPORT PFNGLMATRIXPOPEXTPROC __glewMatrixPopEXT; +GLEW_FUN_EXPORT PFNGLMATRIXPUSHEXTPROC __glewMatrixPushEXT; +GLEW_FUN_EXPORT PFNGLMATRIXROTATEDEXTPROC __glewMatrixRotatedEXT; +GLEW_FUN_EXPORT PFNGLMATRIXROTATEFEXTPROC __glewMatrixRotatefEXT; +GLEW_FUN_EXPORT PFNGLMATRIXSCALEDEXTPROC __glewMatrixScaledEXT; +GLEW_FUN_EXPORT PFNGLMATRIXSCALEFEXTPROC __glewMatrixScalefEXT; +GLEW_FUN_EXPORT PFNGLMATRIXTRANSLATEDEXTPROC __glewMatrixTranslatedEXT; +GLEW_FUN_EXPORT PFNGLMATRIXTRANSLATEFEXTPROC __glewMatrixTranslatefEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXBUFFEREXTPROC __glewMultiTexBufferEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDPOINTEREXTPROC __glewMultiTexCoordPointerEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXENVFEXTPROC __glewMultiTexEnvfEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXENVFVEXTPROC __glewMultiTexEnvfvEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXENVIEXTPROC __glewMultiTexEnviEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXENVIVEXTPROC __glewMultiTexEnvivEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENDEXTPROC __glewMultiTexGendEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENDVEXTPROC __glewMultiTexGendvEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENFEXTPROC __glewMultiTexGenfEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENFVEXTPROC __glewMultiTexGenfvEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENIEXTPROC __glewMultiTexGeniEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENIVEXTPROC __glewMultiTexGenivEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXIMAGE1DEXTPROC __glewMultiTexImage1DEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXIMAGE2DEXTPROC __glewMultiTexImage2DEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXIMAGE3DEXTPROC __glewMultiTexImage3DEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIIVEXTPROC __glewMultiTexParameterIivEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIUIVEXTPROC __glewMultiTexParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERFEXTPROC __glewMultiTexParameterfEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERFVEXTPROC __glewMultiTexParameterfvEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIEXTPROC __glewMultiTexParameteriEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIVEXTPROC __glewMultiTexParameterivEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXRENDERBUFFEREXTPROC __glewMultiTexRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE1DEXTPROC __glewMultiTexSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE2DEXTPROC __glewMultiTexSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE3DEXTPROC __glewMultiTexSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLNAMEDBUFFERDATAEXTPROC __glewNamedBufferDataEXT; +GLEW_FUN_EXPORT PFNGLNAMEDBUFFERSUBDATAEXTPROC __glewNamedBufferSubDataEXT; +GLEW_FUN_EXPORT PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC __glewNamedCopyBufferSubDataEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC __glewNamedFramebufferRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC __glewNamedFramebufferTexture1DEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC __glewNamedFramebufferTexture2DEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC __glewNamedFramebufferTexture3DEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC __glewNamedFramebufferTextureEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC __glewNamedFramebufferTextureFaceEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC __glewNamedFramebufferTextureLayerEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC __glewNamedProgramLocalParameter4dEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC __glewNamedProgramLocalParameter4dvEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC __glewNamedProgramLocalParameter4fEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC __glewNamedProgramLocalParameter4fvEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC __glewNamedProgramLocalParameterI4iEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC __glewNamedProgramLocalParameterI4ivEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC __glewNamedProgramLocalParameterI4uiEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC __glewNamedProgramLocalParameterI4uivEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC __glewNamedProgramLocalParameters4fvEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC __glewNamedProgramLocalParametersI4ivEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC __glewNamedProgramLocalParametersI4uivEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMSTRINGEXTPROC __glewNamedProgramStringEXT; +GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC __glewNamedRenderbufferStorageEXT; +GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC __glewNamedRenderbufferStorageMultisampleCoverageEXT; +GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewNamedRenderbufferStorageMultisampleEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FEXTPROC __glewProgramUniform1fEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FVEXTPROC __glewProgramUniform1fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IEXTPROC __glewProgramUniform1iEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IVEXTPROC __glewProgramUniform1ivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIEXTPROC __glewProgramUniform1uiEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIVEXTPROC __glewProgramUniform1uivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FEXTPROC __glewProgramUniform2fEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FVEXTPROC __glewProgramUniform2fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IEXTPROC __glewProgramUniform2iEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IVEXTPROC __glewProgramUniform2ivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIEXTPROC __glewProgramUniform2uiEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIVEXTPROC __glewProgramUniform2uivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FEXTPROC __glewProgramUniform3fEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FVEXTPROC __glewProgramUniform3fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IEXTPROC __glewProgramUniform3iEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IVEXTPROC __glewProgramUniform3ivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIEXTPROC __glewProgramUniform3uiEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIVEXTPROC __glewProgramUniform3uivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FEXTPROC __glewProgramUniform4fEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FVEXTPROC __glewProgramUniform4fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IEXTPROC __glewProgramUniform4iEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IVEXTPROC __glewProgramUniform4ivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIEXTPROC __glewProgramUniform4uiEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIVEXTPROC __glewProgramUniform4uivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC __glewProgramUniformMatrix2fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC __glewProgramUniformMatrix2x3fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC __glewProgramUniformMatrix2x4fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC __glewProgramUniformMatrix3fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC __glewProgramUniformMatrix3x2fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC __glewProgramUniformMatrix3x4fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC __glewProgramUniformMatrix4fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC __glewProgramUniformMatrix4x2fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC __glewProgramUniformMatrix4x3fvEXT; +GLEW_FUN_EXPORT PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC __glewPushClientAttribDefaultEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREBUFFEREXTPROC __glewTextureBufferEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE1DEXTPROC __glewTextureImage1DEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DEXTPROC __glewTextureImage2DEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DEXTPROC __glewTextureImage3DEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIIVEXTPROC __glewTextureParameterIivEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIUIVEXTPROC __glewTextureParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERFEXTPROC __glewTextureParameterfEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERFVEXTPROC __glewTextureParameterfvEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIEXTPROC __glewTextureParameteriEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIVEXTPROC __glewTextureParameterivEXT; +GLEW_FUN_EXPORT PFNGLTEXTURERENDERBUFFEREXTPROC __glewTextureRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE1DEXTPROC __glewTextureSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE2DEXTPROC __glewTextureSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE3DEXTPROC __glewTextureSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLUNMAPNAMEDBUFFEREXTPROC __glewUnmapNamedBufferEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYCOLOROFFSETEXTPROC __glewVertexArrayColorOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC __glewVertexArrayEdgeFlagOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC __glewVertexArrayFogCoordOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYINDEXOFFSETEXTPROC __glewVertexArrayIndexOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC __glewVertexArrayMultiTexCoordOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYNORMALOFFSETEXTPROC __glewVertexArrayNormalOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC __glewVertexArraySecondaryColorOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC __glewVertexArrayTexCoordOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBDIVISOREXTPROC __glewVertexArrayVertexAttribDivisorEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC __glewVertexArrayVertexAttribIOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC __glewVertexArrayVertexAttribOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC __glewVertexArrayVertexOffsetEXT; + +GLEW_FUN_EXPORT PFNGLDISCARDFRAMEBUFFEREXTPROC __glewDiscardFramebufferEXT; + +GLEW_FUN_EXPORT PFNGLDRAWBUFFERSEXTPROC __glewDrawBuffersEXT; + +GLEW_FUN_EXPORT PFNGLCOLORMASKINDEXEDEXTPROC __glewColorMaskIndexedEXT; +GLEW_FUN_EXPORT PFNGLDISABLEINDEXEDEXTPROC __glewDisableIndexedEXT; +GLEW_FUN_EXPORT PFNGLENABLEINDEXEDEXTPROC __glewEnableIndexedEXT; +GLEW_FUN_EXPORT PFNGLGETBOOLEANINDEXEDVEXTPROC __glewGetBooleanIndexedvEXT; +GLEW_FUN_EXPORT PFNGLGETINTEGERINDEXEDVEXTPROC __glewGetIntegerIndexedvEXT; +GLEW_FUN_EXPORT PFNGLISENABLEDINDEXEDEXTPROC __glewIsEnabledIndexedEXT; + +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEIEXTPROC __glewBlendEquationSeparateiEXT; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONIEXTPROC __glewBlendEquationiEXT; +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEIEXTPROC __glewBlendFuncSeparateiEXT; +GLEW_FUN_EXPORT PFNGLBLENDFUNCIEXTPROC __glewBlendFunciEXT; +GLEW_FUN_EXPORT PFNGLCOLORMASKIEXTPROC __glewColorMaskiEXT; +GLEW_FUN_EXPORT PFNGLDISABLEIEXTPROC __glewDisableiEXT; +GLEW_FUN_EXPORT PFNGLENABLEIEXTPROC __glewEnableiEXT; +GLEW_FUN_EXPORT PFNGLISENABLEDIEXTPROC __glewIsEnablediEXT; + +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSBASEVERTEXEXTPROC __glewDrawElementsBaseVertexEXT; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXEXTPROC __glewDrawElementsInstancedBaseVertexEXT; +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSBASEVERTEXEXTPROC __glewDrawRangeElementsBaseVertexEXT; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSBASEVERTEXEXTPROC __glewMultiDrawElementsBaseVertexEXT; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDEXTPROC __glewDrawArraysInstancedEXT; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDEXTPROC __glewDrawElementsInstancedEXT; + +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSEXTPROC __glewDrawRangeElementsEXT; + +GLEW_FUN_EXPORT PFNGLBUFFERSTORAGEEXTERNALEXTPROC __glewBufferStorageExternalEXT; +GLEW_FUN_EXPORT PFNGLNAMEDBUFFERSTORAGEEXTERNALEXTPROC __glewNamedBufferStorageExternalEXT; + +GLEW_FUN_EXPORT PFNGLFOGCOORDPOINTEREXTPROC __glewFogCoordPointerEXT; +GLEW_FUN_EXPORT PFNGLFOGCOORDDEXTPROC __glewFogCoorddEXT; +GLEW_FUN_EXPORT PFNGLFOGCOORDDVEXTPROC __glewFogCoorddvEXT; +GLEW_FUN_EXPORT PFNGLFOGCOORDFEXTPROC __glewFogCoordfEXT; +GLEW_FUN_EXPORT PFNGLFOGCOORDFVEXTPROC __glewFogCoordfvEXT; + +GLEW_FUN_EXPORT PFNGLFRAGMENTCOLORMATERIALEXTPROC __glewFragmentColorMaterialEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFEXTPROC __glewFragmentLightModelfEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFVEXTPROC __glewFragmentLightModelfvEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELIEXTPROC __glewFragmentLightModeliEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELIVEXTPROC __glewFragmentLightModelivEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFEXTPROC __glewFragmentLightfEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFVEXTPROC __glewFragmentLightfvEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTIEXTPROC __glewFragmentLightiEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTIVEXTPROC __glewFragmentLightivEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFEXTPROC __glewFragmentMaterialfEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFVEXTPROC __glewFragmentMaterialfvEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALIEXTPROC __glewFragmentMaterialiEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALIVEXTPROC __glewFragmentMaterialivEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTFVEXTPROC __glewGetFragmentLightfvEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTIVEXTPROC __glewGetFragmentLightivEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALFVEXTPROC __glewGetFragmentMaterialfvEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALIVEXTPROC __glewGetFragmentMaterialivEXT; +GLEW_FUN_EXPORT PFNGLLIGHTENVIEXTPROC __glewLightEnviEXT; + +GLEW_FUN_EXPORT PFNGLBLITFRAMEBUFFEREXTPROC __glewBlitFramebufferEXT; + +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewRenderbufferStorageMultisampleEXT; + +GLEW_FUN_EXPORT PFNGLBINDFRAMEBUFFEREXTPROC __glewBindFramebufferEXT; +GLEW_FUN_EXPORT PFNGLBINDRENDERBUFFEREXTPROC __glewBindRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC __glewCheckFramebufferStatusEXT; +GLEW_FUN_EXPORT PFNGLDELETEFRAMEBUFFERSEXTPROC __glewDeleteFramebuffersEXT; +GLEW_FUN_EXPORT PFNGLDELETERENDERBUFFERSEXTPROC __glewDeleteRenderbuffersEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC __glewFramebufferRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE1DEXTPROC __glewFramebufferTexture1DEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE2DEXTPROC __glewFramebufferTexture2DEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE3DEXTPROC __glewFramebufferTexture3DEXT; +GLEW_FUN_EXPORT PFNGLGENFRAMEBUFFERSEXTPROC __glewGenFramebuffersEXT; +GLEW_FUN_EXPORT PFNGLGENRENDERBUFFERSEXTPROC __glewGenRenderbuffersEXT; +GLEW_FUN_EXPORT PFNGLGENERATEMIPMAPEXTPROC __glewGenerateMipmapEXT; +GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetFramebufferAttachmentParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC __glewGetRenderbufferParameterivEXT; +GLEW_FUN_EXPORT PFNGLISFRAMEBUFFEREXTPROC __glewIsFramebufferEXT; +GLEW_FUN_EXPORT PFNGLISRENDERBUFFEREXTPROC __glewIsRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEEXTPROC __glewRenderbufferStorageEXT; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREEXTPROC __glewFramebufferTextureEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC __glewFramebufferTextureFaceEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIEXTPROC __glewProgramParameteriEXT; + +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERS4FVEXTPROC __glewProgramEnvParameters4fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC __glewProgramLocalParameters4fvEXT; + +GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONEXTPROC __glewBindFragDataLocationEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGDATALOCATIONEXTPROC __glewGetFragDataLocationEXT; +GLEW_FUN_EXPORT PFNGLGETUNIFORMUIVEXTPROC __glewGetUniformuivEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIIVEXTPROC __glewGetVertexAttribIivEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIUIVEXTPROC __glewGetVertexAttribIuivEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM1UIEXTPROC __glewUniform1uiEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM1UIVEXTPROC __glewUniform1uivEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM2UIEXTPROC __glewUniform2uiEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM2UIVEXTPROC __glewUniform2uivEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM3UIEXTPROC __glewUniform3uiEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM3UIVEXTPROC __glewUniform3uivEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM4UIEXTPROC __glewUniform4uiEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM4UIVEXTPROC __glewUniform4uivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IEXTPROC __glewVertexAttribI1iEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IVEXTPROC __glewVertexAttribI1ivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIEXTPROC __glewVertexAttribI1uiEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIVEXTPROC __glewVertexAttribI1uivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IEXTPROC __glewVertexAttribI2iEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IVEXTPROC __glewVertexAttribI2ivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIEXTPROC __glewVertexAttribI2uiEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIVEXTPROC __glewVertexAttribI2uivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IEXTPROC __glewVertexAttribI3iEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IVEXTPROC __glewVertexAttribI3ivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIEXTPROC __glewVertexAttribI3uiEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIVEXTPROC __glewVertexAttribI3uivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4BVEXTPROC __glewVertexAttribI4bvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IEXTPROC __glewVertexAttribI4iEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IVEXTPROC __glewVertexAttribI4ivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4SVEXTPROC __glewVertexAttribI4svEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UBVEXTPROC __glewVertexAttribI4ubvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIEXTPROC __glewVertexAttribI4uiEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIVEXTPROC __glewVertexAttribI4uivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4USVEXTPROC __glewVertexAttribI4usvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIPOINTEREXTPROC __glewVertexAttribIPointerEXT; + +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMEXTPROC __glewGetHistogramEXT; +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERFVEXTPROC __glewGetHistogramParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERIVEXTPROC __glewGetHistogramParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETMINMAXEXTPROC __glewGetMinmaxEXT; +GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERFVEXTPROC __glewGetMinmaxParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERIVEXTPROC __glewGetMinmaxParameterivEXT; +GLEW_FUN_EXPORT PFNGLHISTOGRAMEXTPROC __glewHistogramEXT; +GLEW_FUN_EXPORT PFNGLMINMAXEXTPROC __glewMinmaxEXT; +GLEW_FUN_EXPORT PFNGLRESETHISTOGRAMEXTPROC __glewResetHistogramEXT; +GLEW_FUN_EXPORT PFNGLRESETMINMAXEXTPROC __glewResetMinmaxEXT; + +GLEW_FUN_EXPORT PFNGLINDEXFUNCEXTPROC __glewIndexFuncEXT; + +GLEW_FUN_EXPORT PFNGLINDEXMATERIALEXTPROC __glewIndexMaterialEXT; + +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISOREXTPROC __glewVertexAttribDivisorEXT; + +GLEW_FUN_EXPORT PFNGLAPPLYTEXTUREEXTPROC __glewApplyTextureEXT; +GLEW_FUN_EXPORT PFNGLTEXTURELIGHTEXTPROC __glewTextureLightEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREMATERIALEXTPROC __glewTextureMaterialEXT; + +GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDBUFFERRANGEEXTPROC __glewFlushMappedBufferRangeEXT; +GLEW_FUN_EXPORT PFNGLMAPBUFFERRANGEEXTPROC __glewMapBufferRangeEXT; + +GLEW_FUN_EXPORT PFNGLBUFFERSTORAGEMEMEXTPROC __glewBufferStorageMemEXT; +GLEW_FUN_EXPORT PFNGLCREATEMEMORYOBJECTSEXTPROC __glewCreateMemoryObjectsEXT; +GLEW_FUN_EXPORT PFNGLDELETEMEMORYOBJECTSEXTPROC __glewDeleteMemoryObjectsEXT; +GLEW_FUN_EXPORT PFNGLGETMEMORYOBJECTPARAMETERIVEXTPROC __glewGetMemoryObjectParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETUNSIGNEDBYTEI_VEXTPROC __glewGetUnsignedBytei_vEXT; +GLEW_FUN_EXPORT PFNGLGETUNSIGNEDBYTEVEXTPROC __glewGetUnsignedBytevEXT; +GLEW_FUN_EXPORT PFNGLISMEMORYOBJECTEXTPROC __glewIsMemoryObjectEXT; +GLEW_FUN_EXPORT PFNGLMEMORYOBJECTPARAMETERIVEXTPROC __glewMemoryObjectParameterivEXT; +GLEW_FUN_EXPORT PFNGLNAMEDBUFFERSTORAGEMEMEXTPROC __glewNamedBufferStorageMemEXT; +GLEW_FUN_EXPORT PFNGLTEXSTORAGEMEM1DEXTPROC __glewTexStorageMem1DEXT; +GLEW_FUN_EXPORT PFNGLTEXSTORAGEMEM2DEXTPROC __glewTexStorageMem2DEXT; +GLEW_FUN_EXPORT PFNGLTEXSTORAGEMEM2DMULTISAMPLEEXTPROC __glewTexStorageMem2DMultisampleEXT; +GLEW_FUN_EXPORT PFNGLTEXSTORAGEMEM3DEXTPROC __glewTexStorageMem3DEXT; +GLEW_FUN_EXPORT PFNGLTEXSTORAGEMEM3DMULTISAMPLEEXTPROC __glewTexStorageMem3DMultisampleEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGEMEM1DEXTPROC __glewTextureStorageMem1DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGEMEM2DEXTPROC __glewTextureStorageMem2DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGEMEM2DMULTISAMPLEEXTPROC __glewTextureStorageMem2DMultisampleEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGEMEM3DEXTPROC __glewTextureStorageMem3DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGEMEM3DMULTISAMPLEEXTPROC __glewTextureStorageMem3DMultisampleEXT; + +GLEW_FUN_EXPORT PFNGLIMPORTMEMORYFDEXTPROC __glewImportMemoryFdEXT; + +GLEW_FUN_EXPORT PFNGLIMPORTMEMORYWIN32HANDLEEXTPROC __glewImportMemoryWin32HandleEXT; +GLEW_FUN_EXPORT PFNGLIMPORTMEMORYWIN32NAMEEXTPROC __glewImportMemoryWin32NameEXT; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSEXTPROC __glewMultiDrawArraysEXT; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSEXTPROC __glewMultiDrawElementsEXT; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTEXTPROC __glewMultiDrawArraysIndirectEXT; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTEXTPROC __glewMultiDrawElementsIndirectEXT; + +GLEW_FUN_EXPORT PFNGLSAMPLEMASKEXTPROC __glewSampleMaskEXT; +GLEW_FUN_EXPORT PFNGLSAMPLEPATTERNEXTPROC __glewSamplePatternEXT; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC __glewFramebufferTexture2DMultisampleEXT; + +GLEW_FUN_EXPORT PFNGLDRAWBUFFERSINDEXEDEXTPROC __glewDrawBuffersIndexedEXT; +GLEW_FUN_EXPORT PFNGLGETINTEGERI_VEXTPROC __glewGetIntegeri_vEXT; +GLEW_FUN_EXPORT PFNGLREADBUFFERINDEXEDEXTPROC __glewReadBufferIndexedEXT; + +GLEW_FUN_EXPORT PFNGLCOLORTABLEEXTPROC __glewColorTableEXT; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEEXTPROC __glewGetColorTableEXT; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVEXTPROC __glewGetColorTableParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERIVEXTPROC __glewGetColorTableParameterivEXT; + +GLEW_FUN_EXPORT PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC __glewGetPixelTransformParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC __glewGetPixelTransformParameterivEXT; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERFEXTPROC __glewPixelTransformParameterfEXT; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC __glewPixelTransformParameterfvEXT; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERIEXTPROC __glewPixelTransformParameteriEXT; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC __glewPixelTransformParameterivEXT; + +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFEXTPROC __glewPointParameterfEXT; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVEXTPROC __glewPointParameterfvEXT; + +GLEW_FUN_EXPORT PFNGLPOLYGONOFFSETEXTPROC __glewPolygonOffsetEXT; + +GLEW_FUN_EXPORT PFNGLPOLYGONOFFSETCLAMPEXTPROC __glewPolygonOffsetClampEXT; + +GLEW_FUN_EXPORT PFNGLPROVOKINGVERTEXEXTPROC __glewProvokingVertexEXT; + +GLEW_FUN_EXPORT PFNGLCOVERAGEMODULATIONNVPROC __glewCoverageModulationNV; +GLEW_FUN_EXPORT PFNGLCOVERAGEMODULATIONTABLENVPROC __glewCoverageModulationTableNV; +GLEW_FUN_EXPORT PFNGLGETCOVERAGEMODULATIONTABLENVPROC __glewGetCoverageModulationTableNV; +GLEW_FUN_EXPORT PFNGLRASTERSAMPLESEXTPROC __glewRasterSamplesEXT; + +GLEW_FUN_EXPORT PFNGLBEGINSCENEEXTPROC __glewBeginSceneEXT; +GLEW_FUN_EXPORT PFNGLENDSCENEEXTPROC __glewEndSceneEXT; + +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BEXTPROC __glewSecondaryColor3bEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BVEXTPROC __glewSecondaryColor3bvEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DEXTPROC __glewSecondaryColor3dEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DVEXTPROC __glewSecondaryColor3dvEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FEXTPROC __glewSecondaryColor3fEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FVEXTPROC __glewSecondaryColor3fvEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IEXTPROC __glewSecondaryColor3iEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IVEXTPROC __glewSecondaryColor3ivEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SEXTPROC __glewSecondaryColor3sEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SVEXTPROC __glewSecondaryColor3svEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBEXTPROC __glewSecondaryColor3ubEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBVEXTPROC __glewSecondaryColor3ubvEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIEXTPROC __glewSecondaryColor3uiEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIVEXTPROC __glewSecondaryColor3uivEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USEXTPROC __glewSecondaryColor3usEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USVEXTPROC __glewSecondaryColor3usvEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTEREXTPROC __glewSecondaryColorPointerEXT; + +GLEW_FUN_EXPORT PFNGLDELETESEMAPHORESEXTPROC __glewDeleteSemaphoresEXT; +GLEW_FUN_EXPORT PFNGLGENSEMAPHORESEXTPROC __glewGenSemaphoresEXT; +GLEW_FUN_EXPORT PFNGLGETSEMAPHOREPARAMETERUI64VEXTPROC __glewGetSemaphoreParameterui64vEXT; +GLEW_FUN_EXPORT PFNGLISSEMAPHOREEXTPROC __glewIsSemaphoreEXT; +GLEW_FUN_EXPORT PFNGLSEMAPHOREPARAMETERUI64VEXTPROC __glewSemaphoreParameterui64vEXT; +GLEW_FUN_EXPORT PFNGLSIGNALSEMAPHOREEXTPROC __glewSignalSemaphoreEXT; +GLEW_FUN_EXPORT PFNGLWAITSEMAPHOREEXTPROC __glewWaitSemaphoreEXT; + +GLEW_FUN_EXPORT PFNGLIMPORTSEMAPHOREFDEXTPROC __glewImportSemaphoreFdEXT; + +GLEW_FUN_EXPORT PFNGLIMPORTSEMAPHOREWIN32HANDLEEXTPROC __glewImportSemaphoreWin32HandleEXT; +GLEW_FUN_EXPORT PFNGLIMPORTSEMAPHOREWIN32NAMEEXTPROC __glewImportSemaphoreWin32NameEXT; + +GLEW_FUN_EXPORT PFNGLACTIVEPROGRAMEXTPROC __glewActiveProgramEXT; +GLEW_FUN_EXPORT PFNGLCREATESHADERPROGRAMEXTPROC __glewCreateShaderProgramEXT; +GLEW_FUN_EXPORT PFNGLUSESHADERPROGRAMEXTPROC __glewUseShaderProgramEXT; + +GLEW_FUN_EXPORT PFNGLBINDIMAGETEXTUREEXTPROC __glewBindImageTextureEXT; +GLEW_FUN_EXPORT PFNGLMEMORYBARRIEREXTPROC __glewMemoryBarrierEXT; + +GLEW_FUN_EXPORT PFNGLCLEARPIXELLOCALSTORAGEUIEXTPROC __glewClearPixelLocalStorageuiEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERPIXELLOCALSTORAGESIZEEXTPROC __glewFramebufferPixelLocalStorageSizeEXT; +GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERPIXELLOCALSTORAGESIZEEXTPROC __glewGetFramebufferPixelLocalStorageSizeEXT; + +GLEW_FUN_EXPORT PFNGLTEXPAGECOMMITMENTEXTPROC __glewTexPageCommitmentEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPAGECOMMITMENTEXTPROC __glewTexturePageCommitmentEXT; + +GLEW_FUN_EXPORT PFNGLACTIVESTENCILFACEEXTPROC __glewActiveStencilFaceEXT; + +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE1DEXTPROC __glewTexSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE2DEXTPROC __glewTexSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE3DEXTPROC __glewTexSubImage3DEXT; + +GLEW_FUN_EXPORT PFNGLTEXIMAGE3DEXTPROC __glewTexImage3DEXT; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC __glewFramebufferTextureLayerEXT; + +GLEW_FUN_EXPORT PFNGLTEXBUFFEREXTPROC __glewTexBufferEXT; + +GLEW_FUN_EXPORT PFNGLCLEARCOLORIIEXTPROC __glewClearColorIiEXT; +GLEW_FUN_EXPORT PFNGLCLEARCOLORIUIEXTPROC __glewClearColorIuiEXT; +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIIVEXTPROC __glewGetTexParameterIivEXT; +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIUIVEXTPROC __glewGetTexParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLTEXPARAMETERIIVEXTPROC __glewTexParameterIivEXT; +GLEW_FUN_EXPORT PFNGLTEXPARAMETERIUIVEXTPROC __glewTexParameterIuivEXT; + +GLEW_FUN_EXPORT PFNGLARETEXTURESRESIDENTEXTPROC __glewAreTexturesResidentEXT; +GLEW_FUN_EXPORT PFNGLBINDTEXTUREEXTPROC __glewBindTextureEXT; +GLEW_FUN_EXPORT PFNGLDELETETEXTURESEXTPROC __glewDeleteTexturesEXT; +GLEW_FUN_EXPORT PFNGLGENTEXTURESEXTPROC __glewGenTexturesEXT; +GLEW_FUN_EXPORT PFNGLISTEXTUREEXTPROC __glewIsTextureEXT; +GLEW_FUN_EXPORT PFNGLPRIORITIZETEXTURESEXTPROC __glewPrioritizeTexturesEXT; + +GLEW_FUN_EXPORT PFNGLTEXTURENORMALEXTPROC __glewTextureNormalEXT; + +GLEW_FUN_EXPORT PFNGLTEXSTORAGE1DEXTPROC __glewTexStorage1DEXT; +GLEW_FUN_EXPORT PFNGLTEXSTORAGE2DEXTPROC __glewTexStorage2DEXT; +GLEW_FUN_EXPORT PFNGLTEXSTORAGE3DEXTPROC __glewTexStorage3DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE1DEXTPROC __glewTextureStorage1DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE2DEXTPROC __glewTextureStorage2DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE3DEXTPROC __glewTextureStorage3DEXT; + +GLEW_FUN_EXPORT PFNGLTEXTUREVIEWEXTPROC __glewTextureViewEXT; + +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTI64VEXTPROC __glewGetQueryObjecti64vEXT; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUI64VEXTPROC __glewGetQueryObjectui64vEXT; + +GLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKEXTPROC __glewBeginTransformFeedbackEXT; +GLEW_FUN_EXPORT PFNGLBINDBUFFERBASEEXTPROC __glewBindBufferBaseEXT; +GLEW_FUN_EXPORT PFNGLBINDBUFFEROFFSETEXTPROC __glewBindBufferOffsetEXT; +GLEW_FUN_EXPORT PFNGLBINDBUFFERRANGEEXTPROC __glewBindBufferRangeEXT; +GLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKEXTPROC __glewEndTransformFeedbackEXT; +GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC __glewGetTransformFeedbackVaryingEXT; +GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC __glewTransformFeedbackVaryingsEXT; + +GLEW_FUN_EXPORT PFNGLARRAYELEMENTEXTPROC __glewArrayElementEXT; +GLEW_FUN_EXPORT PFNGLCOLORPOINTEREXTPROC __glewColorPointerEXT; +GLEW_FUN_EXPORT PFNGLDRAWARRAYSEXTPROC __glewDrawArraysEXT; +GLEW_FUN_EXPORT PFNGLEDGEFLAGPOINTEREXTPROC __glewEdgeFlagPointerEXT; +GLEW_FUN_EXPORT PFNGLINDEXPOINTEREXTPROC __glewIndexPointerEXT; +GLEW_FUN_EXPORT PFNGLNORMALPOINTEREXTPROC __glewNormalPointerEXT; +GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTEREXTPROC __glewTexCoordPointerEXT; +GLEW_FUN_EXPORT PFNGLVERTEXPOINTEREXTPROC __glewVertexPointerEXT; + +GLEW_FUN_EXPORT PFNGLBINDARRAYSETEXTPROC __glewBindArraySetEXT; +GLEW_FUN_EXPORT PFNGLCREATEARRAYSETEXTPROC __glewCreateArraySetExt; +GLEW_FUN_EXPORT PFNGLDELETEARRAYSETSEXTPROC __glewDeleteArraySetsEXT; + +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLDVEXTPROC __glewGetVertexAttribLdvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC __glewVertexArrayVertexAttribLOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DEXTPROC __glewVertexAttribL1dEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DVEXTPROC __glewVertexAttribL1dvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DEXTPROC __glewVertexAttribL2dEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DVEXTPROC __glewVertexAttribL2dvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DEXTPROC __glewVertexAttribL3dEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DVEXTPROC __glewVertexAttribL3dvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DEXTPROC __glewVertexAttribL4dEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DVEXTPROC __glewVertexAttribL4dvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLPOINTEREXTPROC __glewVertexAttribLPointerEXT; + +GLEW_FUN_EXPORT PFNGLBEGINVERTEXSHADEREXTPROC __glewBeginVertexShaderEXT; +GLEW_FUN_EXPORT PFNGLBINDLIGHTPARAMETEREXTPROC __glewBindLightParameterEXT; +GLEW_FUN_EXPORT PFNGLBINDMATERIALPARAMETEREXTPROC __glewBindMaterialParameterEXT; +GLEW_FUN_EXPORT PFNGLBINDPARAMETEREXTPROC __glewBindParameterEXT; +GLEW_FUN_EXPORT PFNGLBINDTEXGENPARAMETEREXTPROC __glewBindTexGenParameterEXT; +GLEW_FUN_EXPORT PFNGLBINDTEXTUREUNITPARAMETEREXTPROC __glewBindTextureUnitParameterEXT; +GLEW_FUN_EXPORT PFNGLBINDVERTEXSHADEREXTPROC __glewBindVertexShaderEXT; +GLEW_FUN_EXPORT PFNGLDELETEVERTEXSHADEREXTPROC __glewDeleteVertexShaderEXT; +GLEW_FUN_EXPORT PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC __glewDisableVariantClientStateEXT; +GLEW_FUN_EXPORT PFNGLENABLEVARIANTCLIENTSTATEEXTPROC __glewEnableVariantClientStateEXT; +GLEW_FUN_EXPORT PFNGLENDVERTEXSHADEREXTPROC __glewEndVertexShaderEXT; +GLEW_FUN_EXPORT PFNGLEXTRACTCOMPONENTEXTPROC __glewExtractComponentEXT; +GLEW_FUN_EXPORT PFNGLGENSYMBOLSEXTPROC __glewGenSymbolsEXT; +GLEW_FUN_EXPORT PFNGLGENVERTEXSHADERSEXTPROC __glewGenVertexShadersEXT; +GLEW_FUN_EXPORT PFNGLGETINVARIANTBOOLEANVEXTPROC __glewGetInvariantBooleanvEXT; +GLEW_FUN_EXPORT PFNGLGETINVARIANTFLOATVEXTPROC __glewGetInvariantFloatvEXT; +GLEW_FUN_EXPORT PFNGLGETINVARIANTINTEGERVEXTPROC __glewGetInvariantIntegervEXT; +GLEW_FUN_EXPORT PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC __glewGetLocalConstantBooleanvEXT; +GLEW_FUN_EXPORT PFNGLGETLOCALCONSTANTFLOATVEXTPROC __glewGetLocalConstantFloatvEXT; +GLEW_FUN_EXPORT PFNGLGETLOCALCONSTANTINTEGERVEXTPROC __glewGetLocalConstantIntegervEXT; +GLEW_FUN_EXPORT PFNGLGETVARIANTBOOLEANVEXTPROC __glewGetVariantBooleanvEXT; +GLEW_FUN_EXPORT PFNGLGETVARIANTFLOATVEXTPROC __glewGetVariantFloatvEXT; +GLEW_FUN_EXPORT PFNGLGETVARIANTINTEGERVEXTPROC __glewGetVariantIntegervEXT; +GLEW_FUN_EXPORT PFNGLGETVARIANTPOINTERVEXTPROC __glewGetVariantPointervEXT; +GLEW_FUN_EXPORT PFNGLINSERTCOMPONENTEXTPROC __glewInsertComponentEXT; +GLEW_FUN_EXPORT PFNGLISVARIANTENABLEDEXTPROC __glewIsVariantEnabledEXT; +GLEW_FUN_EXPORT PFNGLSETINVARIANTEXTPROC __glewSetInvariantEXT; +GLEW_FUN_EXPORT PFNGLSETLOCALCONSTANTEXTPROC __glewSetLocalConstantEXT; +GLEW_FUN_EXPORT PFNGLSHADEROP1EXTPROC __glewShaderOp1EXT; +GLEW_FUN_EXPORT PFNGLSHADEROP2EXTPROC __glewShaderOp2EXT; +GLEW_FUN_EXPORT PFNGLSHADEROP3EXTPROC __glewShaderOp3EXT; +GLEW_FUN_EXPORT PFNGLSWIZZLEEXTPROC __glewSwizzleEXT; +GLEW_FUN_EXPORT PFNGLVARIANTPOINTEREXTPROC __glewVariantPointerEXT; +GLEW_FUN_EXPORT PFNGLVARIANTBVEXTPROC __glewVariantbvEXT; +GLEW_FUN_EXPORT PFNGLVARIANTDVEXTPROC __glewVariantdvEXT; +GLEW_FUN_EXPORT PFNGLVARIANTFVEXTPROC __glewVariantfvEXT; +GLEW_FUN_EXPORT PFNGLVARIANTIVEXTPROC __glewVariantivEXT; +GLEW_FUN_EXPORT PFNGLVARIANTSVEXTPROC __glewVariantsvEXT; +GLEW_FUN_EXPORT PFNGLVARIANTUBVEXTPROC __glewVariantubvEXT; +GLEW_FUN_EXPORT PFNGLVARIANTUIVEXTPROC __glewVariantuivEXT; +GLEW_FUN_EXPORT PFNGLVARIANTUSVEXTPROC __glewVariantusvEXT; +GLEW_FUN_EXPORT PFNGLWRITEMASKEXTPROC __glewWriteMaskEXT; + +GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTPOINTEREXTPROC __glewVertexWeightPointerEXT; +GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTFEXTPROC __glewVertexWeightfEXT; +GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTFVEXTPROC __glewVertexWeightfvEXT; + +GLEW_FUN_EXPORT PFNGLACQUIREKEYEDMUTEXWIN32EXTPROC __glewAcquireKeyedMutexWin32EXT; +GLEW_FUN_EXPORT PFNGLRELEASEKEYEDMUTEXWIN32EXTPROC __glewReleaseKeyedMutexWin32EXT; + +GLEW_FUN_EXPORT PFNGLWINDOWRECTANGLESEXTPROC __glewWindowRectanglesEXT; + +GLEW_FUN_EXPORT PFNGLIMPORTSYNCEXTPROC __glewImportSyncEXT; + +GLEW_FUN_EXPORT PFNGLFRAMETERMINATORGREMEDYPROC __glewFrameTerminatorGREMEDY; + +GLEW_FUN_EXPORT PFNGLSTRINGMARKERGREMEDYPROC __glewStringMarkerGREMEDY; + +GLEW_FUN_EXPORT PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC __glewGetImageTransformParameterfvHP; +GLEW_FUN_EXPORT PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC __glewGetImageTransformParameterivHP; +GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERFHPPROC __glewImageTransformParameterfHP; +GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERFVHPPROC __glewImageTransformParameterfvHP; +GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERIHPPROC __glewImageTransformParameteriHP; +GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERIVHPPROC __glewImageTransformParameterivHP; + +GLEW_FUN_EXPORT PFNGLMULTIMODEDRAWARRAYSIBMPROC __glewMultiModeDrawArraysIBM; +GLEW_FUN_EXPORT PFNGLMULTIMODEDRAWELEMENTSIBMPROC __glewMultiModeDrawElementsIBM; + +GLEW_FUN_EXPORT PFNGLCOLORPOINTERLISTIBMPROC __glewColorPointerListIBM; +GLEW_FUN_EXPORT PFNGLEDGEFLAGPOINTERLISTIBMPROC __glewEdgeFlagPointerListIBM; +GLEW_FUN_EXPORT PFNGLFOGCOORDPOINTERLISTIBMPROC __glewFogCoordPointerListIBM; +GLEW_FUN_EXPORT PFNGLINDEXPOINTERLISTIBMPROC __glewIndexPointerListIBM; +GLEW_FUN_EXPORT PFNGLNORMALPOINTERLISTIBMPROC __glewNormalPointerListIBM; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTERLISTIBMPROC __glewSecondaryColorPointerListIBM; +GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTERLISTIBMPROC __glewTexCoordPointerListIBM; +GLEW_FUN_EXPORT PFNGLVERTEXPOINTERLISTIBMPROC __glewVertexPointerListIBM; + +GLEW_FUN_EXPORT PFNGLMAPTEXTURE2DINTELPROC __glewMapTexture2DINTEL; +GLEW_FUN_EXPORT PFNGLSYNCTEXTUREINTELPROC __glewSyncTextureINTEL; +GLEW_FUN_EXPORT PFNGLUNMAPTEXTURE2DINTELPROC __glewUnmapTexture2DINTEL; + +GLEW_FUN_EXPORT PFNGLCOLORPOINTERVINTELPROC __glewColorPointervINTEL; +GLEW_FUN_EXPORT PFNGLNORMALPOINTERVINTELPROC __glewNormalPointervINTEL; +GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTERVINTELPROC __glewTexCoordPointervINTEL; +GLEW_FUN_EXPORT PFNGLVERTEXPOINTERVINTELPROC __glewVertexPointervINTEL; + +GLEW_FUN_EXPORT PFNGLBEGINPERFQUERYINTELPROC __glewBeginPerfQueryINTEL; +GLEW_FUN_EXPORT PFNGLCREATEPERFQUERYINTELPROC __glewCreatePerfQueryINTEL; +GLEW_FUN_EXPORT PFNGLDELETEPERFQUERYINTELPROC __glewDeletePerfQueryINTEL; +GLEW_FUN_EXPORT PFNGLENDPERFQUERYINTELPROC __glewEndPerfQueryINTEL; +GLEW_FUN_EXPORT PFNGLGETFIRSTPERFQUERYIDINTELPROC __glewGetFirstPerfQueryIdINTEL; +GLEW_FUN_EXPORT PFNGLGETNEXTPERFQUERYIDINTELPROC __glewGetNextPerfQueryIdINTEL; +GLEW_FUN_EXPORT PFNGLGETPERFCOUNTERINFOINTELPROC __glewGetPerfCounterInfoINTEL; +GLEW_FUN_EXPORT PFNGLGETPERFQUERYDATAINTELPROC __glewGetPerfQueryDataINTEL; +GLEW_FUN_EXPORT PFNGLGETPERFQUERYIDBYNAMEINTELPROC __glewGetPerfQueryIdByNameINTEL; +GLEW_FUN_EXPORT PFNGLGETPERFQUERYINFOINTELPROC __glewGetPerfQueryInfoINTEL; + +GLEW_FUN_EXPORT PFNGLTEXSCISSORFUNCINTELPROC __glewTexScissorFuncINTEL; +GLEW_FUN_EXPORT PFNGLTEXSCISSORINTELPROC __glewTexScissorINTEL; + +GLEW_FUN_EXPORT PFNGLBLENDBARRIERKHRPROC __glewBlendBarrierKHR; + +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECALLBACKPROC __glewDebugMessageCallback; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECONTROLPROC __glewDebugMessageControl; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEINSERTPROC __glewDebugMessageInsert; +GLEW_FUN_EXPORT PFNGLGETDEBUGMESSAGELOGPROC __glewGetDebugMessageLog; +GLEW_FUN_EXPORT PFNGLGETOBJECTLABELPROC __glewGetObjectLabel; +GLEW_FUN_EXPORT PFNGLGETOBJECTPTRLABELPROC __glewGetObjectPtrLabel; +GLEW_FUN_EXPORT PFNGLOBJECTLABELPROC __glewObjectLabel; +GLEW_FUN_EXPORT PFNGLOBJECTPTRLABELPROC __glewObjectPtrLabel; +GLEW_FUN_EXPORT PFNGLPOPDEBUGGROUPPROC __glewPopDebugGroup; +GLEW_FUN_EXPORT PFNGLPUSHDEBUGGROUPPROC __glewPushDebugGroup; + +GLEW_FUN_EXPORT PFNGLMAXSHADERCOMPILERTHREADSKHRPROC __glewMaxShaderCompilerThreadsKHR; + +GLEW_FUN_EXPORT PFNGLGETNUNIFORMFVPROC __glewGetnUniformfv; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMIVPROC __glewGetnUniformiv; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMUIVPROC __glewGetnUniformuiv; +GLEW_FUN_EXPORT PFNGLREADNPIXELSPROC __glewReadnPixels; + +GLEW_FUN_EXPORT PFNGLBUFFERREGIONENABLEDPROC __glewBufferRegionEnabled; +GLEW_FUN_EXPORT PFNGLDELETEBUFFERREGIONPROC __glewDeleteBufferRegion; +GLEW_FUN_EXPORT PFNGLDRAWBUFFERREGIONPROC __glewDrawBufferRegion; +GLEW_FUN_EXPORT PFNGLNEWBUFFERREGIONPROC __glewNewBufferRegion; +GLEW_FUN_EXPORT PFNGLREADBUFFERREGIONPROC __glewReadBufferRegion; + +GLEW_FUN_EXPORT PFNGLRESIZEBUFFERSMESAPROC __glewResizeBuffersMESA; + +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DMESAPROC __glewWindowPos2dMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DVMESAPROC __glewWindowPos2dvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FMESAPROC __glewWindowPos2fMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FVMESAPROC __glewWindowPos2fvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IMESAPROC __glewWindowPos2iMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IVMESAPROC __glewWindowPos2ivMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SMESAPROC __glewWindowPos2sMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SVMESAPROC __glewWindowPos2svMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DMESAPROC __glewWindowPos3dMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DVMESAPROC __glewWindowPos3dvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FMESAPROC __glewWindowPos3fMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FVMESAPROC __glewWindowPos3fvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IMESAPROC __glewWindowPos3iMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IVMESAPROC __glewWindowPos3ivMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SMESAPROC __glewWindowPos3sMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SVMESAPROC __glewWindowPos3svMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4DMESAPROC __glewWindowPos4dMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4DVMESAPROC __glewWindowPos4dvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4FMESAPROC __glewWindowPos4fMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4FVMESAPROC __glewWindowPos4fvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4IMESAPROC __glewWindowPos4iMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4IVMESAPROC __glewWindowPos4ivMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4SMESAPROC __glewWindowPos4sMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4SVMESAPROC __glewWindowPos4svMESA; + +GLEW_FUN_EXPORT PFNGLBEGINCONDITIONALRENDERNVXPROC __glewBeginConditionalRenderNVX; +GLEW_FUN_EXPORT PFNGLENDCONDITIONALRENDERNVXPROC __glewEndConditionalRenderNVX; + +GLEW_FUN_EXPORT PFNGLLGPUCOPYIMAGESUBDATANVXPROC __glewLGPUCopyImageSubDataNVX; +GLEW_FUN_EXPORT PFNGLLGPUINTERLOCKNVXPROC __glewLGPUInterlockNVX; +GLEW_FUN_EXPORT PFNGLLGPUNAMEDBUFFERSUBDATANVXPROC __glewLGPUNamedBufferSubDataNVX; + +GLEW_FUN_EXPORT PFNGLSTEREOPARAMETERFNVPROC __glewStereoParameterfNV; +GLEW_FUN_EXPORT PFNGLSTEREOPARAMETERINVPROC __glewStereoParameteriNV; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC __glewMultiDrawArraysIndirectBindlessNV; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC __glewMultiDrawElementsIndirectBindlessNV; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSCOUNTNVPROC __glewMultiDrawArraysIndirectBindlessCountNV; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSCOUNTNVPROC __glewMultiDrawElementsIndirectBindlessCountNV; + +GLEW_FUN_EXPORT PFNGLGETIMAGEHANDLENVPROC __glewGetImageHandleNV; +GLEW_FUN_EXPORT PFNGLGETTEXTUREHANDLENVPROC __glewGetTextureHandleNV; +GLEW_FUN_EXPORT PFNGLGETTEXTURESAMPLERHANDLENVPROC __glewGetTextureSamplerHandleNV; +GLEW_FUN_EXPORT PFNGLISIMAGEHANDLERESIDENTNVPROC __glewIsImageHandleResidentNV; +GLEW_FUN_EXPORT PFNGLISTEXTUREHANDLERESIDENTNVPROC __glewIsTextureHandleResidentNV; +GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC __glewMakeImageHandleNonResidentNV; +GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLERESIDENTNVPROC __glewMakeImageHandleResidentNV; +GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC __glewMakeTextureHandleNonResidentNV; +GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLERESIDENTNVPROC __glewMakeTextureHandleResidentNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC __glewProgramUniformHandleui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC __glewProgramUniformHandleui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64NVPROC __glewUniformHandleui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64VNVPROC __glewUniformHandleui64vNV; + +GLEW_FUN_EXPORT PFNGLBLENDBARRIERNVPROC __glewBlendBarrierNV; +GLEW_FUN_EXPORT PFNGLBLENDPARAMETERINVPROC __glewBlendParameteriNV; + +GLEW_FUN_EXPORT PFNGLVIEWPORTPOSITIONWSCALENVPROC __glewViewportPositionWScaleNV; + +GLEW_FUN_EXPORT PFNGLCALLCOMMANDLISTNVPROC __glewCallCommandListNV; +GLEW_FUN_EXPORT PFNGLCOMMANDLISTSEGMENTSNVPROC __glewCommandListSegmentsNV; +GLEW_FUN_EXPORT PFNGLCOMPILECOMMANDLISTNVPROC __glewCompileCommandListNV; +GLEW_FUN_EXPORT PFNGLCREATECOMMANDLISTSNVPROC __glewCreateCommandListsNV; +GLEW_FUN_EXPORT PFNGLCREATESTATESNVPROC __glewCreateStatesNV; +GLEW_FUN_EXPORT PFNGLDELETECOMMANDLISTSNVPROC __glewDeleteCommandListsNV; +GLEW_FUN_EXPORT PFNGLDELETESTATESNVPROC __glewDeleteStatesNV; +GLEW_FUN_EXPORT PFNGLDRAWCOMMANDSADDRESSNVPROC __glewDrawCommandsAddressNV; +GLEW_FUN_EXPORT PFNGLDRAWCOMMANDSNVPROC __glewDrawCommandsNV; +GLEW_FUN_EXPORT PFNGLDRAWCOMMANDSSTATESADDRESSNVPROC __glewDrawCommandsStatesAddressNV; +GLEW_FUN_EXPORT PFNGLDRAWCOMMANDSSTATESNVPROC __glewDrawCommandsStatesNV; +GLEW_FUN_EXPORT PFNGLGETCOMMANDHEADERNVPROC __glewGetCommandHeaderNV; +GLEW_FUN_EXPORT PFNGLGETSTAGEINDEXNVPROC __glewGetStageIndexNV; +GLEW_FUN_EXPORT PFNGLISCOMMANDLISTNVPROC __glewIsCommandListNV; +GLEW_FUN_EXPORT PFNGLISSTATENVPROC __glewIsStateNV; +GLEW_FUN_EXPORT PFNGLLISTDRAWCOMMANDSSTATESCLIENTNVPROC __glewListDrawCommandsStatesClientNV; +GLEW_FUN_EXPORT PFNGLSTATECAPTURENVPROC __glewStateCaptureNV; + +GLEW_FUN_EXPORT PFNGLBEGINCONDITIONALRENDERNVPROC __glewBeginConditionalRenderNV; +GLEW_FUN_EXPORT PFNGLENDCONDITIONALRENDERNVPROC __glewEndConditionalRenderNV; + +GLEW_FUN_EXPORT PFNGLSUBPIXELPRECISIONBIASNVPROC __glewSubpixelPrecisionBiasNV; + +GLEW_FUN_EXPORT PFNGLCONSERVATIVERASTERPARAMETERFNVPROC __glewConservativeRasterParameterfNV; + +GLEW_FUN_EXPORT PFNGLCONSERVATIVERASTERPARAMETERINVPROC __glewConservativeRasterParameteriNV; + +GLEW_FUN_EXPORT PFNGLCOPYBUFFERSUBDATANVPROC __glewCopyBufferSubDataNV; + +GLEW_FUN_EXPORT PFNGLCOPYIMAGESUBDATANVPROC __glewCopyImageSubDataNV; + +GLEW_FUN_EXPORT PFNGLCLEARDEPTHDNVPROC __glewClearDepthdNV; +GLEW_FUN_EXPORT PFNGLDEPTHBOUNDSDNVPROC __glewDepthBoundsdNV; +GLEW_FUN_EXPORT PFNGLDEPTHRANGEDNVPROC __glewDepthRangedNV; + +GLEW_FUN_EXPORT PFNGLDRAWBUFFERSNVPROC __glewDrawBuffersNV; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDNVPROC __glewDrawArraysInstancedNV; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDNVPROC __glewDrawElementsInstancedNV; + +GLEW_FUN_EXPORT PFNGLDRAWTEXTURENVPROC __glewDrawTextureNV; + +GLEW_FUN_EXPORT PFNGLDRAWVKIMAGENVPROC __glewDrawVkImageNV; +GLEW_FUN_EXPORT PFNGLGETVKPROCADDRNVPROC __glewGetVkProcAddrNV; +GLEW_FUN_EXPORT PFNGLSIGNALVKFENCENVPROC __glewSignalVkFenceNV; +GLEW_FUN_EXPORT PFNGLSIGNALVKSEMAPHORENVPROC __glewSignalVkSemaphoreNV; +GLEW_FUN_EXPORT PFNGLWAITVKSEMAPHORENVPROC __glewWaitVkSemaphoreNV; + +GLEW_FUN_EXPORT PFNGLEVALMAPSNVPROC __glewEvalMapsNV; +GLEW_FUN_EXPORT PFNGLGETMAPATTRIBPARAMETERFVNVPROC __glewGetMapAttribParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETMAPATTRIBPARAMETERIVNVPROC __glewGetMapAttribParameterivNV; +GLEW_FUN_EXPORT PFNGLGETMAPCONTROLPOINTSNVPROC __glewGetMapControlPointsNV; +GLEW_FUN_EXPORT PFNGLGETMAPPARAMETERFVNVPROC __glewGetMapParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETMAPPARAMETERIVNVPROC __glewGetMapParameterivNV; +GLEW_FUN_EXPORT PFNGLMAPCONTROLPOINTSNVPROC __glewMapControlPointsNV; +GLEW_FUN_EXPORT PFNGLMAPPARAMETERFVNVPROC __glewMapParameterfvNV; +GLEW_FUN_EXPORT PFNGLMAPPARAMETERIVNVPROC __glewMapParameterivNV; + +GLEW_FUN_EXPORT PFNGLGETMULTISAMPLEFVNVPROC __glewGetMultisamplefvNV; +GLEW_FUN_EXPORT PFNGLSAMPLEMASKINDEXEDNVPROC __glewSampleMaskIndexedNV; +GLEW_FUN_EXPORT PFNGLTEXRENDERBUFFERNVPROC __glewTexRenderbufferNV; + +GLEW_FUN_EXPORT PFNGLDELETEFENCESNVPROC __glewDeleteFencesNV; +GLEW_FUN_EXPORT PFNGLFINISHFENCENVPROC __glewFinishFenceNV; +GLEW_FUN_EXPORT PFNGLGENFENCESNVPROC __glewGenFencesNV; +GLEW_FUN_EXPORT PFNGLGETFENCEIVNVPROC __glewGetFenceivNV; +GLEW_FUN_EXPORT PFNGLISFENCENVPROC __glewIsFenceNV; +GLEW_FUN_EXPORT PFNGLSETFENCENVPROC __glewSetFenceNV; +GLEW_FUN_EXPORT PFNGLTESTFENCENVPROC __glewTestFenceNV; + +GLEW_FUN_EXPORT PFNGLFRAGMENTCOVERAGECOLORNVPROC __glewFragmentCoverageColorNV; + +GLEW_FUN_EXPORT PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC __glewGetProgramNamedParameterdvNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC __glewGetProgramNamedParameterfvNV; +GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4DNVPROC __glewProgramNamedParameter4dNV; +GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC __glewProgramNamedParameter4dvNV; +GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4FNVPROC __glewProgramNamedParameter4fNV; +GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC __glewProgramNamedParameter4fvNV; + +GLEW_FUN_EXPORT PFNGLBLITFRAMEBUFFERNVPROC __glewBlitFramebufferNV; + +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLENVPROC __glewRenderbufferStorageMultisampleNV; + +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC __glewRenderbufferStorageMultisampleCoverageNV; + +GLEW_FUN_EXPORT PFNGLPROGRAMVERTEXLIMITNVPROC __glewProgramVertexLimitNV; + +GLEW_FUN_EXPORT PFNGLMULTICASTBARRIERNVPROC __glewMulticastBarrierNV; +GLEW_FUN_EXPORT PFNGLMULTICASTBLITFRAMEBUFFERNVPROC __glewMulticastBlitFramebufferNV; +GLEW_FUN_EXPORT PFNGLMULTICASTBUFFERSUBDATANVPROC __glewMulticastBufferSubDataNV; +GLEW_FUN_EXPORT PFNGLMULTICASTCOPYBUFFERSUBDATANVPROC __glewMulticastCopyBufferSubDataNV; +GLEW_FUN_EXPORT PFNGLMULTICASTCOPYIMAGESUBDATANVPROC __glewMulticastCopyImageSubDataNV; +GLEW_FUN_EXPORT PFNGLMULTICASTFRAMEBUFFERSAMPLELOCATIONSFVNVPROC __glewMulticastFramebufferSampleLocationsfvNV; +GLEW_FUN_EXPORT PFNGLMULTICASTGETQUERYOBJECTI64VNVPROC __glewMulticastGetQueryObjecti64vNV; +GLEW_FUN_EXPORT PFNGLMULTICASTGETQUERYOBJECTIVNVPROC __glewMulticastGetQueryObjectivNV; +GLEW_FUN_EXPORT PFNGLMULTICASTGETQUERYOBJECTUI64VNVPROC __glewMulticastGetQueryObjectui64vNV; +GLEW_FUN_EXPORT PFNGLMULTICASTGETQUERYOBJECTUIVNVPROC __glewMulticastGetQueryObjectuivNV; +GLEW_FUN_EXPORT PFNGLMULTICASTWAITSYNCNVPROC __glewMulticastWaitSyncNV; +GLEW_FUN_EXPORT PFNGLRENDERGPUMASKNVPROC __glewRenderGpuMaskNV; + +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4INVPROC __glewProgramEnvParameterI4iNV; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4IVNVPROC __glewProgramEnvParameterI4ivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4UINVPROC __glewProgramEnvParameterI4uiNV; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4UIVNVPROC __glewProgramEnvParameterI4uivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERSI4IVNVPROC __glewProgramEnvParametersI4ivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC __glewProgramEnvParametersI4uivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4INVPROC __glewProgramLocalParameterI4iNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC __glewProgramLocalParameterI4ivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4UINVPROC __glewProgramLocalParameterI4uiNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC __glewProgramLocalParameterI4uivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC __glewProgramLocalParametersI4ivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC __glewProgramLocalParametersI4uivNV; + +GLEW_FUN_EXPORT PFNGLGETUNIFORMI64VNVPROC __glewGetUniformi64vNV; +GLEW_FUN_EXPORT PFNGLGETUNIFORMUI64VNVPROC __glewGetUniformui64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1I64NVPROC __glewProgramUniform1i64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1I64VNVPROC __glewProgramUniform1i64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UI64NVPROC __glewProgramUniform1ui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UI64VNVPROC __glewProgramUniform1ui64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2I64NVPROC __glewProgramUniform2i64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2I64VNVPROC __glewProgramUniform2i64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UI64NVPROC __glewProgramUniform2ui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UI64VNVPROC __glewProgramUniform2ui64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3I64NVPROC __glewProgramUniform3i64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3I64VNVPROC __glewProgramUniform3i64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UI64NVPROC __glewProgramUniform3ui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UI64VNVPROC __glewProgramUniform3ui64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4I64NVPROC __glewProgramUniform4i64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4I64VNVPROC __glewProgramUniform4i64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UI64NVPROC __glewProgramUniform4ui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UI64VNVPROC __glewProgramUniform4ui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM1I64NVPROC __glewUniform1i64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM1I64VNVPROC __glewUniform1i64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM1UI64NVPROC __glewUniform1ui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM1UI64VNVPROC __glewUniform1ui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM2I64NVPROC __glewUniform2i64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM2I64VNVPROC __glewUniform2i64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM2UI64NVPROC __glewUniform2ui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM2UI64VNVPROC __glewUniform2ui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM3I64NVPROC __glewUniform3i64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM3I64VNVPROC __glewUniform3i64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM3UI64NVPROC __glewUniform3ui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM3UI64VNVPROC __glewUniform3ui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM4I64NVPROC __glewUniform4i64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM4I64VNVPROC __glewUniform4i64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM4UI64NVPROC __glewUniform4ui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM4UI64VNVPROC __glewUniform4ui64vNV; + +GLEW_FUN_EXPORT PFNGLCOLOR3HNVPROC __glewColor3hNV; +GLEW_FUN_EXPORT PFNGLCOLOR3HVNVPROC __glewColor3hvNV; +GLEW_FUN_EXPORT PFNGLCOLOR4HNVPROC __glewColor4hNV; +GLEW_FUN_EXPORT PFNGLCOLOR4HVNVPROC __glewColor4hvNV; +GLEW_FUN_EXPORT PFNGLFOGCOORDHNVPROC __glewFogCoordhNV; +GLEW_FUN_EXPORT PFNGLFOGCOORDHVNVPROC __glewFogCoordhvNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1HNVPROC __glewMultiTexCoord1hNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1HVNVPROC __glewMultiTexCoord1hvNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2HNVPROC __glewMultiTexCoord2hNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2HVNVPROC __glewMultiTexCoord2hvNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3HNVPROC __glewMultiTexCoord3hNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3HVNVPROC __glewMultiTexCoord3hvNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4HNVPROC __glewMultiTexCoord4hNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4HVNVPROC __glewMultiTexCoord4hvNV; +GLEW_FUN_EXPORT PFNGLNORMAL3HNVPROC __glewNormal3hNV; +GLEW_FUN_EXPORT PFNGLNORMAL3HVNVPROC __glewNormal3hvNV; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3HNVPROC __glewSecondaryColor3hNV; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3HVNVPROC __glewSecondaryColor3hvNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD1HNVPROC __glewTexCoord1hNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD1HVNVPROC __glewTexCoord1hvNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD2HNVPROC __glewTexCoord2hNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD2HVNVPROC __glewTexCoord2hvNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD3HNVPROC __glewTexCoord3hNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD3HVNVPROC __glewTexCoord3hvNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD4HNVPROC __glewTexCoord4hNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD4HVNVPROC __glewTexCoord4hvNV; +GLEW_FUN_EXPORT PFNGLVERTEX2HNVPROC __glewVertex2hNV; +GLEW_FUN_EXPORT PFNGLVERTEX2HVNVPROC __glewVertex2hvNV; +GLEW_FUN_EXPORT PFNGLVERTEX3HNVPROC __glewVertex3hNV; +GLEW_FUN_EXPORT PFNGLVERTEX3HVNVPROC __glewVertex3hvNV; +GLEW_FUN_EXPORT PFNGLVERTEX4HNVPROC __glewVertex4hNV; +GLEW_FUN_EXPORT PFNGLVERTEX4HVNVPROC __glewVertex4hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1HNVPROC __glewVertexAttrib1hNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1HVNVPROC __glewVertexAttrib1hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2HNVPROC __glewVertexAttrib2hNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2HVNVPROC __glewVertexAttrib2hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3HNVPROC __glewVertexAttrib3hNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3HVNVPROC __glewVertexAttrib3hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4HNVPROC __glewVertexAttrib4hNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4HVNVPROC __glewVertexAttrib4hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1HVNVPROC __glewVertexAttribs1hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2HVNVPROC __glewVertexAttribs2hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3HVNVPROC __glewVertexAttribs3hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4HVNVPROC __glewVertexAttribs4hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTHNVPROC __glewVertexWeighthNV; +GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTHVNVPROC __glewVertexWeighthvNV; + +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORNVPROC __glewVertexAttribDivisorNV; + +GLEW_FUN_EXPORT PFNGLGETINTERNALFORMATSAMPLEIVNVPROC __glewGetInternalformatSampleivNV; + +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X3FVNVPROC __glewUniformMatrix2x3fvNV; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X4FVNVPROC __glewUniformMatrix2x4fvNV; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X2FVNVPROC __glewUniformMatrix3x2fvNV; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X4FVNVPROC __glewUniformMatrix3x4fvNV; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X2FVNVPROC __glewUniformMatrix4x2fvNV; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X3FVNVPROC __glewUniformMatrix4x3fvNV; + +GLEW_FUN_EXPORT PFNGLBEGINOCCLUSIONQUERYNVPROC __glewBeginOcclusionQueryNV; +GLEW_FUN_EXPORT PFNGLDELETEOCCLUSIONQUERIESNVPROC __glewDeleteOcclusionQueriesNV; +GLEW_FUN_EXPORT PFNGLENDOCCLUSIONQUERYNVPROC __glewEndOcclusionQueryNV; +GLEW_FUN_EXPORT PFNGLGENOCCLUSIONQUERIESNVPROC __glewGenOcclusionQueriesNV; +GLEW_FUN_EXPORT PFNGLGETOCCLUSIONQUERYIVNVPROC __glewGetOcclusionQueryivNV; +GLEW_FUN_EXPORT PFNGLGETOCCLUSIONQUERYUIVNVPROC __glewGetOcclusionQueryuivNV; +GLEW_FUN_EXPORT PFNGLISOCCLUSIONQUERYNVPROC __glewIsOcclusionQueryNV; + +GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC __glewProgramBufferParametersIivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC __glewProgramBufferParametersIuivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC __glewProgramBufferParametersfvNV; + +GLEW_FUN_EXPORT PFNGLCOPYPATHNVPROC __glewCopyPathNV; +GLEW_FUN_EXPORT PFNGLCOVERFILLPATHINSTANCEDNVPROC __glewCoverFillPathInstancedNV; +GLEW_FUN_EXPORT PFNGLCOVERFILLPATHNVPROC __glewCoverFillPathNV; +GLEW_FUN_EXPORT PFNGLCOVERSTROKEPATHINSTANCEDNVPROC __glewCoverStrokePathInstancedNV; +GLEW_FUN_EXPORT PFNGLCOVERSTROKEPATHNVPROC __glewCoverStrokePathNV; +GLEW_FUN_EXPORT PFNGLDELETEPATHSNVPROC __glewDeletePathsNV; +GLEW_FUN_EXPORT PFNGLGENPATHSNVPROC __glewGenPathsNV; +GLEW_FUN_EXPORT PFNGLGETPATHCOLORGENFVNVPROC __glewGetPathColorGenfvNV; +GLEW_FUN_EXPORT PFNGLGETPATHCOLORGENIVNVPROC __glewGetPathColorGenivNV; +GLEW_FUN_EXPORT PFNGLGETPATHCOMMANDSNVPROC __glewGetPathCommandsNV; +GLEW_FUN_EXPORT PFNGLGETPATHCOORDSNVPROC __glewGetPathCoordsNV; +GLEW_FUN_EXPORT PFNGLGETPATHDASHARRAYNVPROC __glewGetPathDashArrayNV; +GLEW_FUN_EXPORT PFNGLGETPATHLENGTHNVPROC __glewGetPathLengthNV; +GLEW_FUN_EXPORT PFNGLGETPATHMETRICRANGENVPROC __glewGetPathMetricRangeNV; +GLEW_FUN_EXPORT PFNGLGETPATHMETRICSNVPROC __glewGetPathMetricsNV; +GLEW_FUN_EXPORT PFNGLGETPATHPARAMETERFVNVPROC __glewGetPathParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETPATHPARAMETERIVNVPROC __glewGetPathParameterivNV; +GLEW_FUN_EXPORT PFNGLGETPATHSPACINGNVPROC __glewGetPathSpacingNV; +GLEW_FUN_EXPORT PFNGLGETPATHTEXGENFVNVPROC __glewGetPathTexGenfvNV; +GLEW_FUN_EXPORT PFNGLGETPATHTEXGENIVNVPROC __glewGetPathTexGenivNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCEFVNVPROC __glewGetProgramResourcefvNV; +GLEW_FUN_EXPORT PFNGLINTERPOLATEPATHSNVPROC __glewInterpolatePathsNV; +GLEW_FUN_EXPORT PFNGLISPATHNVPROC __glewIsPathNV; +GLEW_FUN_EXPORT PFNGLISPOINTINFILLPATHNVPROC __glewIsPointInFillPathNV; +GLEW_FUN_EXPORT PFNGLISPOINTINSTROKEPATHNVPROC __glewIsPointInStrokePathNV; +GLEW_FUN_EXPORT PFNGLMATRIXLOAD3X2FNVPROC __glewMatrixLoad3x2fNV; +GLEW_FUN_EXPORT PFNGLMATRIXLOAD3X3FNVPROC __glewMatrixLoad3x3fNV; +GLEW_FUN_EXPORT PFNGLMATRIXLOADTRANSPOSE3X3FNVPROC __glewMatrixLoadTranspose3x3fNV; +GLEW_FUN_EXPORT PFNGLMATRIXMULT3X2FNVPROC __glewMatrixMult3x2fNV; +GLEW_FUN_EXPORT PFNGLMATRIXMULT3X3FNVPROC __glewMatrixMult3x3fNV; +GLEW_FUN_EXPORT PFNGLMATRIXMULTTRANSPOSE3X3FNVPROC __glewMatrixMultTranspose3x3fNV; +GLEW_FUN_EXPORT PFNGLPATHCOLORGENNVPROC __glewPathColorGenNV; +GLEW_FUN_EXPORT PFNGLPATHCOMMANDSNVPROC __glewPathCommandsNV; +GLEW_FUN_EXPORT PFNGLPATHCOORDSNVPROC __glewPathCoordsNV; +GLEW_FUN_EXPORT PFNGLPATHCOVERDEPTHFUNCNVPROC __glewPathCoverDepthFuncNV; +GLEW_FUN_EXPORT PFNGLPATHDASHARRAYNVPROC __glewPathDashArrayNV; +GLEW_FUN_EXPORT PFNGLPATHFOGGENNVPROC __glewPathFogGenNV; +GLEW_FUN_EXPORT PFNGLPATHGLYPHINDEXARRAYNVPROC __glewPathGlyphIndexArrayNV; +GLEW_FUN_EXPORT PFNGLPATHGLYPHINDEXRANGENVPROC __glewPathGlyphIndexRangeNV; +GLEW_FUN_EXPORT PFNGLPATHGLYPHRANGENVPROC __glewPathGlyphRangeNV; +GLEW_FUN_EXPORT PFNGLPATHGLYPHSNVPROC __glewPathGlyphsNV; +GLEW_FUN_EXPORT PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC __glewPathMemoryGlyphIndexArrayNV; +GLEW_FUN_EXPORT PFNGLPATHPARAMETERFNVPROC __glewPathParameterfNV; +GLEW_FUN_EXPORT PFNGLPATHPARAMETERFVNVPROC __glewPathParameterfvNV; +GLEW_FUN_EXPORT PFNGLPATHPARAMETERINVPROC __glewPathParameteriNV; +GLEW_FUN_EXPORT PFNGLPATHPARAMETERIVNVPROC __glewPathParameterivNV; +GLEW_FUN_EXPORT PFNGLPATHSTENCILDEPTHOFFSETNVPROC __glewPathStencilDepthOffsetNV; +GLEW_FUN_EXPORT PFNGLPATHSTENCILFUNCNVPROC __glewPathStencilFuncNV; +GLEW_FUN_EXPORT PFNGLPATHSTRINGNVPROC __glewPathStringNV; +GLEW_FUN_EXPORT PFNGLPATHSUBCOMMANDSNVPROC __glewPathSubCommandsNV; +GLEW_FUN_EXPORT PFNGLPATHSUBCOORDSNVPROC __glewPathSubCoordsNV; +GLEW_FUN_EXPORT PFNGLPATHTEXGENNVPROC __glewPathTexGenNV; +GLEW_FUN_EXPORT PFNGLPOINTALONGPATHNVPROC __glewPointAlongPathNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC __glewProgramPathFragmentInputGenNV; +GLEW_FUN_EXPORT PFNGLSTENCILFILLPATHINSTANCEDNVPROC __glewStencilFillPathInstancedNV; +GLEW_FUN_EXPORT PFNGLSTENCILFILLPATHNVPROC __glewStencilFillPathNV; +GLEW_FUN_EXPORT PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC __glewStencilStrokePathInstancedNV; +GLEW_FUN_EXPORT PFNGLSTENCILSTROKEPATHNVPROC __glewStencilStrokePathNV; +GLEW_FUN_EXPORT PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC __glewStencilThenCoverFillPathInstancedNV; +GLEW_FUN_EXPORT PFNGLSTENCILTHENCOVERFILLPATHNVPROC __glewStencilThenCoverFillPathNV; +GLEW_FUN_EXPORT PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC __glewStencilThenCoverStrokePathInstancedNV; +GLEW_FUN_EXPORT PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC __glewStencilThenCoverStrokePathNV; +GLEW_FUN_EXPORT PFNGLTRANSFORMPATHNVPROC __glewTransformPathNV; +GLEW_FUN_EXPORT PFNGLWEIGHTPATHSNVPROC __glewWeightPathsNV; + +GLEW_FUN_EXPORT PFNGLFLUSHPIXELDATARANGENVPROC __glewFlushPixelDataRangeNV; +GLEW_FUN_EXPORT PFNGLPIXELDATARANGENVPROC __glewPixelDataRangeNV; + +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERINVPROC __glewPointParameteriNV; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERIVNVPROC __glewPointParameterivNV; + +GLEW_FUN_EXPORT PFNGLPOLYGONMODENVPROC __glewPolygonModeNV; + +GLEW_FUN_EXPORT PFNGLGETVIDEOI64VNVPROC __glewGetVideoi64vNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOIVNVPROC __glewGetVideoivNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOUI64VNVPROC __glewGetVideoui64vNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOUIVNVPROC __glewGetVideouivNV; +GLEW_FUN_EXPORT PFNGLPRESENTFRAMEDUALFILLNVPROC __glewPresentFrameDualFillNV; +GLEW_FUN_EXPORT PFNGLPRESENTFRAMEKEYEDNVPROC __glewPresentFrameKeyedNV; + +GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTINDEXNVPROC __glewPrimitiveRestartIndexNV; +GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTNVPROC __glewPrimitiveRestartNV; + +GLEW_FUN_EXPORT PFNGLCOMBINERINPUTNVPROC __glewCombinerInputNV; +GLEW_FUN_EXPORT PFNGLCOMBINEROUTPUTNVPROC __glewCombinerOutputNV; +GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERFNVPROC __glewCombinerParameterfNV; +GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERFVNVPROC __glewCombinerParameterfvNV; +GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERINVPROC __glewCombinerParameteriNV; +GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERIVNVPROC __glewCombinerParameterivNV; +GLEW_FUN_EXPORT PFNGLFINALCOMBINERINPUTNVPROC __glewFinalCombinerInputNV; +GLEW_FUN_EXPORT PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC __glewGetCombinerInputParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC __glewGetCombinerInputParameterivNV; +GLEW_FUN_EXPORT PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC __glewGetCombinerOutputParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC __glewGetCombinerOutputParameterivNV; +GLEW_FUN_EXPORT PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC __glewGetFinalCombinerInputParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC __glewGetFinalCombinerInputParameterivNV; + +GLEW_FUN_EXPORT PFNGLCOMBINERSTAGEPARAMETERFVNVPROC __glewCombinerStageParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC __glewGetCombinerStageParameterfvNV; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERSAMPLELOCATIONSFVNVPROC __glewFramebufferSampleLocationsfvNV; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNVPROC __glewNamedFramebufferSampleLocationsfvNV; + +GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERUI64VNVPROC __glewGetBufferParameterui64vNV; +GLEW_FUN_EXPORT PFNGLGETINTEGERUI64VNVPROC __glewGetIntegerui64vNV; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC __glewGetNamedBufferParameterui64vNV; +GLEW_FUN_EXPORT PFNGLISBUFFERRESIDENTNVPROC __glewIsBufferResidentNV; +GLEW_FUN_EXPORT PFNGLISNAMEDBUFFERRESIDENTNVPROC __glewIsNamedBufferResidentNV; +GLEW_FUN_EXPORT PFNGLMAKEBUFFERNONRESIDENTNVPROC __glewMakeBufferNonResidentNV; +GLEW_FUN_EXPORT PFNGLMAKEBUFFERRESIDENTNVPROC __glewMakeBufferResidentNV; +GLEW_FUN_EXPORT PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC __glewMakeNamedBufferNonResidentNV; +GLEW_FUN_EXPORT PFNGLMAKENAMEDBUFFERRESIDENTNVPROC __glewMakeNamedBufferResidentNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMUI64NVPROC __glewProgramUniformui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMUI64VNVPROC __glewProgramUniformui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORMUI64NVPROC __glewUniformui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORMUI64VNVPROC __glewUniformui64vNV; + +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE3DNVPROC __glewCompressedTexImage3DNV; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE3DNVPROC __glewCompressedTexSubImage3DNV; +GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE3DNVPROC __glewCopyTexSubImage3DNV; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYERNVPROC __glewFramebufferTextureLayerNV; +GLEW_FUN_EXPORT PFNGLTEXIMAGE3DNVPROC __glewTexImage3DNV; +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE3DNVPROC __glewTexSubImage3DNV; + +GLEW_FUN_EXPORT PFNGLTEXTUREBARRIERNVPROC __glewTextureBarrierNV; + +GLEW_FUN_EXPORT PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTexImage2DMultisampleCoverageNV; +GLEW_FUN_EXPORT PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTexImage3DMultisampleCoverageNV; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTextureImage2DMultisampleCoverageNV; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC __glewTextureImage2DMultisampleNV; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTextureImage3DMultisampleCoverageNV; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC __glewTextureImage3DMultisampleNV; + +GLEW_FUN_EXPORT PFNGLACTIVEVARYINGNVPROC __glewActiveVaryingNV; +GLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKNVPROC __glewBeginTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLBINDBUFFERBASENVPROC __glewBindBufferBaseNV; +GLEW_FUN_EXPORT PFNGLBINDBUFFEROFFSETNVPROC __glewBindBufferOffsetNV; +GLEW_FUN_EXPORT PFNGLBINDBUFFERRANGENVPROC __glewBindBufferRangeNV; +GLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKNVPROC __glewEndTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLGETACTIVEVARYINGNVPROC __glewGetActiveVaryingNV; +GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC __glewGetTransformFeedbackVaryingNV; +GLEW_FUN_EXPORT PFNGLGETVARYINGLOCATIONNVPROC __glewGetVaryingLocationNV; +GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC __glewTransformFeedbackAttribsNV; +GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC __glewTransformFeedbackVaryingsNV; + +GLEW_FUN_EXPORT PFNGLBINDTRANSFORMFEEDBACKNVPROC __glewBindTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLDELETETRANSFORMFEEDBACKSNVPROC __glewDeleteTransformFeedbacksNV; +GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKNVPROC __glewDrawTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLGENTRANSFORMFEEDBACKSNVPROC __glewGenTransformFeedbacksNV; +GLEW_FUN_EXPORT PFNGLISTRANSFORMFEEDBACKNVPROC __glewIsTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLPAUSETRANSFORMFEEDBACKNVPROC __glewPauseTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLRESUMETRANSFORMFEEDBACKNVPROC __glewResumeTransformFeedbackNV; + +GLEW_FUN_EXPORT PFNGLVDPAUFININVPROC __glewVDPAUFiniNV; +GLEW_FUN_EXPORT PFNGLVDPAUGETSURFACEIVNVPROC __glewVDPAUGetSurfaceivNV; +GLEW_FUN_EXPORT PFNGLVDPAUINITNVPROC __glewVDPAUInitNV; +GLEW_FUN_EXPORT PFNGLVDPAUISSURFACENVPROC __glewVDPAUIsSurfaceNV; +GLEW_FUN_EXPORT PFNGLVDPAUMAPSURFACESNVPROC __glewVDPAUMapSurfacesNV; +GLEW_FUN_EXPORT PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC __glewVDPAURegisterOutputSurfaceNV; +GLEW_FUN_EXPORT PFNGLVDPAUREGISTERVIDEOSURFACENVPROC __glewVDPAURegisterVideoSurfaceNV; +GLEW_FUN_EXPORT PFNGLVDPAUSURFACEACCESSNVPROC __glewVDPAUSurfaceAccessNV; +GLEW_FUN_EXPORT PFNGLVDPAUUNMAPSURFACESNVPROC __glewVDPAUUnmapSurfacesNV; +GLEW_FUN_EXPORT PFNGLVDPAUUNREGISTERSURFACENVPROC __glewVDPAUUnregisterSurfaceNV; + +GLEW_FUN_EXPORT PFNGLFLUSHVERTEXARRAYRANGENVPROC __glewFlushVertexArrayRangeNV; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYRANGENVPROC __glewVertexArrayRangeNV; + +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLI64VNVPROC __glewGetVertexAttribLi64vNV; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLUI64VNVPROC __glewGetVertexAttribLui64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1I64NVPROC __glewVertexAttribL1i64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1I64VNVPROC __glewVertexAttribL1i64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64NVPROC __glewVertexAttribL1ui64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64VNVPROC __glewVertexAttribL1ui64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2I64NVPROC __glewVertexAttribL2i64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2I64VNVPROC __glewVertexAttribL2i64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2UI64NVPROC __glewVertexAttribL2ui64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2UI64VNVPROC __glewVertexAttribL2ui64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3I64NVPROC __glewVertexAttribL3i64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3I64VNVPROC __glewVertexAttribL3i64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3UI64NVPROC __glewVertexAttribL3ui64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3UI64VNVPROC __glewVertexAttribL3ui64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4I64NVPROC __glewVertexAttribL4i64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4I64VNVPROC __glewVertexAttribL4i64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4UI64NVPROC __glewVertexAttribL4ui64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4UI64VNVPROC __glewVertexAttribL4ui64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLFORMATNVPROC __glewVertexAttribLFormatNV; + +GLEW_FUN_EXPORT PFNGLBUFFERADDRESSRANGENVPROC __glewBufferAddressRangeNV; +GLEW_FUN_EXPORT PFNGLCOLORFORMATNVPROC __glewColorFormatNV; +GLEW_FUN_EXPORT PFNGLEDGEFLAGFORMATNVPROC __glewEdgeFlagFormatNV; +GLEW_FUN_EXPORT PFNGLFOGCOORDFORMATNVPROC __glewFogCoordFormatNV; +GLEW_FUN_EXPORT PFNGLGETINTEGERUI64I_VNVPROC __glewGetIntegerui64i_vNV; +GLEW_FUN_EXPORT PFNGLINDEXFORMATNVPROC __glewIndexFormatNV; +GLEW_FUN_EXPORT PFNGLNORMALFORMATNVPROC __glewNormalFormatNV; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORFORMATNVPROC __glewSecondaryColorFormatNV; +GLEW_FUN_EXPORT PFNGLTEXCOORDFORMATNVPROC __glewTexCoordFormatNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBFORMATNVPROC __glewVertexAttribFormatNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIFORMATNVPROC __glewVertexAttribIFormatNV; +GLEW_FUN_EXPORT PFNGLVERTEXFORMATNVPROC __glewVertexFormatNV; + +GLEW_FUN_EXPORT PFNGLAREPROGRAMSRESIDENTNVPROC __glewAreProgramsResidentNV; +GLEW_FUN_EXPORT PFNGLBINDPROGRAMNVPROC __glewBindProgramNV; +GLEW_FUN_EXPORT PFNGLDELETEPROGRAMSNVPROC __glewDeleteProgramsNV; +GLEW_FUN_EXPORT PFNGLEXECUTEPROGRAMNVPROC __glewExecuteProgramNV; +GLEW_FUN_EXPORT PFNGLGENPROGRAMSNVPROC __glewGenProgramsNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMPARAMETERDVNVPROC __glewGetProgramParameterdvNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMPARAMETERFVNVPROC __glewGetProgramParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMSTRINGNVPROC __glewGetProgramStringNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMIVNVPROC __glewGetProgramivNV; +GLEW_FUN_EXPORT PFNGLGETTRACKMATRIXIVNVPROC __glewGetTrackMatrixivNV; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVNVPROC __glewGetVertexAttribPointervNV; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVNVPROC __glewGetVertexAttribdvNV; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVNVPROC __glewGetVertexAttribfvNV; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVNVPROC __glewGetVertexAttribivNV; +GLEW_FUN_EXPORT PFNGLISPROGRAMNVPROC __glewIsProgramNV; +GLEW_FUN_EXPORT PFNGLLOADPROGRAMNVPROC __glewLoadProgramNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4DNVPROC __glewProgramParameter4dNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4DVNVPROC __glewProgramParameter4dvNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4FNVPROC __glewProgramParameter4fNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4FVNVPROC __glewProgramParameter4fvNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERS4DVNVPROC __glewProgramParameters4dvNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERS4FVNVPROC __glewProgramParameters4fvNV; +GLEW_FUN_EXPORT PFNGLREQUESTRESIDENTPROGRAMSNVPROC __glewRequestResidentProgramsNV; +GLEW_FUN_EXPORT PFNGLTRACKMATRIXNVPROC __glewTrackMatrixNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DNVPROC __glewVertexAttrib1dNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVNVPROC __glewVertexAttrib1dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FNVPROC __glewVertexAttrib1fNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVNVPROC __glewVertexAttrib1fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SNVPROC __glewVertexAttrib1sNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVNVPROC __glewVertexAttrib1svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DNVPROC __glewVertexAttrib2dNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVNVPROC __glewVertexAttrib2dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FNVPROC __glewVertexAttrib2fNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVNVPROC __glewVertexAttrib2fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SNVPROC __glewVertexAttrib2sNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVNVPROC __glewVertexAttrib2svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DNVPROC __glewVertexAttrib3dNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVNVPROC __glewVertexAttrib3dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FNVPROC __glewVertexAttrib3fNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVNVPROC __glewVertexAttrib3fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SNVPROC __glewVertexAttrib3sNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVNVPROC __glewVertexAttrib3svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DNVPROC __glewVertexAttrib4dNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVNVPROC __glewVertexAttrib4dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FNVPROC __glewVertexAttrib4fNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVNVPROC __glewVertexAttrib4fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SNVPROC __glewVertexAttrib4sNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVNVPROC __glewVertexAttrib4svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBNVPROC __glewVertexAttrib4ubNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVNVPROC __glewVertexAttrib4ubvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERNVPROC __glewVertexAttribPointerNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1DVNVPROC __glewVertexAttribs1dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1FVNVPROC __glewVertexAttribs1fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1SVNVPROC __glewVertexAttribs1svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2DVNVPROC __glewVertexAttribs2dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2FVNVPROC __glewVertexAttribs2fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2SVNVPROC __glewVertexAttribs2svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3DVNVPROC __glewVertexAttribs3dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3FVNVPROC __glewVertexAttribs3fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3SVNVPROC __glewVertexAttribs3svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4DVNVPROC __glewVertexAttribs4dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4FVNVPROC __glewVertexAttribs4fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4SVNVPROC __glewVertexAttribs4svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4UBVNVPROC __glewVertexAttribs4ubvNV; + +GLEW_FUN_EXPORT PFNGLBEGINVIDEOCAPTURENVPROC __glewBeginVideoCaptureNV; +GLEW_FUN_EXPORT PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC __glewBindVideoCaptureStreamBufferNV; +GLEW_FUN_EXPORT PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC __glewBindVideoCaptureStreamTextureNV; +GLEW_FUN_EXPORT PFNGLENDVIDEOCAPTURENVPROC __glewEndVideoCaptureNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMDVNVPROC __glewGetVideoCaptureStreamdvNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMFVNVPROC __glewGetVideoCaptureStreamfvNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMIVNVPROC __glewGetVideoCaptureStreamivNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTUREIVNVPROC __glewGetVideoCaptureivNV; +GLEW_FUN_EXPORT PFNGLVIDEOCAPTURENVPROC __glewVideoCaptureNV; +GLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC __glewVideoCaptureStreamParameterdvNV; +GLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC __glewVideoCaptureStreamParameterfvNV; +GLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC __glewVideoCaptureStreamParameterivNV; + +GLEW_FUN_EXPORT PFNGLDEPTHRANGEARRAYFVNVPROC __glewDepthRangeArrayfvNV; +GLEW_FUN_EXPORT PFNGLDEPTHRANGEINDEXEDFNVPROC __glewDepthRangeIndexedfNV; +GLEW_FUN_EXPORT PFNGLDISABLEINVPROC __glewDisableiNV; +GLEW_FUN_EXPORT PFNGLENABLEINVPROC __glewEnableiNV; +GLEW_FUN_EXPORT PFNGLGETFLOATI_VNVPROC __glewGetFloati_vNV; +GLEW_FUN_EXPORT PFNGLISENABLEDINVPROC __glewIsEnablediNV; +GLEW_FUN_EXPORT PFNGLSCISSORARRAYVNVPROC __glewScissorArrayvNV; +GLEW_FUN_EXPORT PFNGLSCISSORINDEXEDNVPROC __glewScissorIndexedNV; +GLEW_FUN_EXPORT PFNGLSCISSORINDEXEDVNVPROC __glewScissorIndexedvNV; +GLEW_FUN_EXPORT PFNGLVIEWPORTARRAYVNVPROC __glewViewportArrayvNV; +GLEW_FUN_EXPORT PFNGLVIEWPORTINDEXEDFNVPROC __glewViewportIndexedfNV; +GLEW_FUN_EXPORT PFNGLVIEWPORTINDEXEDFVNVPROC __glewViewportIndexedfvNV; + +GLEW_FUN_EXPORT PFNGLVIEWPORTSWIZZLENVPROC __glewViewportSwizzleNV; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC __glewFramebufferTextureMultiviewOVR; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREMULTISAMPLEMULTIVIEWOVRPROC __glewFramebufferTextureMultisampleMultiviewOVR; + +GLEW_FUN_EXPORT PFNGLALPHAFUNCQCOMPROC __glewAlphaFuncQCOM; + +GLEW_FUN_EXPORT PFNGLDISABLEDRIVERCONTROLQCOMPROC __glewDisableDriverControlQCOM; +GLEW_FUN_EXPORT PFNGLENABLEDRIVERCONTROLQCOMPROC __glewEnableDriverControlQCOM; +GLEW_FUN_EXPORT PFNGLGETDRIVERCONTROLSTRINGQCOMPROC __glewGetDriverControlStringQCOM; +GLEW_FUN_EXPORT PFNGLGETDRIVERCONTROLSQCOMPROC __glewGetDriverControlsQCOM; + +GLEW_FUN_EXPORT PFNGLEXTGETBUFFERPOINTERVQCOMPROC __glewExtGetBufferPointervQCOM; +GLEW_FUN_EXPORT PFNGLEXTGETBUFFERSQCOMPROC __glewExtGetBuffersQCOM; +GLEW_FUN_EXPORT PFNGLEXTGETFRAMEBUFFERSQCOMPROC __glewExtGetFramebuffersQCOM; +GLEW_FUN_EXPORT PFNGLEXTGETRENDERBUFFERSQCOMPROC __glewExtGetRenderbuffersQCOM; +GLEW_FUN_EXPORT PFNGLEXTGETTEXLEVELPARAMETERIVQCOMPROC __glewExtGetTexLevelParameterivQCOM; +GLEW_FUN_EXPORT PFNGLEXTGETTEXSUBIMAGEQCOMPROC __glewExtGetTexSubImageQCOM; +GLEW_FUN_EXPORT PFNGLEXTGETTEXTURESQCOMPROC __glewExtGetTexturesQCOM; +GLEW_FUN_EXPORT PFNGLEXTTEXOBJECTSTATEOVERRIDEIQCOMPROC __glewExtTexObjectStateOverrideiQCOM; + +GLEW_FUN_EXPORT PFNGLEXTGETPROGRAMBINARYSOURCEQCOMPROC __glewExtGetProgramBinarySourceQCOM; +GLEW_FUN_EXPORT PFNGLEXTGETPROGRAMSQCOMPROC __glewExtGetProgramsQCOM; +GLEW_FUN_EXPORT PFNGLEXTGETSHADERSQCOMPROC __glewExtGetShadersQCOM; +GLEW_FUN_EXPORT PFNGLEXTISPROGRAMBINARYQCOMPROC __glewExtIsProgramBinaryQCOM; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERFOVEATIONCONFIGQCOMPROC __glewFramebufferFoveationConfigQCOM; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERFOVEATIONPARAMETERSQCOMPROC __glewFramebufferFoveationParametersQCOM; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERFETCHBARRIERQCOMPROC __glewFramebufferFetchBarrierQCOM; + +GLEW_FUN_EXPORT PFNGLENDTILINGQCOMPROC __glewEndTilingQCOM; +GLEW_FUN_EXPORT PFNGLSTARTTILINGQCOMPROC __glewStartTilingQCOM; + +GLEW_FUN_EXPORT PFNGLALPHAFUNCXPROC __glewAlphaFuncx; +GLEW_FUN_EXPORT PFNGLCLEARCOLORXPROC __glewClearColorx; +GLEW_FUN_EXPORT PFNGLCLEARDEPTHXPROC __glewClearDepthx; +GLEW_FUN_EXPORT PFNGLCOLOR4XPROC __glewColor4x; +GLEW_FUN_EXPORT PFNGLDEPTHRANGEXPROC __glewDepthRangex; +GLEW_FUN_EXPORT PFNGLFOGXPROC __glewFogx; +GLEW_FUN_EXPORT PFNGLFOGXVPROC __glewFogxv; +GLEW_FUN_EXPORT PFNGLFRUSTUMFPROC __glewFrustumf; +GLEW_FUN_EXPORT PFNGLFRUSTUMXPROC __glewFrustumx; +GLEW_FUN_EXPORT PFNGLLIGHTMODELXPROC __glewLightModelx; +GLEW_FUN_EXPORT PFNGLLIGHTMODELXVPROC __glewLightModelxv; +GLEW_FUN_EXPORT PFNGLLIGHTXPROC __glewLightx; +GLEW_FUN_EXPORT PFNGLLIGHTXVPROC __glewLightxv; +GLEW_FUN_EXPORT PFNGLLINEWIDTHXPROC __glewLineWidthx; +GLEW_FUN_EXPORT PFNGLLOADMATRIXXPROC __glewLoadMatrixx; +GLEW_FUN_EXPORT PFNGLMATERIALXPROC __glewMaterialx; +GLEW_FUN_EXPORT PFNGLMATERIALXVPROC __glewMaterialxv; +GLEW_FUN_EXPORT PFNGLMULTMATRIXXPROC __glewMultMatrixx; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4XPROC __glewMultiTexCoord4x; +GLEW_FUN_EXPORT PFNGLNORMAL3XPROC __glewNormal3x; +GLEW_FUN_EXPORT PFNGLORTHOFPROC __glewOrthof; +GLEW_FUN_EXPORT PFNGLORTHOXPROC __glewOrthox; +GLEW_FUN_EXPORT PFNGLPOINTSIZEXPROC __glewPointSizex; +GLEW_FUN_EXPORT PFNGLPOLYGONOFFSETXPROC __glewPolygonOffsetx; +GLEW_FUN_EXPORT PFNGLROTATEXPROC __glewRotatex; +GLEW_FUN_EXPORT PFNGLSAMPLECOVERAGEXPROC __glewSampleCoveragex; +GLEW_FUN_EXPORT PFNGLSCALEXPROC __glewScalex; +GLEW_FUN_EXPORT PFNGLTEXENVXPROC __glewTexEnvx; +GLEW_FUN_EXPORT PFNGLTEXENVXVPROC __glewTexEnvxv; +GLEW_FUN_EXPORT PFNGLTEXPARAMETERXPROC __glewTexParameterx; +GLEW_FUN_EXPORT PFNGLTRANSLATEXPROC __glewTranslatex; + +GLEW_FUN_EXPORT PFNGLCLIPPLANEFPROC __glewClipPlanef; +GLEW_FUN_EXPORT PFNGLCLIPPLANEXPROC __glewClipPlanex; +GLEW_FUN_EXPORT PFNGLGETCLIPPLANEFPROC __glewGetClipPlanef; +GLEW_FUN_EXPORT PFNGLGETCLIPPLANEXPROC __glewGetClipPlanex; +GLEW_FUN_EXPORT PFNGLGETFIXEDVPROC __glewGetFixedv; +GLEW_FUN_EXPORT PFNGLGETLIGHTXVPROC __glewGetLightxv; +GLEW_FUN_EXPORT PFNGLGETMATERIALXVPROC __glewGetMaterialxv; +GLEW_FUN_EXPORT PFNGLGETTEXENVXVPROC __glewGetTexEnvxv; +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERXVPROC __glewGetTexParameterxv; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERXPROC __glewPointParameterx; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERXVPROC __glewPointParameterxv; +GLEW_FUN_EXPORT PFNGLPOINTSIZEPOINTEROESPROC __glewPointSizePointerOES; +GLEW_FUN_EXPORT PFNGLTEXPARAMETERXVPROC __glewTexParameterxv; + +GLEW_FUN_EXPORT PFNGLERRORSTRINGREGALPROC __glewErrorStringREGAL; + +GLEW_FUN_EXPORT PFNGLGETEXTENSIONREGALPROC __glewGetExtensionREGAL; +GLEW_FUN_EXPORT PFNGLISSUPPORTEDREGALPROC __glewIsSupportedREGAL; + +GLEW_FUN_EXPORT PFNGLLOGMESSAGECALLBACKREGALPROC __glewLogMessageCallbackREGAL; + +GLEW_FUN_EXPORT PFNGLGETPROCADDRESSREGALPROC __glewGetProcAddressREGAL; + +GLEW_FUN_EXPORT PFNGLDETAILTEXFUNCSGISPROC __glewDetailTexFuncSGIS; +GLEW_FUN_EXPORT PFNGLGETDETAILTEXFUNCSGISPROC __glewGetDetailTexFuncSGIS; + +GLEW_FUN_EXPORT PFNGLFOGFUNCSGISPROC __glewFogFuncSGIS; +GLEW_FUN_EXPORT PFNGLGETFOGFUNCSGISPROC __glewGetFogFuncSGIS; + +GLEW_FUN_EXPORT PFNGLSAMPLEMASKSGISPROC __glewSampleMaskSGIS; +GLEW_FUN_EXPORT PFNGLSAMPLEPATTERNSGISPROC __glewSamplePatternSGIS; + +GLEW_FUN_EXPORT PFNGLINTERLEAVEDTEXTURECOORDSETSSGISPROC __glewInterleavedTextureCoordSetsSGIS; +GLEW_FUN_EXPORT PFNGLSELECTTEXTURECOORDSETSGISPROC __glewSelectTextureCoordSetSGIS; +GLEW_FUN_EXPORT PFNGLSELECTTEXTURESGISPROC __glewSelectTextureSGIS; +GLEW_FUN_EXPORT PFNGLSELECTTEXTURETRANSFORMSGISPROC __glewSelectTextureTransformSGIS; + +GLEW_FUN_EXPORT PFNGLMULTISAMPLESUBRECTPOSSGISPROC __glewMultisampleSubRectPosSGIS; + +GLEW_FUN_EXPORT PFNGLGETSHARPENTEXFUNCSGISPROC __glewGetSharpenTexFuncSGIS; +GLEW_FUN_EXPORT PFNGLSHARPENTEXFUNCSGISPROC __glewSharpenTexFuncSGIS; + +GLEW_FUN_EXPORT PFNGLTEXIMAGE4DSGISPROC __glewTexImage4DSGIS; +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE4DSGISPROC __glewTexSubImage4DSGIS; + +GLEW_FUN_EXPORT PFNGLGETTEXFILTERFUNCSGISPROC __glewGetTexFilterFuncSGIS; +GLEW_FUN_EXPORT PFNGLTEXFILTERFUNCSGISPROC __glewTexFilterFuncSGIS; + +GLEW_FUN_EXPORT PFNGLASYNCMARKERSGIXPROC __glewAsyncMarkerSGIX; +GLEW_FUN_EXPORT PFNGLDELETEASYNCMARKERSSGIXPROC __glewDeleteAsyncMarkersSGIX; +GLEW_FUN_EXPORT PFNGLFINISHASYNCSGIXPROC __glewFinishAsyncSGIX; +GLEW_FUN_EXPORT PFNGLGENASYNCMARKERSSGIXPROC __glewGenAsyncMarkersSGIX; +GLEW_FUN_EXPORT PFNGLISASYNCMARKERSGIXPROC __glewIsAsyncMarkerSGIX; +GLEW_FUN_EXPORT PFNGLPOLLASYNCSGIXPROC __glewPollAsyncSGIX; + +GLEW_FUN_EXPORT PFNGLADDRESSSPACEPROC __glewAddressSpace; +GLEW_FUN_EXPORT PFNGLDATAPIPEPROC __glewDataPipe; + +GLEW_FUN_EXPORT PFNGLFLUSHRASTERSGIXPROC __glewFlushRasterSGIX; + +GLEW_FUN_EXPORT PFNGLFOGLAYERSSGIXPROC __glewFogLayersSGIX; +GLEW_FUN_EXPORT PFNGLGETFOGLAYERSSGIXPROC __glewGetFogLayersSGIX; + +GLEW_FUN_EXPORT PFNGLTEXTUREFOGSGIXPROC __glewTextureFogSGIX; + +GLEW_FUN_EXPORT PFNGLFRAGMENTCOLORMATERIALSGIXPROC __glewFragmentColorMaterialSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFSGIXPROC __glewFragmentLightModelfSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFVSGIXPROC __glewFragmentLightModelfvSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELISGIXPROC __glewFragmentLightModeliSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELIVSGIXPROC __glewFragmentLightModelivSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFSGIXPROC __glewFragmentLightfSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFVSGIXPROC __glewFragmentLightfvSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTISGIXPROC __glewFragmentLightiSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTIVSGIXPROC __glewFragmentLightivSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFSGIXPROC __glewFragmentMaterialfSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFVSGIXPROC __glewFragmentMaterialfvSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALISGIXPROC __glewFragmentMaterialiSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALIVSGIXPROC __glewFragmentMaterialivSGIX; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTFVSGIXPROC __glewGetFragmentLightfvSGIX; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTIVSGIXPROC __glewGetFragmentLightivSGIX; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALFVSGIXPROC __glewGetFragmentMaterialfvSGIX; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALIVSGIXPROC __glewGetFragmentMaterialivSGIX; + +GLEW_FUN_EXPORT PFNGLFRAMEZOOMSGIXPROC __glewFrameZoomSGIX; + +GLEW_FUN_EXPORT PFNGLIGLOOINTERFACESGIXPROC __glewIglooInterfaceSGIX; + +GLEW_FUN_EXPORT PFNGLALLOCMPEGPREDICTORSSGIXPROC __glewAllocMPEGPredictorsSGIX; +GLEW_FUN_EXPORT PFNGLDELETEMPEGPREDICTORSSGIXPROC __glewDeleteMPEGPredictorsSGIX; +GLEW_FUN_EXPORT PFNGLGENMPEGPREDICTORSSGIXPROC __glewGenMPEGPredictorsSGIX; +GLEW_FUN_EXPORT PFNGLGETMPEGPARAMETERFVSGIXPROC __glewGetMPEGParameterfvSGIX; +GLEW_FUN_EXPORT PFNGLGETMPEGPARAMETERIVSGIXPROC __glewGetMPEGParameterivSGIX; +GLEW_FUN_EXPORT PFNGLGETMPEGPREDICTORSGIXPROC __glewGetMPEGPredictorSGIX; +GLEW_FUN_EXPORT PFNGLGETMPEGQUANTTABLEUBVPROC __glewGetMPEGQuantTableubv; +GLEW_FUN_EXPORT PFNGLISMPEGPREDICTORSGIXPROC __glewIsMPEGPredictorSGIX; +GLEW_FUN_EXPORT PFNGLMPEGPREDICTORSGIXPROC __glewMPEGPredictorSGIX; +GLEW_FUN_EXPORT PFNGLMPEGQUANTTABLEUBVPROC __glewMPEGQuantTableubv; +GLEW_FUN_EXPORT PFNGLSWAPMPEGPREDICTORSSGIXPROC __glewSwapMPEGPredictorsSGIX; + +GLEW_FUN_EXPORT PFNGLGETNONLINLIGHTFVSGIXPROC __glewGetNonlinLightfvSGIX; +GLEW_FUN_EXPORT PFNGLGETNONLINMATERIALFVSGIXPROC __glewGetNonlinMaterialfvSGIX; +GLEW_FUN_EXPORT PFNGLNONLINLIGHTFVSGIXPROC __glewNonlinLightfvSGIX; +GLEW_FUN_EXPORT PFNGLNONLINMATERIALFVSGIXPROC __glewNonlinMaterialfvSGIX; + +GLEW_FUN_EXPORT PFNGLPIXELTEXGENSGIXPROC __glewPixelTexGenSGIX; + +GLEW_FUN_EXPORT PFNGLDEFORMSGIXPROC __glewDeformSGIX; +GLEW_FUN_EXPORT PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC __glewLoadIdentityDeformationMapSGIX; + +GLEW_FUN_EXPORT PFNGLMESHBREADTHSGIXPROC __glewMeshBreadthSGIX; +GLEW_FUN_EXPORT PFNGLMESHSTRIDESGIXPROC __glewMeshStrideSGIX; + +GLEW_FUN_EXPORT PFNGLREFERENCEPLANESGIXPROC __glewReferencePlaneSGIX; + +GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERFSGIXPROC __glewSpriteParameterfSGIX; +GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERFVSGIXPROC __glewSpriteParameterfvSGIX; +GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERISGIXPROC __glewSpriteParameteriSGIX; +GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERIVSGIXPROC __glewSpriteParameterivSGIX; + +GLEW_FUN_EXPORT PFNGLTAGSAMPLEBUFFERSGIXPROC __glewTagSampleBufferSGIX; + +GLEW_FUN_EXPORT PFNGLGETVECTOROPERATIONSGIXPROC __glewGetVectorOperationSGIX; +GLEW_FUN_EXPORT PFNGLVECTOROPERATIONSGIXPROC __glewVectorOperationSGIX; + +GLEW_FUN_EXPORT PFNGLAREVERTEXARRAYSRESIDENTSGIXPROC __glewAreVertexArraysResidentSGIX; +GLEW_FUN_EXPORT PFNGLBINDVERTEXARRAYSGIXPROC __glewBindVertexArraySGIX; +GLEW_FUN_EXPORT PFNGLDELETEVERTEXARRAYSSGIXPROC __glewDeleteVertexArraysSGIX; +GLEW_FUN_EXPORT PFNGLGENVERTEXARRAYSSGIXPROC __glewGenVertexArraysSGIX; +GLEW_FUN_EXPORT PFNGLISVERTEXARRAYSGIXPROC __glewIsVertexArraySGIX; +GLEW_FUN_EXPORT PFNGLPRIORITIZEVERTEXARRAYSSGIXPROC __glewPrioritizeVertexArraysSGIX; + +GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERFVSGIPROC __glewColorTableParameterfvSGI; +GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERIVSGIPROC __glewColorTableParameterivSGI; +GLEW_FUN_EXPORT PFNGLCOLORTABLESGIPROC __glewColorTableSGI; +GLEW_FUN_EXPORT PFNGLCOPYCOLORTABLESGIPROC __glewCopyColorTableSGI; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVSGIPROC __glewGetColorTableParameterfvSGI; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERIVSGIPROC __glewGetColorTableParameterivSGI; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLESGIPROC __glewGetColorTableSGI; + +GLEW_FUN_EXPORT PFNGLGETPIXELTRANSFORMPARAMETERFVSGIPROC __glewGetPixelTransformParameterfvSGI; +GLEW_FUN_EXPORT PFNGLGETPIXELTRANSFORMPARAMETERIVSGIPROC __glewGetPixelTransformParameterivSGI; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERFSGIPROC __glewPixelTransformParameterfSGI; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERFVSGIPROC __glewPixelTransformParameterfvSGI; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERISGIPROC __glewPixelTransformParameteriSGI; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERIVSGIPROC __glewPixelTransformParameterivSGI; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMSGIPROC __glewPixelTransformSGI; + +GLEW_FUN_EXPORT PFNGLFINISHTEXTURESUNXPROC __glewFinishTextureSUNX; + +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORBSUNPROC __glewGlobalAlphaFactorbSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORDSUNPROC __glewGlobalAlphaFactordSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORFSUNPROC __glewGlobalAlphaFactorfSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORISUNPROC __glewGlobalAlphaFactoriSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORSSUNPROC __glewGlobalAlphaFactorsSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORUBSUNPROC __glewGlobalAlphaFactorubSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORUISUNPROC __glewGlobalAlphaFactoruiSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORUSSUNPROC __glewGlobalAlphaFactorusSUN; + +GLEW_FUN_EXPORT PFNGLREADVIDEOPIXELSSUNPROC __glewReadVideoPixelsSUN; + +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEPOINTERSUNPROC __glewReplacementCodePointerSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUBSUNPROC __glewReplacementCodeubSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUBVSUNPROC __glewReplacementCodeubvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUISUNPROC __glewReplacementCodeuiSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUIVSUNPROC __glewReplacementCodeuivSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUSSUNPROC __glewReplacementCodeusSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUSVSUNPROC __glewReplacementCodeusvSUN; + +GLEW_FUN_EXPORT PFNGLCOLOR3FVERTEX3FSUNPROC __glewColor3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLCOLOR3FVERTEX3FVSUNPROC __glewColor3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewColor4fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewColor4fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX2FSUNPROC __glewColor4ubVertex2fSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX2FVSUNPROC __glewColor4ubVertex2fvSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX3FSUNPROC __glewColor4ubVertex3fSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX3FVSUNPROC __glewColor4ubVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLNORMAL3FVERTEX3FSUNPROC __glewNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLNORMAL3FVERTEX3FVSUNPROC __glewNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC __glewReplacementCodeuiColor3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC __glewReplacementCodeuiColor4ubVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC __glewReplacementCodeuiColor4ubVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC __glewReplacementCodeuiVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC __glewReplacementCodeuiVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC __glewTexCoord2fColor3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC __glewTexCoord2fColor3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC __glewTexCoord2fColor4ubVertex3fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC __glewTexCoord2fColor4ubVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FVERTEX3FSUNPROC __glewTexCoord2fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FVERTEX3FVSUNPROC __glewTexCoord2fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD4FVERTEX4FSUNPROC __glewTexCoord4fVertex4fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD4FVERTEX4FVSUNPROC __glewTexCoord4fVertex4fvSUN; + +GLEW_FUN_EXPORT PFNGLADDSWAPHINTRECTWINPROC __glewAddSwapHintRectWIN; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_1; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_2; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_2_1; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_3; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_4; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_5; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_2_0; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_2_1; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_0; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_1; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_2; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_3; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_0; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_1; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_2; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_3; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_4; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_5; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_6; +GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_tbuffer; +GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_texture_compression_FXT1; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_blend_minmax_factor; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_compressed_3DC_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_compressed_ATC_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_conservative_depth; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_debug_output; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_depth_clamp_separate; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_draw_buffers_blend; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_framebuffer_sample_positions; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_gcn_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_gpu_shader_half_float; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_gpu_shader_int16; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_gpu_shader_int64; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_interleaved_elements; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_multi_draw_indirect; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_name_gen_delete; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_occlusion_query_event; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_performance_monitor; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_pinned_memory; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_program_binary_Z400; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_query_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_sample_positions; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_seamless_cubemap_per_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_atomic_counter_ops; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_ballot; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_explicit_vertex_parameter; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_stencil_export; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_stencil_value_export; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_trinary_minmax; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_sparse_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_stencil_operation_extended; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_texture_gather_bias_lod; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_texture_texture4; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_transform_feedback3_lines_triangles; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_transform_feedback4; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_vertex_shader_layer; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_vertex_shader_tessellator; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_vertex_shader_viewport_index; +GLEW_VAR_EXPORT GLboolean __GLEW_ANDROID_extension_pack_es31a; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_depth_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_framebuffer_blit; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_framebuffer_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_instanced_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_pack_reverse_row_order; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_program_binary; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_texture_compression_dxt1; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_texture_compression_dxt3; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_texture_compression_dxt5; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_texture_usage; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_timer_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_translated_shader_source; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_aux_depth_stencil; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_client_storage; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_clip_distance; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_color_buffer_packed_float; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_copy_texture_levels; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_element_array; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_fence; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_float_pixels; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_flush_buffer_range; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_framebuffer_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_object_purgeable; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_pixel_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_rgb_422; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_row_bytes; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_specular_vector; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_sync; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_texture_2D_limited_npot; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_texture_format_BGRA8888; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_texture_max_level; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_texture_packed_float; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_texture_range; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_transform_hint; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_array_object; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_array_range; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_program_evaluators; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_ycbcr_422; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_ES2_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_ES3_1_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_ES3_2_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_ES3_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_arrays_of_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_base_instance; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_bindless_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_blend_func_extended; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_buffer_storage; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_cl_event; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_clear_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_clear_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_clip_control; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_color_buffer_float; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compressed_texture_pixel_storage; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compute_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compute_variable_group_size; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_conditional_render_inverted; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_conservative_depth; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_copy_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_copy_image; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_cull_distance; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_debug_output; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_buffer_float; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_derivative_control; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_direct_state_access; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_buffers; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_buffers_blend; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_elements_base_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_indirect; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_instanced; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_enhanced_layouts; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_explicit_attrib_location; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_explicit_uniform_location; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_coord_conventions; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_layer_viewport; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_program; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_program_shadow; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_shader_interlock; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_framebuffer_no_attachments; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_framebuffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_framebuffer_sRGB; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_geometry_shader4; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_get_program_binary; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_get_texture_sub_image; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_gl_spirv; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_gpu_shader5; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_gpu_shader_fp64; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_gpu_shader_int64; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_half_float_pixel; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_half_float_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_imaging; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_indirect_parameters; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_instanced_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_internalformat_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_internalformat_query2; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_invalidate_subdata; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_map_buffer_alignment; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_map_buffer_range; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_matrix_palette; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multi_bind; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multi_draw_indirect; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multitexture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_occlusion_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_occlusion_query2; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_parallel_shader_compile; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_pipeline_statistics_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_pixel_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_point_parameters; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_point_sprite; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_polygon_offset_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_post_depth_coverage; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_program_interface_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_provoking_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_query_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robust_buffer_access_behavior; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robustness; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robustness_application_isolation; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robustness_share_group_isolation; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sample_locations; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sample_shading; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sampler_objects; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_seamless_cube_map; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_seamless_cubemap_per_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_separate_shader_objects; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_atomic_counter_ops; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_atomic_counters; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_ballot; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_bit_encoding; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_clock; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_draw_parameters; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_group_vote; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_image_load_store; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_image_size; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_objects; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_precision; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_stencil_export; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_storage_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_subroutine; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_texture_image_samples; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_texture_lod; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_viewport_layer_array; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_100; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_420pack; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_include; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_packing; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shadow; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shadow_ambient; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sparse_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sparse_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sparse_texture2; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sparse_texture_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_spirv_extensions; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_stencil_texturing; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sync; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_tessellation_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_barrier; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_border_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_buffer_object_rgb32; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_buffer_range; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression_bptc; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression_rgtc; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_cube_map; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_cube_map_array; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_add; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_combine; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_crossbar; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_dot3; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_filter_anisotropic; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_filter_minmax; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_float; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_gather; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_mirror_clamp_to_edge; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_mirrored_repeat; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_non_power_of_two; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_query_levels; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_query_lod; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rectangle; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rg; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rgb10_a2ui; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_stencil8; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_storage; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_storage_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_swizzle; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_view; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_timer_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback2; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback3; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback_instanced; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback_overflow_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transpose_matrix; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_uniform_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_array_bgra; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_array_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_attrib_64bit; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_attrib_binding; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_blend; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_program; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_type_10f_11f_11f_rev; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_type_2_10_10_10_rev; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_viewport_array; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_window_pos; +GLEW_VAR_EXPORT GLboolean __GLEW_ARM_mali_program_binary; +GLEW_VAR_EXPORT GLboolean __GLEW_ARM_mali_shader_binary; +GLEW_VAR_EXPORT GLboolean __GLEW_ARM_rgba8; +GLEW_VAR_EXPORT GLboolean __GLEW_ARM_shader_framebuffer_fetch; +GLEW_VAR_EXPORT GLboolean __GLEW_ARM_shader_framebuffer_fetch_depth_stencil; +GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_point_sprites; +GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_texture_env_combine3; +GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_texture_env_route; +GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_vertex_shader_output_point_size; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_draw_buffers; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_element_array; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_envmap_bumpmap; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_fragment_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_map_object_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_meminfo; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_pn_triangles; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_separate_stencil; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_shader_texture_lod; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_text_fragment_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_compression_3dc; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_env_combine3; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_float; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_mirror_once; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_array_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_attrib_array_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_streams; +GLEW_VAR_EXPORT GLboolean __GLEW_EGL_KHR_context_flush_control; +GLEW_VAR_EXPORT GLboolean __GLEW_EGL_NV_robustness_video_memory_purge; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_422_pixels; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_Cg_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_EGL_image_array; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_YUV_target; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_abgr; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_base_instance; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_bgra; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_bindable_uniform; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_color; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_equation_separate; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_func_extended; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_func_separate; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_logic_op; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_minmax; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_subtract; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_buffer_storage; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_clear_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_clip_cull_distance; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_clip_volume_hint; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_cmyka; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_color_buffer_float; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_color_buffer_half_float; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_color_subtable; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_compiled_vertex_array; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_compressed_ETC1_RGB8_sub_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_conservative_depth; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_convolution; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_coordinate_frame; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_copy_image; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_copy_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_cull_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_debug_label; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_debug_marker; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_depth_bounds_test; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_direct_state_access; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_discard_framebuffer; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_buffers; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_buffers2; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_buffers_indexed; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_elements_base_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_instanced; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_range_elements; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_external_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_float_blend; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_fog_coord; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_frag_depth; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_fragment_lighting; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_blit; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_multisample_blit_scaled; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_sRGB; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_geometry_point_size; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_geometry_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_geometry_shader4; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_gpu_program_parameters; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_gpu_shader4; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_gpu_shader5; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_histogram; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_array_formats; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_func; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_material; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_instanced_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_light_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_map_buffer_range; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_memory_object; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_memory_object_fd; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_memory_object_win32; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_misc_attribute; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multi_draw_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multi_draw_indirect; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multiple_textures; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multisample_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multisampled_render_to_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multisampled_render_to_texture2; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multiview_draw_buffers; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_depth_stencil; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_float; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_pixels; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_paletted_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_transform; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_transform_color_table; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_point_parameters; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_polygon_offset; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_polygon_offset_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_post_depth_coverage; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_provoking_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pvrtc_sRGB; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_raster_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_read_format_bgra; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_render_snorm; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_rescale_normal; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_sRGB; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_sRGB_write_control; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_scene_marker; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_secondary_color; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_semaphore; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_semaphore_fd; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_semaphore_win32; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_separate_shader_objects; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_separate_specular_color; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_framebuffer_fetch; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_group_vote; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_image_load_formatted; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_image_load_store; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_implicit_conversions; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_integer_mix; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_io_blocks; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_non_constant_global_initializers; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_pixel_local_storage; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_pixel_local_storage2; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_texture_lod; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shadow_funcs; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shadow_samplers; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shared_texture_palette; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_sparse_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_sparse_texture2; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_clear_tag; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_two_side; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_wrap; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_subtexture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture3D; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_array; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_astc_decode_mode; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_astc_decode_mode_rgb9e5; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_bptc; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_dxt1; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_latc; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_rgtc; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_s3tc; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_cube_map; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_cube_map_array; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_edge_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_add; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_combine; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_dot3; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_filter_anisotropic; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_filter_minmax; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_format_BGRA8888; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_integer; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_lod_bias; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_mirror_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_norm16; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_object; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_perturb_normal; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_rectangle; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_rg; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_sRGB; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_sRGB_R8; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_sRGB_RG8; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_sRGB_decode; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_shared_exponent; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_snorm; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_storage; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_swizzle; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_type_2_10_10_10_REV; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_view; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_timer_query; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_transform_feedback; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_unpack_subimage; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_array; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_array_bgra; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_array_setXXX; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_attrib_64bit; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_weighting; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_win32_keyed_mutex; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_window_rectangles; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_x11_sync_object; +GLEW_VAR_EXPORT GLboolean __GLEW_GREMEDY_frame_terminator; +GLEW_VAR_EXPORT GLboolean __GLEW_GREMEDY_string_marker; +GLEW_VAR_EXPORT GLboolean __GLEW_HP_convolution_border_modes; +GLEW_VAR_EXPORT GLboolean __GLEW_HP_image_transform; +GLEW_VAR_EXPORT GLboolean __GLEW_HP_occlusion_test; +GLEW_VAR_EXPORT GLboolean __GLEW_HP_texture_lighting; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_cull_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_multimode_draw_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_rasterpos_clip; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_static_data; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_texture_mirrored_repeat; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_vertex_array_lists; +GLEW_VAR_EXPORT GLboolean __GLEW_INGR_color_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_INGR_interlace_read; +GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_conservative_rasterization; +GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_fragment_shader_ordering; +GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_framebuffer_CMAA; +GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_map_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_parallel_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_performance_query; +GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_texture_scissor; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_blend_equation_advanced; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_blend_equation_advanced_coherent; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_context_flush_control; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_debug; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_no_error; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_parallel_shader_compile; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_robust_buffer_access_behavior; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_robustness; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_texture_compression_astc_hdr; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_texture_compression_astc_ldr; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_texture_compression_astc_sliced_3d; +GLEW_VAR_EXPORT GLboolean __GLEW_KTX_buffer_region; +GLEW_VAR_EXPORT GLboolean __GLEW_MESAX_texture_stack; +GLEW_VAR_EXPORT GLboolean __GLEW_MESA_pack_invert; +GLEW_VAR_EXPORT GLboolean __GLEW_MESA_resize_buffers; +GLEW_VAR_EXPORT GLboolean __GLEW_MESA_shader_integer_functions; +GLEW_VAR_EXPORT GLboolean __GLEW_MESA_window_pos; +GLEW_VAR_EXPORT GLboolean __GLEW_MESA_ycbcr_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_NVX_blend_equation_advanced_multi_draw_buffers; +GLEW_VAR_EXPORT GLboolean __GLEW_NVX_conditional_render; +GLEW_VAR_EXPORT GLboolean __GLEW_NVX_gpu_memory_info; +GLEW_VAR_EXPORT GLboolean __GLEW_NVX_linked_gpu_multicast; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_3dvision_settings; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_EGL_stream_consumer_external; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_alpha_to_coverage_dither_control; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_bgr; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_bindless_multi_draw_indirect; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_bindless_multi_draw_indirect_count; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_bindless_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_blend_equation_advanced; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_blend_equation_advanced_coherent; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_blend_minmax_factor; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_blend_square; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_clip_space_w_scaling; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_command_list; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_compute_program5; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_conditional_render; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_conservative_raster; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_conservative_raster_dilate; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_conservative_raster_pre_snap_triangles; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_copy_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_copy_depth_to_color; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_copy_image; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_deep_texture3D; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_buffer_float; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_range_unclamped; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_draw_buffers; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_draw_instanced; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_draw_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_draw_vulkan_image; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_evaluators; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_explicit_attrib_location; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_explicit_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fbo_color_attachments; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fence; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fill_rectangle; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_float_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fog_distance; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_coverage_to_color; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program_option; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_shader_interlock; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_framebuffer_blit; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_framebuffer_mixed_samples; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_framebuffer_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_framebuffer_multisample_coverage; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_generate_mipmap_sRGB; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_geometry_program4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_geometry_shader4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_geometry_shader_passthrough; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_multicast; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program5; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program5_mem_extended; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program_fp64; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_shader5; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_half_float; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_image_formats; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_instanced_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_internalformat_sample_query; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_light_max_exponent; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_multisample_coverage; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_multisample_filter_hint; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_non_square_matrices; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_occlusion_query; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_pack_subimage; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_packed_depth_stencil; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_packed_float; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_packed_float_linear; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_parameter_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_parameter_buffer_object2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_path_rendering; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_path_rendering_shared_edge; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_pixel_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_pixel_data_range; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_platform_binary; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_point_sprite; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_polygon_mode; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_present_video; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_primitive_restart; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_read_depth; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_read_depth_stencil; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_read_stencil; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_register_combiners; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_register_combiners2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_robustness_video_memory_purge; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_sRGB_formats; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_sample_locations; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_sample_mask_override_coverage; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_atomic_counters; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_atomic_float; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_atomic_float64; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_atomic_fp16_vector; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_atomic_int64; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_buffer_load; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_noperspective_interpolation; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_storage_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_thread_group; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_thread_shuffle; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shadow_samplers_array; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shadow_samplers_cube; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_stereo_view_rendering; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_tessellation_program5; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texgen_emboss; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texgen_reflection; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_array; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_barrier; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_border_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_compression_latc; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_compression_s3tc; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_compression_s3tc_update; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_compression_vtc; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_env_combine4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_expand_normal; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_npot_2D_mipmap; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_rectangle; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_rectangle_compressed; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader3; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_transform_feedback; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_transform_feedback2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_uniform_buffer_unified_memory; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vdpau_interop; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_array_range; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_array_range2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_attrib_integer_64bit; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_buffer_unified_memory; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program1_1; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program2_option; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program3; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_video_capture; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_viewport_array; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_viewport_array2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_viewport_swizzle; +GLEW_VAR_EXPORT GLboolean __GLEW_OES_byte_coordinates; +GLEW_VAR_EXPORT GLboolean __GLEW_OML_interlace; +GLEW_VAR_EXPORT GLboolean __GLEW_OML_resample; +GLEW_VAR_EXPORT GLboolean __GLEW_OML_subsample; +GLEW_VAR_EXPORT GLboolean __GLEW_OVR_multiview; +GLEW_VAR_EXPORT GLboolean __GLEW_OVR_multiview2; +GLEW_VAR_EXPORT GLboolean __GLEW_OVR_multiview_multisampled_render_to_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_PGI_misc_hints; +GLEW_VAR_EXPORT GLboolean __GLEW_PGI_vertex_hints; +GLEW_VAR_EXPORT GLboolean __GLEW_QCOM_alpha_test; +GLEW_VAR_EXPORT GLboolean __GLEW_QCOM_binning_control; +GLEW_VAR_EXPORT GLboolean __GLEW_QCOM_driver_control; +GLEW_VAR_EXPORT GLboolean __GLEW_QCOM_extended_get; +GLEW_VAR_EXPORT GLboolean __GLEW_QCOM_extended_get2; +GLEW_VAR_EXPORT GLboolean __GLEW_QCOM_framebuffer_foveated; +GLEW_VAR_EXPORT GLboolean __GLEW_QCOM_perfmon_global_mode; +GLEW_VAR_EXPORT GLboolean __GLEW_QCOM_shader_framebuffer_fetch_noncoherent; +GLEW_VAR_EXPORT GLboolean __GLEW_QCOM_tiled_rendering; +GLEW_VAR_EXPORT GLboolean __GLEW_QCOM_writeonly_rendering; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_ES1_0_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_ES1_1_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_enable; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_error_string; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_extension_query; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_log; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_proc_address; +GLEW_VAR_EXPORT GLboolean __GLEW_REND_screen_coordinates; +GLEW_VAR_EXPORT GLboolean __GLEW_S3_s3tc; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_clip_band_hint; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_color_range; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_detail_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_fog_function; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_generate_mipmap; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_line_texgen; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_multitexture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_pixel_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_point_line_texgen; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_shared_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_sharpen_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture4D; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_border_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_edge_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_filter4; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_lod; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_select; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async_histogram; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async_pixel; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_bali_g_instruments; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_bali_r_instruments; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_bali_timer_instruments; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_blend_alpha_minmax; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_blend_cadd; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_blend_cmultiply; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_calligraphic_fragment; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_clipmap; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_color_matrix_accuracy; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_color_table_index_mode; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_complex_polar; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_convolution_accuracy; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_cube_map; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_cylinder_texgen; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_datapipe; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_decimation; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_depth_pass_instrument; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_depth_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_dvc; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_flush_raster; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_blend; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_factor_to_alpha; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_layers; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_offset; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_patchy; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_scale; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fragment_lighting_space; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fragment_specular_lighting; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fragments_instrument; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_framezoom; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_icc_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_igloo_interface; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_image_compression; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_impact_pixel_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_instrument_error; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_interlace; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_ir_instrument1; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_line_quality_hint; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_list_priority; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_mpeg1; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_mpeg2; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_nonlinear_lighting_pervertex; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_nurbs_eval; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_occlusion_instrument; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_packed_6bytes; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_pixel_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_pixel_texture_bits; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_pixel_texture_lod; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_pixel_tiles; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_polynomial_ffd; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_quad_mesh; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_reference_plane; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_resample; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_scalebias_hint; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_shadow; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_shadow_ambient; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_slim; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_spotlight_cutoff; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_sprite; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_subdiv_patch; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_subsample; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_tag_sample_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_add_env; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_coordinate_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_lod_bias; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_mipmap_anisotropic; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_multi_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_phase; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_range; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_scale_bias; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_supersample; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_vector_ops; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_vertex_array_object; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_vertex_preclip; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_vertex_preclip_hint; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_ycrcb; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_ycrcb_subsample; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_ycrcba; +GLEW_VAR_EXPORT GLboolean __GLEW_SGI_color_matrix; +GLEW_VAR_EXPORT GLboolean __GLEW_SGI_color_table; +GLEW_VAR_EXPORT GLboolean __GLEW_SGI_complex; +GLEW_VAR_EXPORT GLboolean __GLEW_SGI_complex_type; +GLEW_VAR_EXPORT GLboolean __GLEW_SGI_fft; +GLEW_VAR_EXPORT GLboolean __GLEW_SGI_texture_color_table; +GLEW_VAR_EXPORT GLboolean __GLEW_SUNX_constant_data; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_convolution_border_modes; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_global_alpha; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_mesh_array; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_read_video_pixels; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_slice_accum; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_triangle_list; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_WIN_phong_shading; +GLEW_VAR_EXPORT GLboolean __GLEW_WIN_scene_markerXXX; +GLEW_VAR_EXPORT GLboolean __GLEW_WIN_specular_fog; +GLEW_VAR_EXPORT GLboolean __GLEW_WIN_swap_hint; +/* ------------------------------------------------------------------------- */ + +/* error codes */ +#define GLEW_OK 0 +#define GLEW_NO_ERROR 0 +#define GLEW_ERROR_NO_GL_VERSION 1 /* missing GL version */ +#define GLEW_ERROR_GL_VERSION_10_ONLY 2 /* Need at least OpenGL 1.1 */ +#define GLEW_ERROR_GLX_VERSION_11_ONLY 3 /* Need at least GLX 1.2 */ +#define GLEW_ERROR_NO_GLX_DISPLAY 4 /* Need GLX display for GLX support */ + +/* string codes */ +#define GLEW_VERSION 1 +#define GLEW_VERSION_MAJOR 2 +#define GLEW_VERSION_MINOR 3 +#define GLEW_VERSION_MICRO 4 + +/* ------------------------------------------------------------------------- */ + +/* GLEW version info */ + +/* +VERSION 2.1.0 +VERSION_MAJOR 2 +VERSION_MINOR 1 +VERSION_MICRO 0 +*/ + +/* API */ +GLEWAPI GLenum GLEWAPIENTRY glewInit (void); +GLEWAPI GLboolean GLEWAPIENTRY glewIsSupported (const char *name); +#define glewIsExtensionSupported(x) glewIsSupported(x) + +#ifndef GLEW_GET_VAR +#define GLEW_GET_VAR(x) (*(const GLboolean*)&x) +#endif + +#ifndef GLEW_GET_FUN +#define GLEW_GET_FUN(x) x +#endif + +GLEWAPI GLboolean glewExperimental; +GLEWAPI GLboolean GLEWAPIENTRY glewGetExtension (const char *name); +GLEWAPI const GLubyte * GLEWAPIENTRY glewGetErrorString (GLenum error); +GLEWAPI const GLubyte * GLEWAPIENTRY glewGetString (GLenum name); + +#ifdef __cplusplus +} +#endif + +#ifdef GLEW_APIENTRY_DEFINED +#undef GLEW_APIENTRY_DEFINED +#undef APIENTRY +#endif + +#ifdef GLEW_CALLBACK_DEFINED +#undef GLEW_CALLBACK_DEFINED +#undef CALLBACK +#endif + +#ifdef GLEW_WINGDIAPI_DEFINED +#undef GLEW_WINGDIAPI_DEFINED +#undef WINGDIAPI +#endif + +#undef GLAPI +/* #undef GLEWAPI */ + +#endif /* __glew_h__ */ diff --git a/r5dev/thirdparty/cppnet/cppkore_docs/glew_reference/glxew.h b/r5dev/thirdparty/cppnet/cppkore_docs/glew_reference/glxew.h new file mode 100644 index 00000000..7e39c2fd --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore_docs/glew_reference/glxew.h @@ -0,0 +1,1775 @@ +/* +** The OpenGL Extension Wrangler Library +** Copyright (C) 2008-2017, Nigel Stewart +** Copyright (C) 2002-2008, Milan Ikits +** Copyright (C) 2002-2008, Marcelo E. Magallon +** Copyright (C) 2002, Lev Povalahev +** All rights reserved. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are met: +** +** * Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** * The name of the author may be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +** THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/* + * Mesa 3-D graphics library + * Version: 7.0 + * + * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* +** Copyright (c) 2007 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 +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +#ifndef __glxew_h__ +#define __glxew_h__ +#define __GLXEW_H__ + +#ifdef __glxext_h_ +#error glxext.h included before glxew.h +#endif + +#if defined(GLX_H) || defined(__GLX_glx_h__) || defined(__glx_h__) +#error glx.h included before glxew.h +#endif + +#define __glxext_h_ + +#define GLX_H +#define __GLX_glx_h__ +#define __glx_h__ + +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* ---------------------------- GLX_VERSION_1_0 --------------------------- */ + +#ifndef GLX_VERSION_1_0 +#define GLX_VERSION_1_0 1 + +#define GLX_USE_GL 1 +#define GLX_BUFFER_SIZE 2 +#define GLX_LEVEL 3 +#define GLX_RGBA 4 +#define GLX_DOUBLEBUFFER 5 +#define GLX_STEREO 6 +#define GLX_AUX_BUFFERS 7 +#define GLX_RED_SIZE 8 +#define GLX_GREEN_SIZE 9 +#define GLX_BLUE_SIZE 10 +#define GLX_ALPHA_SIZE 11 +#define GLX_DEPTH_SIZE 12 +#define GLX_STENCIL_SIZE 13 +#define GLX_ACCUM_RED_SIZE 14 +#define GLX_ACCUM_GREEN_SIZE 15 +#define GLX_ACCUM_BLUE_SIZE 16 +#define GLX_ACCUM_ALPHA_SIZE 17 +#define GLX_BAD_SCREEN 1 +#define GLX_BAD_ATTRIBUTE 2 +#define GLX_NO_EXTENSION 3 +#define GLX_BAD_VISUAL 4 +#define GLX_BAD_CONTEXT 5 +#define GLX_BAD_VALUE 6 +#define GLX_BAD_ENUM 7 + +typedef XID GLXDrawable; +typedef XID GLXPixmap; +#ifdef __sun +typedef struct __glXContextRec *GLXContext; +#else +typedef struct __GLXcontextRec *GLXContext; +#endif + +typedef unsigned int GLXVideoDeviceNV; + +extern Bool glXQueryExtension (Display *dpy, int *errorBase, int *eventBase); +extern Bool glXQueryVersion (Display *dpy, int *major, int *minor); +extern int glXGetConfig (Display *dpy, XVisualInfo *vis, int attrib, int *value); +extern XVisualInfo* glXChooseVisual (Display *dpy, int screen, int *attribList); +extern GLXPixmap glXCreateGLXPixmap (Display *dpy, XVisualInfo *vis, Pixmap pixmap); +extern void glXDestroyGLXPixmap (Display *dpy, GLXPixmap pix); +extern GLXContext glXCreateContext (Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct); +extern void glXDestroyContext (Display *dpy, GLXContext ctx); +extern Bool glXIsDirect (Display *dpy, GLXContext ctx); +extern void glXCopyContext (Display *dpy, GLXContext src, GLXContext dst, GLulong mask); +extern Bool glXMakeCurrent (Display *dpy, GLXDrawable drawable, GLXContext ctx); +extern GLXContext glXGetCurrentContext (void); +extern GLXDrawable glXGetCurrentDrawable (void); +extern void glXWaitGL (void); +extern void glXWaitX (void); +extern void glXSwapBuffers (Display *dpy, GLXDrawable drawable); +extern void glXUseXFont (Font font, int first, int count, int listBase); + +#define GLXEW_VERSION_1_0 GLXEW_GET_VAR(__GLXEW_VERSION_1_0) + +#endif /* GLX_VERSION_1_0 */ + +/* ---------------------------- GLX_VERSION_1_1 --------------------------- */ + +#ifndef GLX_VERSION_1_1 +#define GLX_VERSION_1_1 + +#define GLX_VENDOR 0x1 +#define GLX_VERSION 0x2 +#define GLX_EXTENSIONS 0x3 + +extern const char* glXQueryExtensionsString (Display *dpy, int screen); +extern const char* glXGetClientString (Display *dpy, int name); +extern const char* glXQueryServerString (Display *dpy, int screen, int name); + +#define GLXEW_VERSION_1_1 GLXEW_GET_VAR(__GLXEW_VERSION_1_1) + +#endif /* GLX_VERSION_1_1 */ + +/* ---------------------------- GLX_VERSION_1_2 ---------------------------- */ + +#ifndef GLX_VERSION_1_2 +#define GLX_VERSION_1_2 1 + +typedef Display* ( * PFNGLXGETCURRENTDISPLAYPROC) (void); + +#define glXGetCurrentDisplay GLXEW_GET_FUN(__glewXGetCurrentDisplay) + +#define GLXEW_VERSION_1_2 GLXEW_GET_VAR(__GLXEW_VERSION_1_2) + +#endif /* GLX_VERSION_1_2 */ + +/* ---------------------------- GLX_VERSION_1_3 ---------------------------- */ + +#ifndef GLX_VERSION_1_3 +#define GLX_VERSION_1_3 1 + +#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001 +#define GLX_RGBA_BIT 0x00000001 +#define GLX_WINDOW_BIT 0x00000001 +#define GLX_COLOR_INDEX_BIT 0x00000002 +#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002 +#define GLX_PIXMAP_BIT 0x00000002 +#define GLX_BACK_LEFT_BUFFER_BIT 0x00000004 +#define GLX_PBUFFER_BIT 0x00000004 +#define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008 +#define GLX_AUX_BUFFERS_BIT 0x00000010 +#define GLX_CONFIG_CAVEAT 0x20 +#define GLX_DEPTH_BUFFER_BIT 0x00000020 +#define GLX_X_VISUAL_TYPE 0x22 +#define GLX_TRANSPARENT_TYPE 0x23 +#define GLX_TRANSPARENT_INDEX_VALUE 0x24 +#define GLX_TRANSPARENT_RED_VALUE 0x25 +#define GLX_TRANSPARENT_GREEN_VALUE 0x26 +#define GLX_TRANSPARENT_BLUE_VALUE 0x27 +#define GLX_TRANSPARENT_ALPHA_VALUE 0x28 +#define GLX_STENCIL_BUFFER_BIT 0x00000040 +#define GLX_ACCUM_BUFFER_BIT 0x00000080 +#define GLX_NONE 0x8000 +#define GLX_SLOW_CONFIG 0x8001 +#define GLX_TRUE_COLOR 0x8002 +#define GLX_DIRECT_COLOR 0x8003 +#define GLX_PSEUDO_COLOR 0x8004 +#define GLX_STATIC_COLOR 0x8005 +#define GLX_GRAY_SCALE 0x8006 +#define GLX_STATIC_GRAY 0x8007 +#define GLX_TRANSPARENT_RGB 0x8008 +#define GLX_TRANSPARENT_INDEX 0x8009 +#define GLX_VISUAL_ID 0x800B +#define GLX_SCREEN 0x800C +#define GLX_NON_CONFORMANT_CONFIG 0x800D +#define GLX_DRAWABLE_TYPE 0x8010 +#define GLX_RENDER_TYPE 0x8011 +#define GLX_X_RENDERABLE 0x8012 +#define GLX_FBCONFIG_ID 0x8013 +#define GLX_RGBA_TYPE 0x8014 +#define GLX_COLOR_INDEX_TYPE 0x8015 +#define GLX_MAX_PBUFFER_WIDTH 0x8016 +#define GLX_MAX_PBUFFER_HEIGHT 0x8017 +#define GLX_MAX_PBUFFER_PIXELS 0x8018 +#define GLX_PRESERVED_CONTENTS 0x801B +#define GLX_LARGEST_PBUFFER 0x801C +#define GLX_WIDTH 0x801D +#define GLX_HEIGHT 0x801E +#define GLX_EVENT_MASK 0x801F +#define GLX_DAMAGED 0x8020 +#define GLX_SAVED 0x8021 +#define GLX_WINDOW 0x8022 +#define GLX_PBUFFER 0x8023 +#define GLX_PBUFFER_HEIGHT 0x8040 +#define GLX_PBUFFER_WIDTH 0x8041 +#define GLX_PBUFFER_CLOBBER_MASK 0x08000000 +#define GLX_DONT_CARE 0xFFFFFFFF + +typedef XID GLXFBConfigID; +typedef XID GLXPbuffer; +typedef XID GLXWindow; +typedef struct __GLXFBConfigRec *GLXFBConfig; + +typedef struct { + int event_type; + int draw_type; + unsigned long serial; + Bool send_event; + Display *display; + GLXDrawable drawable; + unsigned int buffer_mask; + unsigned int aux_buffer; + int x, y; + int width, height; + int count; +} GLXPbufferClobberEvent; +typedef union __GLXEvent { + GLXPbufferClobberEvent glxpbufferclobber; + long pad[24]; +} GLXEvent; + +typedef GLXFBConfig* ( * PFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements); +typedef GLXContext ( * PFNGLXCREATENEWCONTEXTPROC) (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct); +typedef GLXPbuffer ( * PFNGLXCREATEPBUFFERPROC) (Display *dpy, GLXFBConfig config, const int *attrib_list); +typedef GLXPixmap ( * PFNGLXCREATEPIXMAPPROC) (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list); +typedef GLXWindow ( * PFNGLXCREATEWINDOWPROC) (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list); +typedef void ( * PFNGLXDESTROYPBUFFERPROC) (Display *dpy, GLXPbuffer pbuf); +typedef void ( * PFNGLXDESTROYPIXMAPPROC) (Display *dpy, GLXPixmap pixmap); +typedef void ( * PFNGLXDESTROYWINDOWPROC) (Display *dpy, GLXWindow win); +typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLEPROC) (void); +typedef int ( * PFNGLXGETFBCONFIGATTRIBPROC) (Display *dpy, GLXFBConfig config, int attribute, int *value); +typedef GLXFBConfig* ( * PFNGLXGETFBCONFIGSPROC) (Display *dpy, int screen, int *nelements); +typedef void ( * PFNGLXGETSELECTEDEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask); +typedef XVisualInfo* ( * PFNGLXGETVISUALFROMFBCONFIGPROC) (Display *dpy, GLXFBConfig config); +typedef Bool ( * PFNGLXMAKECONTEXTCURRENTPROC) (Display *display, GLXDrawable draw, GLXDrawable read, GLXContext ctx); +typedef int ( * PFNGLXQUERYCONTEXTPROC) (Display *dpy, GLXContext ctx, int attribute, int *value); +typedef void ( * PFNGLXQUERYDRAWABLEPROC) (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value); +typedef void ( * PFNGLXSELECTEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long event_mask); + +#define glXChooseFBConfig GLXEW_GET_FUN(__glewXChooseFBConfig) +#define glXCreateNewContext GLXEW_GET_FUN(__glewXCreateNewContext) +#define glXCreatePbuffer GLXEW_GET_FUN(__glewXCreatePbuffer) +#define glXCreatePixmap GLXEW_GET_FUN(__glewXCreatePixmap) +#define glXCreateWindow GLXEW_GET_FUN(__glewXCreateWindow) +#define glXDestroyPbuffer GLXEW_GET_FUN(__glewXDestroyPbuffer) +#define glXDestroyPixmap GLXEW_GET_FUN(__glewXDestroyPixmap) +#define glXDestroyWindow GLXEW_GET_FUN(__glewXDestroyWindow) +#define glXGetCurrentReadDrawable GLXEW_GET_FUN(__glewXGetCurrentReadDrawable) +#define glXGetFBConfigAttrib GLXEW_GET_FUN(__glewXGetFBConfigAttrib) +#define glXGetFBConfigs GLXEW_GET_FUN(__glewXGetFBConfigs) +#define glXGetSelectedEvent GLXEW_GET_FUN(__glewXGetSelectedEvent) +#define glXGetVisualFromFBConfig GLXEW_GET_FUN(__glewXGetVisualFromFBConfig) +#define glXMakeContextCurrent GLXEW_GET_FUN(__glewXMakeContextCurrent) +#define glXQueryContext GLXEW_GET_FUN(__glewXQueryContext) +#define glXQueryDrawable GLXEW_GET_FUN(__glewXQueryDrawable) +#define glXSelectEvent GLXEW_GET_FUN(__glewXSelectEvent) + +#define GLXEW_VERSION_1_3 GLXEW_GET_VAR(__GLXEW_VERSION_1_3) + +#endif /* GLX_VERSION_1_3 */ + +/* ---------------------------- GLX_VERSION_1_4 ---------------------------- */ + +#ifndef GLX_VERSION_1_4 +#define GLX_VERSION_1_4 1 + +#define GLX_SAMPLE_BUFFERS 100000 +#define GLX_SAMPLES 100001 + +extern void ( * glXGetProcAddress (const GLubyte *procName)) (void); + +#define GLXEW_VERSION_1_4 GLXEW_GET_VAR(__GLXEW_VERSION_1_4) + +#endif /* GLX_VERSION_1_4 */ + +/* -------------------------- GLX_3DFX_multisample ------------------------- */ + +#ifndef GLX_3DFX_multisample +#define GLX_3DFX_multisample 1 + +#define GLX_SAMPLE_BUFFERS_3DFX 0x8050 +#define GLX_SAMPLES_3DFX 0x8051 + +#define GLXEW_3DFX_multisample GLXEW_GET_VAR(__GLXEW_3DFX_multisample) + +#endif /* GLX_3DFX_multisample */ + +/* ------------------------ GLX_AMD_gpu_association ------------------------ */ + +#ifndef GLX_AMD_gpu_association +#define GLX_AMD_gpu_association 1 + +#define GLX_GPU_VENDOR_AMD 0x1F00 +#define GLX_GPU_RENDERER_STRING_AMD 0x1F01 +#define GLX_GPU_OPENGL_VERSION_STRING_AMD 0x1F02 +#define GLX_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2 +#define GLX_GPU_RAM_AMD 0x21A3 +#define GLX_GPU_CLOCK_AMD 0x21A4 +#define GLX_GPU_NUM_PIPES_AMD 0x21A5 +#define GLX_GPU_NUM_SIMD_AMD 0x21A6 +#define GLX_GPU_NUM_RB_AMD 0x21A7 +#define GLX_GPU_NUM_SPI_AMD 0x21A8 + +typedef void ( * PFNGLXBLITCONTEXTFRAMEBUFFERAMDPROC) (GLXContext dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +typedef GLXContext ( * PFNGLXCREATEASSOCIATEDCONTEXTAMDPROC) (unsigned int id, GLXContext share_list); +typedef GLXContext ( * PFNGLXCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (unsigned int id, GLXContext share_context, const int* attribList); +typedef Bool ( * PFNGLXDELETEASSOCIATEDCONTEXTAMDPROC) (GLXContext ctx); +typedef unsigned int ( * PFNGLXGETCONTEXTGPUIDAMDPROC) (GLXContext ctx); +typedef GLXContext ( * PFNGLXGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void); +typedef unsigned int ( * PFNGLXGETGPUIDSAMDPROC) (unsigned int maxCount, unsigned int* ids); +typedef int ( * PFNGLXGETGPUINFOAMDPROC) (unsigned int id, int property, GLenum dataType, unsigned int size, void* data); +typedef Bool ( * PFNGLXMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (GLXContext ctx); + +#define glXBlitContextFramebufferAMD GLXEW_GET_FUN(__glewXBlitContextFramebufferAMD) +#define glXCreateAssociatedContextAMD GLXEW_GET_FUN(__glewXCreateAssociatedContextAMD) +#define glXCreateAssociatedContextAttribsAMD GLXEW_GET_FUN(__glewXCreateAssociatedContextAttribsAMD) +#define glXDeleteAssociatedContextAMD GLXEW_GET_FUN(__glewXDeleteAssociatedContextAMD) +#define glXGetContextGPUIDAMD GLXEW_GET_FUN(__glewXGetContextGPUIDAMD) +#define glXGetCurrentAssociatedContextAMD GLXEW_GET_FUN(__glewXGetCurrentAssociatedContextAMD) +#define glXGetGPUIDsAMD GLXEW_GET_FUN(__glewXGetGPUIDsAMD) +#define glXGetGPUInfoAMD GLXEW_GET_FUN(__glewXGetGPUInfoAMD) +#define glXMakeAssociatedContextCurrentAMD GLXEW_GET_FUN(__glewXMakeAssociatedContextCurrentAMD) + +#define GLXEW_AMD_gpu_association GLXEW_GET_VAR(__GLXEW_AMD_gpu_association) + +#endif /* GLX_AMD_gpu_association */ + +/* --------------------- GLX_ARB_context_flush_control --------------------- */ + +#ifndef GLX_ARB_context_flush_control +#define GLX_ARB_context_flush_control 1 + +#define GLXEW_ARB_context_flush_control GLXEW_GET_VAR(__GLXEW_ARB_context_flush_control) + +#endif /* GLX_ARB_context_flush_control */ + +/* ------------------------- GLX_ARB_create_context ------------------------ */ + +#ifndef GLX_ARB_create_context +#define GLX_ARB_create_context 1 + +#define GLX_CONTEXT_DEBUG_BIT_ARB 0x0001 +#define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002 +#define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091 +#define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092 +#define GLX_CONTEXT_FLAGS_ARB 0x2094 + +typedef GLXContext ( * PFNGLXCREATECONTEXTATTRIBSARBPROC) (Display* dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list); + +#define glXCreateContextAttribsARB GLXEW_GET_FUN(__glewXCreateContextAttribsARB) + +#define GLXEW_ARB_create_context GLXEW_GET_VAR(__GLXEW_ARB_create_context) + +#endif /* GLX_ARB_create_context */ + +/* -------------------- GLX_ARB_create_context_no_error -------------------- */ + +#ifndef GLX_ARB_create_context_no_error +#define GLX_ARB_create_context_no_error 1 + +#define GLXEW_ARB_create_context_no_error GLXEW_GET_VAR(__GLXEW_ARB_create_context_no_error) + +#endif /* GLX_ARB_create_context_no_error */ + +/* --------------------- GLX_ARB_create_context_profile -------------------- */ + +#ifndef GLX_ARB_create_context_profile +#define GLX_ARB_create_context_profile 1 + +#define GLX_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001 +#define GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002 +#define GLX_CONTEXT_PROFILE_MASK_ARB 0x9126 + +#define GLXEW_ARB_create_context_profile GLXEW_GET_VAR(__GLXEW_ARB_create_context_profile) + +#endif /* GLX_ARB_create_context_profile */ + +/* ------------------- GLX_ARB_create_context_robustness ------------------- */ + +#ifndef GLX_ARB_create_context_robustness +#define GLX_ARB_create_context_robustness 1 + +#define GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004 +#define GLX_LOSE_CONTEXT_ON_RESET_ARB 0x8252 +#define GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 +#define GLX_NO_RESET_NOTIFICATION_ARB 0x8261 + +#define GLXEW_ARB_create_context_robustness GLXEW_GET_VAR(__GLXEW_ARB_create_context_robustness) + +#endif /* GLX_ARB_create_context_robustness */ + +/* ------------------------- GLX_ARB_fbconfig_float ------------------------ */ + +#ifndef GLX_ARB_fbconfig_float +#define GLX_ARB_fbconfig_float 1 + +#define GLX_RGBA_FLOAT_BIT_ARB 0x00000004 +#define GLX_RGBA_FLOAT_TYPE_ARB 0x20B9 + +#define GLXEW_ARB_fbconfig_float GLXEW_GET_VAR(__GLXEW_ARB_fbconfig_float) + +#endif /* GLX_ARB_fbconfig_float */ + +/* ------------------------ GLX_ARB_framebuffer_sRGB ----------------------- */ + +#ifndef GLX_ARB_framebuffer_sRGB +#define GLX_ARB_framebuffer_sRGB 1 + +#define GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20B2 + +#define GLXEW_ARB_framebuffer_sRGB GLXEW_GET_VAR(__GLXEW_ARB_framebuffer_sRGB) + +#endif /* GLX_ARB_framebuffer_sRGB */ + +/* ------------------------ GLX_ARB_get_proc_address ----------------------- */ + +#ifndef GLX_ARB_get_proc_address +#define GLX_ARB_get_proc_address 1 + +extern void ( * glXGetProcAddressARB (const GLubyte *procName)) (void); + +#define GLXEW_ARB_get_proc_address GLXEW_GET_VAR(__GLXEW_ARB_get_proc_address) + +#endif /* GLX_ARB_get_proc_address */ + +/* -------------------------- GLX_ARB_multisample -------------------------- */ + +#ifndef GLX_ARB_multisample +#define GLX_ARB_multisample 1 + +#define GLX_SAMPLE_BUFFERS_ARB 100000 +#define GLX_SAMPLES_ARB 100001 + +#define GLXEW_ARB_multisample GLXEW_GET_VAR(__GLXEW_ARB_multisample) + +#endif /* GLX_ARB_multisample */ + +/* ---------------- GLX_ARB_robustness_application_isolation --------------- */ + +#ifndef GLX_ARB_robustness_application_isolation +#define GLX_ARB_robustness_application_isolation 1 + +#define GLX_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 + +#define GLXEW_ARB_robustness_application_isolation GLXEW_GET_VAR(__GLXEW_ARB_robustness_application_isolation) + +#endif /* GLX_ARB_robustness_application_isolation */ + +/* ---------------- GLX_ARB_robustness_share_group_isolation --------------- */ + +#ifndef GLX_ARB_robustness_share_group_isolation +#define GLX_ARB_robustness_share_group_isolation 1 + +#define GLX_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 + +#define GLXEW_ARB_robustness_share_group_isolation GLXEW_GET_VAR(__GLXEW_ARB_robustness_share_group_isolation) + +#endif /* GLX_ARB_robustness_share_group_isolation */ + +/* ---------------------- GLX_ARB_vertex_buffer_object --------------------- */ + +#ifndef GLX_ARB_vertex_buffer_object +#define GLX_ARB_vertex_buffer_object 1 + +#define GLX_CONTEXT_ALLOW_BUFFER_BYTE_ORDER_MISMATCH_ARB 0x2095 + +#define GLXEW_ARB_vertex_buffer_object GLXEW_GET_VAR(__GLXEW_ARB_vertex_buffer_object) + +#endif /* GLX_ARB_vertex_buffer_object */ + +/* ----------------------- GLX_ATI_pixel_format_float ---------------------- */ + +#ifndef GLX_ATI_pixel_format_float +#define GLX_ATI_pixel_format_float 1 + +#define GLX_RGBA_FLOAT_ATI_BIT 0x00000100 + +#define GLXEW_ATI_pixel_format_float GLXEW_GET_VAR(__GLXEW_ATI_pixel_format_float) + +#endif /* GLX_ATI_pixel_format_float */ + +/* ------------------------- GLX_ATI_render_texture ------------------------ */ + +#ifndef GLX_ATI_render_texture +#define GLX_ATI_render_texture 1 + +#define GLX_BIND_TO_TEXTURE_RGB_ATI 0x9800 +#define GLX_BIND_TO_TEXTURE_RGBA_ATI 0x9801 +#define GLX_TEXTURE_FORMAT_ATI 0x9802 +#define GLX_TEXTURE_TARGET_ATI 0x9803 +#define GLX_MIPMAP_TEXTURE_ATI 0x9804 +#define GLX_TEXTURE_RGB_ATI 0x9805 +#define GLX_TEXTURE_RGBA_ATI 0x9806 +#define GLX_NO_TEXTURE_ATI 0x9807 +#define GLX_TEXTURE_CUBE_MAP_ATI 0x9808 +#define GLX_TEXTURE_1D_ATI 0x9809 +#define GLX_TEXTURE_2D_ATI 0x980A +#define GLX_MIPMAP_LEVEL_ATI 0x980B +#define GLX_CUBE_MAP_FACE_ATI 0x980C +#define GLX_TEXTURE_CUBE_MAP_POSITIVE_X_ATI 0x980D +#define GLX_TEXTURE_CUBE_MAP_NEGATIVE_X_ATI 0x980E +#define GLX_TEXTURE_CUBE_MAP_POSITIVE_Y_ATI 0x980F +#define GLX_TEXTURE_CUBE_MAP_NEGATIVE_Y_ATI 0x9810 +#define GLX_TEXTURE_CUBE_MAP_POSITIVE_Z_ATI 0x9811 +#define GLX_TEXTURE_CUBE_MAP_NEGATIVE_Z_ATI 0x9812 +#define GLX_FRONT_LEFT_ATI 0x9813 +#define GLX_FRONT_RIGHT_ATI 0x9814 +#define GLX_BACK_LEFT_ATI 0x9815 +#define GLX_BACK_RIGHT_ATI 0x9816 +#define GLX_AUX0_ATI 0x9817 +#define GLX_AUX1_ATI 0x9818 +#define GLX_AUX2_ATI 0x9819 +#define GLX_AUX3_ATI 0x981A +#define GLX_AUX4_ATI 0x981B +#define GLX_AUX5_ATI 0x981C +#define GLX_AUX6_ATI 0x981D +#define GLX_AUX7_ATI 0x981E +#define GLX_AUX8_ATI 0x981F +#define GLX_AUX9_ATI 0x9820 +#define GLX_BIND_TO_TEXTURE_LUMINANCE_ATI 0x9821 +#define GLX_BIND_TO_TEXTURE_INTENSITY_ATI 0x9822 + +typedef void ( * PFNGLXBINDTEXIMAGEATIPROC) (Display *dpy, GLXPbuffer pbuf, int buffer); +typedef void ( * PFNGLXDRAWABLEATTRIBATIPROC) (Display *dpy, GLXDrawable draw, const int *attrib_list); +typedef void ( * PFNGLXRELEASETEXIMAGEATIPROC) (Display *dpy, GLXPbuffer pbuf, int buffer); + +#define glXBindTexImageATI GLXEW_GET_FUN(__glewXBindTexImageATI) +#define glXDrawableAttribATI GLXEW_GET_FUN(__glewXDrawableAttribATI) +#define glXReleaseTexImageATI GLXEW_GET_FUN(__glewXReleaseTexImageATI) + +#define GLXEW_ATI_render_texture GLXEW_GET_VAR(__GLXEW_ATI_render_texture) + +#endif /* GLX_ATI_render_texture */ + +/* --------------------------- GLX_EXT_buffer_age -------------------------- */ + +#ifndef GLX_EXT_buffer_age +#define GLX_EXT_buffer_age 1 + +#define GLX_BACK_BUFFER_AGE_EXT 0x20F4 + +#define GLXEW_EXT_buffer_age GLXEW_GET_VAR(__GLXEW_EXT_buffer_age) + +#endif /* GLX_EXT_buffer_age */ + +/* ------------------- GLX_EXT_create_context_es2_profile ------------------ */ + +#ifndef GLX_EXT_create_context_es2_profile +#define GLX_EXT_create_context_es2_profile 1 + +#define GLX_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004 + +#define GLXEW_EXT_create_context_es2_profile GLXEW_GET_VAR(__GLXEW_EXT_create_context_es2_profile) + +#endif /* GLX_EXT_create_context_es2_profile */ + +/* ------------------- GLX_EXT_create_context_es_profile ------------------- */ + +#ifndef GLX_EXT_create_context_es_profile +#define GLX_EXT_create_context_es_profile 1 + +#define GLX_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004 + +#define GLXEW_EXT_create_context_es_profile GLXEW_GET_VAR(__GLXEW_EXT_create_context_es_profile) + +#endif /* GLX_EXT_create_context_es_profile */ + +/* --------------------- GLX_EXT_fbconfig_packed_float --------------------- */ + +#ifndef GLX_EXT_fbconfig_packed_float +#define GLX_EXT_fbconfig_packed_float 1 + +#define GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT 0x00000008 +#define GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT 0x20B1 + +#define GLXEW_EXT_fbconfig_packed_float GLXEW_GET_VAR(__GLXEW_EXT_fbconfig_packed_float) + +#endif /* GLX_EXT_fbconfig_packed_float */ + +/* ------------------------ GLX_EXT_framebuffer_sRGB ----------------------- */ + +#ifndef GLX_EXT_framebuffer_sRGB +#define GLX_EXT_framebuffer_sRGB 1 + +#define GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20B2 + +#define GLXEW_EXT_framebuffer_sRGB GLXEW_GET_VAR(__GLXEW_EXT_framebuffer_sRGB) + +#endif /* GLX_EXT_framebuffer_sRGB */ + +/* ------------------------- GLX_EXT_import_context ------------------------ */ + +#ifndef GLX_EXT_import_context +#define GLX_EXT_import_context 1 + +#define GLX_SHARE_CONTEXT_EXT 0x800A +#define GLX_VISUAL_ID_EXT 0x800B +#define GLX_SCREEN_EXT 0x800C + +typedef XID GLXContextID; + +typedef void ( * PFNGLXFREECONTEXTEXTPROC) (Display* dpy, GLXContext context); +typedef GLXContextID ( * PFNGLXGETCONTEXTIDEXTPROC) (const GLXContext context); +typedef GLXContext ( * PFNGLXIMPORTCONTEXTEXTPROC) (Display* dpy, GLXContextID contextID); +typedef int ( * PFNGLXQUERYCONTEXTINFOEXTPROC) (Display* dpy, GLXContext context, int attribute,int *value); + +#define glXFreeContextEXT GLXEW_GET_FUN(__glewXFreeContextEXT) +#define glXGetContextIDEXT GLXEW_GET_FUN(__glewXGetContextIDEXT) +#define glXImportContextEXT GLXEW_GET_FUN(__glewXImportContextEXT) +#define glXQueryContextInfoEXT GLXEW_GET_FUN(__glewXQueryContextInfoEXT) + +#define GLXEW_EXT_import_context GLXEW_GET_VAR(__GLXEW_EXT_import_context) + +#endif /* GLX_EXT_import_context */ + +/* ---------------------------- GLX_EXT_libglvnd --------------------------- */ + +#ifndef GLX_EXT_libglvnd +#define GLX_EXT_libglvnd 1 + +#define GLX_VENDOR_NAMES_EXT 0x20F6 + +#define GLXEW_EXT_libglvnd GLXEW_GET_VAR(__GLXEW_EXT_libglvnd) + +#endif /* GLX_EXT_libglvnd */ + +/* -------------------------- GLX_EXT_scene_marker ------------------------- */ + +#ifndef GLX_EXT_scene_marker +#define GLX_EXT_scene_marker 1 + +#define GLXEW_EXT_scene_marker GLXEW_GET_VAR(__GLXEW_EXT_scene_marker) + +#endif /* GLX_EXT_scene_marker */ + +/* -------------------------- GLX_EXT_stereo_tree -------------------------- */ + +#ifndef GLX_EXT_stereo_tree +#define GLX_EXT_stereo_tree 1 + +#define GLX_STEREO_NOTIFY_EXT 0x00000000 +#define GLX_STEREO_NOTIFY_MASK_EXT 0x00000001 +#define GLX_STEREO_TREE_EXT 0x20F5 + +#define GLXEW_EXT_stereo_tree GLXEW_GET_VAR(__GLXEW_EXT_stereo_tree) + +#endif /* GLX_EXT_stereo_tree */ + +/* -------------------------- GLX_EXT_swap_control ------------------------- */ + +#ifndef GLX_EXT_swap_control +#define GLX_EXT_swap_control 1 + +#define GLX_SWAP_INTERVAL_EXT 0x20F1 +#define GLX_MAX_SWAP_INTERVAL_EXT 0x20F2 + +typedef void ( * PFNGLXSWAPINTERVALEXTPROC) (Display* dpy, GLXDrawable drawable, int interval); + +#define glXSwapIntervalEXT GLXEW_GET_FUN(__glewXSwapIntervalEXT) + +#define GLXEW_EXT_swap_control GLXEW_GET_VAR(__GLXEW_EXT_swap_control) + +#endif /* GLX_EXT_swap_control */ + +/* ----------------------- GLX_EXT_swap_control_tear ----------------------- */ + +#ifndef GLX_EXT_swap_control_tear +#define GLX_EXT_swap_control_tear 1 + +#define GLX_LATE_SWAPS_TEAR_EXT 0x20F3 + +#define GLXEW_EXT_swap_control_tear GLXEW_GET_VAR(__GLXEW_EXT_swap_control_tear) + +#endif /* GLX_EXT_swap_control_tear */ + +/* ---------------------- GLX_EXT_texture_from_pixmap ---------------------- */ + +#ifndef GLX_EXT_texture_from_pixmap +#define GLX_EXT_texture_from_pixmap 1 + +#define GLX_TEXTURE_1D_BIT_EXT 0x00000001 +#define GLX_TEXTURE_2D_BIT_EXT 0x00000002 +#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004 +#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0 +#define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1 +#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2 +#define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3 +#define GLX_Y_INVERTED_EXT 0x20D4 +#define GLX_TEXTURE_FORMAT_EXT 0x20D5 +#define GLX_TEXTURE_TARGET_EXT 0x20D6 +#define GLX_MIPMAP_TEXTURE_EXT 0x20D7 +#define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8 +#define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9 +#define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA +#define GLX_TEXTURE_1D_EXT 0x20DB +#define GLX_TEXTURE_2D_EXT 0x20DC +#define GLX_TEXTURE_RECTANGLE_EXT 0x20DD +#define GLX_FRONT_LEFT_EXT 0x20DE +#define GLX_FRONT_RIGHT_EXT 0x20DF +#define GLX_BACK_LEFT_EXT 0x20E0 +#define GLX_BACK_RIGHT_EXT 0x20E1 +#define GLX_AUX0_EXT 0x20E2 +#define GLX_AUX1_EXT 0x20E3 +#define GLX_AUX2_EXT 0x20E4 +#define GLX_AUX3_EXT 0x20E5 +#define GLX_AUX4_EXT 0x20E6 +#define GLX_AUX5_EXT 0x20E7 +#define GLX_AUX6_EXT 0x20E8 +#define GLX_AUX7_EXT 0x20E9 +#define GLX_AUX8_EXT 0x20EA +#define GLX_AUX9_EXT 0x20EB + +typedef void ( * PFNGLXBINDTEXIMAGEEXTPROC) (Display* display, GLXDrawable drawable, int buffer, const int *attrib_list); +typedef void ( * PFNGLXRELEASETEXIMAGEEXTPROC) (Display* display, GLXDrawable drawable, int buffer); + +#define glXBindTexImageEXT GLXEW_GET_FUN(__glewXBindTexImageEXT) +#define glXReleaseTexImageEXT GLXEW_GET_FUN(__glewXReleaseTexImageEXT) + +#define GLXEW_EXT_texture_from_pixmap GLXEW_GET_VAR(__GLXEW_EXT_texture_from_pixmap) + +#endif /* GLX_EXT_texture_from_pixmap */ + +/* -------------------------- GLX_EXT_visual_info -------------------------- */ + +#ifndef GLX_EXT_visual_info +#define GLX_EXT_visual_info 1 + +#define GLX_X_VISUAL_TYPE_EXT 0x22 +#define GLX_TRANSPARENT_TYPE_EXT 0x23 +#define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24 +#define GLX_TRANSPARENT_RED_VALUE_EXT 0x25 +#define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26 +#define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27 +#define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28 +#define GLX_NONE_EXT 0x8000 +#define GLX_TRUE_COLOR_EXT 0x8002 +#define GLX_DIRECT_COLOR_EXT 0x8003 +#define GLX_PSEUDO_COLOR_EXT 0x8004 +#define GLX_STATIC_COLOR_EXT 0x8005 +#define GLX_GRAY_SCALE_EXT 0x8006 +#define GLX_STATIC_GRAY_EXT 0x8007 +#define GLX_TRANSPARENT_RGB_EXT 0x8008 +#define GLX_TRANSPARENT_INDEX_EXT 0x8009 + +#define GLXEW_EXT_visual_info GLXEW_GET_VAR(__GLXEW_EXT_visual_info) + +#endif /* GLX_EXT_visual_info */ + +/* ------------------------- GLX_EXT_visual_rating ------------------------- */ + +#ifndef GLX_EXT_visual_rating +#define GLX_EXT_visual_rating 1 + +#define GLX_VISUAL_CAVEAT_EXT 0x20 +#define GLX_SLOW_VISUAL_EXT 0x8001 +#define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D + +#define GLXEW_EXT_visual_rating GLXEW_GET_VAR(__GLXEW_EXT_visual_rating) + +#endif /* GLX_EXT_visual_rating */ + +/* -------------------------- GLX_INTEL_swap_event ------------------------- */ + +#ifndef GLX_INTEL_swap_event +#define GLX_INTEL_swap_event 1 + +#define GLX_EXCHANGE_COMPLETE_INTEL 0x8180 +#define GLX_COPY_COMPLETE_INTEL 0x8181 +#define GLX_FLIP_COMPLETE_INTEL 0x8182 +#define GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK 0x04000000 + +#define GLXEW_INTEL_swap_event GLXEW_GET_VAR(__GLXEW_INTEL_swap_event) + +#endif /* GLX_INTEL_swap_event */ + +/* -------------------------- GLX_MESA_agp_offset -------------------------- */ + +#ifndef GLX_MESA_agp_offset +#define GLX_MESA_agp_offset 1 + +typedef unsigned int ( * PFNGLXGETAGPOFFSETMESAPROC) (const void* pointer); + +#define glXGetAGPOffsetMESA GLXEW_GET_FUN(__glewXGetAGPOffsetMESA) + +#define GLXEW_MESA_agp_offset GLXEW_GET_VAR(__GLXEW_MESA_agp_offset) + +#endif /* GLX_MESA_agp_offset */ + +/* ------------------------ GLX_MESA_copy_sub_buffer ----------------------- */ + +#ifndef GLX_MESA_copy_sub_buffer +#define GLX_MESA_copy_sub_buffer 1 + +typedef void ( * PFNGLXCOPYSUBBUFFERMESAPROC) (Display* dpy, GLXDrawable drawable, int x, int y, int width, int height); + +#define glXCopySubBufferMESA GLXEW_GET_FUN(__glewXCopySubBufferMESA) + +#define GLXEW_MESA_copy_sub_buffer GLXEW_GET_VAR(__GLXEW_MESA_copy_sub_buffer) + +#endif /* GLX_MESA_copy_sub_buffer */ + +/* ------------------------ GLX_MESA_pixmap_colormap ----------------------- */ + +#ifndef GLX_MESA_pixmap_colormap +#define GLX_MESA_pixmap_colormap 1 + +typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPMESAPROC) (Display* dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap); + +#define glXCreateGLXPixmapMESA GLXEW_GET_FUN(__glewXCreateGLXPixmapMESA) + +#define GLXEW_MESA_pixmap_colormap GLXEW_GET_VAR(__GLXEW_MESA_pixmap_colormap) + +#endif /* GLX_MESA_pixmap_colormap */ + +/* ------------------------ GLX_MESA_query_renderer ------------------------ */ + +#ifndef GLX_MESA_query_renderer +#define GLX_MESA_query_renderer 1 + +#define GLX_RENDERER_VENDOR_ID_MESA 0x8183 +#define GLX_RENDERER_DEVICE_ID_MESA 0x8184 +#define GLX_RENDERER_VERSION_MESA 0x8185 +#define GLX_RENDERER_ACCELERATED_MESA 0x8186 +#define GLX_RENDERER_VIDEO_MEMORY_MESA 0x8187 +#define GLX_RENDERER_UNIFIED_MEMORY_ARCHITECTURE_MESA 0x8188 +#define GLX_RENDERER_PREFERRED_PROFILE_MESA 0x8189 +#define GLX_RENDERER_OPENGL_CORE_PROFILE_VERSION_MESA 0x818A +#define GLX_RENDERER_OPENGL_COMPATIBILITY_PROFILE_VERSION_MESA 0x818B +#define GLX_RENDERER_OPENGL_ES_PROFILE_VERSION_MESA 0x818C +#define GLX_RENDERER_OPENGL_ES2_PROFILE_VERSION_MESA 0x818D +#define GLX_RENDERER_ID_MESA 0x818E + +typedef Bool ( * PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC) (int attribute, unsigned int* value); +typedef const char* ( * PFNGLXQUERYCURRENTRENDERERSTRINGMESAPROC) (int attribute); +typedef Bool ( * PFNGLXQUERYRENDERERINTEGERMESAPROC) (Display* dpy, int screen, int renderer, int attribute, unsigned int *value); +typedef const char* ( * PFNGLXQUERYRENDERERSTRINGMESAPROC) (Display *dpy, int screen, int renderer, int attribute); + +#define glXQueryCurrentRendererIntegerMESA GLXEW_GET_FUN(__glewXQueryCurrentRendererIntegerMESA) +#define glXQueryCurrentRendererStringMESA GLXEW_GET_FUN(__glewXQueryCurrentRendererStringMESA) +#define glXQueryRendererIntegerMESA GLXEW_GET_FUN(__glewXQueryRendererIntegerMESA) +#define glXQueryRendererStringMESA GLXEW_GET_FUN(__glewXQueryRendererStringMESA) + +#define GLXEW_MESA_query_renderer GLXEW_GET_VAR(__GLXEW_MESA_query_renderer) + +#endif /* GLX_MESA_query_renderer */ + +/* ------------------------ GLX_MESA_release_buffers ----------------------- */ + +#ifndef GLX_MESA_release_buffers +#define GLX_MESA_release_buffers 1 + +typedef Bool ( * PFNGLXRELEASEBUFFERSMESAPROC) (Display* dpy, GLXDrawable d); + +#define glXReleaseBuffersMESA GLXEW_GET_FUN(__glewXReleaseBuffersMESA) + +#define GLXEW_MESA_release_buffers GLXEW_GET_VAR(__GLXEW_MESA_release_buffers) + +#endif /* GLX_MESA_release_buffers */ + +/* ------------------------- GLX_MESA_set_3dfx_mode ------------------------ */ + +#ifndef GLX_MESA_set_3dfx_mode +#define GLX_MESA_set_3dfx_mode 1 + +#define GLX_3DFX_WINDOW_MODE_MESA 0x1 +#define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2 + +typedef GLboolean ( * PFNGLXSET3DFXMODEMESAPROC) (GLint mode); + +#define glXSet3DfxModeMESA GLXEW_GET_FUN(__glewXSet3DfxModeMESA) + +#define GLXEW_MESA_set_3dfx_mode GLXEW_GET_VAR(__GLXEW_MESA_set_3dfx_mode) + +#endif /* GLX_MESA_set_3dfx_mode */ + +/* ------------------------- GLX_MESA_swap_control ------------------------- */ + +#ifndef GLX_MESA_swap_control +#define GLX_MESA_swap_control 1 + +typedef int ( * PFNGLXGETSWAPINTERVALMESAPROC) (void); +typedef int ( * PFNGLXSWAPINTERVALMESAPROC) (unsigned int interval); + +#define glXGetSwapIntervalMESA GLXEW_GET_FUN(__glewXGetSwapIntervalMESA) +#define glXSwapIntervalMESA GLXEW_GET_FUN(__glewXSwapIntervalMESA) + +#define GLXEW_MESA_swap_control GLXEW_GET_VAR(__GLXEW_MESA_swap_control) + +#endif /* GLX_MESA_swap_control */ + +/* --------------------------- GLX_NV_copy_buffer -------------------------- */ + +#ifndef GLX_NV_copy_buffer +#define GLX_NV_copy_buffer 1 + +typedef void ( * PFNGLXCOPYBUFFERSUBDATANVPROC) (Display* dpy, GLXContext readCtx, GLXContext writeCtx, GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +typedef void ( * PFNGLXNAMEDCOPYBUFFERSUBDATANVPROC) (Display* dpy, GLXContext readCtx, GLXContext writeCtx, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); + +#define glXCopyBufferSubDataNV GLXEW_GET_FUN(__glewXCopyBufferSubDataNV) +#define glXNamedCopyBufferSubDataNV GLXEW_GET_FUN(__glewXNamedCopyBufferSubDataNV) + +#define GLXEW_NV_copy_buffer GLXEW_GET_VAR(__GLXEW_NV_copy_buffer) + +#endif /* GLX_NV_copy_buffer */ + +/* --------------------------- GLX_NV_copy_image --------------------------- */ + +#ifndef GLX_NV_copy_image +#define GLX_NV_copy_image 1 + +typedef void ( * PFNGLXCOPYIMAGESUBDATANVPROC) (Display *dpy, GLXContext srcCtx, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLXContext dstCtx, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); + +#define glXCopyImageSubDataNV GLXEW_GET_FUN(__glewXCopyImageSubDataNV) + +#define GLXEW_NV_copy_image GLXEW_GET_VAR(__GLXEW_NV_copy_image) + +#endif /* GLX_NV_copy_image */ + +/* ------------------------ GLX_NV_delay_before_swap ----------------------- */ + +#ifndef GLX_NV_delay_before_swap +#define GLX_NV_delay_before_swap 1 + +typedef Bool ( * PFNGLXDELAYBEFORESWAPNVPROC) (Display* dpy, GLXDrawable drawable, GLfloat seconds); + +#define glXDelayBeforeSwapNV GLXEW_GET_FUN(__glewXDelayBeforeSwapNV) + +#define GLXEW_NV_delay_before_swap GLXEW_GET_VAR(__GLXEW_NV_delay_before_swap) + +#endif /* GLX_NV_delay_before_swap */ + +/* -------------------------- GLX_NV_float_buffer -------------------------- */ + +#ifndef GLX_NV_float_buffer +#define GLX_NV_float_buffer 1 + +#define GLX_FLOAT_COMPONENTS_NV 0x20B0 + +#define GLXEW_NV_float_buffer GLXEW_GET_VAR(__GLXEW_NV_float_buffer) + +#endif /* GLX_NV_float_buffer */ + +/* ---------------------- GLX_NV_multisample_coverage ---------------------- */ + +#ifndef GLX_NV_multisample_coverage +#define GLX_NV_multisample_coverage 1 + +#define GLX_COLOR_SAMPLES_NV 0x20B3 +#define GLX_COVERAGE_SAMPLES_NV 100001 + +#define GLXEW_NV_multisample_coverage GLXEW_GET_VAR(__GLXEW_NV_multisample_coverage) + +#endif /* GLX_NV_multisample_coverage */ + +/* -------------------------- GLX_NV_present_video ------------------------- */ + +#ifndef GLX_NV_present_video +#define GLX_NV_present_video 1 + +#define GLX_NUM_VIDEO_SLOTS_NV 0x20F0 + +typedef int ( * PFNGLXBINDVIDEODEVICENVPROC) (Display* dpy, unsigned int video_slot, unsigned int video_device, const int *attrib_list); +typedef unsigned int* ( * PFNGLXENUMERATEVIDEODEVICESNVPROC) (Display *dpy, int screen, int *nelements); + +#define glXBindVideoDeviceNV GLXEW_GET_FUN(__glewXBindVideoDeviceNV) +#define glXEnumerateVideoDevicesNV GLXEW_GET_FUN(__glewXEnumerateVideoDevicesNV) + +#define GLXEW_NV_present_video GLXEW_GET_VAR(__GLXEW_NV_present_video) + +#endif /* GLX_NV_present_video */ + +/* ------------------ GLX_NV_robustness_video_memory_purge ----------------- */ + +#ifndef GLX_NV_robustness_video_memory_purge +#define GLX_NV_robustness_video_memory_purge 1 + +#define GLX_GENERATE_RESET_ON_VIDEO_MEMORY_PURGE_NV 0x20F7 + +#define GLXEW_NV_robustness_video_memory_purge GLXEW_GET_VAR(__GLXEW_NV_robustness_video_memory_purge) + +#endif /* GLX_NV_robustness_video_memory_purge */ + +/* --------------------------- GLX_NV_swap_group --------------------------- */ + +#ifndef GLX_NV_swap_group +#define GLX_NV_swap_group 1 + +typedef Bool ( * PFNGLXBINDSWAPBARRIERNVPROC) (Display* dpy, GLuint group, GLuint barrier); +typedef Bool ( * PFNGLXJOINSWAPGROUPNVPROC) (Display* dpy, GLXDrawable drawable, GLuint group); +typedef Bool ( * PFNGLXQUERYFRAMECOUNTNVPROC) (Display* dpy, int screen, GLuint *count); +typedef Bool ( * PFNGLXQUERYMAXSWAPGROUPSNVPROC) (Display* dpy, int screen, GLuint *maxGroups, GLuint *maxBarriers); +typedef Bool ( * PFNGLXQUERYSWAPGROUPNVPROC) (Display* dpy, GLXDrawable drawable, GLuint *group, GLuint *barrier); +typedef Bool ( * PFNGLXRESETFRAMECOUNTNVPROC) (Display* dpy, int screen); + +#define glXBindSwapBarrierNV GLXEW_GET_FUN(__glewXBindSwapBarrierNV) +#define glXJoinSwapGroupNV GLXEW_GET_FUN(__glewXJoinSwapGroupNV) +#define glXQueryFrameCountNV GLXEW_GET_FUN(__glewXQueryFrameCountNV) +#define glXQueryMaxSwapGroupsNV GLXEW_GET_FUN(__glewXQueryMaxSwapGroupsNV) +#define glXQuerySwapGroupNV GLXEW_GET_FUN(__glewXQuerySwapGroupNV) +#define glXResetFrameCountNV GLXEW_GET_FUN(__glewXResetFrameCountNV) + +#define GLXEW_NV_swap_group GLXEW_GET_VAR(__GLXEW_NV_swap_group) + +#endif /* GLX_NV_swap_group */ + +/* ----------------------- GLX_NV_vertex_array_range ----------------------- */ + +#ifndef GLX_NV_vertex_array_range +#define GLX_NV_vertex_array_range 1 + +typedef void * ( * PFNGLXALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority); +typedef void ( * PFNGLXFREEMEMORYNVPROC) (void *pointer); + +#define glXAllocateMemoryNV GLXEW_GET_FUN(__glewXAllocateMemoryNV) +#define glXFreeMemoryNV GLXEW_GET_FUN(__glewXFreeMemoryNV) + +#define GLXEW_NV_vertex_array_range GLXEW_GET_VAR(__GLXEW_NV_vertex_array_range) + +#endif /* GLX_NV_vertex_array_range */ + +/* -------------------------- GLX_NV_video_capture ------------------------- */ + +#ifndef GLX_NV_video_capture +#define GLX_NV_video_capture 1 + +#define GLX_DEVICE_ID_NV 0x20CD +#define GLX_UNIQUE_ID_NV 0x20CE +#define GLX_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF + +typedef XID GLXVideoCaptureDeviceNV; + +typedef int ( * PFNGLXBINDVIDEOCAPTUREDEVICENVPROC) (Display* dpy, unsigned int video_capture_slot, GLXVideoCaptureDeviceNV device); +typedef GLXVideoCaptureDeviceNV * ( * PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC) (Display* dpy, int screen, int *nelements); +typedef void ( * PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device); +typedef int ( * PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device, int attribute, int *value); +typedef void ( * PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device); + +#define glXBindVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXBindVideoCaptureDeviceNV) +#define glXEnumerateVideoCaptureDevicesNV GLXEW_GET_FUN(__glewXEnumerateVideoCaptureDevicesNV) +#define glXLockVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXLockVideoCaptureDeviceNV) +#define glXQueryVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXQueryVideoCaptureDeviceNV) +#define glXReleaseVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXReleaseVideoCaptureDeviceNV) + +#define GLXEW_NV_video_capture GLXEW_GET_VAR(__GLXEW_NV_video_capture) + +#endif /* GLX_NV_video_capture */ + +/* ---------------------------- GLX_NV_video_out --------------------------- */ + +#ifndef GLX_NV_video_out +#define GLX_NV_video_out 1 + +#define GLX_VIDEO_OUT_COLOR_NV 0x20C3 +#define GLX_VIDEO_OUT_ALPHA_NV 0x20C4 +#define GLX_VIDEO_OUT_DEPTH_NV 0x20C5 +#define GLX_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6 +#define GLX_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7 +#define GLX_VIDEO_OUT_FRAME_NV 0x20C8 +#define GLX_VIDEO_OUT_FIELD_1_NV 0x20C9 +#define GLX_VIDEO_OUT_FIELD_2_NV 0x20CA +#define GLX_VIDEO_OUT_STACKED_FIELDS_1_2_NV 0x20CB +#define GLX_VIDEO_OUT_STACKED_FIELDS_2_1_NV 0x20CC + +typedef int ( * PFNGLXBINDVIDEOIMAGENVPROC) (Display* dpy, GLXVideoDeviceNV VideoDevice, GLXPbuffer pbuf, int iVideoBuffer); +typedef int ( * PFNGLXGETVIDEODEVICENVPROC) (Display* dpy, int screen, int numVideoDevices, GLXVideoDeviceNV *pVideoDevice); +typedef int ( * PFNGLXGETVIDEOINFONVPROC) (Display* dpy, int screen, GLXVideoDeviceNV VideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo); +typedef int ( * PFNGLXRELEASEVIDEODEVICENVPROC) (Display* dpy, int screen, GLXVideoDeviceNV VideoDevice); +typedef int ( * PFNGLXRELEASEVIDEOIMAGENVPROC) (Display* dpy, GLXPbuffer pbuf); +typedef int ( * PFNGLXSENDPBUFFERTOVIDEONVPROC) (Display* dpy, GLXPbuffer pbuf, int iBufferType, unsigned long *pulCounterPbuffer, GLboolean bBlock); + +#define glXBindVideoImageNV GLXEW_GET_FUN(__glewXBindVideoImageNV) +#define glXGetVideoDeviceNV GLXEW_GET_FUN(__glewXGetVideoDeviceNV) +#define glXGetVideoInfoNV GLXEW_GET_FUN(__glewXGetVideoInfoNV) +#define glXReleaseVideoDeviceNV GLXEW_GET_FUN(__glewXReleaseVideoDeviceNV) +#define glXReleaseVideoImageNV GLXEW_GET_FUN(__glewXReleaseVideoImageNV) +#define glXSendPbufferToVideoNV GLXEW_GET_FUN(__glewXSendPbufferToVideoNV) + +#define GLXEW_NV_video_out GLXEW_GET_VAR(__GLXEW_NV_video_out) + +#endif /* GLX_NV_video_out */ + +/* -------------------------- GLX_OML_swap_method -------------------------- */ + +#ifndef GLX_OML_swap_method +#define GLX_OML_swap_method 1 + +#define GLX_SWAP_METHOD_OML 0x8060 +#define GLX_SWAP_EXCHANGE_OML 0x8061 +#define GLX_SWAP_COPY_OML 0x8062 +#define GLX_SWAP_UNDEFINED_OML 0x8063 + +#define GLXEW_OML_swap_method GLXEW_GET_VAR(__GLXEW_OML_swap_method) + +#endif /* GLX_OML_swap_method */ + +/* -------------------------- GLX_OML_sync_control ------------------------- */ + +#ifndef GLX_OML_sync_control +#define GLX_OML_sync_control 1 + +typedef Bool ( * PFNGLXGETMSCRATEOMLPROC) (Display* dpy, GLXDrawable drawable, int32_t* numerator, int32_t* denominator); +typedef Bool ( * PFNGLXGETSYNCVALUESOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t* ust, int64_t* msc, int64_t* sbc); +typedef int64_t ( * PFNGLXSWAPBUFFERSMSCOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder); +typedef Bool ( * PFNGLXWAITFORMSCOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t* ust, int64_t* msc, int64_t* sbc); +typedef Bool ( * PFNGLXWAITFORSBCOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t target_sbc, int64_t* ust, int64_t* msc, int64_t* sbc); + +#define glXGetMscRateOML GLXEW_GET_FUN(__glewXGetMscRateOML) +#define glXGetSyncValuesOML GLXEW_GET_FUN(__glewXGetSyncValuesOML) +#define glXSwapBuffersMscOML GLXEW_GET_FUN(__glewXSwapBuffersMscOML) +#define glXWaitForMscOML GLXEW_GET_FUN(__glewXWaitForMscOML) +#define glXWaitForSbcOML GLXEW_GET_FUN(__glewXWaitForSbcOML) + +#define GLXEW_OML_sync_control GLXEW_GET_VAR(__GLXEW_OML_sync_control) + +#endif /* GLX_OML_sync_control */ + +/* ------------------------ GLX_SGIS_blended_overlay ----------------------- */ + +#ifndef GLX_SGIS_blended_overlay +#define GLX_SGIS_blended_overlay 1 + +#define GLX_BLENDED_RGBA_SGIS 0x8025 + +#define GLXEW_SGIS_blended_overlay GLXEW_GET_VAR(__GLXEW_SGIS_blended_overlay) + +#endif /* GLX_SGIS_blended_overlay */ + +/* -------------------------- GLX_SGIS_color_range ------------------------- */ + +#ifndef GLX_SGIS_color_range +#define GLX_SGIS_color_range 1 + +#define GLXEW_SGIS_color_range GLXEW_GET_VAR(__GLXEW_SGIS_color_range) + +#endif /* GLX_SGIS_color_range */ + +/* -------------------------- GLX_SGIS_multisample ------------------------- */ + +#ifndef GLX_SGIS_multisample +#define GLX_SGIS_multisample 1 + +#define GLX_SAMPLE_BUFFERS_SGIS 100000 +#define GLX_SAMPLES_SGIS 100001 + +#define GLXEW_SGIS_multisample GLXEW_GET_VAR(__GLXEW_SGIS_multisample) + +#endif /* GLX_SGIS_multisample */ + +/* ---------------------- GLX_SGIS_shared_multisample ---------------------- */ + +#ifndef GLX_SGIS_shared_multisample +#define GLX_SGIS_shared_multisample 1 + +#define GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS 0x8026 +#define GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS 0x8027 + +#define GLXEW_SGIS_shared_multisample GLXEW_GET_VAR(__GLXEW_SGIS_shared_multisample) + +#endif /* GLX_SGIS_shared_multisample */ + +/* --------------------------- GLX_SGIX_fbconfig --------------------------- */ + +#ifndef GLX_SGIX_fbconfig +#define GLX_SGIX_fbconfig 1 + +#define GLX_RGBA_BIT_SGIX 0x00000001 +#define GLX_WINDOW_BIT_SGIX 0x00000001 +#define GLX_COLOR_INDEX_BIT_SGIX 0x00000002 +#define GLX_PIXMAP_BIT_SGIX 0x00000002 +#define GLX_SCREEN_EXT 0x800C +#define GLX_DRAWABLE_TYPE_SGIX 0x8010 +#define GLX_RENDER_TYPE_SGIX 0x8011 +#define GLX_X_RENDERABLE_SGIX 0x8012 +#define GLX_FBCONFIG_ID_SGIX 0x8013 +#define GLX_RGBA_TYPE_SGIX 0x8014 +#define GLX_COLOR_INDEX_TYPE_SGIX 0x8015 + +typedef XID GLXFBConfigIDSGIX; +typedef struct __GLXFBConfigRec *GLXFBConfigSGIX; + +typedef GLXFBConfigSGIX* ( * PFNGLXCHOOSEFBCONFIGSGIXPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements); +typedef GLXContext ( * PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) (Display* dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct); +typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC) (Display* dpy, GLXFBConfig config, Pixmap pixmap); +typedef int ( * PFNGLXGETFBCONFIGATTRIBSGIXPROC) (Display* dpy, GLXFBConfigSGIX config, int attribute, int *value); +typedef GLXFBConfigSGIX ( * PFNGLXGETFBCONFIGFROMVISUALSGIXPROC) (Display* dpy, XVisualInfo *vis); +typedef XVisualInfo* ( * PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) (Display *dpy, GLXFBConfig config); + +#define glXChooseFBConfigSGIX GLXEW_GET_FUN(__glewXChooseFBConfigSGIX) +#define glXCreateContextWithConfigSGIX GLXEW_GET_FUN(__glewXCreateContextWithConfigSGIX) +#define glXCreateGLXPixmapWithConfigSGIX GLXEW_GET_FUN(__glewXCreateGLXPixmapWithConfigSGIX) +#define glXGetFBConfigAttribSGIX GLXEW_GET_FUN(__glewXGetFBConfigAttribSGIX) +#define glXGetFBConfigFromVisualSGIX GLXEW_GET_FUN(__glewXGetFBConfigFromVisualSGIX) +#define glXGetVisualFromFBConfigSGIX GLXEW_GET_FUN(__glewXGetVisualFromFBConfigSGIX) + +#define GLXEW_SGIX_fbconfig GLXEW_GET_VAR(__GLXEW_SGIX_fbconfig) + +#endif /* GLX_SGIX_fbconfig */ + +/* --------------------------- GLX_SGIX_hyperpipe -------------------------- */ + +#ifndef GLX_SGIX_hyperpipe +#define GLX_SGIX_hyperpipe 1 + +#define GLX_HYPERPIPE_DISPLAY_PIPE_SGIX 0x00000001 +#define GLX_PIPE_RECT_SGIX 0x00000001 +#define GLX_HYPERPIPE_RENDER_PIPE_SGIX 0x00000002 +#define GLX_PIPE_RECT_LIMITS_SGIX 0x00000002 +#define GLX_HYPERPIPE_STEREO_SGIX 0x00000003 +#define GLX_HYPERPIPE_PIXEL_AVERAGE_SGIX 0x00000004 +#define GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX 80 +#define GLX_BAD_HYPERPIPE_CONFIG_SGIX 91 +#define GLX_BAD_HYPERPIPE_SGIX 92 +#define GLX_HYPERPIPE_ID_SGIX 0x8030 + +typedef struct { + char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int networkId; +} GLXHyperpipeNetworkSGIX; +typedef struct { + char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int XOrigin; + int YOrigin; + int maxHeight; + int maxWidth; +} GLXPipeRectLimits; +typedef struct { + char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int channel; + unsigned int participationType; + int timeSlice; +} GLXHyperpipeConfigSGIX; +typedef struct { + char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int srcXOrigin; + int srcYOrigin; + int srcWidth; + int srcHeight; + int destXOrigin; + int destYOrigin; + int destWidth; + int destHeight; +} GLXPipeRect; + +typedef int ( * PFNGLXBINDHYPERPIPESGIXPROC) (Display *dpy, int hpId); +typedef int ( * PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId); +typedef int ( * PFNGLXHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList); +typedef int ( * PFNGLXHYPERPIPECONFIGSGIXPROC) (Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX *cfg, int *hpId); +typedef int ( * PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *returnAttribList); +typedef int ( * PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList, void *returnAttribList); +typedef GLXHyperpipeConfigSGIX * ( * PFNGLXQUERYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId, int *npipes); +typedef GLXHyperpipeNetworkSGIX * ( * PFNGLXQUERYHYPERPIPENETWORKSGIXPROC) (Display *dpy, int *npipes); + +#define glXBindHyperpipeSGIX GLXEW_GET_FUN(__glewXBindHyperpipeSGIX) +#define glXDestroyHyperpipeConfigSGIX GLXEW_GET_FUN(__glewXDestroyHyperpipeConfigSGIX) +#define glXHyperpipeAttribSGIX GLXEW_GET_FUN(__glewXHyperpipeAttribSGIX) +#define glXHyperpipeConfigSGIX GLXEW_GET_FUN(__glewXHyperpipeConfigSGIX) +#define glXQueryHyperpipeAttribSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeAttribSGIX) +#define glXQueryHyperpipeBestAttribSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeBestAttribSGIX) +#define glXQueryHyperpipeConfigSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeConfigSGIX) +#define glXQueryHyperpipeNetworkSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeNetworkSGIX) + +#define GLXEW_SGIX_hyperpipe GLXEW_GET_VAR(__GLXEW_SGIX_hyperpipe) + +#endif /* GLX_SGIX_hyperpipe */ + +/* ---------------------------- GLX_SGIX_pbuffer --------------------------- */ + +#ifndef GLX_SGIX_pbuffer +#define GLX_SGIX_pbuffer 1 + +#define GLX_FRONT_LEFT_BUFFER_BIT_SGIX 0x00000001 +#define GLX_FRONT_RIGHT_BUFFER_BIT_SGIX 0x00000002 +#define GLX_BACK_LEFT_BUFFER_BIT_SGIX 0x00000004 +#define GLX_PBUFFER_BIT_SGIX 0x00000004 +#define GLX_BACK_RIGHT_BUFFER_BIT_SGIX 0x00000008 +#define GLX_AUX_BUFFERS_BIT_SGIX 0x00000010 +#define GLX_DEPTH_BUFFER_BIT_SGIX 0x00000020 +#define GLX_STENCIL_BUFFER_BIT_SGIX 0x00000040 +#define GLX_ACCUM_BUFFER_BIT_SGIX 0x00000080 +#define GLX_SAMPLE_BUFFERS_BIT_SGIX 0x00000100 +#define GLX_MAX_PBUFFER_WIDTH_SGIX 0x8016 +#define GLX_MAX_PBUFFER_HEIGHT_SGIX 0x8017 +#define GLX_MAX_PBUFFER_PIXELS_SGIX 0x8018 +#define GLX_OPTIMAL_PBUFFER_WIDTH_SGIX 0x8019 +#define GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX 0x801A +#define GLX_PRESERVED_CONTENTS_SGIX 0x801B +#define GLX_LARGEST_PBUFFER_SGIX 0x801C +#define GLX_WIDTH_SGIX 0x801D +#define GLX_HEIGHT_SGIX 0x801E +#define GLX_EVENT_MASK_SGIX 0x801F +#define GLX_DAMAGED_SGIX 0x8020 +#define GLX_SAVED_SGIX 0x8021 +#define GLX_WINDOW_SGIX 0x8022 +#define GLX_PBUFFER_SGIX 0x8023 +#define GLX_BUFFER_CLOBBER_MASK_SGIX 0x08000000 + +typedef XID GLXPbufferSGIX; +typedef struct { int type; unsigned long serial; Bool send_event; Display *display; GLXDrawable drawable; int event_type; int draw_type; unsigned int mask; int x, y; int width, height; int count; } GLXBufferClobberEventSGIX; + +typedef GLXPbuffer ( * PFNGLXCREATEGLXPBUFFERSGIXPROC) (Display* dpy, GLXFBConfig config, unsigned int width, unsigned int height, int *attrib_list); +typedef void ( * PFNGLXDESTROYGLXPBUFFERSGIXPROC) (Display* dpy, GLXPbuffer pbuf); +typedef void ( * PFNGLXGETSELECTEDEVENTSGIXPROC) (Display* dpy, GLXDrawable drawable, unsigned long *mask); +typedef void ( * PFNGLXQUERYGLXPBUFFERSGIXPROC) (Display* dpy, GLXPbuffer pbuf, int attribute, unsigned int *value); +typedef void ( * PFNGLXSELECTEVENTSGIXPROC) (Display* dpy, GLXDrawable drawable, unsigned long mask); + +#define glXCreateGLXPbufferSGIX GLXEW_GET_FUN(__glewXCreateGLXPbufferSGIX) +#define glXDestroyGLXPbufferSGIX GLXEW_GET_FUN(__glewXDestroyGLXPbufferSGIX) +#define glXGetSelectedEventSGIX GLXEW_GET_FUN(__glewXGetSelectedEventSGIX) +#define glXQueryGLXPbufferSGIX GLXEW_GET_FUN(__glewXQueryGLXPbufferSGIX) +#define glXSelectEventSGIX GLXEW_GET_FUN(__glewXSelectEventSGIX) + +#define GLXEW_SGIX_pbuffer GLXEW_GET_VAR(__GLXEW_SGIX_pbuffer) + +#endif /* GLX_SGIX_pbuffer */ + +/* ------------------------- GLX_SGIX_swap_barrier ------------------------- */ + +#ifndef GLX_SGIX_swap_barrier +#define GLX_SGIX_swap_barrier 1 + +typedef void ( * PFNGLXBINDSWAPBARRIERSGIXPROC) (Display *dpy, GLXDrawable drawable, int barrier); +typedef Bool ( * PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC) (Display *dpy, int screen, int *max); + +#define glXBindSwapBarrierSGIX GLXEW_GET_FUN(__glewXBindSwapBarrierSGIX) +#define glXQueryMaxSwapBarriersSGIX GLXEW_GET_FUN(__glewXQueryMaxSwapBarriersSGIX) + +#define GLXEW_SGIX_swap_barrier GLXEW_GET_VAR(__GLXEW_SGIX_swap_barrier) + +#endif /* GLX_SGIX_swap_barrier */ + +/* -------------------------- GLX_SGIX_swap_group -------------------------- */ + +#ifndef GLX_SGIX_swap_group +#define GLX_SGIX_swap_group 1 + +typedef void ( * PFNGLXJOINSWAPGROUPSGIXPROC) (Display *dpy, GLXDrawable drawable, GLXDrawable member); + +#define glXJoinSwapGroupSGIX GLXEW_GET_FUN(__glewXJoinSwapGroupSGIX) + +#define GLXEW_SGIX_swap_group GLXEW_GET_VAR(__GLXEW_SGIX_swap_group) + +#endif /* GLX_SGIX_swap_group */ + +/* ------------------------- GLX_SGIX_video_resize ------------------------- */ + +#ifndef GLX_SGIX_video_resize +#define GLX_SGIX_video_resize 1 + +#define GLX_SYNC_FRAME_SGIX 0x00000000 +#define GLX_SYNC_SWAP_SGIX 0x00000001 + +typedef int ( * PFNGLXBINDCHANNELTOWINDOWSGIXPROC) (Display* display, int screen, int channel, Window window); +typedef int ( * PFNGLXCHANNELRECTSGIXPROC) (Display* display, int screen, int channel, int x, int y, int w, int h); +typedef int ( * PFNGLXCHANNELRECTSYNCSGIXPROC) (Display* display, int screen, int channel, GLenum synctype); +typedef int ( * PFNGLXQUERYCHANNELDELTASSGIXPROC) (Display* display, int screen, int channel, int *x, int *y, int *w, int *h); +typedef int ( * PFNGLXQUERYCHANNELRECTSGIXPROC) (Display* display, int screen, int channel, int *dx, int *dy, int *dw, int *dh); + +#define glXBindChannelToWindowSGIX GLXEW_GET_FUN(__glewXBindChannelToWindowSGIX) +#define glXChannelRectSGIX GLXEW_GET_FUN(__glewXChannelRectSGIX) +#define glXChannelRectSyncSGIX GLXEW_GET_FUN(__glewXChannelRectSyncSGIX) +#define glXQueryChannelDeltasSGIX GLXEW_GET_FUN(__glewXQueryChannelDeltasSGIX) +#define glXQueryChannelRectSGIX GLXEW_GET_FUN(__glewXQueryChannelRectSGIX) + +#define GLXEW_SGIX_video_resize GLXEW_GET_VAR(__GLXEW_SGIX_video_resize) + +#endif /* GLX_SGIX_video_resize */ + +/* ---------------------- GLX_SGIX_visual_select_group --------------------- */ + +#ifndef GLX_SGIX_visual_select_group +#define GLX_SGIX_visual_select_group 1 + +#define GLX_VISUAL_SELECT_GROUP_SGIX 0x8028 + +#define GLXEW_SGIX_visual_select_group GLXEW_GET_VAR(__GLXEW_SGIX_visual_select_group) + +#endif /* GLX_SGIX_visual_select_group */ + +/* ---------------------------- GLX_SGI_cushion ---------------------------- */ + +#ifndef GLX_SGI_cushion +#define GLX_SGI_cushion 1 + +typedef void ( * PFNGLXCUSHIONSGIPROC) (Display* dpy, Window window, float cushion); + +#define glXCushionSGI GLXEW_GET_FUN(__glewXCushionSGI) + +#define GLXEW_SGI_cushion GLXEW_GET_VAR(__GLXEW_SGI_cushion) + +#endif /* GLX_SGI_cushion */ + +/* ----------------------- GLX_SGI_make_current_read ----------------------- */ + +#ifndef GLX_SGI_make_current_read +#define GLX_SGI_make_current_read 1 + +typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLESGIPROC) (void); +typedef Bool ( * PFNGLXMAKECURRENTREADSGIPROC) (Display* dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx); + +#define glXGetCurrentReadDrawableSGI GLXEW_GET_FUN(__glewXGetCurrentReadDrawableSGI) +#define glXMakeCurrentReadSGI GLXEW_GET_FUN(__glewXMakeCurrentReadSGI) + +#define GLXEW_SGI_make_current_read GLXEW_GET_VAR(__GLXEW_SGI_make_current_read) + +#endif /* GLX_SGI_make_current_read */ + +/* -------------------------- GLX_SGI_swap_control ------------------------- */ + +#ifndef GLX_SGI_swap_control +#define GLX_SGI_swap_control 1 + +typedef int ( * PFNGLXSWAPINTERVALSGIPROC) (int interval); + +#define glXSwapIntervalSGI GLXEW_GET_FUN(__glewXSwapIntervalSGI) + +#define GLXEW_SGI_swap_control GLXEW_GET_VAR(__GLXEW_SGI_swap_control) + +#endif /* GLX_SGI_swap_control */ + +/* --------------------------- GLX_SGI_video_sync -------------------------- */ + +#ifndef GLX_SGI_video_sync +#define GLX_SGI_video_sync 1 + +typedef int ( * PFNGLXGETVIDEOSYNCSGIPROC) (unsigned int* count); +typedef int ( * PFNGLXWAITVIDEOSYNCSGIPROC) (int divisor, int remainder, unsigned int* count); + +#define glXGetVideoSyncSGI GLXEW_GET_FUN(__glewXGetVideoSyncSGI) +#define glXWaitVideoSyncSGI GLXEW_GET_FUN(__glewXWaitVideoSyncSGI) + +#define GLXEW_SGI_video_sync GLXEW_GET_VAR(__GLXEW_SGI_video_sync) + +#endif /* GLX_SGI_video_sync */ + +/* --------------------- GLX_SUN_get_transparent_index --------------------- */ + +#ifndef GLX_SUN_get_transparent_index +#define GLX_SUN_get_transparent_index 1 + +typedef Status ( * PFNGLXGETTRANSPARENTINDEXSUNPROC) (Display* dpy, Window overlay, Window underlay, unsigned long *pTransparentIndex); + +#define glXGetTransparentIndexSUN GLXEW_GET_FUN(__glewXGetTransparentIndexSUN) + +#define GLXEW_SUN_get_transparent_index GLXEW_GET_VAR(__GLXEW_SUN_get_transparent_index) + +#endif /* GLX_SUN_get_transparent_index */ + +/* -------------------------- GLX_SUN_video_resize ------------------------- */ + +#ifndef GLX_SUN_video_resize +#define GLX_SUN_video_resize 1 + +#define GLX_VIDEO_RESIZE_SUN 0x8171 +#define GL_VIDEO_RESIZE_COMPENSATION_SUN 0x85CD + +typedef int ( * PFNGLXGETVIDEORESIZESUNPROC) (Display* display, GLXDrawable window, float* factor); +typedef int ( * PFNGLXVIDEORESIZESUNPROC) (Display* display, GLXDrawable window, float factor); + +#define glXGetVideoResizeSUN GLXEW_GET_FUN(__glewXGetVideoResizeSUN) +#define glXVideoResizeSUN GLXEW_GET_FUN(__glewXVideoResizeSUN) + +#define GLXEW_SUN_video_resize GLXEW_GET_VAR(__GLXEW_SUN_video_resize) + +#endif /* GLX_SUN_video_resize */ + +/* ------------------------------------------------------------------------- */ + +#define GLXEW_FUN_EXPORT GLEW_FUN_EXPORT +#define GLXEW_VAR_EXPORT GLEW_VAR_EXPORT + +GLXEW_FUN_EXPORT PFNGLXGETCURRENTDISPLAYPROC __glewXGetCurrentDisplay; + +GLXEW_FUN_EXPORT PFNGLXCHOOSEFBCONFIGPROC __glewXChooseFBConfig; +GLXEW_FUN_EXPORT PFNGLXCREATENEWCONTEXTPROC __glewXCreateNewContext; +GLXEW_FUN_EXPORT PFNGLXCREATEPBUFFERPROC __glewXCreatePbuffer; +GLXEW_FUN_EXPORT PFNGLXCREATEPIXMAPPROC __glewXCreatePixmap; +GLXEW_FUN_EXPORT PFNGLXCREATEWINDOWPROC __glewXCreateWindow; +GLXEW_FUN_EXPORT PFNGLXDESTROYPBUFFERPROC __glewXDestroyPbuffer; +GLXEW_FUN_EXPORT PFNGLXDESTROYPIXMAPPROC __glewXDestroyPixmap; +GLXEW_FUN_EXPORT PFNGLXDESTROYWINDOWPROC __glewXDestroyWindow; +GLXEW_FUN_EXPORT PFNGLXGETCURRENTREADDRAWABLEPROC __glewXGetCurrentReadDrawable; +GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGATTRIBPROC __glewXGetFBConfigAttrib; +GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGSPROC __glewXGetFBConfigs; +GLXEW_FUN_EXPORT PFNGLXGETSELECTEDEVENTPROC __glewXGetSelectedEvent; +GLXEW_FUN_EXPORT PFNGLXGETVISUALFROMFBCONFIGPROC __glewXGetVisualFromFBConfig; +GLXEW_FUN_EXPORT PFNGLXMAKECONTEXTCURRENTPROC __glewXMakeContextCurrent; +GLXEW_FUN_EXPORT PFNGLXQUERYCONTEXTPROC __glewXQueryContext; +GLXEW_FUN_EXPORT PFNGLXQUERYDRAWABLEPROC __glewXQueryDrawable; +GLXEW_FUN_EXPORT PFNGLXSELECTEVENTPROC __glewXSelectEvent; + +GLXEW_FUN_EXPORT PFNGLXBLITCONTEXTFRAMEBUFFERAMDPROC __glewXBlitContextFramebufferAMD; +GLXEW_FUN_EXPORT PFNGLXCREATEASSOCIATEDCONTEXTAMDPROC __glewXCreateAssociatedContextAMD; +GLXEW_FUN_EXPORT PFNGLXCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC __glewXCreateAssociatedContextAttribsAMD; +GLXEW_FUN_EXPORT PFNGLXDELETEASSOCIATEDCONTEXTAMDPROC __glewXDeleteAssociatedContextAMD; +GLXEW_FUN_EXPORT PFNGLXGETCONTEXTGPUIDAMDPROC __glewXGetContextGPUIDAMD; +GLXEW_FUN_EXPORT PFNGLXGETCURRENTASSOCIATEDCONTEXTAMDPROC __glewXGetCurrentAssociatedContextAMD; +GLXEW_FUN_EXPORT PFNGLXGETGPUIDSAMDPROC __glewXGetGPUIDsAMD; +GLXEW_FUN_EXPORT PFNGLXGETGPUINFOAMDPROC __glewXGetGPUInfoAMD; +GLXEW_FUN_EXPORT PFNGLXMAKEASSOCIATEDCONTEXTCURRENTAMDPROC __glewXMakeAssociatedContextCurrentAMD; + +GLXEW_FUN_EXPORT PFNGLXCREATECONTEXTATTRIBSARBPROC __glewXCreateContextAttribsARB; + +GLXEW_FUN_EXPORT PFNGLXBINDTEXIMAGEATIPROC __glewXBindTexImageATI; +GLXEW_FUN_EXPORT PFNGLXDRAWABLEATTRIBATIPROC __glewXDrawableAttribATI; +GLXEW_FUN_EXPORT PFNGLXRELEASETEXIMAGEATIPROC __glewXReleaseTexImageATI; + +GLXEW_FUN_EXPORT PFNGLXFREECONTEXTEXTPROC __glewXFreeContextEXT; +GLXEW_FUN_EXPORT PFNGLXGETCONTEXTIDEXTPROC __glewXGetContextIDEXT; +GLXEW_FUN_EXPORT PFNGLXIMPORTCONTEXTEXTPROC __glewXImportContextEXT; +GLXEW_FUN_EXPORT PFNGLXQUERYCONTEXTINFOEXTPROC __glewXQueryContextInfoEXT; + +GLXEW_FUN_EXPORT PFNGLXSWAPINTERVALEXTPROC __glewXSwapIntervalEXT; + +GLXEW_FUN_EXPORT PFNGLXBINDTEXIMAGEEXTPROC __glewXBindTexImageEXT; +GLXEW_FUN_EXPORT PFNGLXRELEASETEXIMAGEEXTPROC __glewXReleaseTexImageEXT; + +GLXEW_FUN_EXPORT PFNGLXGETAGPOFFSETMESAPROC __glewXGetAGPOffsetMESA; + +GLXEW_FUN_EXPORT PFNGLXCOPYSUBBUFFERMESAPROC __glewXCopySubBufferMESA; + +GLXEW_FUN_EXPORT PFNGLXCREATEGLXPIXMAPMESAPROC __glewXCreateGLXPixmapMESA; + +GLXEW_FUN_EXPORT PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC __glewXQueryCurrentRendererIntegerMESA; +GLXEW_FUN_EXPORT PFNGLXQUERYCURRENTRENDERERSTRINGMESAPROC __glewXQueryCurrentRendererStringMESA; +GLXEW_FUN_EXPORT PFNGLXQUERYRENDERERINTEGERMESAPROC __glewXQueryRendererIntegerMESA; +GLXEW_FUN_EXPORT PFNGLXQUERYRENDERERSTRINGMESAPROC __glewXQueryRendererStringMESA; + +GLXEW_FUN_EXPORT PFNGLXRELEASEBUFFERSMESAPROC __glewXReleaseBuffersMESA; + +GLXEW_FUN_EXPORT PFNGLXSET3DFXMODEMESAPROC __glewXSet3DfxModeMESA; + +GLXEW_FUN_EXPORT PFNGLXGETSWAPINTERVALMESAPROC __glewXGetSwapIntervalMESA; +GLXEW_FUN_EXPORT PFNGLXSWAPINTERVALMESAPROC __glewXSwapIntervalMESA; + +GLXEW_FUN_EXPORT PFNGLXCOPYBUFFERSUBDATANVPROC __glewXCopyBufferSubDataNV; +GLXEW_FUN_EXPORT PFNGLXNAMEDCOPYBUFFERSUBDATANVPROC __glewXNamedCopyBufferSubDataNV; + +GLXEW_FUN_EXPORT PFNGLXCOPYIMAGESUBDATANVPROC __glewXCopyImageSubDataNV; + +GLXEW_FUN_EXPORT PFNGLXDELAYBEFORESWAPNVPROC __glewXDelayBeforeSwapNV; + +GLXEW_FUN_EXPORT PFNGLXBINDVIDEODEVICENVPROC __glewXBindVideoDeviceNV; +GLXEW_FUN_EXPORT PFNGLXENUMERATEVIDEODEVICESNVPROC __glewXEnumerateVideoDevicesNV; + +GLXEW_FUN_EXPORT PFNGLXBINDSWAPBARRIERNVPROC __glewXBindSwapBarrierNV; +GLXEW_FUN_EXPORT PFNGLXJOINSWAPGROUPNVPROC __glewXJoinSwapGroupNV; +GLXEW_FUN_EXPORT PFNGLXQUERYFRAMECOUNTNVPROC __glewXQueryFrameCountNV; +GLXEW_FUN_EXPORT PFNGLXQUERYMAXSWAPGROUPSNVPROC __glewXQueryMaxSwapGroupsNV; +GLXEW_FUN_EXPORT PFNGLXQUERYSWAPGROUPNVPROC __glewXQuerySwapGroupNV; +GLXEW_FUN_EXPORT PFNGLXRESETFRAMECOUNTNVPROC __glewXResetFrameCountNV; + +GLXEW_FUN_EXPORT PFNGLXALLOCATEMEMORYNVPROC __glewXAllocateMemoryNV; +GLXEW_FUN_EXPORT PFNGLXFREEMEMORYNVPROC __glewXFreeMemoryNV; + +GLXEW_FUN_EXPORT PFNGLXBINDVIDEOCAPTUREDEVICENVPROC __glewXBindVideoCaptureDeviceNV; +GLXEW_FUN_EXPORT PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC __glewXEnumerateVideoCaptureDevicesNV; +GLXEW_FUN_EXPORT PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC __glewXLockVideoCaptureDeviceNV; +GLXEW_FUN_EXPORT PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC __glewXQueryVideoCaptureDeviceNV; +GLXEW_FUN_EXPORT PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC __glewXReleaseVideoCaptureDeviceNV; + +GLXEW_FUN_EXPORT PFNGLXBINDVIDEOIMAGENVPROC __glewXBindVideoImageNV; +GLXEW_FUN_EXPORT PFNGLXGETVIDEODEVICENVPROC __glewXGetVideoDeviceNV; +GLXEW_FUN_EXPORT PFNGLXGETVIDEOINFONVPROC __glewXGetVideoInfoNV; +GLXEW_FUN_EXPORT PFNGLXRELEASEVIDEODEVICENVPROC __glewXReleaseVideoDeviceNV; +GLXEW_FUN_EXPORT PFNGLXRELEASEVIDEOIMAGENVPROC __glewXReleaseVideoImageNV; +GLXEW_FUN_EXPORT PFNGLXSENDPBUFFERTOVIDEONVPROC __glewXSendPbufferToVideoNV; + +GLXEW_FUN_EXPORT PFNGLXGETMSCRATEOMLPROC __glewXGetMscRateOML; +GLXEW_FUN_EXPORT PFNGLXGETSYNCVALUESOMLPROC __glewXGetSyncValuesOML; +GLXEW_FUN_EXPORT PFNGLXSWAPBUFFERSMSCOMLPROC __glewXSwapBuffersMscOML; +GLXEW_FUN_EXPORT PFNGLXWAITFORMSCOMLPROC __glewXWaitForMscOML; +GLXEW_FUN_EXPORT PFNGLXWAITFORSBCOMLPROC __glewXWaitForSbcOML; + +GLXEW_FUN_EXPORT PFNGLXCHOOSEFBCONFIGSGIXPROC __glewXChooseFBConfigSGIX; +GLXEW_FUN_EXPORT PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC __glewXCreateContextWithConfigSGIX; +GLXEW_FUN_EXPORT PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC __glewXCreateGLXPixmapWithConfigSGIX; +GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGATTRIBSGIXPROC __glewXGetFBConfigAttribSGIX; +GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGFROMVISUALSGIXPROC __glewXGetFBConfigFromVisualSGIX; +GLXEW_FUN_EXPORT PFNGLXGETVISUALFROMFBCONFIGSGIXPROC __glewXGetVisualFromFBConfigSGIX; + +GLXEW_FUN_EXPORT PFNGLXBINDHYPERPIPESGIXPROC __glewXBindHyperpipeSGIX; +GLXEW_FUN_EXPORT PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC __glewXDestroyHyperpipeConfigSGIX; +GLXEW_FUN_EXPORT PFNGLXHYPERPIPEATTRIBSGIXPROC __glewXHyperpipeAttribSGIX; +GLXEW_FUN_EXPORT PFNGLXHYPERPIPECONFIGSGIXPROC __glewXHyperpipeConfigSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC __glewXQueryHyperpipeAttribSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC __glewXQueryHyperpipeBestAttribSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPECONFIGSGIXPROC __glewXQueryHyperpipeConfigSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPENETWORKSGIXPROC __glewXQueryHyperpipeNetworkSGIX; + +GLXEW_FUN_EXPORT PFNGLXCREATEGLXPBUFFERSGIXPROC __glewXCreateGLXPbufferSGIX; +GLXEW_FUN_EXPORT PFNGLXDESTROYGLXPBUFFERSGIXPROC __glewXDestroyGLXPbufferSGIX; +GLXEW_FUN_EXPORT PFNGLXGETSELECTEDEVENTSGIXPROC __glewXGetSelectedEventSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYGLXPBUFFERSGIXPROC __glewXQueryGLXPbufferSGIX; +GLXEW_FUN_EXPORT PFNGLXSELECTEVENTSGIXPROC __glewXSelectEventSGIX; + +GLXEW_FUN_EXPORT PFNGLXBINDSWAPBARRIERSGIXPROC __glewXBindSwapBarrierSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC __glewXQueryMaxSwapBarriersSGIX; + +GLXEW_FUN_EXPORT PFNGLXJOINSWAPGROUPSGIXPROC __glewXJoinSwapGroupSGIX; + +GLXEW_FUN_EXPORT PFNGLXBINDCHANNELTOWINDOWSGIXPROC __glewXBindChannelToWindowSGIX; +GLXEW_FUN_EXPORT PFNGLXCHANNELRECTSGIXPROC __glewXChannelRectSGIX; +GLXEW_FUN_EXPORT PFNGLXCHANNELRECTSYNCSGIXPROC __glewXChannelRectSyncSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYCHANNELDELTASSGIXPROC __glewXQueryChannelDeltasSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYCHANNELRECTSGIXPROC __glewXQueryChannelRectSGIX; + +GLXEW_FUN_EXPORT PFNGLXCUSHIONSGIPROC __glewXCushionSGI; + +GLXEW_FUN_EXPORT PFNGLXGETCURRENTREADDRAWABLESGIPROC __glewXGetCurrentReadDrawableSGI; +GLXEW_FUN_EXPORT PFNGLXMAKECURRENTREADSGIPROC __glewXMakeCurrentReadSGI; + +GLXEW_FUN_EXPORT PFNGLXSWAPINTERVALSGIPROC __glewXSwapIntervalSGI; + +GLXEW_FUN_EXPORT PFNGLXGETVIDEOSYNCSGIPROC __glewXGetVideoSyncSGI; +GLXEW_FUN_EXPORT PFNGLXWAITVIDEOSYNCSGIPROC __glewXWaitVideoSyncSGI; + +GLXEW_FUN_EXPORT PFNGLXGETTRANSPARENTINDEXSUNPROC __glewXGetTransparentIndexSUN; + +GLXEW_FUN_EXPORT PFNGLXGETVIDEORESIZESUNPROC __glewXGetVideoResizeSUN; +GLXEW_FUN_EXPORT PFNGLXVIDEORESIZESUNPROC __glewXVideoResizeSUN; +GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_0; +GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_1; +GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_2; +GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_3; +GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_4; +GLXEW_VAR_EXPORT GLboolean __GLXEW_3DFX_multisample; +GLXEW_VAR_EXPORT GLboolean __GLXEW_AMD_gpu_association; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_context_flush_control; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_create_context; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_create_context_no_error; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_create_context_profile; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_create_context_robustness; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_fbconfig_float; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_framebuffer_sRGB; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_get_proc_address; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_multisample; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_robustness_application_isolation; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_robustness_share_group_isolation; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_vertex_buffer_object; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ATI_pixel_format_float; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ATI_render_texture; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_buffer_age; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_create_context_es2_profile; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_create_context_es_profile; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_fbconfig_packed_float; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_framebuffer_sRGB; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_import_context; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_libglvnd; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_scene_marker; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_stereo_tree; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_swap_control; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_swap_control_tear; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_texture_from_pixmap; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_visual_info; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_visual_rating; +GLXEW_VAR_EXPORT GLboolean __GLXEW_INTEL_swap_event; +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_agp_offset; +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_copy_sub_buffer; +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_pixmap_colormap; +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_query_renderer; +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_release_buffers; +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_set_3dfx_mode; +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_swap_control; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_copy_buffer; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_copy_image; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_delay_before_swap; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_float_buffer; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_multisample_coverage; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_present_video; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_robustness_video_memory_purge; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_swap_group; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_vertex_array_range; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_video_capture; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_video_out; +GLXEW_VAR_EXPORT GLboolean __GLXEW_OML_swap_method; +GLXEW_VAR_EXPORT GLboolean __GLXEW_OML_sync_control; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_blended_overlay; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_color_range; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_multisample; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_shared_multisample; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_fbconfig; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_hyperpipe; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_pbuffer; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_swap_barrier; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_swap_group; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_video_resize; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_visual_select_group; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_cushion; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_make_current_read; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_swap_control; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_video_sync; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SUN_get_transparent_index; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SUN_video_resize; +/* ------------------------------------------------------------------------ */ + +GLEWAPI GLenum GLEWAPIENTRY glxewInit (); +GLEWAPI GLboolean GLEWAPIENTRY glxewIsSupported (const char *name); + +#ifndef GLXEW_GET_VAR +#define GLXEW_GET_VAR(x) (*(const GLboolean*)&x) +#endif + +#ifndef GLXEW_GET_FUN +#define GLXEW_GET_FUN(x) x +#endif + +GLEWAPI GLboolean GLEWAPIENTRY glxewGetExtension (const char *name); + +#ifdef __cplusplus +} +#endif + +#endif /* __glxew_h__ */ diff --git a/r5dev/thirdparty/cppnet/cppkore_docs/glew_reference/wglew.h b/r5dev/thirdparty/cppnet/cppkore_docs/glew_reference/wglew.h new file mode 100644 index 00000000..2097c0f0 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore_docs/glew_reference/wglew.h @@ -0,0 +1,1447 @@ +/* +** The OpenGL Extension Wrangler Library +** Copyright (C) 2008-2017, Nigel Stewart +** Copyright (C) 2002-2008, Milan Ikits +** Copyright (C) 2002-2008, Marcelo E. Magallon +** Copyright (C) 2002, Lev Povalahev +** All rights reserved. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are met: +** +** * Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** * The name of the author may be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +** THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/* +** Copyright (c) 2007 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 +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +#ifndef __wglew_h__ +#define __wglew_h__ +#define __WGLEW_H__ + +#ifdef __wglext_h_ +#error wglext.h included before wglew.h +#endif + +#define __wglext_h_ + +#if !defined(WINAPI) +# ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN 1 +# endif +#include +# undef WIN32_LEAN_AND_MEAN +#endif + +/* + * GLEW_STATIC needs to be set when using the static version. + * GLEW_BUILD is set when building the DLL version. + */ +#ifdef GLEW_STATIC +# define GLEWAPI extern +#else +# ifdef GLEW_BUILD +# define GLEWAPI extern __declspec(dllexport) +# else +# define GLEWAPI extern __declspec(dllimport) +# endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* -------------------------- WGL_3DFX_multisample ------------------------- */ + +#ifndef WGL_3DFX_multisample +#define WGL_3DFX_multisample 1 + +#define WGL_SAMPLE_BUFFERS_3DFX 0x2060 +#define WGL_SAMPLES_3DFX 0x2061 + +#define WGLEW_3DFX_multisample WGLEW_GET_VAR(__WGLEW_3DFX_multisample) + +#endif /* WGL_3DFX_multisample */ + +/* ------------------------- WGL_3DL_stereo_control ------------------------ */ + +#ifndef WGL_3DL_stereo_control +#define WGL_3DL_stereo_control 1 + +#define WGL_STEREO_EMITTER_ENABLE_3DL 0x2055 +#define WGL_STEREO_EMITTER_DISABLE_3DL 0x2056 +#define WGL_STEREO_POLARITY_NORMAL_3DL 0x2057 +#define WGL_STEREO_POLARITY_INVERT_3DL 0x2058 + +typedef BOOL (WINAPI * PFNWGLSETSTEREOEMITTERSTATE3DLPROC) (HDC hDC, UINT uState); + +#define wglSetStereoEmitterState3DL WGLEW_GET_FUN(__wglewSetStereoEmitterState3DL) + +#define WGLEW_3DL_stereo_control WGLEW_GET_VAR(__WGLEW_3DL_stereo_control) + +#endif /* WGL_3DL_stereo_control */ + +/* ------------------------ WGL_AMD_gpu_association ------------------------ */ + +#ifndef WGL_AMD_gpu_association +#define WGL_AMD_gpu_association 1 + +#define WGL_GPU_VENDOR_AMD 0x1F00 +#define WGL_GPU_RENDERER_STRING_AMD 0x1F01 +#define WGL_GPU_OPENGL_VERSION_STRING_AMD 0x1F02 +#define WGL_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2 +#define WGL_GPU_RAM_AMD 0x21A3 +#define WGL_GPU_CLOCK_AMD 0x21A4 +#define WGL_GPU_NUM_PIPES_AMD 0x21A5 +#define WGL_GPU_NUM_SIMD_AMD 0x21A6 +#define WGL_GPU_NUM_RB_AMD 0x21A7 +#define WGL_GPU_NUM_SPI_AMD 0x21A8 + +typedef VOID (WINAPI * PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC) (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC) (UINT id); +typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (UINT id, HGLRC hShareContext, const int* attribList); +typedef BOOL (WINAPI * PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC) (HGLRC hglrc); +typedef UINT (WINAPI * PFNWGLGETCONTEXTGPUIDAMDPROC) (HGLRC hglrc); +typedef HGLRC (WINAPI * PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void); +typedef UINT (WINAPI * PFNWGLGETGPUIDSAMDPROC) (UINT maxCount, UINT* ids); +typedef INT (WINAPI * PFNWGLGETGPUINFOAMDPROC) (UINT id, INT property, GLenum dataType, UINT size, void* data); +typedef BOOL (WINAPI * PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (HGLRC hglrc); + +#define wglBlitContextFramebufferAMD WGLEW_GET_FUN(__wglewBlitContextFramebufferAMD) +#define wglCreateAssociatedContextAMD WGLEW_GET_FUN(__wglewCreateAssociatedContextAMD) +#define wglCreateAssociatedContextAttribsAMD WGLEW_GET_FUN(__wglewCreateAssociatedContextAttribsAMD) +#define wglDeleteAssociatedContextAMD WGLEW_GET_FUN(__wglewDeleteAssociatedContextAMD) +#define wglGetContextGPUIDAMD WGLEW_GET_FUN(__wglewGetContextGPUIDAMD) +#define wglGetCurrentAssociatedContextAMD WGLEW_GET_FUN(__wglewGetCurrentAssociatedContextAMD) +#define wglGetGPUIDsAMD WGLEW_GET_FUN(__wglewGetGPUIDsAMD) +#define wglGetGPUInfoAMD WGLEW_GET_FUN(__wglewGetGPUInfoAMD) +#define wglMakeAssociatedContextCurrentAMD WGLEW_GET_FUN(__wglewMakeAssociatedContextCurrentAMD) + +#define WGLEW_AMD_gpu_association WGLEW_GET_VAR(__WGLEW_AMD_gpu_association) + +#endif /* WGL_AMD_gpu_association */ + +/* ------------------------- WGL_ARB_buffer_region ------------------------- */ + +#ifndef WGL_ARB_buffer_region +#define WGL_ARB_buffer_region 1 + +#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001 +#define WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002 +#define WGL_DEPTH_BUFFER_BIT_ARB 0x00000004 +#define WGL_STENCIL_BUFFER_BIT_ARB 0x00000008 + +typedef HANDLE (WINAPI * PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, UINT uType); +typedef VOID (WINAPI * PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion); +typedef BOOL (WINAPI * PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc); +typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height); + +#define wglCreateBufferRegionARB WGLEW_GET_FUN(__wglewCreateBufferRegionARB) +#define wglDeleteBufferRegionARB WGLEW_GET_FUN(__wglewDeleteBufferRegionARB) +#define wglRestoreBufferRegionARB WGLEW_GET_FUN(__wglewRestoreBufferRegionARB) +#define wglSaveBufferRegionARB WGLEW_GET_FUN(__wglewSaveBufferRegionARB) + +#define WGLEW_ARB_buffer_region WGLEW_GET_VAR(__WGLEW_ARB_buffer_region) + +#endif /* WGL_ARB_buffer_region */ + +/* --------------------- WGL_ARB_context_flush_control --------------------- */ + +#ifndef WGL_ARB_context_flush_control +#define WGL_ARB_context_flush_control 1 + +#define WGLEW_ARB_context_flush_control WGLEW_GET_VAR(__WGLEW_ARB_context_flush_control) + +#endif /* WGL_ARB_context_flush_control */ + +/* ------------------------- WGL_ARB_create_context ------------------------ */ + +#ifndef WGL_ARB_create_context +#define WGL_ARB_create_context 1 + +#define WGL_CONTEXT_DEBUG_BIT_ARB 0x0001 +#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002 +#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091 +#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092 +#define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093 +#define WGL_CONTEXT_FLAGS_ARB 0x2094 +#define ERROR_INVALID_VERSION_ARB 0x2095 +#define ERROR_INVALID_PROFILE_ARB 0x2096 + +typedef HGLRC (WINAPI * PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hShareContext, const int* attribList); + +#define wglCreateContextAttribsARB WGLEW_GET_FUN(__wglewCreateContextAttribsARB) + +#define WGLEW_ARB_create_context WGLEW_GET_VAR(__WGLEW_ARB_create_context) + +#endif /* WGL_ARB_create_context */ + +/* -------------------- WGL_ARB_create_context_no_error -------------------- */ + +#ifndef WGL_ARB_create_context_no_error +#define WGL_ARB_create_context_no_error 1 + +#define WGLEW_ARB_create_context_no_error WGLEW_GET_VAR(__WGLEW_ARB_create_context_no_error) + +#endif /* WGL_ARB_create_context_no_error */ + +/* --------------------- WGL_ARB_create_context_profile -------------------- */ + +#ifndef WGL_ARB_create_context_profile +#define WGL_ARB_create_context_profile 1 + +#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001 +#define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002 +#define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126 + +#define WGLEW_ARB_create_context_profile WGLEW_GET_VAR(__WGLEW_ARB_create_context_profile) + +#endif /* WGL_ARB_create_context_profile */ + +/* ------------------- WGL_ARB_create_context_robustness ------------------- */ + +#ifndef WGL_ARB_create_context_robustness +#define WGL_ARB_create_context_robustness 1 + +#define WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004 +#define WGL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 +#define WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 +#define WGL_NO_RESET_NOTIFICATION_ARB 0x8261 + +#define WGLEW_ARB_create_context_robustness WGLEW_GET_VAR(__WGLEW_ARB_create_context_robustness) + +#endif /* WGL_ARB_create_context_robustness */ + +/* ----------------------- WGL_ARB_extensions_string ----------------------- */ + +#ifndef WGL_ARB_extensions_string +#define WGL_ARB_extensions_string 1 + +typedef const char* (WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc); + +#define wglGetExtensionsStringARB WGLEW_GET_FUN(__wglewGetExtensionsStringARB) + +#define WGLEW_ARB_extensions_string WGLEW_GET_VAR(__WGLEW_ARB_extensions_string) + +#endif /* WGL_ARB_extensions_string */ + +/* ------------------------ WGL_ARB_framebuffer_sRGB ----------------------- */ + +#ifndef WGL_ARB_framebuffer_sRGB +#define WGL_ARB_framebuffer_sRGB 1 + +#define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20A9 + +#define WGLEW_ARB_framebuffer_sRGB WGLEW_GET_VAR(__WGLEW_ARB_framebuffer_sRGB) + +#endif /* WGL_ARB_framebuffer_sRGB */ + +/* ----------------------- WGL_ARB_make_current_read ----------------------- */ + +#ifndef WGL_ARB_make_current_read +#define WGL_ARB_make_current_read 1 + +#define ERROR_INVALID_PIXEL_TYPE_ARB 0x2043 +#define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054 + +typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCARBPROC) (VOID); +typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc); + +#define wglGetCurrentReadDCARB WGLEW_GET_FUN(__wglewGetCurrentReadDCARB) +#define wglMakeContextCurrentARB WGLEW_GET_FUN(__wglewMakeContextCurrentARB) + +#define WGLEW_ARB_make_current_read WGLEW_GET_VAR(__WGLEW_ARB_make_current_read) + +#endif /* WGL_ARB_make_current_read */ + +/* -------------------------- WGL_ARB_multisample -------------------------- */ + +#ifndef WGL_ARB_multisample +#define WGL_ARB_multisample 1 + +#define WGL_SAMPLE_BUFFERS_ARB 0x2041 +#define WGL_SAMPLES_ARB 0x2042 + +#define WGLEW_ARB_multisample WGLEW_GET_VAR(__WGLEW_ARB_multisample) + +#endif /* WGL_ARB_multisample */ + +/* ---------------------------- WGL_ARB_pbuffer ---------------------------- */ + +#ifndef WGL_ARB_pbuffer +#define WGL_ARB_pbuffer 1 + +#define WGL_DRAW_TO_PBUFFER_ARB 0x202D +#define WGL_MAX_PBUFFER_PIXELS_ARB 0x202E +#define WGL_MAX_PBUFFER_WIDTH_ARB 0x202F +#define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030 +#define WGL_PBUFFER_LARGEST_ARB 0x2033 +#define WGL_PBUFFER_WIDTH_ARB 0x2034 +#define WGL_PBUFFER_HEIGHT_ARB 0x2035 +#define WGL_PBUFFER_LOST_ARB 0x2036 + +DECLARE_HANDLE(HPBUFFERARB); + +typedef HPBUFFERARB (WINAPI * PFNWGLCREATEPBUFFERARBPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int* piAttribList); +typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFERARBPROC) (HPBUFFERARB hPbuffer); +typedef HDC (WINAPI * PFNWGLGETPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer); +typedef BOOL (WINAPI * PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer, int iAttribute, int* piValue); +typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer, HDC hDC); + +#define wglCreatePbufferARB WGLEW_GET_FUN(__wglewCreatePbufferARB) +#define wglDestroyPbufferARB WGLEW_GET_FUN(__wglewDestroyPbufferARB) +#define wglGetPbufferDCARB WGLEW_GET_FUN(__wglewGetPbufferDCARB) +#define wglQueryPbufferARB WGLEW_GET_FUN(__wglewQueryPbufferARB) +#define wglReleasePbufferDCARB WGLEW_GET_FUN(__wglewReleasePbufferDCARB) + +#define WGLEW_ARB_pbuffer WGLEW_GET_VAR(__WGLEW_ARB_pbuffer) + +#endif /* WGL_ARB_pbuffer */ + +/* -------------------------- WGL_ARB_pixel_format ------------------------- */ + +#ifndef WGL_ARB_pixel_format +#define WGL_ARB_pixel_format 1 + +#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000 +#define WGL_DRAW_TO_WINDOW_ARB 0x2001 +#define WGL_DRAW_TO_BITMAP_ARB 0x2002 +#define WGL_ACCELERATION_ARB 0x2003 +#define WGL_NEED_PALETTE_ARB 0x2004 +#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005 +#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006 +#define WGL_SWAP_METHOD_ARB 0x2007 +#define WGL_NUMBER_OVERLAYS_ARB 0x2008 +#define WGL_NUMBER_UNDERLAYS_ARB 0x2009 +#define WGL_TRANSPARENT_ARB 0x200A +#define WGL_SHARE_DEPTH_ARB 0x200C +#define WGL_SHARE_STENCIL_ARB 0x200D +#define WGL_SHARE_ACCUM_ARB 0x200E +#define WGL_SUPPORT_GDI_ARB 0x200F +#define WGL_SUPPORT_OPENGL_ARB 0x2010 +#define WGL_DOUBLE_BUFFER_ARB 0x2011 +#define WGL_STEREO_ARB 0x2012 +#define WGL_PIXEL_TYPE_ARB 0x2013 +#define WGL_COLOR_BITS_ARB 0x2014 +#define WGL_RED_BITS_ARB 0x2015 +#define WGL_RED_SHIFT_ARB 0x2016 +#define WGL_GREEN_BITS_ARB 0x2017 +#define WGL_GREEN_SHIFT_ARB 0x2018 +#define WGL_BLUE_BITS_ARB 0x2019 +#define WGL_BLUE_SHIFT_ARB 0x201A +#define WGL_ALPHA_BITS_ARB 0x201B +#define WGL_ALPHA_SHIFT_ARB 0x201C +#define WGL_ACCUM_BITS_ARB 0x201D +#define WGL_ACCUM_RED_BITS_ARB 0x201E +#define WGL_ACCUM_GREEN_BITS_ARB 0x201F +#define WGL_ACCUM_BLUE_BITS_ARB 0x2020 +#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021 +#define WGL_DEPTH_BITS_ARB 0x2022 +#define WGL_STENCIL_BITS_ARB 0x2023 +#define WGL_AUX_BUFFERS_ARB 0x2024 +#define WGL_NO_ACCELERATION_ARB 0x2025 +#define WGL_GENERIC_ACCELERATION_ARB 0x2026 +#define WGL_FULL_ACCELERATION_ARB 0x2027 +#define WGL_SWAP_EXCHANGE_ARB 0x2028 +#define WGL_SWAP_COPY_ARB 0x2029 +#define WGL_SWAP_UNDEFINED_ARB 0x202A +#define WGL_TYPE_RGBA_ARB 0x202B +#define WGL_TYPE_COLORINDEX_ARB 0x202C +#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037 +#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038 +#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039 +#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A +#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B + +typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int* piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats); +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int* piAttributes, FLOAT *pfValues); +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int* piAttributes, int *piValues); + +#define wglChoosePixelFormatARB WGLEW_GET_FUN(__wglewChoosePixelFormatARB) +#define wglGetPixelFormatAttribfvARB WGLEW_GET_FUN(__wglewGetPixelFormatAttribfvARB) +#define wglGetPixelFormatAttribivARB WGLEW_GET_FUN(__wglewGetPixelFormatAttribivARB) + +#define WGLEW_ARB_pixel_format WGLEW_GET_VAR(__WGLEW_ARB_pixel_format) + +#endif /* WGL_ARB_pixel_format */ + +/* ----------------------- WGL_ARB_pixel_format_float ---------------------- */ + +#ifndef WGL_ARB_pixel_format_float +#define WGL_ARB_pixel_format_float 1 + +#define WGL_TYPE_RGBA_FLOAT_ARB 0x21A0 + +#define WGLEW_ARB_pixel_format_float WGLEW_GET_VAR(__WGLEW_ARB_pixel_format_float) + +#endif /* WGL_ARB_pixel_format_float */ + +/* ------------------------- WGL_ARB_render_texture ------------------------ */ + +#ifndef WGL_ARB_render_texture +#define WGL_ARB_render_texture 1 + +#define WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070 +#define WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071 +#define WGL_TEXTURE_FORMAT_ARB 0x2072 +#define WGL_TEXTURE_TARGET_ARB 0x2073 +#define WGL_MIPMAP_TEXTURE_ARB 0x2074 +#define WGL_TEXTURE_RGB_ARB 0x2075 +#define WGL_TEXTURE_RGBA_ARB 0x2076 +#define WGL_NO_TEXTURE_ARB 0x2077 +#define WGL_TEXTURE_CUBE_MAP_ARB 0x2078 +#define WGL_TEXTURE_1D_ARB 0x2079 +#define WGL_TEXTURE_2D_ARB 0x207A +#define WGL_MIPMAP_LEVEL_ARB 0x207B +#define WGL_CUBE_MAP_FACE_ARB 0x207C +#define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D +#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E +#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F +#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080 +#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081 +#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082 +#define WGL_FRONT_LEFT_ARB 0x2083 +#define WGL_FRONT_RIGHT_ARB 0x2084 +#define WGL_BACK_LEFT_ARB 0x2085 +#define WGL_BACK_RIGHT_ARB 0x2086 +#define WGL_AUX0_ARB 0x2087 +#define WGL_AUX1_ARB 0x2088 +#define WGL_AUX2_ARB 0x2089 +#define WGL_AUX3_ARB 0x208A +#define WGL_AUX4_ARB 0x208B +#define WGL_AUX5_ARB 0x208C +#define WGL_AUX6_ARB 0x208D +#define WGL_AUX7_ARB 0x208E +#define WGL_AUX8_ARB 0x208F +#define WGL_AUX9_ARB 0x2090 + +typedef BOOL (WINAPI * PFNWGLBINDTEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer); +typedef BOOL (WINAPI * PFNWGLRELEASETEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer); +typedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, const int* piAttribList); + +#define wglBindTexImageARB WGLEW_GET_FUN(__wglewBindTexImageARB) +#define wglReleaseTexImageARB WGLEW_GET_FUN(__wglewReleaseTexImageARB) +#define wglSetPbufferAttribARB WGLEW_GET_FUN(__wglewSetPbufferAttribARB) + +#define WGLEW_ARB_render_texture WGLEW_GET_VAR(__WGLEW_ARB_render_texture) + +#endif /* WGL_ARB_render_texture */ + +/* ---------------- WGL_ARB_robustness_application_isolation --------------- */ + +#ifndef WGL_ARB_robustness_application_isolation +#define WGL_ARB_robustness_application_isolation 1 + +#define WGL_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 + +#define WGLEW_ARB_robustness_application_isolation WGLEW_GET_VAR(__WGLEW_ARB_robustness_application_isolation) + +#endif /* WGL_ARB_robustness_application_isolation */ + +/* ---------------- WGL_ARB_robustness_share_group_isolation --------------- */ + +#ifndef WGL_ARB_robustness_share_group_isolation +#define WGL_ARB_robustness_share_group_isolation 1 + +#define WGL_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 + +#define WGLEW_ARB_robustness_share_group_isolation WGLEW_GET_VAR(__WGLEW_ARB_robustness_share_group_isolation) + +#endif /* WGL_ARB_robustness_share_group_isolation */ + +/* ----------------------- WGL_ATI_pixel_format_float ---------------------- */ + +#ifndef WGL_ATI_pixel_format_float +#define WGL_ATI_pixel_format_float 1 + +#define WGL_TYPE_RGBA_FLOAT_ATI 0x21A0 +#define GL_RGBA_FLOAT_MODE_ATI 0x8820 +#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835 + +#define WGLEW_ATI_pixel_format_float WGLEW_GET_VAR(__WGLEW_ATI_pixel_format_float) + +#endif /* WGL_ATI_pixel_format_float */ + +/* -------------------- WGL_ATI_render_texture_rectangle ------------------- */ + +#ifndef WGL_ATI_render_texture_rectangle +#define WGL_ATI_render_texture_rectangle 1 + +#define WGL_TEXTURE_RECTANGLE_ATI 0x21A5 + +#define WGLEW_ATI_render_texture_rectangle WGLEW_GET_VAR(__WGLEW_ATI_render_texture_rectangle) + +#endif /* WGL_ATI_render_texture_rectangle */ + +/* --------------------------- WGL_EXT_colorspace -------------------------- */ + +#ifndef WGL_EXT_colorspace +#define WGL_EXT_colorspace 1 + +#define WGL_COLORSPACE_SRGB_EXT 0x3089 +#define WGL_COLORSPACE_LINEAR_EXT 0x308A +#define WGL_COLORSPACE_EXT 0x309D + +#define WGLEW_EXT_colorspace WGLEW_GET_VAR(__WGLEW_EXT_colorspace) + +#endif /* WGL_EXT_colorspace */ + +/* ------------------- WGL_EXT_create_context_es2_profile ------------------ */ + +#ifndef WGL_EXT_create_context_es2_profile +#define WGL_EXT_create_context_es2_profile 1 + +#define WGL_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004 + +#define WGLEW_EXT_create_context_es2_profile WGLEW_GET_VAR(__WGLEW_EXT_create_context_es2_profile) + +#endif /* WGL_EXT_create_context_es2_profile */ + +/* ------------------- WGL_EXT_create_context_es_profile ------------------- */ + +#ifndef WGL_EXT_create_context_es_profile +#define WGL_EXT_create_context_es_profile 1 + +#define WGL_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004 + +#define WGLEW_EXT_create_context_es_profile WGLEW_GET_VAR(__WGLEW_EXT_create_context_es_profile) + +#endif /* WGL_EXT_create_context_es_profile */ + +/* -------------------------- WGL_EXT_depth_float -------------------------- */ + +#ifndef WGL_EXT_depth_float +#define WGL_EXT_depth_float 1 + +#define WGL_DEPTH_FLOAT_EXT 0x2040 + +#define WGLEW_EXT_depth_float WGLEW_GET_VAR(__WGLEW_EXT_depth_float) + +#endif /* WGL_EXT_depth_float */ + +/* ---------------------- WGL_EXT_display_color_table ---------------------- */ + +#ifndef WGL_EXT_display_color_table +#define WGL_EXT_display_color_table 1 + +typedef GLboolean (WINAPI * PFNWGLBINDDISPLAYCOLORTABLEEXTPROC) (GLushort id); +typedef GLboolean (WINAPI * PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC) (GLushort id); +typedef void (WINAPI * PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC) (GLushort id); +typedef GLboolean (WINAPI * PFNWGLLOADDISPLAYCOLORTABLEEXTPROC) (GLushort* table, GLuint length); + +#define wglBindDisplayColorTableEXT WGLEW_GET_FUN(__wglewBindDisplayColorTableEXT) +#define wglCreateDisplayColorTableEXT WGLEW_GET_FUN(__wglewCreateDisplayColorTableEXT) +#define wglDestroyDisplayColorTableEXT WGLEW_GET_FUN(__wglewDestroyDisplayColorTableEXT) +#define wglLoadDisplayColorTableEXT WGLEW_GET_FUN(__wglewLoadDisplayColorTableEXT) + +#define WGLEW_EXT_display_color_table WGLEW_GET_VAR(__WGLEW_EXT_display_color_table) + +#endif /* WGL_EXT_display_color_table */ + +/* ----------------------- WGL_EXT_extensions_string ----------------------- */ + +#ifndef WGL_EXT_extensions_string +#define WGL_EXT_extensions_string 1 + +typedef const char* (WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (void); + +#define wglGetExtensionsStringEXT WGLEW_GET_FUN(__wglewGetExtensionsStringEXT) + +#define WGLEW_EXT_extensions_string WGLEW_GET_VAR(__WGLEW_EXT_extensions_string) + +#endif /* WGL_EXT_extensions_string */ + +/* ------------------------ WGL_EXT_framebuffer_sRGB ----------------------- */ + +#ifndef WGL_EXT_framebuffer_sRGB +#define WGL_EXT_framebuffer_sRGB 1 + +#define WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20A9 + +#define WGLEW_EXT_framebuffer_sRGB WGLEW_GET_VAR(__WGLEW_EXT_framebuffer_sRGB) + +#endif /* WGL_EXT_framebuffer_sRGB */ + +/* ----------------------- WGL_EXT_make_current_read ----------------------- */ + +#ifndef WGL_EXT_make_current_read +#define WGL_EXT_make_current_read 1 + +#define ERROR_INVALID_PIXEL_TYPE_EXT 0x2043 + +typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCEXTPROC) (VOID); +typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTEXTPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc); + +#define wglGetCurrentReadDCEXT WGLEW_GET_FUN(__wglewGetCurrentReadDCEXT) +#define wglMakeContextCurrentEXT WGLEW_GET_FUN(__wglewMakeContextCurrentEXT) + +#define WGLEW_EXT_make_current_read WGLEW_GET_VAR(__WGLEW_EXT_make_current_read) + +#endif /* WGL_EXT_make_current_read */ + +/* -------------------------- WGL_EXT_multisample -------------------------- */ + +#ifndef WGL_EXT_multisample +#define WGL_EXT_multisample 1 + +#define WGL_SAMPLE_BUFFERS_EXT 0x2041 +#define WGL_SAMPLES_EXT 0x2042 + +#define WGLEW_EXT_multisample WGLEW_GET_VAR(__WGLEW_EXT_multisample) + +#endif /* WGL_EXT_multisample */ + +/* ---------------------------- WGL_EXT_pbuffer ---------------------------- */ + +#ifndef WGL_EXT_pbuffer +#define WGL_EXT_pbuffer 1 + +#define WGL_DRAW_TO_PBUFFER_EXT 0x202D +#define WGL_MAX_PBUFFER_PIXELS_EXT 0x202E +#define WGL_MAX_PBUFFER_WIDTH_EXT 0x202F +#define WGL_MAX_PBUFFER_HEIGHT_EXT 0x2030 +#define WGL_OPTIMAL_PBUFFER_WIDTH_EXT 0x2031 +#define WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032 +#define WGL_PBUFFER_LARGEST_EXT 0x2033 +#define WGL_PBUFFER_WIDTH_EXT 0x2034 +#define WGL_PBUFFER_HEIGHT_EXT 0x2035 + +DECLARE_HANDLE(HPBUFFEREXT); + +typedef HPBUFFEREXT (WINAPI * PFNWGLCREATEPBUFFEREXTPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int* piAttribList); +typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer); +typedef HDC (WINAPI * PFNWGLGETPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer); +typedef BOOL (WINAPI * PFNWGLQUERYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer, int iAttribute, int* piValue); +typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer, HDC hDC); + +#define wglCreatePbufferEXT WGLEW_GET_FUN(__wglewCreatePbufferEXT) +#define wglDestroyPbufferEXT WGLEW_GET_FUN(__wglewDestroyPbufferEXT) +#define wglGetPbufferDCEXT WGLEW_GET_FUN(__wglewGetPbufferDCEXT) +#define wglQueryPbufferEXT WGLEW_GET_FUN(__wglewQueryPbufferEXT) +#define wglReleasePbufferDCEXT WGLEW_GET_FUN(__wglewReleasePbufferDCEXT) + +#define WGLEW_EXT_pbuffer WGLEW_GET_VAR(__WGLEW_EXT_pbuffer) + +#endif /* WGL_EXT_pbuffer */ + +/* -------------------------- WGL_EXT_pixel_format ------------------------- */ + +#ifndef WGL_EXT_pixel_format +#define WGL_EXT_pixel_format 1 + +#define WGL_NUMBER_PIXEL_FORMATS_EXT 0x2000 +#define WGL_DRAW_TO_WINDOW_EXT 0x2001 +#define WGL_DRAW_TO_BITMAP_EXT 0x2002 +#define WGL_ACCELERATION_EXT 0x2003 +#define WGL_NEED_PALETTE_EXT 0x2004 +#define WGL_NEED_SYSTEM_PALETTE_EXT 0x2005 +#define WGL_SWAP_LAYER_BUFFERS_EXT 0x2006 +#define WGL_SWAP_METHOD_EXT 0x2007 +#define WGL_NUMBER_OVERLAYS_EXT 0x2008 +#define WGL_NUMBER_UNDERLAYS_EXT 0x2009 +#define WGL_TRANSPARENT_EXT 0x200A +#define WGL_TRANSPARENT_VALUE_EXT 0x200B +#define WGL_SHARE_DEPTH_EXT 0x200C +#define WGL_SHARE_STENCIL_EXT 0x200D +#define WGL_SHARE_ACCUM_EXT 0x200E +#define WGL_SUPPORT_GDI_EXT 0x200F +#define WGL_SUPPORT_OPENGL_EXT 0x2010 +#define WGL_DOUBLE_BUFFER_EXT 0x2011 +#define WGL_STEREO_EXT 0x2012 +#define WGL_PIXEL_TYPE_EXT 0x2013 +#define WGL_COLOR_BITS_EXT 0x2014 +#define WGL_RED_BITS_EXT 0x2015 +#define WGL_RED_SHIFT_EXT 0x2016 +#define WGL_GREEN_BITS_EXT 0x2017 +#define WGL_GREEN_SHIFT_EXT 0x2018 +#define WGL_BLUE_BITS_EXT 0x2019 +#define WGL_BLUE_SHIFT_EXT 0x201A +#define WGL_ALPHA_BITS_EXT 0x201B +#define WGL_ALPHA_SHIFT_EXT 0x201C +#define WGL_ACCUM_BITS_EXT 0x201D +#define WGL_ACCUM_RED_BITS_EXT 0x201E +#define WGL_ACCUM_GREEN_BITS_EXT 0x201F +#define WGL_ACCUM_BLUE_BITS_EXT 0x2020 +#define WGL_ACCUM_ALPHA_BITS_EXT 0x2021 +#define WGL_DEPTH_BITS_EXT 0x2022 +#define WGL_STENCIL_BITS_EXT 0x2023 +#define WGL_AUX_BUFFERS_EXT 0x2024 +#define WGL_NO_ACCELERATION_EXT 0x2025 +#define WGL_GENERIC_ACCELERATION_EXT 0x2026 +#define WGL_FULL_ACCELERATION_EXT 0x2027 +#define WGL_SWAP_EXCHANGE_EXT 0x2028 +#define WGL_SWAP_COPY_EXT 0x2029 +#define WGL_SWAP_UNDEFINED_EXT 0x202A +#define WGL_TYPE_RGBA_EXT 0x202B +#define WGL_TYPE_COLORINDEX_EXT 0x202C + +typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATEXTPROC) (HDC hdc, const int* piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats); +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int* piAttributes, FLOAT *pfValues); +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int* piAttributes, int *piValues); + +#define wglChoosePixelFormatEXT WGLEW_GET_FUN(__wglewChoosePixelFormatEXT) +#define wglGetPixelFormatAttribfvEXT WGLEW_GET_FUN(__wglewGetPixelFormatAttribfvEXT) +#define wglGetPixelFormatAttribivEXT WGLEW_GET_FUN(__wglewGetPixelFormatAttribivEXT) + +#define WGLEW_EXT_pixel_format WGLEW_GET_VAR(__WGLEW_EXT_pixel_format) + +#endif /* WGL_EXT_pixel_format */ + +/* ------------------- WGL_EXT_pixel_format_packed_float ------------------- */ + +#ifndef WGL_EXT_pixel_format_packed_float +#define WGL_EXT_pixel_format_packed_float 1 + +#define WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT 0x20A8 + +#define WGLEW_EXT_pixel_format_packed_float WGLEW_GET_VAR(__WGLEW_EXT_pixel_format_packed_float) + +#endif /* WGL_EXT_pixel_format_packed_float */ + +/* -------------------------- WGL_EXT_swap_control ------------------------- */ + +#ifndef WGL_EXT_swap_control +#define WGL_EXT_swap_control 1 + +typedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void); +typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval); + +#define wglGetSwapIntervalEXT WGLEW_GET_FUN(__wglewGetSwapIntervalEXT) +#define wglSwapIntervalEXT WGLEW_GET_FUN(__wglewSwapIntervalEXT) + +#define WGLEW_EXT_swap_control WGLEW_GET_VAR(__WGLEW_EXT_swap_control) + +#endif /* WGL_EXT_swap_control */ + +/* ----------------------- WGL_EXT_swap_control_tear ----------------------- */ + +#ifndef WGL_EXT_swap_control_tear +#define WGL_EXT_swap_control_tear 1 + +#define WGLEW_EXT_swap_control_tear WGLEW_GET_VAR(__WGLEW_EXT_swap_control_tear) + +#endif /* WGL_EXT_swap_control_tear */ + +/* --------------------- WGL_I3D_digital_video_control --------------------- */ + +#ifndef WGL_I3D_digital_video_control +#define WGL_I3D_digital_video_control 1 + +#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050 +#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051 +#define WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052 +#define WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053 + +typedef BOOL (WINAPI * PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int* piValue); +typedef BOOL (WINAPI * PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int* piValue); + +#define wglGetDigitalVideoParametersI3D WGLEW_GET_FUN(__wglewGetDigitalVideoParametersI3D) +#define wglSetDigitalVideoParametersI3D WGLEW_GET_FUN(__wglewSetDigitalVideoParametersI3D) + +#define WGLEW_I3D_digital_video_control WGLEW_GET_VAR(__WGLEW_I3D_digital_video_control) + +#endif /* WGL_I3D_digital_video_control */ + +/* ----------------------------- WGL_I3D_gamma ----------------------------- */ + +#ifndef WGL_I3D_gamma +#define WGL_I3D_gamma 1 + +#define WGL_GAMMA_TABLE_SIZE_I3D 0x204E +#define WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F + +typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, USHORT* puRed, USHORT *puGreen, USHORT *puBlue); +typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int* piValue); +typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, const USHORT* puRed, const USHORT *puGreen, const USHORT *puBlue); +typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int* piValue); + +#define wglGetGammaTableI3D WGLEW_GET_FUN(__wglewGetGammaTableI3D) +#define wglGetGammaTableParametersI3D WGLEW_GET_FUN(__wglewGetGammaTableParametersI3D) +#define wglSetGammaTableI3D WGLEW_GET_FUN(__wglewSetGammaTableI3D) +#define wglSetGammaTableParametersI3D WGLEW_GET_FUN(__wglewSetGammaTableParametersI3D) + +#define WGLEW_I3D_gamma WGLEW_GET_VAR(__WGLEW_I3D_gamma) + +#endif /* WGL_I3D_gamma */ + +/* ---------------------------- WGL_I3D_genlock ---------------------------- */ + +#ifndef WGL_I3D_genlock +#define WGL_I3D_genlock 1 + +#define WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044 +#define WGL_GENLOCK_SOURCE_EXTERNAL_SYNC_I3D 0x2045 +#define WGL_GENLOCK_SOURCE_EXTERNAL_FIELD_I3D 0x2046 +#define WGL_GENLOCK_SOURCE_EXTERNAL_TTL_I3D 0x2047 +#define WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048 +#define WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049 +#define WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A +#define WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B +#define WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C + +typedef BOOL (WINAPI * PFNWGLDISABLEGENLOCKI3DPROC) (HDC hDC); +typedef BOOL (WINAPI * PFNWGLENABLEGENLOCKI3DPROC) (HDC hDC); +typedef BOOL (WINAPI * PFNWGLGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT uRate); +typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT uDelay); +typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT uEdge); +typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEI3DPROC) (HDC hDC, UINT uSource); +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT* uRate); +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT* uDelay); +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT* uEdge); +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEI3DPROC) (HDC hDC, UINT* uSource); +typedef BOOL (WINAPI * PFNWGLISENABLEDGENLOCKI3DPROC) (HDC hDC, BOOL* pFlag); +typedef BOOL (WINAPI * PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, UINT* uMaxLineDelay, UINT *uMaxPixelDelay); + +#define wglDisableGenlockI3D WGLEW_GET_FUN(__wglewDisableGenlockI3D) +#define wglEnableGenlockI3D WGLEW_GET_FUN(__wglewEnableGenlockI3D) +#define wglGenlockSampleRateI3D WGLEW_GET_FUN(__wglewGenlockSampleRateI3D) +#define wglGenlockSourceDelayI3D WGLEW_GET_FUN(__wglewGenlockSourceDelayI3D) +#define wglGenlockSourceEdgeI3D WGLEW_GET_FUN(__wglewGenlockSourceEdgeI3D) +#define wglGenlockSourceI3D WGLEW_GET_FUN(__wglewGenlockSourceI3D) +#define wglGetGenlockSampleRateI3D WGLEW_GET_FUN(__wglewGetGenlockSampleRateI3D) +#define wglGetGenlockSourceDelayI3D WGLEW_GET_FUN(__wglewGetGenlockSourceDelayI3D) +#define wglGetGenlockSourceEdgeI3D WGLEW_GET_FUN(__wglewGetGenlockSourceEdgeI3D) +#define wglGetGenlockSourceI3D WGLEW_GET_FUN(__wglewGetGenlockSourceI3D) +#define wglIsEnabledGenlockI3D WGLEW_GET_FUN(__wglewIsEnabledGenlockI3D) +#define wglQueryGenlockMaxSourceDelayI3D WGLEW_GET_FUN(__wglewQueryGenlockMaxSourceDelayI3D) + +#define WGLEW_I3D_genlock WGLEW_GET_VAR(__WGLEW_I3D_genlock) + +#endif /* WGL_I3D_genlock */ + +/* -------------------------- WGL_I3D_image_buffer ------------------------- */ + +#ifndef WGL_I3D_image_buffer +#define WGL_I3D_image_buffer 1 + +#define WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001 +#define WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002 + +typedef BOOL (WINAPI * PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) (HDC hdc, HANDLE* pEvent, LPVOID *pAddress, DWORD *pSize, UINT count); +typedef LPVOID (WINAPI * PFNWGLCREATEIMAGEBUFFERI3DPROC) (HDC hDC, DWORD dwSize, UINT uFlags); +typedef BOOL (WINAPI * PFNWGLDESTROYIMAGEBUFFERI3DPROC) (HDC hDC, LPVOID pAddress); +typedef BOOL (WINAPI * PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) (HDC hdc, LPVOID* pAddress, UINT count); + +#define wglAssociateImageBufferEventsI3D WGLEW_GET_FUN(__wglewAssociateImageBufferEventsI3D) +#define wglCreateImageBufferI3D WGLEW_GET_FUN(__wglewCreateImageBufferI3D) +#define wglDestroyImageBufferI3D WGLEW_GET_FUN(__wglewDestroyImageBufferI3D) +#define wglReleaseImageBufferEventsI3D WGLEW_GET_FUN(__wglewReleaseImageBufferEventsI3D) + +#define WGLEW_I3D_image_buffer WGLEW_GET_VAR(__WGLEW_I3D_image_buffer) + +#endif /* WGL_I3D_image_buffer */ + +/* ------------------------ WGL_I3D_swap_frame_lock ------------------------ */ + +#ifndef WGL_I3D_swap_frame_lock +#define WGL_I3D_swap_frame_lock 1 + +typedef BOOL (WINAPI * PFNWGLDISABLEFRAMELOCKI3DPROC) (VOID); +typedef BOOL (WINAPI * PFNWGLENABLEFRAMELOCKI3DPROC) (VOID); +typedef BOOL (WINAPI * PFNWGLISENABLEDFRAMELOCKI3DPROC) (BOOL* pFlag); +typedef BOOL (WINAPI * PFNWGLQUERYFRAMELOCKMASTERI3DPROC) (BOOL* pFlag); + +#define wglDisableFrameLockI3D WGLEW_GET_FUN(__wglewDisableFrameLockI3D) +#define wglEnableFrameLockI3D WGLEW_GET_FUN(__wglewEnableFrameLockI3D) +#define wglIsEnabledFrameLockI3D WGLEW_GET_FUN(__wglewIsEnabledFrameLockI3D) +#define wglQueryFrameLockMasterI3D WGLEW_GET_FUN(__wglewQueryFrameLockMasterI3D) + +#define WGLEW_I3D_swap_frame_lock WGLEW_GET_VAR(__WGLEW_I3D_swap_frame_lock) + +#endif /* WGL_I3D_swap_frame_lock */ + +/* ------------------------ WGL_I3D_swap_frame_usage ----------------------- */ + +#ifndef WGL_I3D_swap_frame_usage +#define WGL_I3D_swap_frame_usage 1 + +typedef BOOL (WINAPI * PFNWGLBEGINFRAMETRACKINGI3DPROC) (void); +typedef BOOL (WINAPI * PFNWGLENDFRAMETRACKINGI3DPROC) (void); +typedef BOOL (WINAPI * PFNWGLGETFRAMEUSAGEI3DPROC) (float* pUsage); +typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD* pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage); + +#define wglBeginFrameTrackingI3D WGLEW_GET_FUN(__wglewBeginFrameTrackingI3D) +#define wglEndFrameTrackingI3D WGLEW_GET_FUN(__wglewEndFrameTrackingI3D) +#define wglGetFrameUsageI3D WGLEW_GET_FUN(__wglewGetFrameUsageI3D) +#define wglQueryFrameTrackingI3D WGLEW_GET_FUN(__wglewQueryFrameTrackingI3D) + +#define WGLEW_I3D_swap_frame_usage WGLEW_GET_VAR(__WGLEW_I3D_swap_frame_usage) + +#endif /* WGL_I3D_swap_frame_usage */ + +/* --------------------------- WGL_NV_DX_interop --------------------------- */ + +#ifndef WGL_NV_DX_interop +#define WGL_NV_DX_interop 1 + +#define WGL_ACCESS_READ_ONLY_NV 0x0000 +#define WGL_ACCESS_READ_WRITE_NV 0x0001 +#define WGL_ACCESS_WRITE_DISCARD_NV 0x0002 + +typedef BOOL (WINAPI * PFNWGLDXCLOSEDEVICENVPROC) (HANDLE hDevice); +typedef BOOL (WINAPI * PFNWGLDXLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE* hObjects); +typedef BOOL (WINAPI * PFNWGLDXOBJECTACCESSNVPROC) (HANDLE hObject, GLenum access); +typedef HANDLE (WINAPI * PFNWGLDXOPENDEVICENVPROC) (void* dxDevice); +typedef HANDLE (WINAPI * PFNWGLDXREGISTEROBJECTNVPROC) (HANDLE hDevice, void* dxObject, GLuint name, GLenum type, GLenum access); +typedef BOOL (WINAPI * PFNWGLDXSETRESOURCESHAREHANDLENVPROC) (void* dxObject, HANDLE shareHandle); +typedef BOOL (WINAPI * PFNWGLDXUNLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE* hObjects); +typedef BOOL (WINAPI * PFNWGLDXUNREGISTEROBJECTNVPROC) (HANDLE hDevice, HANDLE hObject); + +#define wglDXCloseDeviceNV WGLEW_GET_FUN(__wglewDXCloseDeviceNV) +#define wglDXLockObjectsNV WGLEW_GET_FUN(__wglewDXLockObjectsNV) +#define wglDXObjectAccessNV WGLEW_GET_FUN(__wglewDXObjectAccessNV) +#define wglDXOpenDeviceNV WGLEW_GET_FUN(__wglewDXOpenDeviceNV) +#define wglDXRegisterObjectNV WGLEW_GET_FUN(__wglewDXRegisterObjectNV) +#define wglDXSetResourceShareHandleNV WGLEW_GET_FUN(__wglewDXSetResourceShareHandleNV) +#define wglDXUnlockObjectsNV WGLEW_GET_FUN(__wglewDXUnlockObjectsNV) +#define wglDXUnregisterObjectNV WGLEW_GET_FUN(__wglewDXUnregisterObjectNV) + +#define WGLEW_NV_DX_interop WGLEW_GET_VAR(__WGLEW_NV_DX_interop) + +#endif /* WGL_NV_DX_interop */ + +/* --------------------------- WGL_NV_DX_interop2 -------------------------- */ + +#ifndef WGL_NV_DX_interop2 +#define WGL_NV_DX_interop2 1 + +#define WGLEW_NV_DX_interop2 WGLEW_GET_VAR(__WGLEW_NV_DX_interop2) + +#endif /* WGL_NV_DX_interop2 */ + +/* --------------------------- WGL_NV_copy_image --------------------------- */ + +#ifndef WGL_NV_copy_image +#define WGL_NV_copy_image 1 + +typedef BOOL (WINAPI * PFNWGLCOPYIMAGESUBDATANVPROC) (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); + +#define wglCopyImageSubDataNV WGLEW_GET_FUN(__wglewCopyImageSubDataNV) + +#define WGLEW_NV_copy_image WGLEW_GET_VAR(__WGLEW_NV_copy_image) + +#endif /* WGL_NV_copy_image */ + +/* ------------------------ WGL_NV_delay_before_swap ----------------------- */ + +#ifndef WGL_NV_delay_before_swap +#define WGL_NV_delay_before_swap 1 + +typedef BOOL (WINAPI * PFNWGLDELAYBEFORESWAPNVPROC) (HDC hDC, GLfloat seconds); + +#define wglDelayBeforeSwapNV WGLEW_GET_FUN(__wglewDelayBeforeSwapNV) + +#define WGLEW_NV_delay_before_swap WGLEW_GET_VAR(__WGLEW_NV_delay_before_swap) + +#endif /* WGL_NV_delay_before_swap */ + +/* -------------------------- WGL_NV_float_buffer -------------------------- */ + +#ifndef WGL_NV_float_buffer +#define WGL_NV_float_buffer 1 + +#define WGL_FLOAT_COMPONENTS_NV 0x20B0 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4 +#define WGL_TEXTURE_FLOAT_R_NV 0x20B5 +#define WGL_TEXTURE_FLOAT_RG_NV 0x20B6 +#define WGL_TEXTURE_FLOAT_RGB_NV 0x20B7 +#define WGL_TEXTURE_FLOAT_RGBA_NV 0x20B8 + +#define WGLEW_NV_float_buffer WGLEW_GET_VAR(__WGLEW_NV_float_buffer) + +#endif /* WGL_NV_float_buffer */ + +/* -------------------------- WGL_NV_gpu_affinity -------------------------- */ + +#ifndef WGL_NV_gpu_affinity +#define WGL_NV_gpu_affinity 1 + +#define WGL_ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV 0x20D0 +#define WGL_ERROR_MISSING_AFFINITY_MASK_NV 0x20D1 + +DECLARE_HANDLE(HGPUNV); +typedef struct _GPU_DEVICE { + DWORD cb; + CHAR DeviceName[32]; + CHAR DeviceString[128]; + DWORD Flags; + RECT rcVirtualScreen; +} GPU_DEVICE, *PGPU_DEVICE; + +typedef HDC (WINAPI * PFNWGLCREATEAFFINITYDCNVPROC) (const HGPUNV *phGpuList); +typedef BOOL (WINAPI * PFNWGLDELETEDCNVPROC) (HDC hdc); +typedef BOOL (WINAPI * PFNWGLENUMGPUDEVICESNVPROC) (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice); +typedef BOOL (WINAPI * PFNWGLENUMGPUSFROMAFFINITYDCNVPROC) (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu); +typedef BOOL (WINAPI * PFNWGLENUMGPUSNVPROC) (UINT iGpuIndex, HGPUNV *phGpu); + +#define wglCreateAffinityDCNV WGLEW_GET_FUN(__wglewCreateAffinityDCNV) +#define wglDeleteDCNV WGLEW_GET_FUN(__wglewDeleteDCNV) +#define wglEnumGpuDevicesNV WGLEW_GET_FUN(__wglewEnumGpuDevicesNV) +#define wglEnumGpusFromAffinityDCNV WGLEW_GET_FUN(__wglewEnumGpusFromAffinityDCNV) +#define wglEnumGpusNV WGLEW_GET_FUN(__wglewEnumGpusNV) + +#define WGLEW_NV_gpu_affinity WGLEW_GET_VAR(__WGLEW_NV_gpu_affinity) + +#endif /* WGL_NV_gpu_affinity */ + +/* ---------------------- WGL_NV_multisample_coverage ---------------------- */ + +#ifndef WGL_NV_multisample_coverage +#define WGL_NV_multisample_coverage 1 + +#define WGL_COVERAGE_SAMPLES_NV 0x2042 +#define WGL_COLOR_SAMPLES_NV 0x20B9 + +#define WGLEW_NV_multisample_coverage WGLEW_GET_VAR(__WGLEW_NV_multisample_coverage) + +#endif /* WGL_NV_multisample_coverage */ + +/* -------------------------- WGL_NV_present_video ------------------------- */ + +#ifndef WGL_NV_present_video +#define WGL_NV_present_video 1 + +#define WGL_NUM_VIDEO_SLOTS_NV 0x20F0 + +DECLARE_HANDLE(HVIDEOOUTPUTDEVICENV); + +typedef BOOL (WINAPI * PFNWGLBINDVIDEODEVICENVPROC) (HDC hDc, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int* piAttribList); +typedef int (WINAPI * PFNWGLENUMERATEVIDEODEVICESNVPROC) (HDC hDc, HVIDEOOUTPUTDEVICENV* phDeviceList); +typedef BOOL (WINAPI * PFNWGLQUERYCURRENTCONTEXTNVPROC) (int iAttribute, int* piValue); + +#define wglBindVideoDeviceNV WGLEW_GET_FUN(__wglewBindVideoDeviceNV) +#define wglEnumerateVideoDevicesNV WGLEW_GET_FUN(__wglewEnumerateVideoDevicesNV) +#define wglQueryCurrentContextNV WGLEW_GET_FUN(__wglewQueryCurrentContextNV) + +#define WGLEW_NV_present_video WGLEW_GET_VAR(__WGLEW_NV_present_video) + +#endif /* WGL_NV_present_video */ + +/* ---------------------- WGL_NV_render_depth_texture ---------------------- */ + +#ifndef WGL_NV_render_depth_texture +#define WGL_NV_render_depth_texture 1 + +#define WGL_NO_TEXTURE_ARB 0x2077 +#define WGL_BIND_TO_TEXTURE_DEPTH_NV 0x20A3 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV 0x20A4 +#define WGL_DEPTH_TEXTURE_FORMAT_NV 0x20A5 +#define WGL_TEXTURE_DEPTH_COMPONENT_NV 0x20A6 +#define WGL_DEPTH_COMPONENT_NV 0x20A7 + +#define WGLEW_NV_render_depth_texture WGLEW_GET_VAR(__WGLEW_NV_render_depth_texture) + +#endif /* WGL_NV_render_depth_texture */ + +/* -------------------- WGL_NV_render_texture_rectangle -------------------- */ + +#ifndef WGL_NV_render_texture_rectangle +#define WGL_NV_render_texture_rectangle 1 + +#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1 +#define WGL_TEXTURE_RECTANGLE_NV 0x20A2 + +#define WGLEW_NV_render_texture_rectangle WGLEW_GET_VAR(__WGLEW_NV_render_texture_rectangle) + +#endif /* WGL_NV_render_texture_rectangle */ + +/* --------------------------- WGL_NV_swap_group --------------------------- */ + +#ifndef WGL_NV_swap_group +#define WGL_NV_swap_group 1 + +typedef BOOL (WINAPI * PFNWGLBINDSWAPBARRIERNVPROC) (GLuint group, GLuint barrier); +typedef BOOL (WINAPI * PFNWGLJOINSWAPGROUPNVPROC) (HDC hDC, GLuint group); +typedef BOOL (WINAPI * PFNWGLQUERYFRAMECOUNTNVPROC) (HDC hDC, GLuint* count); +typedef BOOL (WINAPI * PFNWGLQUERYMAXSWAPGROUPSNVPROC) (HDC hDC, GLuint* maxGroups, GLuint *maxBarriers); +typedef BOOL (WINAPI * PFNWGLQUERYSWAPGROUPNVPROC) (HDC hDC, GLuint* group, GLuint *barrier); +typedef BOOL (WINAPI * PFNWGLRESETFRAMECOUNTNVPROC) (HDC hDC); + +#define wglBindSwapBarrierNV WGLEW_GET_FUN(__wglewBindSwapBarrierNV) +#define wglJoinSwapGroupNV WGLEW_GET_FUN(__wglewJoinSwapGroupNV) +#define wglQueryFrameCountNV WGLEW_GET_FUN(__wglewQueryFrameCountNV) +#define wglQueryMaxSwapGroupsNV WGLEW_GET_FUN(__wglewQueryMaxSwapGroupsNV) +#define wglQuerySwapGroupNV WGLEW_GET_FUN(__wglewQuerySwapGroupNV) +#define wglResetFrameCountNV WGLEW_GET_FUN(__wglewResetFrameCountNV) + +#define WGLEW_NV_swap_group WGLEW_GET_VAR(__WGLEW_NV_swap_group) + +#endif /* WGL_NV_swap_group */ + +/* ----------------------- WGL_NV_vertex_array_range ----------------------- */ + +#ifndef WGL_NV_vertex_array_range +#define WGL_NV_vertex_array_range 1 + +typedef void * (WINAPI * PFNWGLALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority); +typedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer); + +#define wglAllocateMemoryNV WGLEW_GET_FUN(__wglewAllocateMemoryNV) +#define wglFreeMemoryNV WGLEW_GET_FUN(__wglewFreeMemoryNV) + +#define WGLEW_NV_vertex_array_range WGLEW_GET_VAR(__WGLEW_NV_vertex_array_range) + +#endif /* WGL_NV_vertex_array_range */ + +/* -------------------------- WGL_NV_video_capture ------------------------- */ + +#ifndef WGL_NV_video_capture +#define WGL_NV_video_capture 1 + +#define WGL_UNIQUE_ID_NV 0x20CE +#define WGL_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF + +DECLARE_HANDLE(HVIDEOINPUTDEVICENV); + +typedef BOOL (WINAPI * PFNWGLBINDVIDEOCAPTUREDEVICENVPROC) (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice); +typedef UINT (WINAPI * PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC) (HDC hDc, HVIDEOINPUTDEVICENV* phDeviceList); +typedef BOOL (WINAPI * PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice); +typedef BOOL (WINAPI * PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int* piValue); +typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice); + +#define wglBindVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewBindVideoCaptureDeviceNV) +#define wglEnumerateVideoCaptureDevicesNV WGLEW_GET_FUN(__wglewEnumerateVideoCaptureDevicesNV) +#define wglLockVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewLockVideoCaptureDeviceNV) +#define wglQueryVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewQueryVideoCaptureDeviceNV) +#define wglReleaseVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewReleaseVideoCaptureDeviceNV) + +#define WGLEW_NV_video_capture WGLEW_GET_VAR(__WGLEW_NV_video_capture) + +#endif /* WGL_NV_video_capture */ + +/* -------------------------- WGL_NV_video_output -------------------------- */ + +#ifndef WGL_NV_video_output +#define WGL_NV_video_output 1 + +#define WGL_BIND_TO_VIDEO_RGB_NV 0x20C0 +#define WGL_BIND_TO_VIDEO_RGBA_NV 0x20C1 +#define WGL_BIND_TO_VIDEO_RGB_AND_DEPTH_NV 0x20C2 +#define WGL_VIDEO_OUT_COLOR_NV 0x20C3 +#define WGL_VIDEO_OUT_ALPHA_NV 0x20C4 +#define WGL_VIDEO_OUT_DEPTH_NV 0x20C5 +#define WGL_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6 +#define WGL_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7 +#define WGL_VIDEO_OUT_FRAME 0x20C8 +#define WGL_VIDEO_OUT_FIELD_1 0x20C9 +#define WGL_VIDEO_OUT_FIELD_2 0x20CA +#define WGL_VIDEO_OUT_STACKED_FIELDS_1_2 0x20CB +#define WGL_VIDEO_OUT_STACKED_FIELDS_2_1 0x20CC + +DECLARE_HANDLE(HPVIDEODEV); + +typedef BOOL (WINAPI * PFNWGLBINDVIDEOIMAGENVPROC) (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer); +typedef BOOL (WINAPI * PFNWGLGETVIDEODEVICENVPROC) (HDC hDC, int numDevices, HPVIDEODEV* hVideoDevice); +typedef BOOL (WINAPI * PFNWGLGETVIDEOINFONVPROC) (HPVIDEODEV hpVideoDevice, unsigned long* pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo); +typedef BOOL (WINAPI * PFNWGLRELEASEVIDEODEVICENVPROC) (HPVIDEODEV hVideoDevice); +typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOIMAGENVPROC) (HPBUFFERARB hPbuffer, int iVideoBuffer); +typedef BOOL (WINAPI * PFNWGLSENDPBUFFERTOVIDEONVPROC) (HPBUFFERARB hPbuffer, int iBufferType, unsigned long* pulCounterPbuffer, BOOL bBlock); + +#define wglBindVideoImageNV WGLEW_GET_FUN(__wglewBindVideoImageNV) +#define wglGetVideoDeviceNV WGLEW_GET_FUN(__wglewGetVideoDeviceNV) +#define wglGetVideoInfoNV WGLEW_GET_FUN(__wglewGetVideoInfoNV) +#define wglReleaseVideoDeviceNV WGLEW_GET_FUN(__wglewReleaseVideoDeviceNV) +#define wglReleaseVideoImageNV WGLEW_GET_FUN(__wglewReleaseVideoImageNV) +#define wglSendPbufferToVideoNV WGLEW_GET_FUN(__wglewSendPbufferToVideoNV) + +#define WGLEW_NV_video_output WGLEW_GET_VAR(__WGLEW_NV_video_output) + +#endif /* WGL_NV_video_output */ + +/* -------------------------- WGL_OML_sync_control ------------------------- */ + +#ifndef WGL_OML_sync_control +#define WGL_OML_sync_control 1 + +typedef BOOL (WINAPI * PFNWGLGETMSCRATEOMLPROC) (HDC hdc, INT32* numerator, INT32 *denominator); +typedef BOOL (WINAPI * PFNWGLGETSYNCVALUESOMLPROC) (HDC hdc, INT64* ust, INT64 *msc, INT64 *sbc); +typedef INT64 (WINAPI * PFNWGLSWAPBUFFERSMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder); +typedef INT64 (WINAPI * PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) (HDC hdc, INT fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder); +typedef BOOL (WINAPI * PFNWGLWAITFORMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64* ust, INT64 *msc, INT64 *sbc); +typedef BOOL (WINAPI * PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT64* ust, INT64 *msc, INT64 *sbc); + +#define wglGetMscRateOML WGLEW_GET_FUN(__wglewGetMscRateOML) +#define wglGetSyncValuesOML WGLEW_GET_FUN(__wglewGetSyncValuesOML) +#define wglSwapBuffersMscOML WGLEW_GET_FUN(__wglewSwapBuffersMscOML) +#define wglSwapLayerBuffersMscOML WGLEW_GET_FUN(__wglewSwapLayerBuffersMscOML) +#define wglWaitForMscOML WGLEW_GET_FUN(__wglewWaitForMscOML) +#define wglWaitForSbcOML WGLEW_GET_FUN(__wglewWaitForSbcOML) + +#define WGLEW_OML_sync_control WGLEW_GET_VAR(__WGLEW_OML_sync_control) + +#endif /* WGL_OML_sync_control */ + +/* ------------------------------------------------------------------------- */ + +#define WGLEW_FUN_EXPORT GLEW_FUN_EXPORT +#define WGLEW_VAR_EXPORT GLEW_VAR_EXPORT + +WGLEW_FUN_EXPORT PFNWGLSETSTEREOEMITTERSTATE3DLPROC __wglewSetStereoEmitterState3DL; + +WGLEW_FUN_EXPORT PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC __wglewBlitContextFramebufferAMD; +WGLEW_FUN_EXPORT PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC __wglewCreateAssociatedContextAMD; +WGLEW_FUN_EXPORT PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC __wglewCreateAssociatedContextAttribsAMD; +WGLEW_FUN_EXPORT PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC __wglewDeleteAssociatedContextAMD; +WGLEW_FUN_EXPORT PFNWGLGETCONTEXTGPUIDAMDPROC __wglewGetContextGPUIDAMD; +WGLEW_FUN_EXPORT PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC __wglewGetCurrentAssociatedContextAMD; +WGLEW_FUN_EXPORT PFNWGLGETGPUIDSAMDPROC __wglewGetGPUIDsAMD; +WGLEW_FUN_EXPORT PFNWGLGETGPUINFOAMDPROC __wglewGetGPUInfoAMD; +WGLEW_FUN_EXPORT PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC __wglewMakeAssociatedContextCurrentAMD; + +WGLEW_FUN_EXPORT PFNWGLCREATEBUFFERREGIONARBPROC __wglewCreateBufferRegionARB; +WGLEW_FUN_EXPORT PFNWGLDELETEBUFFERREGIONARBPROC __wglewDeleteBufferRegionARB; +WGLEW_FUN_EXPORT PFNWGLRESTOREBUFFERREGIONARBPROC __wglewRestoreBufferRegionARB; +WGLEW_FUN_EXPORT PFNWGLSAVEBUFFERREGIONARBPROC __wglewSaveBufferRegionARB; + +WGLEW_FUN_EXPORT PFNWGLCREATECONTEXTATTRIBSARBPROC __wglewCreateContextAttribsARB; + +WGLEW_FUN_EXPORT PFNWGLGETEXTENSIONSSTRINGARBPROC __wglewGetExtensionsStringARB; + +WGLEW_FUN_EXPORT PFNWGLGETCURRENTREADDCARBPROC __wglewGetCurrentReadDCARB; +WGLEW_FUN_EXPORT PFNWGLMAKECONTEXTCURRENTARBPROC __wglewMakeContextCurrentARB; + +WGLEW_FUN_EXPORT PFNWGLCREATEPBUFFERARBPROC __wglewCreatePbufferARB; +WGLEW_FUN_EXPORT PFNWGLDESTROYPBUFFERARBPROC __wglewDestroyPbufferARB; +WGLEW_FUN_EXPORT PFNWGLGETPBUFFERDCARBPROC __wglewGetPbufferDCARB; +WGLEW_FUN_EXPORT PFNWGLQUERYPBUFFERARBPROC __wglewQueryPbufferARB; +WGLEW_FUN_EXPORT PFNWGLRELEASEPBUFFERDCARBPROC __wglewReleasePbufferDCARB; + +WGLEW_FUN_EXPORT PFNWGLCHOOSEPIXELFORMATARBPROC __wglewChoosePixelFormatARB; +WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBFVARBPROC __wglewGetPixelFormatAttribfvARB; +WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBIVARBPROC __wglewGetPixelFormatAttribivARB; + +WGLEW_FUN_EXPORT PFNWGLBINDTEXIMAGEARBPROC __wglewBindTexImageARB; +WGLEW_FUN_EXPORT PFNWGLRELEASETEXIMAGEARBPROC __wglewReleaseTexImageARB; +WGLEW_FUN_EXPORT PFNWGLSETPBUFFERATTRIBARBPROC __wglewSetPbufferAttribARB; + +WGLEW_FUN_EXPORT PFNWGLBINDDISPLAYCOLORTABLEEXTPROC __wglewBindDisplayColorTableEXT; +WGLEW_FUN_EXPORT PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC __wglewCreateDisplayColorTableEXT; +WGLEW_FUN_EXPORT PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC __wglewDestroyDisplayColorTableEXT; +WGLEW_FUN_EXPORT PFNWGLLOADDISPLAYCOLORTABLEEXTPROC __wglewLoadDisplayColorTableEXT; + +WGLEW_FUN_EXPORT PFNWGLGETEXTENSIONSSTRINGEXTPROC __wglewGetExtensionsStringEXT; + +WGLEW_FUN_EXPORT PFNWGLGETCURRENTREADDCEXTPROC __wglewGetCurrentReadDCEXT; +WGLEW_FUN_EXPORT PFNWGLMAKECONTEXTCURRENTEXTPROC __wglewMakeContextCurrentEXT; + +WGLEW_FUN_EXPORT PFNWGLCREATEPBUFFEREXTPROC __wglewCreatePbufferEXT; +WGLEW_FUN_EXPORT PFNWGLDESTROYPBUFFEREXTPROC __wglewDestroyPbufferEXT; +WGLEW_FUN_EXPORT PFNWGLGETPBUFFERDCEXTPROC __wglewGetPbufferDCEXT; +WGLEW_FUN_EXPORT PFNWGLQUERYPBUFFEREXTPROC __wglewQueryPbufferEXT; +WGLEW_FUN_EXPORT PFNWGLRELEASEPBUFFERDCEXTPROC __wglewReleasePbufferDCEXT; + +WGLEW_FUN_EXPORT PFNWGLCHOOSEPIXELFORMATEXTPROC __wglewChoosePixelFormatEXT; +WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBFVEXTPROC __wglewGetPixelFormatAttribfvEXT; +WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBIVEXTPROC __wglewGetPixelFormatAttribivEXT; + +WGLEW_FUN_EXPORT PFNWGLGETSWAPINTERVALEXTPROC __wglewGetSwapIntervalEXT; +WGLEW_FUN_EXPORT PFNWGLSWAPINTERVALEXTPROC __wglewSwapIntervalEXT; + +WGLEW_FUN_EXPORT PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC __wglewGetDigitalVideoParametersI3D; +WGLEW_FUN_EXPORT PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC __wglewSetDigitalVideoParametersI3D; + +WGLEW_FUN_EXPORT PFNWGLGETGAMMATABLEI3DPROC __wglewGetGammaTableI3D; +WGLEW_FUN_EXPORT PFNWGLGETGAMMATABLEPARAMETERSI3DPROC __wglewGetGammaTableParametersI3D; +WGLEW_FUN_EXPORT PFNWGLSETGAMMATABLEI3DPROC __wglewSetGammaTableI3D; +WGLEW_FUN_EXPORT PFNWGLSETGAMMATABLEPARAMETERSI3DPROC __wglewSetGammaTableParametersI3D; + +WGLEW_FUN_EXPORT PFNWGLDISABLEGENLOCKI3DPROC __wglewDisableGenlockI3D; +WGLEW_FUN_EXPORT PFNWGLENABLEGENLOCKI3DPROC __wglewEnableGenlockI3D; +WGLEW_FUN_EXPORT PFNWGLGENLOCKSAMPLERATEI3DPROC __wglewGenlockSampleRateI3D; +WGLEW_FUN_EXPORT PFNWGLGENLOCKSOURCEDELAYI3DPROC __wglewGenlockSourceDelayI3D; +WGLEW_FUN_EXPORT PFNWGLGENLOCKSOURCEEDGEI3DPROC __wglewGenlockSourceEdgeI3D; +WGLEW_FUN_EXPORT PFNWGLGENLOCKSOURCEI3DPROC __wglewGenlockSourceI3D; +WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSAMPLERATEI3DPROC __wglewGetGenlockSampleRateI3D; +WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSOURCEDELAYI3DPROC __wglewGetGenlockSourceDelayI3D; +WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSOURCEEDGEI3DPROC __wglewGetGenlockSourceEdgeI3D; +WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSOURCEI3DPROC __wglewGetGenlockSourceI3D; +WGLEW_FUN_EXPORT PFNWGLISENABLEDGENLOCKI3DPROC __wglewIsEnabledGenlockI3D; +WGLEW_FUN_EXPORT PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC __wglewQueryGenlockMaxSourceDelayI3D; + +WGLEW_FUN_EXPORT PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC __wglewAssociateImageBufferEventsI3D; +WGLEW_FUN_EXPORT PFNWGLCREATEIMAGEBUFFERI3DPROC __wglewCreateImageBufferI3D; +WGLEW_FUN_EXPORT PFNWGLDESTROYIMAGEBUFFERI3DPROC __wglewDestroyImageBufferI3D; +WGLEW_FUN_EXPORT PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC __wglewReleaseImageBufferEventsI3D; + +WGLEW_FUN_EXPORT PFNWGLDISABLEFRAMELOCKI3DPROC __wglewDisableFrameLockI3D; +WGLEW_FUN_EXPORT PFNWGLENABLEFRAMELOCKI3DPROC __wglewEnableFrameLockI3D; +WGLEW_FUN_EXPORT PFNWGLISENABLEDFRAMELOCKI3DPROC __wglewIsEnabledFrameLockI3D; +WGLEW_FUN_EXPORT PFNWGLQUERYFRAMELOCKMASTERI3DPROC __wglewQueryFrameLockMasterI3D; + +WGLEW_FUN_EXPORT PFNWGLBEGINFRAMETRACKINGI3DPROC __wglewBeginFrameTrackingI3D; +WGLEW_FUN_EXPORT PFNWGLENDFRAMETRACKINGI3DPROC __wglewEndFrameTrackingI3D; +WGLEW_FUN_EXPORT PFNWGLGETFRAMEUSAGEI3DPROC __wglewGetFrameUsageI3D; +WGLEW_FUN_EXPORT PFNWGLQUERYFRAMETRACKINGI3DPROC __wglewQueryFrameTrackingI3D; + +WGLEW_FUN_EXPORT PFNWGLDXCLOSEDEVICENVPROC __wglewDXCloseDeviceNV; +WGLEW_FUN_EXPORT PFNWGLDXLOCKOBJECTSNVPROC __wglewDXLockObjectsNV; +WGLEW_FUN_EXPORT PFNWGLDXOBJECTACCESSNVPROC __wglewDXObjectAccessNV; +WGLEW_FUN_EXPORT PFNWGLDXOPENDEVICENVPROC __wglewDXOpenDeviceNV; +WGLEW_FUN_EXPORT PFNWGLDXREGISTEROBJECTNVPROC __wglewDXRegisterObjectNV; +WGLEW_FUN_EXPORT PFNWGLDXSETRESOURCESHAREHANDLENVPROC __wglewDXSetResourceShareHandleNV; +WGLEW_FUN_EXPORT PFNWGLDXUNLOCKOBJECTSNVPROC __wglewDXUnlockObjectsNV; +WGLEW_FUN_EXPORT PFNWGLDXUNREGISTEROBJECTNVPROC __wglewDXUnregisterObjectNV; + +WGLEW_FUN_EXPORT PFNWGLCOPYIMAGESUBDATANVPROC __wglewCopyImageSubDataNV; + +WGLEW_FUN_EXPORT PFNWGLDELAYBEFORESWAPNVPROC __wglewDelayBeforeSwapNV; + +WGLEW_FUN_EXPORT PFNWGLCREATEAFFINITYDCNVPROC __wglewCreateAffinityDCNV; +WGLEW_FUN_EXPORT PFNWGLDELETEDCNVPROC __wglewDeleteDCNV; +WGLEW_FUN_EXPORT PFNWGLENUMGPUDEVICESNVPROC __wglewEnumGpuDevicesNV; +WGLEW_FUN_EXPORT PFNWGLENUMGPUSFROMAFFINITYDCNVPROC __wglewEnumGpusFromAffinityDCNV; +WGLEW_FUN_EXPORT PFNWGLENUMGPUSNVPROC __wglewEnumGpusNV; + +WGLEW_FUN_EXPORT PFNWGLBINDVIDEODEVICENVPROC __wglewBindVideoDeviceNV; +WGLEW_FUN_EXPORT PFNWGLENUMERATEVIDEODEVICESNVPROC __wglewEnumerateVideoDevicesNV; +WGLEW_FUN_EXPORT PFNWGLQUERYCURRENTCONTEXTNVPROC __wglewQueryCurrentContextNV; + +WGLEW_FUN_EXPORT PFNWGLBINDSWAPBARRIERNVPROC __wglewBindSwapBarrierNV; +WGLEW_FUN_EXPORT PFNWGLJOINSWAPGROUPNVPROC __wglewJoinSwapGroupNV; +WGLEW_FUN_EXPORT PFNWGLQUERYFRAMECOUNTNVPROC __wglewQueryFrameCountNV; +WGLEW_FUN_EXPORT PFNWGLQUERYMAXSWAPGROUPSNVPROC __wglewQueryMaxSwapGroupsNV; +WGLEW_FUN_EXPORT PFNWGLQUERYSWAPGROUPNVPROC __wglewQuerySwapGroupNV; +WGLEW_FUN_EXPORT PFNWGLRESETFRAMECOUNTNVPROC __wglewResetFrameCountNV; + +WGLEW_FUN_EXPORT PFNWGLALLOCATEMEMORYNVPROC __wglewAllocateMemoryNV; +WGLEW_FUN_EXPORT PFNWGLFREEMEMORYNVPROC __wglewFreeMemoryNV; + +WGLEW_FUN_EXPORT PFNWGLBINDVIDEOCAPTUREDEVICENVPROC __wglewBindVideoCaptureDeviceNV; +WGLEW_FUN_EXPORT PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC __wglewEnumerateVideoCaptureDevicesNV; +WGLEW_FUN_EXPORT PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC __wglewLockVideoCaptureDeviceNV; +WGLEW_FUN_EXPORT PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC __wglewQueryVideoCaptureDeviceNV; +WGLEW_FUN_EXPORT PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC __wglewReleaseVideoCaptureDeviceNV; + +WGLEW_FUN_EXPORT PFNWGLBINDVIDEOIMAGENVPROC __wglewBindVideoImageNV; +WGLEW_FUN_EXPORT PFNWGLGETVIDEODEVICENVPROC __wglewGetVideoDeviceNV; +WGLEW_FUN_EXPORT PFNWGLGETVIDEOINFONVPROC __wglewGetVideoInfoNV; +WGLEW_FUN_EXPORT PFNWGLRELEASEVIDEODEVICENVPROC __wglewReleaseVideoDeviceNV; +WGLEW_FUN_EXPORT PFNWGLRELEASEVIDEOIMAGENVPROC __wglewReleaseVideoImageNV; +WGLEW_FUN_EXPORT PFNWGLSENDPBUFFERTOVIDEONVPROC __wglewSendPbufferToVideoNV; + +WGLEW_FUN_EXPORT PFNWGLGETMSCRATEOMLPROC __wglewGetMscRateOML; +WGLEW_FUN_EXPORT PFNWGLGETSYNCVALUESOMLPROC __wglewGetSyncValuesOML; +WGLEW_FUN_EXPORT PFNWGLSWAPBUFFERSMSCOMLPROC __wglewSwapBuffersMscOML; +WGLEW_FUN_EXPORT PFNWGLSWAPLAYERBUFFERSMSCOMLPROC __wglewSwapLayerBuffersMscOML; +WGLEW_FUN_EXPORT PFNWGLWAITFORMSCOMLPROC __wglewWaitForMscOML; +WGLEW_FUN_EXPORT PFNWGLWAITFORSBCOMLPROC __wglewWaitForSbcOML; +WGLEW_VAR_EXPORT GLboolean __WGLEW_3DFX_multisample; +WGLEW_VAR_EXPORT GLboolean __WGLEW_3DL_stereo_control; +WGLEW_VAR_EXPORT GLboolean __WGLEW_AMD_gpu_association; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_buffer_region; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_context_flush_control; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context_no_error; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context_profile; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context_robustness; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_extensions_string; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_framebuffer_sRGB; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_make_current_read; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_multisample; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_pbuffer; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_pixel_format; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_pixel_format_float; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_render_texture; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_robustness_application_isolation; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_robustness_share_group_isolation; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ATI_pixel_format_float; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ATI_render_texture_rectangle; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_colorspace; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_create_context_es2_profile; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_create_context_es_profile; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_depth_float; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_display_color_table; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_extensions_string; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_framebuffer_sRGB; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_make_current_read; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_multisample; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_pbuffer; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_pixel_format; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_pixel_format_packed_float; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_swap_control; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_swap_control_tear; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_digital_video_control; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_gamma; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_genlock; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_image_buffer; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_swap_frame_lock; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_swap_frame_usage; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_DX_interop; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_DX_interop2; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_copy_image; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_delay_before_swap; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_float_buffer; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_gpu_affinity; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_multisample_coverage; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_present_video; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_render_depth_texture; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_render_texture_rectangle; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_swap_group; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_vertex_array_range; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_video_capture; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_video_output; +WGLEW_VAR_EXPORT GLboolean __WGLEW_OML_sync_control; +/* ------------------------------------------------------------------------- */ + +GLEWAPI GLenum GLEWAPIENTRY wglewInit (); +GLEWAPI GLboolean GLEWAPIENTRY wglewIsSupported (const char *name); + +#ifndef WGLEW_GET_VAR +#define WGLEW_GET_VAR(x) (*(const GLboolean*)&x) +#endif + +#ifndef WGLEW_GET_FUN +#define WGLEW_GET_FUN(x) x +#endif + +GLEWAPI GLboolean GLEWAPIENTRY wglewGetExtension (const char *name); + +#ifdef __cplusplus +} +#endif + +#undef GLEWAPI + +#endif /* __wglew_h__ */ diff --git a/r5dev/thirdparty/cppnet/cppkore_docs/korefunctionbinary.txt b/r5dev/thirdparty/cppnet/cppkore_docs/korefunctionbinary.txt new file mode 100644 index 00000000..4b95e94c --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore_docs/korefunctionbinary.txt @@ -0,0 +1,16 @@ +#pragma pack(push, 1) + struct KoreFunctionBinary + { + uint32_t Magic; + uint16_t Version; + uint32_t CodeSize; + }; +#pragma pack(pop) + + DWORD Old = 0; + auto Reader = IO::BinaryReader(IO::File::OpenRead("D:\\imakewins.kfn")); + auto Header = Reader.Read(); + + auto CodeBuffer = VirtualAlloc(NULL, Header.CodeSize, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE); + Reader.Read(CodeBuffer, 0, Header.CodeSize); + VirtualProtect(CodeBuffer, Header.CodeSize, PAGE_EXECUTE_READ, &Old); \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore_fonts/Arial.ptrf b/r5dev/thirdparty/cppnet/cppkore_fonts/Arial.ptrf new file mode 100644 index 0000000000000000000000000000000000000000..821bb910fbfe47216b3ad9fe7154bd3cf083f5dc GIT binary patch literal 131350 zcmeHQJC@_PlGV&qW_9JSU)KuWYQ~;3XZD~?Xa`z>Rv=rxe3`W6(Ud2b7SG%O2vC%8 zBdBC5l~olu-6;}*_+5Y?3xUu7{NMln_v}Arv)O;nX8*>I{QuX#-;DI|`1thnub2ON zeEk0W@c8iXl+(k*^Yio5&*zud*O%wF*Ka>wp8kG)dwF|(d3k;Q=lSLN;o;%?6S#jo zJ%R1pw;$i$g!%Eu!_$w~zkdAn`1ttz_Vo7c>HAOQ{`2zq^X>WV?c2BS-yffTKK%Ug z_|My4FAop^>eJ)vk}l3Mfmgm>F>Y)etrq*CzQUtK;gsdYj6k#A-%jj3pX5q z4X^@9eslWq^aCJxas(WKdm_-@Q@N$P)vW{BC^2u3Gx?vSRo%Ajeo3gaS=BZ>5ETi# zrmYyeVH;yR$u}g}{;%5oY>ofRX$|ist;*!tu3c|h08q7SQlb)eCf=}~h&;_UB-sA% z+6}zeoXR}8Za`^g8`?e^G{3gds=sX)3u+`KoS2|r8WQSyhW}`iy6IB6jEL8sut0B7 z{S3faK!`nFnr&r+&T|d_t7?Y-XiCoGw_K)f4=X|n3|;*KU?mBz=7Jilm5SH z=G}YXqTH@M^6vkl^z|82{jb~QO#W9=yF(Q!bX0Mb-UH{ww&29OVcxJez&XRU_tX40 zpMNo@o$(Gln0svJT|aPP{ZTrPLtD`|;04E(88`O7Y3I`at6J8mV<}K7)PjEobo3T> zrOzK&Ts~gH2Mm$9Z|iwG->cP!>W^=^!b{*FUB?2QD0>4Cy`!^BppRyr&Gz_i+taVR zSao~Jp5Z-Ekg~w* z;{f0HY7bgq{5o0M_s`d{@^+T|>HgmiS(oexI0BApU}KCcA1WTZ?5w`8|Cl|Yq`4k>l<>MTc#rzu&uX;*bl=r~ z37#nlaaDy1(pqNUOiOq5Ukg6Lt=bBlEhPH%{?rG6-!Eelr{4TWw9RR?H_`vVKE;2T zeWoSbJG+D?UuY8~O!lA8n~PT4w%H|a=)Wb}q|3YsE#3P07v0kl)I3mW3#0kV{7O~8 z&HMkU;OP9OdsE;4I(Q?fy8X5Qoj*(uQiW8;1EPOEsG>&^7wYHPC=t^NP5b_zrW@Qx z%-y(an)dI%yPEzn$|wH&|6`1BDUN_6;0QPZj({WJ2si?cfFs}tI0BAl?NN;|%kn+OjQkitQ3`BT1u6c*1k7UrZG9#d*fVY{J&XJlK&;M1 zQUTa%^1Jn2+yGfUt0)LmtS@5%Wc?@>s3|c{QNXx`75o)lzK^wED-5Ai^$;u`a`{I1 z7TkxqvVA}lyymOt!{Rb+eRk8VH2Y$FMJoXlRPqt)-?;xws z)vMVT#qs(Vx>|==*r>_J`pLRI^2hUF#jl}XivdR6ngt{L#|r(3L-B9j*2VmgDNRq) zUdIQRPO$+m@KIw}>IA5d@PE;$Q(&s20svO_tNynVpWE^%9u|KJLbU${$Y^04{}1rr za38v{exFz%%Y#+_BOh-eVdsFYvVQ_5cq!dWr(5ly4f~dQ?FR>_{jqi9FTtnF=5(|F zk~f4R{3x@-wEiEwTsw#xrE!BS>-!Z6rvIIPv;(gLa+-ze<{Ri6_wo|g`Y+Z0m5Q$P zy*u^!1vskwV4C7Wc(j!ML1sAdw@3W?KqW{e(WIdpdLO0z%GM0}@_ya_Mc}8^FCWj6 z==%WyR^2)I{+IRhO49rf+VO|7%fAoQ<^8(ca8?fhrzjlp}!qn;&QbDZCC+_3hutHuACYQf}} z5MrkVCK5F4$BR}gXxla%;7aN@OoAfX)|kD3Nn(ULIoqm#fj=a!$*BL0%#fm~d%m>^ zTJrqx{*Ou?OStv(A0qtJ7_)y9&Xv+ZP{~&il>Xn6(zbg4Z*{=6Opa0Jj~p>UWv++N zEfdGk*Y%iEg)-LrzrZrc>gHF{4g!-ik@)+;e81hU>lpaKZwv#LcmdSZeY6dAdac#G zY&tjmgD8goAEbqfx%>KlYT4%y?!LbNbKG<-j({WJ2si?cfFs}tI0BA}JyVug>gf@mu%jEHOupGs=z9`cbcf6F#xdYLS_8;o!^ zih--J#7YDeH~W_v0zAl^^|K;f0G>rqEdES?xBqE{8XLogf5$Z27^)Dyuu6HD zo$fmQI~F1d^9!Uf2{9!5*(%*cPx{V(EqZVIWzC8#nfikIT}zCARhlRu0vLASPtWK6 z+_3K6vM z@4se_7eKwhH$Y(u6oGXYQkj{OiK_{y)+g#>so;C(A!EGyLm@{o@7` zAP>^}#{?kK_<5>GcGb)zBr|x(1+Q>JHji40ts74l(pOPVR)?e2IJ^Mt>F%y#WBkw6-8qF zAG=(Xhc+`?z8ESY*`o^yzv6z6|4?GS!6M@6bc^g6!}xBRC-=gDHI}0Z1NK~ zJ8OXGaC!p{GA?RCW?Y?Jq@Kc3E^vGQCA7w#{!{z1%YzG8y$8FT<6U$>GQ;-ZMe3>i za)F$iF9zz%N{2;Gm7G(+U*Q2@lcQADAPZ*6=@N1bNYTQODTiPbsi*SG1#)h_7`i~R zM;8))Oo5B8E3+25l`mEGT0Q5czEklFG@uUoE2b}kgo zE>a2w61pzd1t_dRhtT1?^y0;$F>_1a4uk%`XhIg6FS2V{|1f8G7pISv->p(I*~hv7 zqBbiL`W7<~5t%C%?K0&fC-V$0^83I13}&``G2kvMJt-3R2iTtE3@gM-+x=|-oxF`Mjyxoh%x?ST8?}J7ClUv${|8w z{;^`>5HG)T1RMcJz!7i+905nb5pViLW0e$cb*e>(o0?a&;TKVxt-1RyS#cP9B28=nS(vVI=%^U~~# zJSd9=fEUmPhmP$Yo-f$&ZzxlCE#i@B`C@?6rdzVZ&iIaW96}t1p9`gu*z`M)j+>MC zd2t9i^W}@7gf1IP%!m1>ccWW}L%!2Hrd!HnTD~~t6#L}CX3f9jN83dF{6ttUBZ{5xS%k7z+h6tEA~K~e&Ui}1 zH3BooY9luCRF)jeXIj1(%2{`_BZ|R26qT*JmvC+$e(NDK?vnL(e6DOj;-@c=ISy#R zB%U%l(VVj6Ga4%t`W@E%XIR=AgXf#@izwn*iuUvMtG(KC2N&q%*+{CE)&4*Oz$nz~ zNF4odrsa#C7Ovv#i25uy-^v2+z74E%e!5^{6FoowWDoqv&tD%&4tae9vSvf3<%=Y- z`;`Y^SDxD>C1mA(*aIW{UcQ8x*rWxgC*bl>;|+Gn3`)n3{bLfx@HZVTuj$cfY1$TV zVySZ*>dkjJ{vf!3Mo_8)O?QwH-v1IrF844UKX%b6uK-8Oz@xA14*(^a4LH0*8ZF&F zXeOJ}u+Cc?knM}4Zgy?4kJoeyyL8|&m3y$nzbkhS@&y_a`Fsp2l8kV3{->M1Nx#p+ z?gau7N%HL%5X5ic3r5u)MdAd2_OLFZcT#us36Ot2=qHHjHpuo}EnU736Y124V7?si zAg^D1fsrN}y)^&M%MIM*^8${5Bj5-)0*-(q;0QPZj({WJ2si?cfFs}tI0BBq{Sd(L zD3l-A2x=sw1lt21qiP|QqrWmfsE+ROz)gh2U`L_l#8Exj7aoJm^QiCQZxhG8H>I(2 zDIA=~9~ojUCBuP2M0y~_U`N@CEUX%cQEsrfZq7F62V2-5c7_t=;qNGT&US}A86Pg2 zz_xwwORLRChIQ+5V5XN~T%ql=v3ubRPXKHEo#;YbJt;NJkFlv#xb$lX*dnxF7}hUI zB6%`Et_^MD0Vzg~dU4$j1bxQIm0^C^fBvNS<)tB@sb|G~K`sT+91__`pdfB1FY&Ow>Lq9n5cDZDlbp3A%jeBQAS zKu{GEuqjWMh%SY<mQViyAfgl>y4elDfas)zzP$GJr7G`5eBG-N z{_Dn17NCp2HFdK2lLg$`LtVb~4tfcdI*}cZZc3_}+Yu)^Fp>TK{@)H+m+S~Q0*-(q z;0QPZj({WJ2si?cfFs}tj7Ol-hyG1LlSVhP^!H1_x;%aSFzX-}RZR%vvfpp{sr>g# z39HjiMSb%1`z=2;^!-xa&v~j}xn9+>e2o@>{=o^d7X=r!#vZmtsI?JxEKLtvC|n2* z8DVsZ!I77I;n|8g+B)<4PdJD{`ak70VE(tToC ze&|2x^B<-+#!VPbyzVb8|HIA{O8?bMDqmIc@uT)x@4vWx0PP;*`$>8Kb?+}aKgaTa z>iZ9KW3Yn**8)o2*2)ZyCBWY+bbKGF-#?3BK)G^|%Ps3z8xIz)} zCw+o}jGrsxUon2c6zVxp+eS(*<BV{Z>0S=dm)y- z{5wj1C{!*PbIY`#&G`PgwCK7VMe}une$CR#%&=e6p)0K>U!_+{`E`r8$3J&w!LM6u zZn-1i2si?cfFs}tI0BA-Y8b`O4IT&i;j*p+S8t zTh$jg{Exe*^AP)98b;XQe_4*fgstB>eldQiEZ~jt_uk&~tESzr&+|_2C;C4-3bg$A z5!qZDC)Z;U;I`QOt>OF9`_}q=%YHdHNIO2p=HICM56I>!vc#7rkQd?b_i`JN_ZQxO zlwD4jmm;hHr$mnU{@XEjw0}i6xB@>;8K45tL(|Dk!W0iTI&5nR0;0QPZj({WJ2si?cfFs}tI0BBqFOL8QFYi2df$>9S@X`tZV0p4K zHfdLns8-e6A|{qN8WmunqYducrrqCv<7{blXczt|L(jJNvF^3{uO&XZWP{`24`b_d zI>a8HFSUmC`nB4>P1jMd>OXjPV6z7#{IG_C4Gl2<>i%Q@>Gg*19?&(7T8%JaeJc$g z+VwZFeN^4-5~-#_vg%)A=RA52f#CtsV>GJ!=GMEG|9ho|2R9GB zyAt~ge42Nmfa-r}_ShYSp=|r#9K#e6>I3434X*&W&s0Z=>gFF(#PVO;JcSya38w$( z|BM6Z@d3jdxaB?~@8J!a4Z66n{11D7TyTxeu>23^>1UMS1RUN$$fGBT+oREhYbu>< zj?z`*V)rh6oRYLDUcq@)#Z><+e#P*QA+4+ytgEr?pGw!Ye*pDRo;WvF^2G0dOz#=1 z=_cjSwt4S2Mx#ux)yi2^{n^wce+aFatRDbqmRMBn>q3+3G)KS@a0DCyN5Bzq1RMcJ zz!7i+905nb5jaI)hZRJt(~OV4#^&V+(cCQQBM8TS!8HGm zVfEK;uIrdYoi>DTs-EP(x;e9{dQ5>3o*Pr}y=652(ek=Pq#L1a!gWoy=$|%(s%T5z zF$^ra%+5hFVpNI&BS>2_20B6rDH6?>zoY=NHJVQ3GOwYqrN`IE(8{X*fl;G>M*W8= z6q*AQX_|i`TBYyxsVx&t3+$@?4^UvqSLy4?@eRv^xjuWwVz=q4e_+??@%>LXXtC8> zC5-5@#ctDe|1AHz?>}2jxrC)$n>;5H!LN&m)YHG`hG_gF-VbxkZ+ZXszotAIy5qb5 zdC9_rlK{z%*XNN0AcBj5-)0*-(q;0QPZj({WJ2si>?3xPwkTIpLr-`3uH z>z4&;`WmR)`hR!*H+JvF;`Q2_%i-g)NS0bL-_}igm@t04#s0us3}VDY^$E{KS#Dx`g?p;MJGG|Bcf8yBeEcUvtrxZh0r3!mDlT8I%S5eW7<< zVd-nz92DEirwW|tiu>=LWDGAm(0=nzW+P)0bNnHXF39ofFs}tI0BA^7cs~CTJ*Wv4gb5SA&r0a^mO&P=1tlO*x|(c}3vdJ+0Y|_Qa0DCyN5Bzq1RMcJz!7i+905nb5pVT1|@^Bbo-ra-%HZ2&(rlc@$lLWiK4Ywxo5=}ga5nTY_}`=f4#+@$+2o1EKQp? z6Slby{x6QRWEu;Aw{kSf z@_;Q=<}(~6Z#|1eJ?aVcu&$nV$V2ph0Y?ikHAv~Bk + +#include +#include +#include + +#if !defined(__d3d11_h__) && !defined(__d3d11_x_h__) && !defined(__d3d12_h__) && !defined(__d3d12_x_h__) +#if defined(_XBOX_ONE) && defined(_TITLE) +#include +#define DCOMMON_H_INCLUDED +#else +#include +#endif +#endif + +#include + +#include + +#define DIRECTX_TEX_VERSION 161 + +struct IWICImagingFactory; +struct IWICMetadataQueryReader; + + +namespace DirectX +{ + + //--------------------------------------------------------------------------------- + // DXGI Format Utilities + bool __cdecl IsValid(_In_ DXGI_FORMAT fmt); + bool __cdecl IsCompressed(_In_ DXGI_FORMAT fmt); + bool __cdecl IsPacked(_In_ DXGI_FORMAT fmt); + bool __cdecl IsVideo(_In_ DXGI_FORMAT fmt); + bool __cdecl IsPlanar(_In_ DXGI_FORMAT fmt); + bool __cdecl IsPalettized(_In_ DXGI_FORMAT fmt); + bool __cdecl IsDepthStencil(_In_ DXGI_FORMAT fmt); + bool __cdecl IsSRGB(_In_ DXGI_FORMAT fmt); + bool __cdecl IsTypeless(_In_ DXGI_FORMAT fmt, _In_ bool partialTypeless = true); + + bool __cdecl HasAlpha(_In_ DXGI_FORMAT fmt); + + size_t __cdecl BitsPerPixel(_In_ DXGI_FORMAT fmt); + + size_t __cdecl BitsPerColor(_In_ DXGI_FORMAT fmt); + + enum CP_FLAGS + { + CP_FLAGS_NONE = 0x0, // Normal operation + CP_FLAGS_LEGACY_DWORD = 0x1, // Assume pitch is DWORD aligned instead of BYTE aligned + CP_FLAGS_PARAGRAPH = 0x2, // Assume pitch is 16-byte aligned instead of BYTE aligned + CP_FLAGS_YMM = 0x4, // Assume pitch is 32-byte aligned instead of BYTE aligned + CP_FLAGS_ZMM = 0x8, // Assume pitch is 64-byte aligned instead of BYTE aligned + CP_FLAGS_PAGE4K = 0x200, // Assume pitch is 4096-byte aligned instead of BYTE aligned + CP_FLAGS_BAD_DXTN_TAILS = 0x1000, // BC formats with malformed mipchain blocks smaller than 4x4 + CP_FLAGS_24BPP = 0x10000, // Override with a legacy 24 bits-per-pixel format size + CP_FLAGS_16BPP = 0x20000, // Override with a legacy 16 bits-per-pixel format size + CP_FLAGS_8BPP = 0x40000, // Override with a legacy 8 bits-per-pixel format size + }; + + HRESULT __cdecl ComputePitch( + _In_ DXGI_FORMAT fmt, _In_ size_t width, _In_ size_t height, + _Out_ size_t& rowPitch, _Out_ size_t& slicePitch, _In_ DWORD flags = CP_FLAGS_NONE); + + size_t __cdecl ComputeScanlines(_In_ DXGI_FORMAT fmt, _In_ size_t height); + + DXGI_FORMAT __cdecl MakeSRGB(_In_ DXGI_FORMAT fmt); + DXGI_FORMAT __cdecl MakeTypeless(_In_ DXGI_FORMAT fmt); + DXGI_FORMAT __cdecl MakeTypelessUNORM(_In_ DXGI_FORMAT fmt); + DXGI_FORMAT __cdecl MakeTypelessFLOAT(_In_ DXGI_FORMAT fmt); + + //--------------------------------------------------------------------------------- + // Texture metadata + enum TEX_DIMENSION + // Subset here matches D3D10_RESOURCE_DIMENSION and D3D11_RESOURCE_DIMENSION + { + TEX_DIMENSION_TEXTURE1D = 2, + TEX_DIMENSION_TEXTURE2D = 3, + TEX_DIMENSION_TEXTURE3D = 4, + }; + + enum TEX_MISC_FLAG + // Subset here matches D3D10_RESOURCE_MISC_FLAG and D3D11_RESOURCE_MISC_FLAG + { + TEX_MISC_TEXTURECUBE = 0x4L, + }; + + enum TEX_MISC_FLAG2 + { + TEX_MISC2_ALPHA_MODE_MASK = 0x7L, + }; + + enum TEX_ALPHA_MODE + // Matches DDS_ALPHA_MODE, encoded in MISC_FLAGS2 + { + TEX_ALPHA_MODE_UNKNOWN = 0, + TEX_ALPHA_MODE_STRAIGHT = 1, + TEX_ALPHA_MODE_PREMULTIPLIED = 2, + TEX_ALPHA_MODE_OPAQUE = 3, + TEX_ALPHA_MODE_CUSTOM = 4, + }; + + struct TexMetadata + { + size_t width; + size_t height; // Should be 1 for 1D textures + size_t depth; // Should be 1 for 1D or 2D textures + size_t arraySize; // For cubemap, this is a multiple of 6 + size_t mipLevels; + uint32_t miscFlags; + uint32_t miscFlags2; + DXGI_FORMAT format; + TEX_DIMENSION dimension; + + size_t __cdecl ComputeIndex(_In_ size_t mip, _In_ size_t item, _In_ size_t slice) const; + // Returns size_t(-1) to indicate an out-of-range error + + bool __cdecl IsCubemap() const { return (miscFlags & TEX_MISC_TEXTURECUBE) != 0; } + // Helper for miscFlags + + bool __cdecl IsPMAlpha() const { return ((miscFlags2 & TEX_MISC2_ALPHA_MODE_MASK) == TEX_ALPHA_MODE_PREMULTIPLIED) != 0; } + void __cdecl SetAlphaMode(TEX_ALPHA_MODE mode) { miscFlags2 = (miscFlags2 & ~TEX_MISC2_ALPHA_MODE_MASK) | static_cast(mode); } + TEX_ALPHA_MODE __cdecl GetAlphaMode() const { return static_cast(miscFlags2 & TEX_MISC2_ALPHA_MODE_MASK); } + // Helpers for miscFlags2 + + bool __cdecl IsVolumemap() const { return (dimension == TEX_DIMENSION_TEXTURE3D); } + // Helper for dimension + }; + + enum DDS_FLAGS + { + DDS_FLAGS_NONE = 0x0, + + DDS_FLAGS_LEGACY_DWORD = 0x1, + // Assume pitch is DWORD aligned instead of BYTE aligned (used by some legacy DDS files) + + DDS_FLAGS_NO_LEGACY_EXPANSION = 0x2, + // Do not implicitly convert legacy formats that result in larger pixel sizes (24 bpp, 3:3:2, A8L8, A4L4, P8, A8P8) + + DDS_FLAGS_NO_R10B10G10A2_FIXUP = 0x4, + // Do not use work-around for long-standing D3DX DDS file format issue which reversed the 10:10:10:2 color order masks + + DDS_FLAGS_FORCE_RGB = 0x8, + // Convert DXGI 1.1 BGR formats to DXGI_FORMAT_R8G8B8A8_UNORM to avoid use of optional WDDM 1.1 formats + + DDS_FLAGS_NO_16BPP = 0x10, + // Conversions avoid use of 565, 5551, and 4444 formats and instead expand to 8888 to avoid use of optional WDDM 1.2 formats + + DDS_FLAGS_EXPAND_LUMINANCE = 0x20, + // When loading legacy luminance formats expand replicating the color channels rather than leaving them packed (L8, L16, A8L8) + + DDS_FLAGS_BAD_DXTN_TAILS = 0x40, + // Some older DXTn DDS files incorrectly handle mipchain tails for blocks smaller than 4x4 + + DDS_FLAGS_FORCE_DX10_EXT = 0x10000, + // Always use the 'DX10' header extension for DDS writer (i.e. don't try to write DX9 compatible DDS files) + + DDS_FLAGS_FORCE_DX10_EXT_MISC2 = 0x20000, + // DDS_FLAGS_FORCE_DX10_EXT including miscFlags2 information (result may not be compatible with D3DX10 or D3DX11) + }; + + enum WIC_FLAGS + { + WIC_FLAGS_NONE = 0x0, + + WIC_FLAGS_FORCE_RGB = 0x1, + // Loads DXGI 1.1 BGR formats as DXGI_FORMAT_R8G8B8A8_UNORM to avoid use of optional WDDM 1.1 formats + + WIC_FLAGS_NO_X2_BIAS = 0x2, + // Loads DXGI 1.1 X2 10:10:10:2 format as DXGI_FORMAT_R10G10B10A2_UNORM + + WIC_FLAGS_NO_16BPP = 0x4, + // Loads 565, 5551, and 4444 formats as 8888 to avoid use of optional WDDM 1.2 formats + + WIC_FLAGS_ALLOW_MONO = 0x8, + // Loads 1-bit monochrome (black & white) as R1_UNORM rather than 8-bit grayscale + + WIC_FLAGS_ALL_FRAMES = 0x10, + // Loads all images in a multi-frame file, converting/resizing to match the first frame as needed, defaults to 0th frame otherwise + + WIC_FLAGS_IGNORE_SRGB = 0x20, + // Ignores sRGB metadata if present in the file + + WIC_FLAGS_FORCE_SRGB = 0x40, + // Writes sRGB metadata into the file reguardless of format + + WIC_FLAGS_FORCE_LINEAR = 0x80, + // Writes linear gamma metadata into the file reguardless of format + + WIC_FLAGS_DITHER = 0x10000, + // Use ordered 4x4 dithering for any required conversions + + WIC_FLAGS_DITHER_DIFFUSION = 0x20000, + // Use error-diffusion dithering for any required conversions + + WIC_FLAGS_FILTER_POINT = 0x100000, + WIC_FLAGS_FILTER_LINEAR = 0x200000, + WIC_FLAGS_FILTER_CUBIC = 0x300000, + WIC_FLAGS_FILTER_FANT = 0x400000, // Combination of Linear and Box filter + // Filtering mode to use for any required image resizing (only needed when loading arrays of differently sized images; defaults to Fant) + }; + + HRESULT __cdecl GetMetadataFromDDSMemory( + _In_reads_bytes_(size) const void* pSource, _In_ size_t size, + _In_ DWORD flags, + _Out_ TexMetadata& metadata); + HRESULT __cdecl GetMetadataFromDDSFile( + _In_z_ const wchar_t* szFile, + _In_ DWORD flags, + _Out_ TexMetadata& metadata); + + HRESULT __cdecl GetMetadataFromHDRMemory( + _In_reads_bytes_(size) const void* pSource, _In_ size_t size, + _Out_ TexMetadata& metadata); + HRESULT __cdecl GetMetadataFromHDRFile( + _In_z_ const wchar_t* szFile, + _Out_ TexMetadata& metadata); + + HRESULT __cdecl GetMetadataFromTGAMemory( + _In_reads_bytes_(size) const void* pSource, _In_ size_t size, + _Out_ TexMetadata& metadata); + HRESULT __cdecl GetMetadataFromTGAFile( + _In_z_ const wchar_t* szFile, + _Out_ TexMetadata& metadata); + + HRESULT __cdecl GetMetadataFromWICMemory( + _In_reads_bytes_(size) const void* pSource, _In_ size_t size, + _In_ DWORD flags, + _Out_ TexMetadata& metadata, + _In_opt_ std::function getMQR = nullptr); + + HRESULT __cdecl GetMetadataFromWICFile( + _In_z_ const wchar_t* szFile, + _In_ DWORD flags, + _Out_ TexMetadata& metadata, + _In_opt_ std::function getMQR = nullptr); + + //--------------------------------------------------------------------------------- + // Bitmap image container + struct Image + { + size_t width; + size_t height; + DXGI_FORMAT format; + size_t rowPitch; + size_t slicePitch; + uint8_t* pixels; + }; + + class ScratchImage + { + public: + ScratchImage() noexcept + : m_nimages(0), m_size(0), m_metadata{}, m_image(nullptr), m_memory(nullptr) {} + ScratchImage(ScratchImage&& moveFrom) noexcept + : m_nimages(0), m_size(0), m_metadata{}, m_image(nullptr), m_memory(nullptr) { *this = std::move(moveFrom); } + ~ScratchImage() { Release(); } + + ScratchImage& __cdecl operator= (ScratchImage&& moveFrom) noexcept; + + ScratchImage(const ScratchImage&) = delete; + ScratchImage& operator=(const ScratchImage&) = delete; + + HRESULT __cdecl Initialize(_In_ const TexMetadata& mdata, _In_ DWORD flags = CP_FLAGS_NONE); + + HRESULT __cdecl Initialize1D(_In_ DXGI_FORMAT fmt, _In_ size_t length, _In_ size_t arraySize, _In_ size_t mipLevels, _In_ DWORD flags = CP_FLAGS_NONE); + HRESULT __cdecl Initialize2D(_In_ DXGI_FORMAT fmt, _In_ size_t width, _In_ size_t height, _In_ size_t arraySize, _In_ size_t mipLevels, _In_ DWORD flags = CP_FLAGS_NONE); + HRESULT __cdecl Initialize3D(_In_ DXGI_FORMAT fmt, _In_ size_t width, _In_ size_t height, _In_ size_t depth, _In_ size_t mipLevels, _In_ DWORD flags = CP_FLAGS_NONE); + HRESULT __cdecl InitializeCube(_In_ DXGI_FORMAT fmt, _In_ size_t width, _In_ size_t height, _In_ size_t nCubes, _In_ size_t mipLevels, _In_ DWORD flags = CP_FLAGS_NONE); + + HRESULT __cdecl InitializeFromImage(_In_ const Image& srcImage, _In_ bool allow1D = false, _In_ DWORD flags = CP_FLAGS_NONE); + HRESULT __cdecl InitializeArrayFromImages(_In_reads_(nImages) const Image* images, _In_ size_t nImages, _In_ bool allow1D = false, _In_ DWORD flags = CP_FLAGS_NONE); + HRESULT __cdecl InitializeCubeFromImages(_In_reads_(nImages) const Image* images, _In_ size_t nImages, _In_ DWORD flags = CP_FLAGS_NONE); + HRESULT __cdecl Initialize3DFromImages(_In_reads_(depth) const Image* images, _In_ size_t depth, _In_ DWORD flags = CP_FLAGS_NONE); + + void __cdecl Release(); + + bool __cdecl OverrideFormat(_In_ DXGI_FORMAT f); + + const TexMetadata& __cdecl GetMetadata() const { return m_metadata; } + const Image* __cdecl GetImage(_In_ size_t mip, _In_ size_t item, _In_ size_t slice) const; + + const Image* __cdecl GetImages() const { return m_image; } + size_t __cdecl GetImageCount() const { return m_nimages; } + + uint8_t* __cdecl GetPixels() const { return m_memory; } + size_t __cdecl GetPixelsSize() const { return m_size; } + + bool __cdecl IsAlphaAllOpaque() const; + + private: + size_t m_nimages; + size_t m_size; + TexMetadata m_metadata; + Image* m_image; + uint8_t* m_memory; + }; + + //--------------------------------------------------------------------------------- + // Memory blob (allocated buffer pointer is always 16-byte aligned) + class Blob + { + public: + Blob() noexcept : m_buffer(nullptr), m_size(0) {} + Blob(Blob&& moveFrom) noexcept : m_buffer(nullptr), m_size(0) { *this = std::move(moveFrom); } + ~Blob() { Release(); } + + Blob& __cdecl operator= (Blob&& moveFrom) noexcept; + + Blob(const Blob&) = delete; + Blob& operator=(const Blob&) = delete; + + HRESULT __cdecl Initialize(_In_ size_t size); + + void __cdecl Release(); + + void *__cdecl GetBufferPointer() const { return m_buffer; } + size_t __cdecl GetBufferSize() const { return m_size; } + + HRESULT __cdecl Trim(size_t size); + + private: + void* m_buffer; + size_t m_size; + }; + + //--------------------------------------------------------------------------------- + // DDS I/O + HRESULT __cdecl EncodeDDSHeader( + _In_ const TexMetadata& metadata, DWORD flags, + _Out_writes_bytes_to_opt_(maxsize, required) void* pDestination, _In_ size_t maxsize, _Out_ size_t& required); + + constexpr const size_t MaximumDDSHeaderSize(); + + //--------------------------------------------------------------------------------- + // Image I/O + + // DDS operations + HRESULT __cdecl LoadFromDDSMemory( + _In_reads_bytes_(size) const void* pSource, _In_ size_t size, + _In_ DWORD flags, + _Out_opt_ TexMetadata* metadata, _Out_ ScratchImage& image); + HRESULT __cdecl LoadFromDDSFile( + _In_z_ const wchar_t* szFile, + _In_ DWORD flags, + _Out_opt_ TexMetadata* metadata, _Out_ ScratchImage& image); + + HRESULT __cdecl SaveToDDSMemory( + _In_ const Image& image, + _In_ DWORD flags, + _Out_ Blob& blob); + HRESULT __cdecl SaveToDDSMemory( + _In_reads_(nimages) const Image* images, _In_ size_t nimages, _In_ const TexMetadata& metadata, + _In_ DWORD flags, + _Out_ Blob& blob); + + HRESULT __cdecl SaveToDDSFile(_In_ const Image& image, _In_ DWORD flags, _In_z_ const wchar_t* szFile); + HRESULT __cdecl SaveToDDSFile( + _In_reads_(nimages) const Image* images, _In_ size_t nimages, _In_ const TexMetadata& metadata, + _In_ DWORD flags, _In_z_ const wchar_t* szFile); + + // HDR operations + HRESULT __cdecl LoadFromHDRMemory( + _In_reads_bytes_(size) const void* pSource, _In_ size_t size, + _Out_opt_ TexMetadata* metadata, _Out_ ScratchImage& image); + HRESULT __cdecl LoadFromHDRFile( + _In_z_ const wchar_t* szFile, + _Out_opt_ TexMetadata* metadata, _Out_ ScratchImage& image); + + HRESULT __cdecl SaveToHDRMemory(_In_ const Image& image, _Out_ Blob& blob); + HRESULT __cdecl SaveToHDRFile(_In_ const Image& image, _In_z_ const wchar_t* szFile); + + // TGA operations + HRESULT __cdecl LoadFromTGAMemory( + _In_reads_bytes_(size) const void* pSource, _In_ size_t size, + _Out_opt_ TexMetadata* metadata, _Out_ ScratchImage& image); + HRESULT __cdecl LoadFromTGAFile( + _In_z_ const wchar_t* szFile, + _Out_opt_ TexMetadata* metadata, _Out_ ScratchImage& image); + + HRESULT __cdecl SaveToTGAMemory(_In_ const Image& image, _Out_ Blob& blob); + HRESULT __cdecl SaveToTGAFile(_In_ const Image& image, _In_z_ const wchar_t* szFile); + + // WIC operations + HRESULT __cdecl LoadFromWICMemory( + _In_reads_bytes_(size) const void* pSource, _In_ size_t size, + _In_ DWORD flags, + _Out_opt_ TexMetadata* metadata, _Out_ ScratchImage& image, + _In_opt_ std::function getMQR = nullptr); + HRESULT __cdecl LoadFromWICFile( + _In_z_ const wchar_t* szFile, _In_ DWORD flags, + _Out_opt_ TexMetadata* metadata, _Out_ ScratchImage& image, + _In_opt_ std::function getMQR = nullptr); + + HRESULT __cdecl SaveToWICMemory( + _In_ const Image& image, _In_ DWORD flags, _In_ REFGUID guidContainerFormat, + _Out_ Blob& blob, _In_opt_ const GUID* targetFormat = nullptr, + _In_opt_ std::function setCustomProps = nullptr); + HRESULT __cdecl SaveToWICMemory( + _In_count_(nimages) const Image* images, _In_ size_t nimages, + _In_ DWORD flags, _In_ REFGUID guidContainerFormat, + _Out_ Blob& blob, _In_opt_ const GUID* targetFormat = nullptr, + _In_opt_ std::function setCustomProps = nullptr); + + HRESULT __cdecl SaveToWICFile( + _In_ const Image& image, _In_ DWORD flags, _In_ REFGUID guidContainerFormat, + _In_z_ const wchar_t* szFile, _In_opt_ const GUID* targetFormat = nullptr, + _In_opt_ std::function setCustomProps = nullptr); + HRESULT __cdecl SaveToWICFile( + _In_count_(nimages) const Image* images, _In_ size_t nimages, + _In_ DWORD flags, _In_ REFGUID guidContainerFormat, + _In_z_ const wchar_t* szFile, _In_opt_ const GUID* targetFormat = nullptr, + _In_opt_ std::function setCustomProps = nullptr); + + //--------------------------------------------------------------------------------- + // Texture conversion, resizing, mipmap generation, and block compression + + enum TEX_FR_FLAGS + { + TEX_FR_ROTATE0 = 0x0, + TEX_FR_ROTATE90 = 0x1, + TEX_FR_ROTATE180 = 0x2, + TEX_FR_ROTATE270 = 0x3, + TEX_FR_FLIP_HORIZONTAL = 0x08, + TEX_FR_FLIP_VERTICAL = 0x10, + }; + + HRESULT __cdecl FlipRotate(_In_ const Image& srcImage, _In_ DWORD flags, _Out_ ScratchImage& image); + HRESULT __cdecl FlipRotate( + _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata, + _In_ DWORD flags, _Out_ ScratchImage& result); + // Flip and/or rotate image + + enum TEX_FILTER_FLAGS + { + TEX_FILTER_DEFAULT = 0, + + TEX_FILTER_WRAP_U = 0x1, + TEX_FILTER_WRAP_V = 0x2, + TEX_FILTER_WRAP_W = 0x4, + TEX_FILTER_WRAP = (TEX_FILTER_WRAP_U | TEX_FILTER_WRAP_V | TEX_FILTER_WRAP_W), + TEX_FILTER_MIRROR_U = 0x10, + TEX_FILTER_MIRROR_V = 0x20, + TEX_FILTER_MIRROR_W = 0x40, + TEX_FILTER_MIRROR = (TEX_FILTER_MIRROR_U | TEX_FILTER_MIRROR_V | TEX_FILTER_MIRROR_W), + // Wrap vs. Mirror vs. Clamp filtering options + + TEX_FILTER_SEPARATE_ALPHA = 0x100, + // Resize color and alpha channel independently + + TEX_FILTER_FLOAT_X2BIAS = 0x200, + // Enable *2 - 1 conversion cases for unorm<->float and positive-only float formats + + TEX_FILTER_RGB_COPY_RED = 0x1000, + TEX_FILTER_RGB_COPY_GREEN = 0x2000, + TEX_FILTER_RGB_COPY_BLUE = 0x4000, + // When converting RGB to R, defaults to using grayscale. These flags indicate copying a specific channel instead + // When converting RGB to RG, defaults to copying RED | GREEN. These flags control which channels are selected instead. + + TEX_FILTER_DITHER = 0x10000, + // Use ordered 4x4 dithering for any required conversions + TEX_FILTER_DITHER_DIFFUSION = 0x20000, + // Use error-diffusion dithering for any required conversions + + TEX_FILTER_POINT = 0x100000, + TEX_FILTER_LINEAR = 0x200000, + TEX_FILTER_CUBIC = 0x300000, + TEX_FILTER_BOX = 0x400000, + TEX_FILTER_FANT = 0x400000, // Equiv to Box filtering for mipmap generation + TEX_FILTER_TRIANGLE = 0x500000, + // Filtering mode to use for any required image resizing + + TEX_FILTER_SRGB_IN = 0x1000000, + TEX_FILTER_SRGB_OUT = 0x2000000, + TEX_FILTER_SRGB = (TEX_FILTER_SRGB_IN | TEX_FILTER_SRGB_OUT), + // sRGB <-> RGB for use in conversion operations + // if the input format type is IsSRGB(), then SRGB_IN is on by default + // if the output format type is IsSRGB(), then SRGB_OUT is on by default + + TEX_FILTER_FORCE_NON_WIC = 0x10000000, + // Forces use of the non-WIC path when both are an option + + TEX_FILTER_FORCE_WIC = 0x20000000, + // Forces use of the WIC path even when logic would have picked a non-WIC path when both are an option + }; + + HRESULT __cdecl Resize( + _In_ const Image& srcImage, _In_ size_t width, _In_ size_t height, + _In_ DWORD filter, + _Out_ ScratchImage& image); + HRESULT __cdecl Resize( + _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata, + _In_ size_t width, _In_ size_t height, _In_ DWORD filter, _Out_ ScratchImage& result); + // Resize the image to width x height. Defaults to Fant filtering. + // Note for a complex resize, the result will always have mipLevels == 1 + + const float TEX_THRESHOLD_DEFAULT = 0.5f; + // Default value for alpha threshold used when converting to 1-bit alpha + + HRESULT __cdecl Convert( + _In_ const Image& srcImage, _In_ DXGI_FORMAT format, _In_ DWORD filter, _In_ float threshold, + _Out_ ScratchImage& image); + HRESULT __cdecl Convert( + _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata, + _In_ DXGI_FORMAT format, _In_ DWORD filter, _In_ float threshold, _Out_ ScratchImage& result); + // Convert the image to a new format + + HRESULT __cdecl ConvertToSinglePlane(_In_ const Image& srcImage, _Out_ ScratchImage& image); + HRESULT __cdecl ConvertToSinglePlane( + _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata, + _Out_ ScratchImage& image); + // Converts the image from a planar format to an equivalent non-planar format + + HRESULT __cdecl GenerateMipMaps( + _In_ const Image& baseImage, _In_ DWORD filter, _In_ size_t levels, + _Inout_ ScratchImage& mipChain, _In_ bool allow1D = false); + HRESULT __cdecl GenerateMipMaps( + _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata, + _In_ DWORD filter, _In_ size_t levels, _Inout_ ScratchImage& mipChain); + // levels of '0' indicates a full mipchain, otherwise is generates that number of total levels (including the source base image) + // Defaults to Fant filtering which is equivalent to a box filter + + HRESULT __cdecl GenerateMipMaps3D( + _In_reads_(depth) const Image* baseImages, _In_ size_t depth, _In_ DWORD filter, _In_ size_t levels, + _Out_ ScratchImage& mipChain); + HRESULT __cdecl GenerateMipMaps3D( + _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata, + _In_ DWORD filter, _In_ size_t levels, _Out_ ScratchImage& mipChain); + // levels of '0' indicates a full mipchain, otherwise is generates that number of total levels (including the source base image) + // Defaults to Fant filtering which is equivalent to a box filter + + HRESULT __cdecl ScaleMipMapsAlphaForCoverage( + _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata, _In_ size_t item, + _In_ float alphaReference, _Inout_ ScratchImage& mipChain); + + + enum TEX_PMALPHA_FLAGS + { + TEX_PMALPHA_DEFAULT = 0, + + TEX_PMALPHA_IGNORE_SRGB = 0x1, + // ignores sRGB colorspace conversions + + TEX_PMALPHA_REVERSE = 0x2, + // converts from premultiplied alpha back to straight alpha + + TEX_PMALPHA_SRGB_IN = 0x1000000, + TEX_PMALPHA_SRGB_OUT = 0x2000000, + TEX_PMALPHA_SRGB = (TEX_PMALPHA_SRGB_IN | TEX_PMALPHA_SRGB_OUT), + // if the input format type is IsSRGB(), then SRGB_IN is on by default + // if the output format type is IsSRGB(), then SRGB_OUT is on by default + }; + + HRESULT __cdecl PremultiplyAlpha(_In_ const Image& srcImage, _In_ DWORD flags, _Out_ ScratchImage& image); + HRESULT __cdecl PremultiplyAlpha( + _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata, + _In_ DWORD flags, _Out_ ScratchImage& result); + // Converts to/from a premultiplied alpha version of the texture + + enum TEX_COMPRESS_FLAGS + { + TEX_COMPRESS_DEFAULT = 0, + + TEX_COMPRESS_RGB_DITHER = 0x10000, + // Enables dithering RGB colors for BC1-3 compression + + TEX_COMPRESS_A_DITHER = 0x20000, + // Enables dithering alpha for BC1-3 compression + + TEX_COMPRESS_DITHER = 0x30000, + // Enables both RGB and alpha dithering for BC1-3 compression + + TEX_COMPRESS_UNIFORM = 0x40000, + // Uniform color weighting for BC1-3 compression; by default uses perceptual weighting + + TEX_COMPRESS_BC7_USE_3SUBSETS = 0x80000, + // Enables exhaustive search for BC7 compress for mode 0 and 2; by default skips trying these modes + + TEX_COMPRESS_BC7_QUICK = 0x100000, + // Minimal modes (usually mode 6) for BC7 compression + + TEX_COMPRESS_SRGB_IN = 0x1000000, + TEX_COMPRESS_SRGB_OUT = 0x2000000, + TEX_COMPRESS_SRGB = (TEX_COMPRESS_SRGB_IN | TEX_COMPRESS_SRGB_OUT), + // if the input format type is IsSRGB(), then SRGB_IN is on by default + // if the output format type is IsSRGB(), then SRGB_OUT is on by default + + TEX_COMPRESS_PARALLEL = 0x10000000, + // Compress is free to use multithreading to improve performance (by default it does not use multithreading) + }; + + HRESULT __cdecl Compress( + _In_ const Image& srcImage, _In_ DXGI_FORMAT format, _In_ DWORD compress, _In_ float threshold, + _Out_ ScratchImage& cImage); + HRESULT __cdecl Compress( + _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata, + _In_ DXGI_FORMAT format, _In_ DWORD compress, _In_ float threshold, _Out_ ScratchImage& cImages); + // Note that threshold is only used by BC1. TEX_THRESHOLD_DEFAULT is a typical value to use + +#if defined(__d3d11_h__) || defined(__d3d11_x_h__) + HRESULT __cdecl Compress( + _In_ ID3D11Device* pDevice, _In_ const Image& srcImage, _In_ DXGI_FORMAT format, _In_ DWORD compress, + _In_ float alphaWeight, _Out_ ScratchImage& image); + HRESULT __cdecl Compress( + _In_ ID3D11Device* pDevice, _In_ const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata, + _In_ DXGI_FORMAT format, _In_ DWORD compress, _In_ float alphaWeight, _Out_ ScratchImage& cImages); + // DirectCompute-based compression (alphaWeight is only used by BC7. 1.0 is the typical value to use) +#endif + + HRESULT __cdecl Decompress(_In_ const Image& cImage, _In_ DXGI_FORMAT format, _Out_ ScratchImage& image); + HRESULT __cdecl Decompress( + _In_reads_(nimages) const Image* cImages, _In_ size_t nimages, _In_ const TexMetadata& metadata, + _In_ DXGI_FORMAT format, _Out_ ScratchImage& images); + + //--------------------------------------------------------------------------------- + // Normal map operations + + enum CNMAP_FLAGS + { + CNMAP_DEFAULT = 0, + + CNMAP_CHANNEL_RED = 0x1, + CNMAP_CHANNEL_GREEN = 0x2, + CNMAP_CHANNEL_BLUE = 0x3, + CNMAP_CHANNEL_ALPHA = 0x4, + CNMAP_CHANNEL_LUMINANCE = 0x5, + // Channel selection when evaluting color value for height + // Luminance is a combination of red, green, and blue + + CNMAP_MIRROR_U = 0x1000, + CNMAP_MIRROR_V = 0x2000, + CNMAP_MIRROR = 0x3000, + // Use mirror semantics for scanline references (defaults to wrap) + + CNMAP_INVERT_SIGN = 0x4000, + // Inverts normal sign + + CNMAP_COMPUTE_OCCLUSION = 0x8000, + // Computes a crude occlusion term stored in the alpha channel + }; + + HRESULT __cdecl ComputeNormalMap( + _In_ const Image& srcImage, _In_ DWORD flags, _In_ float amplitude, + _In_ DXGI_FORMAT format, _Out_ ScratchImage& normalMap); + HRESULT __cdecl ComputeNormalMap( + _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata, + _In_ DWORD flags, _In_ float amplitude, _In_ DXGI_FORMAT format, _Out_ ScratchImage& normalMaps); + + //--------------------------------------------------------------------------------- + // Misc image operations + + struct Rect + { + size_t x; + size_t y; + size_t w; + size_t h; + + Rect() = default; + Rect(size_t _x, size_t _y, size_t _w, size_t _h) : x(_x), y(_y), w(_w), h(_h) {} + }; + + HRESULT __cdecl CopyRectangle( + _In_ const Image& srcImage, _In_ const Rect& srcRect, _In_ const Image& dstImage, + _In_ DWORD filter, _In_ size_t xOffset, _In_ size_t yOffset); + + enum CMSE_FLAGS + { + CMSE_DEFAULT = 0, + + CMSE_IMAGE1_SRGB = 0x1, + CMSE_IMAGE2_SRGB = 0x2, + // Indicates that image needs gamma correction before comparision + + CMSE_IGNORE_RED = 0x10, + CMSE_IGNORE_GREEN = 0x20, + CMSE_IGNORE_BLUE = 0x40, + CMSE_IGNORE_ALPHA = 0x80, + // Ignore the channel when computing MSE + + CMSE_IMAGE1_X2_BIAS = 0x100, + CMSE_IMAGE2_X2_BIAS = 0x200, + // Indicates that image should be scaled and biased before comparison (i.e. UNORM -> SNORM) + }; + + HRESULT __cdecl ComputeMSE(_In_ const Image& image1, _In_ const Image& image2, _Out_ float& mse, _Out_writes_opt_(4) float* mseV, _In_ DWORD flags = 0); + + HRESULT __cdecl EvaluateImage( + _In_ const Image& image, + _In_ std::function pixelFunc); + HRESULT __cdecl EvaluateImage( + _In_reads_(nimages) const Image* images, _In_ size_t nimages, _In_ const TexMetadata& metadata, + _In_ std::function pixelFunc); + + HRESULT __cdecl TransformImage( + _In_ const Image& image, + _In_ std::function pixelFunc, + ScratchImage& result); + HRESULT __cdecl TransformImage( + _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata, + _In_ std::function pixelFunc, + ScratchImage& result); + + //--------------------------------------------------------------------------------- + // WIC utility code + + enum WICCodecs + { + WIC_CODEC_BMP = 1, // Windows Bitmap (.bmp) + WIC_CODEC_JPEG, // Joint Photographic Experts Group (.jpg, .jpeg) + WIC_CODEC_PNG, // Portable Network Graphics (.png) + WIC_CODEC_TIFF, // Tagged Image File Format (.tif, .tiff) + WIC_CODEC_GIF, // Graphics Interchange Format (.gif) + WIC_CODEC_WMP, // Windows Media Photo / HD Photo / JPEG XR (.hdp, .jxr, .wdp) + WIC_CODEC_ICO, // Windows Icon (.ico) + }; + + REFGUID __cdecl GetWICCodec(_In_ WICCodecs codec); + + IWICImagingFactory* __cdecl GetWICFactory(bool& iswic2); + void __cdecl SetWICFactory(_In_opt_ IWICImagingFactory* pWIC); + + //--------------------------------------------------------------------------------- + // Direct3D 11 functions +#if defined(__d3d11_h__) || defined(__d3d11_x_h__) + bool __cdecl IsSupportedTexture(_In_ ID3D11Device* pDevice, _In_ const TexMetadata& metadata); + + HRESULT __cdecl CreateTexture( + _In_ ID3D11Device* pDevice, _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata, + _Outptr_ ID3D11Resource** ppResource); + + HRESULT __cdecl CreateShaderResourceView( + _In_ ID3D11Device* pDevice, _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata, + _Outptr_ ID3D11ShaderResourceView** ppSRV); + + HRESULT __cdecl CreateTextureEx( + _In_ ID3D11Device* pDevice, _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata, + _In_ D3D11_USAGE usage, _In_ unsigned int bindFlags, _In_ unsigned int cpuAccessFlags, _In_ unsigned int miscFlags, _In_ bool forceSRGB, + _Outptr_ ID3D11Resource** ppResource); + + HRESULT __cdecl CreateShaderResourceViewEx( + _In_ ID3D11Device* pDevice, _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata, + _In_ D3D11_USAGE usage, _In_ unsigned int bindFlags, _In_ unsigned int cpuAccessFlags, _In_ unsigned int miscFlags, _In_ bool forceSRGB, + _Outptr_ ID3D11ShaderResourceView** ppSRV); + + HRESULT __cdecl CaptureTexture(_In_ ID3D11Device* pDevice, _In_ ID3D11DeviceContext* pContext, _In_ ID3D11Resource* pSource, _Out_ ScratchImage& result); +#endif + + //--------------------------------------------------------------------------------- + // Direct3D 12 functions +#if defined(__d3d12_h__) || defined(__d3d12_x_h__) + bool __cdecl IsSupportedTexture(_In_ ID3D12Device* pDevice, _In_ const TexMetadata& metadata); + + HRESULT __cdecl CreateTexture( + _In_ ID3D12Device* pDevice, _In_ const TexMetadata& metadata, + _Outptr_ ID3D12Resource** ppResource); + + HRESULT __cdecl CreateTextureEx( + _In_ ID3D12Device* pDevice, _In_ const TexMetadata& metadata, + _In_ D3D12_RESOURCE_FLAGS resFlags, _In_ bool forceSRGB, + _Outptr_ ID3D12Resource** ppResource); + + HRESULT __cdecl PrepareUpload( + _In_ ID3D12Device* pDevice, + _In_reads_(nimages) const Image* srcImages, _In_ size_t nimages, _In_ const TexMetadata& metadata, + std::vector& subresources); + + HRESULT __cdecl CaptureTexture( + _In_ ID3D12CommandQueue* pCommandQueue, _In_ ID3D12Resource* pSource, _In_ bool isCubeMap, + _Out_ ScratchImage& result, + _In_ D3D12_RESOURCE_STATES beforeState = D3D12_RESOURCE_STATE_RENDER_TARGET, + _In_ D3D12_RESOURCE_STATES afterState = D3D12_RESOURCE_STATE_RENDER_TARGET); +#endif + +#include "DirectXTex.inl" + +} // namespace diff --git a/r5dev/thirdparty/cppnet/cppkore_incl/DirectXTex/DirectXTex.inl b/r5dev/thirdparty/cppnet/cppkore_incl/DirectXTex/DirectXTex.inl new file mode 100644 index 00000000..a45abcd9 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore_incl/DirectXTex/DirectXTex.inl @@ -0,0 +1,124 @@ +//------------------------------------------------------------------------------------- +// DirectXTex.inl +// +// DirectX Texture Library +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// http://go.microsoft.com/fwlink/?LinkId=248926 +//------------------------------------------------------------------------------------- + +#pragma once + +//===================================================================================== +// DXGI Format Utilities +//===================================================================================== + +_Use_decl_annotations_ +inline bool __cdecl IsValid(DXGI_FORMAT fmt) +{ + return (static_cast(fmt) >= 1 && static_cast(fmt) <= 190); +} + +_Use_decl_annotations_ +inline bool __cdecl IsCompressed(DXGI_FORMAT fmt) +{ + switch (fmt) + { + case DXGI_FORMAT_BC1_TYPELESS: + case DXGI_FORMAT_BC1_UNORM: + case DXGI_FORMAT_BC1_UNORM_SRGB: + case DXGI_FORMAT_BC2_TYPELESS: + case DXGI_FORMAT_BC2_UNORM: + case DXGI_FORMAT_BC2_UNORM_SRGB: + case DXGI_FORMAT_BC3_TYPELESS: + case DXGI_FORMAT_BC3_UNORM: + case DXGI_FORMAT_BC3_UNORM_SRGB: + case DXGI_FORMAT_BC4_TYPELESS: + case DXGI_FORMAT_BC4_UNORM: + case DXGI_FORMAT_BC4_SNORM: + case DXGI_FORMAT_BC5_TYPELESS: + case DXGI_FORMAT_BC5_UNORM: + case DXGI_FORMAT_BC5_SNORM: + case DXGI_FORMAT_BC6H_TYPELESS: + case DXGI_FORMAT_BC6H_UF16: + case DXGI_FORMAT_BC6H_SF16: + case DXGI_FORMAT_BC7_TYPELESS: + case DXGI_FORMAT_BC7_UNORM: + case DXGI_FORMAT_BC7_UNORM_SRGB: + return true; + + default: + return false; + } +} + +_Use_decl_annotations_ +inline bool __cdecl IsPalettized(DXGI_FORMAT fmt) +{ + switch (fmt) + { + case DXGI_FORMAT_AI44: + case DXGI_FORMAT_IA44: + case DXGI_FORMAT_P8: + case DXGI_FORMAT_A8P8: + return true; + + default: + return false; + } +} + +_Use_decl_annotations_ +inline bool __cdecl IsSRGB(DXGI_FORMAT fmt) +{ + switch (fmt) + { + case DXGI_FORMAT_R8G8B8A8_UNORM_SRGB: + case DXGI_FORMAT_BC1_UNORM_SRGB: + case DXGI_FORMAT_BC2_UNORM_SRGB: + case DXGI_FORMAT_BC3_UNORM_SRGB: + case DXGI_FORMAT_B8G8R8A8_UNORM_SRGB: + case DXGI_FORMAT_B8G8R8X8_UNORM_SRGB: + case DXGI_FORMAT_BC7_UNORM_SRGB: + return true; + + default: + return false; + } +} + + +//===================================================================================== +// Image I/O +//===================================================================================== +_Use_decl_annotations_ +inline HRESULT __cdecl SaveToDDSMemory(const Image& image, DWORD flags, Blob& blob) +{ + TexMetadata mdata = {}; + mdata.width = image.width; + mdata.height = image.height; + mdata.depth = 1; + mdata.arraySize = 1; + mdata.mipLevels = 1; + mdata.format = image.format; + mdata.dimension = TEX_DIMENSION_TEXTURE2D; + + return SaveToDDSMemory(&image, 1, mdata, flags, blob); +} + +_Use_decl_annotations_ +inline HRESULT __cdecl SaveToDDSFile(const Image& image, DWORD flags, const wchar_t* szFile) +{ + TexMetadata mdata = {}; + mdata.width = image.width; + mdata.height = image.height; + mdata.depth = 1; + mdata.arraySize = 1; + mdata.mipLevels = 1; + mdata.format = image.format; + mdata.dimension = TEX_DIMENSION_TEXTURE2D; + + return SaveToDDSFile(&image, 1, mdata, flags, szFile); +} diff --git a/r5dev/thirdparty/cppnet/cppkore_incl/LZ4_XXHash/lz4.h b/r5dev/thirdparty/cppnet/cppkore_incl/LZ4_XXHash/lz4.h new file mode 100644 index 00000000..059ef7c1 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore_incl/LZ4_XXHash/lz4.h @@ -0,0 +1,631 @@ +/* + * LZ4 - Fast LZ compression algorithm + * Header File + * Copyright (C) 2011-present, Yann Collet. + + BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + You can contact the author at : + - LZ4 homepage : http://www.lz4.org + - LZ4 source repository : https://github.com/lz4/lz4 +*/ +#if defined (__cplusplus) +extern "C" { +#endif + +#ifndef LZ4_H_2983827168210 +#define LZ4_H_2983827168210 + +/* --- Dependency --- */ +#include /* size_t */ + + +/** + Introduction + + LZ4 is lossless compression algorithm, providing compression speed at 500 MB/s per core, + scalable with multi-cores CPU. It features an extremely fast decoder, with speed in + multiple GB/s per core, typically reaching RAM speed limits on multi-core systems. + + The LZ4 compression library provides in-memory compression and decompression functions. + Compression can be done in: + - a single step (described as Simple Functions) + - a single step, reusing a context (described in Advanced Functions) + - unbounded multiple steps (described as Streaming compression) + + lz4.h provides block compression functions. It gives full buffer control to user. + Decompressing an lz4-compressed block also requires metadata (such as compressed size). + Each application is free to encode such metadata in whichever way it wants. + + An additional format, called LZ4 frame specification (doc/lz4_Frame_format.md), + take care of encoding standard metadata alongside LZ4-compressed blocks. + Frame format is required for interoperability. + It is delivered through a companion API, declared in lz4frame.h. +*/ + +/*^*************************************************************** +* Export parameters +*****************************************************************/ +/* +* LZ4_DLL_EXPORT : +* Enable exporting of functions when building a Windows DLL +* LZ4LIB_VISIBILITY : +* Control library symbols visibility. +*/ +#ifndef LZ4LIB_VISIBILITY +# if defined(__GNUC__) && (__GNUC__ >= 4) +# define LZ4LIB_VISIBILITY __attribute__ ((visibility ("default"))) +# else +# define LZ4LIB_VISIBILITY +# endif +#endif +#if defined(LZ4_DLL_EXPORT) && (LZ4_DLL_EXPORT==1) +# define LZ4LIB_API __declspec(dllexport) LZ4LIB_VISIBILITY +#elif defined(LZ4_DLL_IMPORT) && (LZ4_DLL_IMPORT==1) +# define LZ4LIB_API __declspec(dllimport) LZ4LIB_VISIBILITY /* It isn't required but allows to generate better code, saving a function pointer load from the IAT and an indirect jump.*/ +#else +# define LZ4LIB_API LZ4LIB_VISIBILITY +#endif + +/*------ Version ------*/ +#define LZ4_VERSION_MAJOR 1 /* for breaking interface changes */ +#define LZ4_VERSION_MINOR 8 /* for new (non-breaking) interface capabilities */ +#define LZ4_VERSION_RELEASE 3 /* for tweaks, bug-fixes, or development */ + +#define LZ4_VERSION_NUMBER (LZ4_VERSION_MAJOR *100*100 + LZ4_VERSION_MINOR *100 + LZ4_VERSION_RELEASE) + +#define LZ4_LIB_VERSION LZ4_VERSION_MAJOR.LZ4_VERSION_MINOR.LZ4_VERSION_RELEASE +#define LZ4_QUOTE(str) #str +#define LZ4_EXPAND_AND_QUOTE(str) LZ4_QUOTE(str) +#define LZ4_VERSION_STRING LZ4_EXPAND_AND_QUOTE(LZ4_LIB_VERSION) + +LZ4LIB_API int LZ4_versionNumber (void); /**< library version number; useful to check dll version */ +LZ4LIB_API const char* LZ4_versionString (void); /**< library version string; unseful to check dll version */ + + +/*-************************************ +* Tuning parameter +**************************************/ +/*! + * LZ4_MEMORY_USAGE : + * Memory usage formula : N->2^N Bytes (examples : 10 -> 1KB; 12 -> 4KB ; 16 -> 64KB; 20 -> 1MB; etc.) + * Increasing memory usage improves compression ratio + * Reduced memory usage may improve speed, thanks to cache effect + * Default value is 14, for 16KB, which nicely fits into Intel x86 L1 cache + */ +#ifndef LZ4_MEMORY_USAGE +# define LZ4_MEMORY_USAGE 14 +#endif + +/*-************************************ +* Simple Functions +**************************************/ +/*! LZ4_compress_default() : + Compresses 'srcSize' bytes from buffer 'src' + into already allocated 'dst' buffer of size 'dstCapacity'. + Compression is guaranteed to succeed if 'dstCapacity' >= LZ4_compressBound(srcSize). + It also runs faster, so it's a recommended setting. + If the function cannot compress 'src' into a more limited 'dst' budget, + compression stops *immediately*, and the function result is zero. + Note : as a consequence, 'dst' content is not valid. + Note 2 : This function is protected against buffer overflow scenarios (never writes outside 'dst' buffer, nor read outside 'source' buffer). + srcSize : max supported value is LZ4_MAX_INPUT_SIZE. + dstCapacity : size of buffer 'dst' (which must be already allocated) + return : the number of bytes written into buffer 'dst' (necessarily <= dstCapacity) + or 0 if compression fails */ +LZ4LIB_API int LZ4_compress_default(const char* src, char* dst, int srcSize, int dstCapacity); + +/*! LZ4_decompress_safe() : + compressedSize : is the exact complete size of the compressed block. + dstCapacity : is the size of destination buffer, which must be already allocated. + return : the number of bytes decompressed into destination buffer (necessarily <= dstCapacity) + If destination buffer is not large enough, decoding will stop and output an error code (negative value). + If the source stream is detected malformed, the function will stop decoding and return a negative result. + This function is protected against malicious data packets. +*/ +LZ4LIB_API int LZ4_decompress_safe (const char* src, char* dst, int compressedSize, int dstCapacity); + + +/*-************************************ +* Advanced Functions +**************************************/ +#define LZ4_MAX_INPUT_SIZE 0x7E000000 /* 2 113 929 216 bytes */ +#define LZ4_COMPRESSBOUND(isize) ((unsigned)(isize) > (unsigned)LZ4_MAX_INPUT_SIZE ? 0 : (isize) + ((isize)/255) + 16) + +/*! +LZ4_compressBound() : + Provides the maximum size that LZ4 compression may output in a "worst case" scenario (input data not compressible) + This function is primarily useful for memory allocation purposes (destination buffer size). + Macro LZ4_COMPRESSBOUND() is also provided for compilation-time evaluation (stack memory allocation for example). + Note that LZ4_compress_default() compresses faster when dstCapacity is >= LZ4_compressBound(srcSize) + inputSize : max supported value is LZ4_MAX_INPUT_SIZE + return : maximum output size in a "worst case" scenario + or 0, if input size is incorrect (too large or negative) +*/ +LZ4LIB_API int LZ4_compressBound(int inputSize); + +/*! +LZ4_compress_fast() : + Same as LZ4_compress_default(), but allows selection of "acceleration" factor. + The larger the acceleration value, the faster the algorithm, but also the lesser the compression. + It's a trade-off. It can be fine tuned, with each successive value providing roughly +~3% to speed. + An acceleration value of "1" is the same as regular LZ4_compress_default() + Values <= 0 will be replaced by ACCELERATION_DEFAULT (currently == 1, see lz4.c). +*/ +LZ4LIB_API int LZ4_compress_fast (const char* src, char* dst, int srcSize, int dstCapacity, int acceleration); + + +/*! +LZ4_compress_fast_extState() : + Same compression function, just using an externally allocated memory space to store compression state. + Use LZ4_sizeofState() to know how much memory must be allocated, + and allocate it on 8-bytes boundaries (using malloc() typically). + Then, provide this buffer as 'void* state' to compression function. +*/ +LZ4LIB_API int LZ4_sizeofState(void); +LZ4LIB_API int LZ4_compress_fast_extState (void* state, const char* src, char* dst, int srcSize, int dstCapacity, int acceleration); + + +/*! LZ4_compress_destSize() : + * Reverse the logic : compresses as much data as possible from 'src' buffer + * into already allocated buffer 'dst', of size >= 'targetDestSize'. + * This function either compresses the entire 'src' content into 'dst' if it's large enough, + * or fill 'dst' buffer completely with as much data as possible from 'src'. + * note: acceleration parameter is fixed to "default". + * + * *srcSizePtr : will be modified to indicate how many bytes where read from 'src' to fill 'dst'. + * New value is necessarily <= input value. + * @return : Nb bytes written into 'dst' (necessarily <= targetDestSize) + * or 0 if compression fails. +*/ +LZ4LIB_API int LZ4_compress_destSize (const char* src, char* dst, int* srcSizePtr, int targetDstSize); + + +/*! LZ4_decompress_fast() : **unsafe!** + * This function used to be a bit faster than LZ4_decompress_safe(), + * though situation has changed in recent versions, + * and now `LZ4_decompress_safe()` can be as fast and sometimes faster than `LZ4_decompress_fast()`. + * Moreover, LZ4_decompress_fast() is not protected vs malformed input, as it doesn't perform full validation of compressed data. + * As a consequence, this function is no longer recommended, and may be deprecated in future versions. + * It's only remaining specificity is that it can decompress data without knowing its compressed size. + * + * originalSize : is the uncompressed size to regenerate. + * `dst` must be already allocated, its size must be >= 'originalSize' bytes. + * @return : number of bytes read from source buffer (== compressed size). + * If the source stream is detected malformed, the function stops decoding and returns a negative result. + * note : This function requires uncompressed originalSize to be known in advance. + * The function never writes past the output buffer. + * However, since it doesn't know its 'src' size, it may read past the intended input. + * Also, because match offsets are not validated during decoding, + * reads from 'src' may underflow. + * Use this function in trusted environment **only**. + */ +LZ4LIB_API int LZ4_decompress_fast (const char* src, char* dst, int originalSize); + +/*! LZ4_decompress_safe_partial() : + * Decompress an LZ4 compressed block, of size 'srcSize' at position 'src', + * into destination buffer 'dst' of size 'dstCapacity'. + * Up to 'targetOutputSize' bytes will be decoded. + * The function stops decoding on reaching this objective, + * which can boost performance when only the beginning of a block is required. + * + * @return : the number of bytes decoded in `dst` (necessarily <= dstCapacity) + * If source stream is detected malformed, function returns a negative result. + * + * Note : @return can be < targetOutputSize, if compressed block contains less data. + * + * Note 2 : this function features 2 parameters, targetOutputSize and dstCapacity, + * and expects targetOutputSize <= dstCapacity. + * It effectively stops decoding on reaching targetOutputSize, + * so dstCapacity is kind of redundant. + * This is because in a previous version of this function, + * decoding operation would not "break" a sequence in the middle. + * As a consequence, there was no guarantee that decoding would stop at exactly targetOutputSize, + * it could write more bytes, though only up to dstCapacity. + * Some "margin" used to be required for this operation to work properly. + * This is no longer necessary. + * The function nonetheless keeps its signature, in an effort to not break API. + */ +LZ4LIB_API int LZ4_decompress_safe_partial (const char* src, char* dst, int srcSize, int targetOutputSize, int dstCapacity); + + +/*-********************************************* +* Streaming Compression Functions +***********************************************/ +typedef union LZ4_stream_u LZ4_stream_t; /* incomplete type (defined later) */ + +/*! LZ4_createStream() and LZ4_freeStream() : + * LZ4_createStream() will allocate and initialize an `LZ4_stream_t` structure. + * LZ4_freeStream() releases its memory. + */ +LZ4LIB_API LZ4_stream_t* LZ4_createStream(void); +LZ4LIB_API int LZ4_freeStream (LZ4_stream_t* streamPtr); + +/*! LZ4_resetStream() : + * An LZ4_stream_t structure can be allocated once and re-used multiple times. + * Use this function to start compressing a new stream. + */ +LZ4LIB_API void LZ4_resetStream (LZ4_stream_t* streamPtr); + +/*! LZ4_loadDict() : + * Use this function to load a static dictionary into LZ4_stream_t. + * Any previous data will be forgotten, only 'dictionary' will remain in memory. + * Loading a size of 0 is allowed, and is the same as reset. + * @return : dictionary size, in bytes (necessarily <= 64 KB) + */ +LZ4LIB_API int LZ4_loadDict (LZ4_stream_t* streamPtr, const char* dictionary, int dictSize); + +/*! LZ4_compress_fast_continue() : + * Compress 'src' content using data from previously compressed blocks, for better compression ratio. + * 'dst' buffer must be already allocated. + * If dstCapacity >= LZ4_compressBound(srcSize), compression is guaranteed to succeed, and runs faster. + * + * @return : size of compressed block + * or 0 if there is an error (typically, cannot fit into 'dst'). + * + * Note 1 : Each invocation to LZ4_compress_fast_continue() generates a new block. + * Each block has precise boundaries. + * It's not possible to append blocks together and expect a single invocation of LZ4_decompress_*() to decompress them together. + * Each block must be decompressed separately, calling LZ4_decompress_*() with associated metadata. + * + * Note 2 : The previous 64KB of source data is __assumed__ to remain present, unmodified, at same address in memory! + * + * Note 3 : When input is structured as a double-buffer, each buffer can have any size, including < 64 KB. + * Make sure that buffers are separated, by at least one byte. + * This construction ensures that each block only depends on previous block. + * + * Note 4 : If input buffer is a ring-buffer, it can have any size, including < 64 KB. + * + * Note 5 : After an error, the stream status is invalid, it can only be reset or freed. + */ +LZ4LIB_API int LZ4_compress_fast_continue (LZ4_stream_t* streamPtr, const char* src, char* dst, int srcSize, int dstCapacity, int acceleration); + +/*! LZ4_saveDict() : + * If last 64KB data cannot be guaranteed to remain available at its current memory location, + * save it into a safer place (char* safeBuffer). + * This is schematically equivalent to a memcpy() followed by LZ4_loadDict(), + * but is much faster, because LZ4_saveDict() doesn't need to rebuild tables. + * @return : saved dictionary size in bytes (necessarily <= maxDictSize), or 0 if error. + */ +LZ4LIB_API int LZ4_saveDict (LZ4_stream_t* streamPtr, char* safeBuffer, int maxDictSize); + + +/*-********************************************** +* Streaming Decompression Functions +* Bufferless synchronous API +************************************************/ +typedef union LZ4_streamDecode_u LZ4_streamDecode_t; /* tracking context */ + +/*! LZ4_createStreamDecode() and LZ4_freeStreamDecode() : + * creation / destruction of streaming decompression tracking context. + * A tracking context can be re-used multiple times. + */ +LZ4LIB_API LZ4_streamDecode_t* LZ4_createStreamDecode(void); +LZ4LIB_API int LZ4_freeStreamDecode (LZ4_streamDecode_t* LZ4_stream); + +/*! LZ4_setStreamDecode() : + * An LZ4_streamDecode_t context can be allocated once and re-used multiple times. + * Use this function to start decompression of a new stream of blocks. + * A dictionary can optionally be set. Use NULL or size 0 for a reset order. + * Dictionary is presumed stable : it must remain accessible and unmodified during next decompression. + * @return : 1 if OK, 0 if error + */ +LZ4LIB_API int LZ4_setStreamDecode (LZ4_streamDecode_t* LZ4_streamDecode, const char* dictionary, int dictSize); + +/*! LZ4_decoderRingBufferSize() : v1.8.2 + * Note : in a ring buffer scenario (optional), + * blocks are presumed decompressed next to each other + * up to the moment there is not enough remaining space for next block (remainingSize < maxBlockSize), + * at which stage it resumes from beginning of ring buffer. + * When setting such a ring buffer for streaming decompression, + * provides the minimum size of this ring buffer + * to be compatible with any source respecting maxBlockSize condition. + * @return : minimum ring buffer size, + * or 0 if there is an error (invalid maxBlockSize). + */ +LZ4LIB_API int LZ4_decoderRingBufferSize(int maxBlockSize); +#define LZ4_DECODER_RING_BUFFER_SIZE(mbs) (65536 + 14 + (mbs)) /* for static allocation; mbs presumed valid */ + +/*! LZ4_decompress_*_continue() : + * These decoding functions allow decompression of consecutive blocks in "streaming" mode. + * A block is an unsplittable entity, it must be presented entirely to a decompression function. + * Decompression functions only accepts one block at a time. + * The last 64KB of previously decoded data *must* remain available and unmodified at the memory position where they were decoded. + * If less than 64KB of data has been decoded, all the data must be present. + * + * Special : if decompression side sets a ring buffer, it must respect one of the following conditions : + * - Decompression buffer size is _at least_ LZ4_decoderRingBufferSize(maxBlockSize). + * maxBlockSize is the maximum size of any single block. It can have any value > 16 bytes. + * In which case, encoding and decoding buffers do not need to be synchronized. + * Actually, data can be produced by any source compliant with LZ4 format specification, and respecting maxBlockSize. + * - Synchronized mode : + * Decompression buffer size is _exactly_ the same as compression buffer size, + * and follows exactly same update rule (block boundaries at same positions), + * and decoding function is provided with exact decompressed size of each block (exception for last block of the stream), + * _then_ decoding & encoding ring buffer can have any size, including small ones ( < 64 KB). + * - Decompression buffer is larger than encoding buffer, by a minimum of maxBlockSize more bytes. + * In which case, encoding and decoding buffers do not need to be synchronized, + * and encoding ring buffer can have any size, including small ones ( < 64 KB). + * + * Whenever these conditions are not possible, + * save the last 64KB of decoded data into a safe buffer where it can't be modified during decompression, + * then indicate where this data is saved using LZ4_setStreamDecode(), before decompressing next block. +*/ +LZ4LIB_API int LZ4_decompress_safe_continue (LZ4_streamDecode_t* LZ4_streamDecode, const char* src, char* dst, int srcSize, int dstCapacity); +LZ4LIB_API int LZ4_decompress_fast_continue (LZ4_streamDecode_t* LZ4_streamDecode, const char* src, char* dst, int originalSize); + + +/*! LZ4_decompress_*_usingDict() : + * These decoding functions work the same as + * a combination of LZ4_setStreamDecode() followed by LZ4_decompress_*_continue() + * They are stand-alone, and don't need an LZ4_streamDecode_t structure. + * Dictionary is presumed stable : it must remain accessible and unmodified during next decompression. + */ +LZ4LIB_API int LZ4_decompress_safe_usingDict (const char* src, char* dst, int srcSize, int dstCapcity, const char* dictStart, int dictSize); +LZ4LIB_API int LZ4_decompress_fast_usingDict (const char* src, char* dst, int originalSize, const char* dictStart, int dictSize); + + +/*^********************************************** + * !!!!!! STATIC LINKING ONLY !!!!!! + ***********************************************/ + +/*-************************************ + * Unstable declarations + ************************************** + * Declarations in this section should be considered unstable. + * Use at your own peril, etc., etc. + * They may be removed in the future. + * Their signatures may change. + **************************************/ + +#ifdef LZ4_STATIC_LINKING_ONLY + +/*! LZ4_resetStream_fast() : + * Use this, like LZ4_resetStream(), to prepare a context for a new chain of + * calls to a streaming API (e.g., LZ4_compress_fast_continue()). + * + * Note: + * Using this in advance of a non- streaming-compression function is redundant, + * and potentially bad for performance, since they all perform their own custom + * reset internally. + * + * Differences from LZ4_resetStream(): + * When an LZ4_stream_t is known to be in a internally coherent state, + * it can often be prepared for a new compression with almost no work, only + * sometimes falling back to the full, expensive reset that is always required + * when the stream is in an indeterminate state (i.e., the reset performed by + * LZ4_resetStream()). + * + * LZ4_streams are guaranteed to be in a valid state when: + * - returned from LZ4_createStream() + * - reset by LZ4_resetStream() + * - memset(stream, 0, sizeof(LZ4_stream_t)), though this is discouraged + * - the stream was in a valid state and was reset by LZ4_resetStream_fast() + * - the stream was in a valid state and was then used in any compression call + * that returned success + * - the stream was in an indeterminate state and was used in a compression + * call that fully reset the state (e.g., LZ4_compress_fast_extState()) and + * that returned success + * + * When a stream isn't known to be in a valid state, it is not safe to pass to + * any fastReset or streaming function. It must first be cleansed by the full + * LZ4_resetStream(). + */ +LZ4LIB_API void LZ4_resetStream_fast (LZ4_stream_t* streamPtr); + +/*! LZ4_compress_fast_extState_fastReset() : + * A variant of LZ4_compress_fast_extState(). + * + * Using this variant avoids an expensive initialization step. It is only safe + * to call if the state buffer is known to be correctly initialized already + * (see above comment on LZ4_resetStream_fast() for a definition of "correctly + * initialized"). From a high level, the difference is that this function + * initializes the provided state with a call to something like + * LZ4_resetStream_fast() while LZ4_compress_fast_extState() starts with a + * call to LZ4_resetStream(). + */ +LZ4LIB_API int LZ4_compress_fast_extState_fastReset (void* state, const char* src, char* dst, int srcSize, int dstCapacity, int acceleration); + +/*! LZ4_attach_dictionary() : + * This is an experimental API that allows for the efficient use of a + * static dictionary many times. + * + * Rather than re-loading the dictionary buffer into a working context before + * each compression, or copying a pre-loaded dictionary's LZ4_stream_t into a + * working LZ4_stream_t, this function introduces a no-copy setup mechanism, + * in which the working stream references the dictionary stream in-place. + * + * Several assumptions are made about the state of the dictionary stream. + * Currently, only streams which have been prepared by LZ4_loadDict() should + * be expected to work. + * + * Alternatively, the provided dictionary stream pointer may be NULL, in which + * case any existing dictionary stream is unset. + * + * If a dictionary is provided, it replaces any pre-existing stream history. + * The dictionary contents are the only history that can be referenced and + * logically immediately precede the data compressed in the first subsequent + * compression call. + * + * The dictionary will only remain attached to the working stream through the + * first compression call, at the end of which it is cleared. The dictionary + * stream (and source buffer) must remain in-place / accessible / unchanged + * through the completion of the first compression call on the stream. + */ +LZ4LIB_API void LZ4_attach_dictionary(LZ4_stream_t *working_stream, const LZ4_stream_t *dictionary_stream); + +#endif + +/*-************************************ + * Private definitions + ************************************** + * Do not use these definitions. + * They are exposed to allow static allocation of `LZ4_stream_t` and `LZ4_streamDecode_t`. + * Using these definitions will expose code to API and/or ABI break in future versions of the library. + **************************************/ +#define LZ4_HASHLOG (LZ4_MEMORY_USAGE-2) +#define LZ4_HASHTABLESIZE (1 << LZ4_MEMORY_USAGE) +#define LZ4_HASH_SIZE_U32 (1 << LZ4_HASHLOG) /* required as macro for static allocation */ + +#if defined(__cplusplus) || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) +#include + +typedef struct LZ4_stream_t_internal LZ4_stream_t_internal; +struct LZ4_stream_t_internal { + uint32_t hashTable[LZ4_HASH_SIZE_U32]; + uint32_t currentOffset; + uint16_t initCheck; + uint16_t tableType; + const uint8_t* dictionary; + const LZ4_stream_t_internal* dictCtx; + uint32_t dictSize; +}; + +typedef struct { + const uint8_t* externalDict; + size_t extDictSize; + const uint8_t* prefixEnd; + size_t prefixSize; +} LZ4_streamDecode_t_internal; + +#else + +typedef struct LZ4_stream_t_internal LZ4_stream_t_internal; +struct LZ4_stream_t_internal { + unsigned int hashTable[LZ4_HASH_SIZE_U32]; + unsigned int currentOffset; + unsigned short initCheck; + unsigned short tableType; + const unsigned char* dictionary; + const LZ4_stream_t_internal* dictCtx; + unsigned int dictSize; +}; + +typedef struct { + const unsigned char* externalDict; + size_t extDictSize; + const unsigned char* prefixEnd; + size_t prefixSize; +} LZ4_streamDecode_t_internal; + +#endif + +/*! + * LZ4_stream_t : + * information structure to track an LZ4 stream. + * init this structure before first use. + * note : only use in association with static linking ! + * this definition is not API/ABI safe, + * it may change in a future version ! + */ +#define LZ4_STREAMSIZE_U64 ((1 << (LZ4_MEMORY_USAGE-3)) + 4) +#define LZ4_STREAMSIZE (LZ4_STREAMSIZE_U64 * sizeof(unsigned long long)) +union LZ4_stream_u { + unsigned long long table[LZ4_STREAMSIZE_U64]; + LZ4_stream_t_internal internal_donotuse; +} ; /* previously typedef'd to LZ4_stream_t */ + + +/*! + * LZ4_streamDecode_t : + * information structure to track an LZ4 stream during decompression. + * init this structure using LZ4_setStreamDecode (or memset()) before first use + * note : only use in association with static linking ! + * this definition is not API/ABI safe, + * and may change in a future version ! + */ +#define LZ4_STREAMDECODESIZE_U64 4 +#define LZ4_STREAMDECODESIZE (LZ4_STREAMDECODESIZE_U64 * sizeof(unsigned long long)) +union LZ4_streamDecode_u { + unsigned long long table[LZ4_STREAMDECODESIZE_U64]; + LZ4_streamDecode_t_internal internal_donotuse; +} ; /* previously typedef'd to LZ4_streamDecode_t */ + + +/*-************************************ +* Obsolete Functions +**************************************/ + +/*! Deprecation warnings + Should deprecation warnings be a problem, + it is generally possible to disable them, + typically with -Wno-deprecated-declarations for gcc + or _CRT_SECURE_NO_WARNINGS in Visual. + Otherwise, it's also possible to define LZ4_DISABLE_DEPRECATE_WARNINGS */ +#ifdef LZ4_DISABLE_DEPRECATE_WARNINGS +# define LZ4_DEPRECATED(message) /* disable deprecation warnings */ +#else +# define LZ4_GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__) +# if defined (__cplusplus) && (__cplusplus >= 201402) /* C++14 or greater */ +# define LZ4_DEPRECATED(message) [[deprecated(message)]] +# elif (LZ4_GCC_VERSION >= 405) || defined(__clang__) +# define LZ4_DEPRECATED(message) __attribute__((deprecated(message))) +# elif (LZ4_GCC_VERSION >= 301) +# define LZ4_DEPRECATED(message) __attribute__((deprecated)) +# elif defined(_MSC_VER) +# define LZ4_DEPRECATED(message) __declspec(deprecated(message)) +# else +# pragma message("WARNING: You need to implement LZ4_DEPRECATED for this compiler") +# define LZ4_DEPRECATED(message) +# endif +#endif /* LZ4_DISABLE_DEPRECATE_WARNINGS */ + +/* Obsolete compression functions */ +LZ4_DEPRECATED("use LZ4_compress_default() instead") LZ4LIB_API int LZ4_compress (const char* source, char* dest, int sourceSize); +LZ4_DEPRECATED("use LZ4_compress_default() instead") LZ4LIB_API int LZ4_compress_limitedOutput (const char* source, char* dest, int sourceSize, int maxOutputSize); +LZ4_DEPRECATED("use LZ4_compress_fast_extState() instead") LZ4LIB_API int LZ4_compress_withState (void* state, const char* source, char* dest, int inputSize); +LZ4_DEPRECATED("use LZ4_compress_fast_extState() instead") LZ4LIB_API int LZ4_compress_limitedOutput_withState (void* state, const char* source, char* dest, int inputSize, int maxOutputSize); +LZ4_DEPRECATED("use LZ4_compress_fast_continue() instead") LZ4LIB_API int LZ4_compress_continue (LZ4_stream_t* LZ4_streamPtr, const char* source, char* dest, int inputSize); +LZ4_DEPRECATED("use LZ4_compress_fast_continue() instead") LZ4LIB_API int LZ4_compress_limitedOutput_continue (LZ4_stream_t* LZ4_streamPtr, const char* source, char* dest, int inputSize, int maxOutputSize); + +/* Obsolete decompression functions */ +LZ4_DEPRECATED("use LZ4_decompress_fast() instead") LZ4LIB_API int LZ4_uncompress (const char* source, char* dest, int outputSize); +LZ4_DEPRECATED("use LZ4_decompress_safe() instead") LZ4LIB_API int LZ4_uncompress_unknownOutputSize (const char* source, char* dest, int isize, int maxOutputSize); + +/* Obsolete streaming functions; degraded functionality; do not use! + * + * In order to perform streaming compression, these functions depended on data + * that is no longer tracked in the state. They have been preserved as well as + * possible: using them will still produce a correct output. However, they don't + * actually retain any history between compression calls. The compression ratio + * achieved will therefore be no better than compressing each chunk + * independently. + */ +LZ4_DEPRECATED("Use LZ4_createStream() instead") LZ4LIB_API void* LZ4_create (char* inputBuffer); +LZ4_DEPRECATED("Use LZ4_createStream() instead") LZ4LIB_API int LZ4_sizeofStreamState(void); +LZ4_DEPRECATED("Use LZ4_resetStream() instead") LZ4LIB_API int LZ4_resetStreamState(void* state, char* inputBuffer); +LZ4_DEPRECATED("Use LZ4_saveDict() instead") LZ4LIB_API char* LZ4_slideInputBuffer (void* state); + +/* Obsolete streaming decoding functions */ +LZ4_DEPRECATED("use LZ4_decompress_safe_usingDict() instead") LZ4LIB_API int LZ4_decompress_safe_withPrefix64k (const char* src, char* dst, int compressedSize, int maxDstSize); +LZ4_DEPRECATED("use LZ4_decompress_fast_usingDict() instead") LZ4LIB_API int LZ4_decompress_fast_withPrefix64k (const char* src, char* dst, int originalSize); + +#endif /* LZ4_H_2983827168210 */ + + +#if defined (__cplusplus) +} +#endif diff --git a/r5dev/thirdparty/cppnet/cppkore_incl/LZ4_XXHash/lz4frame.h b/r5dev/thirdparty/cppnet/cppkore_incl/LZ4_XXHash/lz4frame.h new file mode 100644 index 00000000..75f1fd91 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore_incl/LZ4_XXHash/lz4frame.h @@ -0,0 +1,541 @@ +/* + LZ4 auto-framing library + Header File + Copyright (C) 2011-2017, Yann Collet. + BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + You can contact the author at : + - LZ4 source repository : https://github.com/lz4/lz4 + - LZ4 public forum : https://groups.google.com/forum/#!forum/lz4c +*/ + +/* LZ4F is a stand-alone API to create LZ4-compressed frames + * conformant with specification v1.6.1. + * It also offers streaming capabilities. + * lz4.h is not required when using lz4frame.h, + * except to get constant such as LZ4_VERSION_NUMBER. + * */ + +#ifndef LZ4F_H_09782039843 +#define LZ4F_H_09782039843 + +#if defined (__cplusplus) +extern "C" { +#endif + +/* --- Dependency --- */ +#include /* size_t */ + + +/** + Introduction + + lz4frame.h implements LZ4 frame specification (doc/lz4_Frame_format.md). + lz4frame.h provides frame compression functions that take care + of encoding standard metadata alongside LZ4-compressed blocks. +*/ + +/*-*************************************************************** + * Compiler specifics + *****************************************************************/ +/* LZ4_DLL_EXPORT : + * Enable exporting of functions when building a Windows DLL + * LZ4FLIB_API : + * Control library symbols visibility. + */ +#if defined(LZ4_DLL_EXPORT) && (LZ4_DLL_EXPORT==1) +# define LZ4FLIB_API __declspec(dllexport) +#elif defined(LZ4_DLL_IMPORT) && (LZ4_DLL_IMPORT==1) +# define LZ4FLIB_API __declspec(dllimport) +#elif defined(__GNUC__) && (__GNUC__ >= 4) +# define LZ4FLIB_API __attribute__ ((__visibility__ ("default"))) +#else +# define LZ4FLIB_API +#endif + +#ifdef LZ4F_DISABLE_DEPRECATE_WARNINGS +# define LZ4F_DEPRECATE(x) x +#else +# if defined(_MSC_VER) +# define LZ4F_DEPRECATE(x) x /* __declspec(deprecated) x - only works with C++ */ +# elif defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 6)) +# define LZ4F_DEPRECATE(x) x __attribute__((deprecated)) +# else +# define LZ4F_DEPRECATE(x) x /* no deprecation warning for this compiler */ +# endif +#endif + + +/*-************************************ + * Error management + **************************************/ +typedef size_t LZ4F_errorCode_t; + +LZ4FLIB_API unsigned LZ4F_isError(LZ4F_errorCode_t code); /**< tells when a function result is an error code */ +LZ4FLIB_API const char* LZ4F_getErrorName(LZ4F_errorCode_t code); /**< return error code string; for debugging */ + + +/*-************************************ + * Frame compression types + **************************************/ +/* #define LZ4F_ENABLE_OBSOLETE_ENUMS // uncomment to enable obsolete enums */ +#ifdef LZ4F_ENABLE_OBSOLETE_ENUMS +# define LZ4F_OBSOLETE_ENUM(x) , LZ4F_DEPRECATE(x) = LZ4F_##x +#else +# define LZ4F_OBSOLETE_ENUM(x) +#endif + +/* The larger the block size, the (slightly) better the compression ratio, + * though there are diminishing returns. + * Larger blocks also increase memory usage on both compression and decompression sides. */ +typedef enum { + LZ4F_default=0, + LZ4F_max64KB=4, + LZ4F_max256KB=5, + LZ4F_max1MB=6, + LZ4F_max4MB=7 + LZ4F_OBSOLETE_ENUM(max64KB) + LZ4F_OBSOLETE_ENUM(max256KB) + LZ4F_OBSOLETE_ENUM(max1MB) + LZ4F_OBSOLETE_ENUM(max4MB) +} LZ4F_blockSizeID_t; + +/* Linked blocks sharply reduce inefficiencies when using small blocks, + * they compress better. + * However, some LZ4 decoders are only compatible with independent blocks */ +typedef enum { + LZ4F_blockLinked=0, + LZ4F_blockIndependent + LZ4F_OBSOLETE_ENUM(blockLinked) + LZ4F_OBSOLETE_ENUM(blockIndependent) +} LZ4F_blockMode_t; + +typedef enum { + LZ4F_noContentChecksum=0, + LZ4F_contentChecksumEnabled + LZ4F_OBSOLETE_ENUM(noContentChecksum) + LZ4F_OBSOLETE_ENUM(contentChecksumEnabled) +} LZ4F_contentChecksum_t; + +typedef enum { + LZ4F_noBlockChecksum=0, + LZ4F_blockChecksumEnabled +} LZ4F_blockChecksum_t; + +typedef enum { + LZ4F_frame=0, + LZ4F_skippableFrame + LZ4F_OBSOLETE_ENUM(skippableFrame) +} LZ4F_frameType_t; + +#ifdef LZ4F_ENABLE_OBSOLETE_ENUMS +typedef LZ4F_blockSizeID_t blockSizeID_t; +typedef LZ4F_blockMode_t blockMode_t; +typedef LZ4F_frameType_t frameType_t; +typedef LZ4F_contentChecksum_t contentChecksum_t; +#endif + +/*! LZ4F_frameInfo_t : + * makes it possible to set or read frame parameters. + * Structure must be first init to 0, using memset() or LZ4F_INIT_FRAMEINFO, + * setting all parameters to default. + * It's then possible to update selectively some parameters */ +typedef struct { + LZ4F_blockSizeID_t blockSizeID; /* max64KB, max256KB, max1MB, max4MB; 0 == default */ + LZ4F_blockMode_t blockMode; /* LZ4F_blockLinked, LZ4F_blockIndependent; 0 == default */ + LZ4F_contentChecksum_t contentChecksumFlag; /* 1: frame terminated with 32-bit checksum of decompressed data; 0: disabled (default) */ + LZ4F_frameType_t frameType; /* read-only field : LZ4F_frame or LZ4F_skippableFrame */ + unsigned long long contentSize; /* Size of uncompressed content ; 0 == unknown */ + unsigned dictID; /* Dictionary ID, sent by compressor to help decoder select correct dictionary; 0 == no dictID provided */ + LZ4F_blockChecksum_t blockChecksumFlag; /* 1: each block followed by a checksum of block's compressed data; 0: disabled (default) */ +} LZ4F_frameInfo_t; + +#define LZ4F_INIT_FRAMEINFO { 0, 0, 0, 0, 0, 0, 0 } /* v1.8.3+ */ + +/*! LZ4F_preferences_t : + * makes it possible to supply advanced compression instructions to streaming interface. + * Structure must be first init to 0, using memset() or LZ4F_INIT_PREFERENCES, + * setting all parameters to default. + * All reserved fields must be set to zero. */ +typedef struct { + LZ4F_frameInfo_t frameInfo; + int compressionLevel; /* 0: default (fast mode); values > LZ4HC_CLEVEL_MAX count as LZ4HC_CLEVEL_MAX; values < 0 trigger "fast acceleration" */ + unsigned autoFlush; /* 1: always flush; reduces usage of internal buffers */ + unsigned favorDecSpeed; /* 1: parser favors decompression speed vs compression ratio. Only works for high compression modes (>= LZ4HC_CLEVEL_OPT_MIN) */ /* v1.8.2+ */ + unsigned reserved[3]; /* must be zero for forward compatibility */ +} LZ4F_preferences_t; + +#define LZ4F_INIT_PREFERENCES { LZ4F_INIT_FRAMEINFO, 0, 0, 0, { 0, 0, 0 } } /* v1.8.3+ */ + + +/*-********************************* +* Simple compression function +***********************************/ + +LZ4FLIB_API int LZ4F_compressionLevel_max(void); + +/*! LZ4F_compressFrameBound() : + * Returns the maximum possible compressed size with LZ4F_compressFrame() given srcSize and preferences. + * `preferencesPtr` is optional. It can be replaced by NULL, in which case, the function will assume default preferences. + * Note : this result is only usable with LZ4F_compressFrame(). + * It may also be used with LZ4F_compressUpdate() _if no flush() operation_ is performed. + */ +LZ4FLIB_API size_t LZ4F_compressFrameBound(size_t srcSize, const LZ4F_preferences_t* preferencesPtr); + +/*! LZ4F_compressFrame() : + * Compress an entire srcBuffer into a valid LZ4 frame. + * dstCapacity MUST be >= LZ4F_compressFrameBound(srcSize, preferencesPtr). + * The LZ4F_preferences_t structure is optional : you can provide NULL as argument. All preferences will be set to default. + * @return : number of bytes written into dstBuffer. + * or an error code if it fails (can be tested using LZ4F_isError()) + */ +LZ4FLIB_API size_t LZ4F_compressFrame(void* dstBuffer, size_t dstCapacity, + const void* srcBuffer, size_t srcSize, + const LZ4F_preferences_t* preferencesPtr); + + +/*-*********************************** +* Advanced compression functions +*************************************/ +typedef struct LZ4F_cctx_s LZ4F_cctx; /* incomplete type */ +typedef LZ4F_cctx* LZ4F_compressionContext_t; /* for compatibility with previous API version */ + +typedef struct { + unsigned stableSrc; /* 1 == src content will remain present on future calls to LZ4F_compress(); skip copying src content within tmp buffer */ + unsigned reserved[3]; +} LZ4F_compressOptions_t; + +/*--- Resource Management ---*/ + +#define LZ4F_VERSION 100 /* This number can be used to check for an incompatible API breaking change */ +LZ4FLIB_API unsigned LZ4F_getVersion(void); + +/*! LZ4F_createCompressionContext() : + * The first thing to do is to create a compressionContext object, which will be used in all compression operations. + * This is achieved using LZ4F_createCompressionContext(), which takes as argument a version. + * The version provided MUST be LZ4F_VERSION. It is intended to track potential version mismatch, notably when using DLL. + * The function will provide a pointer to a fully allocated LZ4F_cctx object. + * If @return != zero, there was an error during context creation. + * Object can release its memory using LZ4F_freeCompressionContext(); + */ +LZ4FLIB_API LZ4F_errorCode_t LZ4F_createCompressionContext(LZ4F_cctx** cctxPtr, unsigned version); +LZ4FLIB_API LZ4F_errorCode_t LZ4F_freeCompressionContext(LZ4F_cctx* cctx); + + +/*---- Compression ----*/ + +#define LZ4F_HEADER_SIZE_MAX 19 /* LZ4 Frame header size can vary from 7 to 19 bytes */ +/*! LZ4F_compressBegin() : + * will write the frame header into dstBuffer. + * dstCapacity must be >= LZ4F_HEADER_SIZE_MAX bytes. + * `prefsPtr` is optional : you can provide NULL as argument, all preferences will then be set to default. + * @return : number of bytes written into dstBuffer for the header + * or an error code (which can be tested using LZ4F_isError()) + */ +LZ4FLIB_API size_t LZ4F_compressBegin(LZ4F_cctx* cctx, + void* dstBuffer, size_t dstCapacity, + const LZ4F_preferences_t* prefsPtr); + +/*! LZ4F_compressBound() : + * Provides minimum dstCapacity required to guarantee compression success + * given a srcSize and preferences, covering worst case scenario. + * prefsPtr is optional : when NULL is provided, preferences will be set to cover worst case scenario. + * Estimation is valid for either LZ4F_compressUpdate(), LZ4F_flush() or LZ4F_compressEnd(), + * Estimation includes the possibility that internal buffer might already be filled by up to (blockSize-1) bytes. + * It also includes frame footer (ending + checksum), which would have to be generated by LZ4F_compressEnd(). + * Estimation doesn't include frame header, as it was already generated by LZ4F_compressBegin(). + * Result is always the same for a srcSize and prefsPtr, so it can be trusted to size reusable buffers. + * When srcSize==0, LZ4F_compressBound() provides an upper bound for LZ4F_flush() and LZ4F_compressEnd() operations. + */ +LZ4FLIB_API size_t LZ4F_compressBound(size_t srcSize, const LZ4F_preferences_t* prefsPtr); + +/*! LZ4F_compressUpdate() : + * LZ4F_compressUpdate() can be called repetitively to compress as much data as necessary. + * Important rule: dstCapacity MUST be large enough to ensure operation success even in worst case situations. + * This value is provided by LZ4F_compressBound(). + * If this condition is not respected, LZ4F_compress() will fail (result is an errorCode). + * LZ4F_compressUpdate() doesn't guarantee error recovery. + * When an error occurs, compression context must be freed or resized. + * `cOptPtr` is optional : NULL can be provided, in which case all options are set to default. + * @return : number of bytes written into `dstBuffer` (it can be zero, meaning input data was just buffered). + * or an error code if it fails (which can be tested using LZ4F_isError()) + */ +LZ4FLIB_API size_t LZ4F_compressUpdate(LZ4F_cctx* cctx, + void* dstBuffer, size_t dstCapacity, + const void* srcBuffer, size_t srcSize, + const LZ4F_compressOptions_t* cOptPtr); + +/*! LZ4F_flush() : + * When data must be generated and sent immediately, without waiting for a block to be completely filled, + * it's possible to call LZ4_flush(). It will immediately compress any data buffered within cctx. + * `dstCapacity` must be large enough to ensure the operation will be successful. + * `cOptPtr` is optional : it's possible to provide NULL, all options will be set to default. + * @return : nb of bytes written into dstBuffer (can be zero, when there is no data stored within cctx) + * or an error code if it fails (which can be tested using LZ4F_isError()) + */ +LZ4FLIB_API size_t LZ4F_flush(LZ4F_cctx* cctx, + void* dstBuffer, size_t dstCapacity, + const LZ4F_compressOptions_t* cOptPtr); + +/*! LZ4F_compressEnd() : + * To properly finish an LZ4 frame, invoke LZ4F_compressEnd(). + * It will flush whatever data remained within `cctx` (like LZ4_flush()) + * and properly finalize the frame, with an endMark and a checksum. + * `cOptPtr` is optional : NULL can be provided, in which case all options will be set to default. + * @return : nb of bytes written into dstBuffer, necessarily >= 4 (endMark), + * or an error code if it fails (which can be tested using LZ4F_isError()) + * A successful call to LZ4F_compressEnd() makes `cctx` available again for another compression task. + */ +LZ4FLIB_API size_t LZ4F_compressEnd(LZ4F_cctx* cctx, + void* dstBuffer, size_t dstCapacity, + const LZ4F_compressOptions_t* cOptPtr); + + +/*-********************************* +* Decompression functions +***********************************/ +typedef struct LZ4F_dctx_s LZ4F_dctx; /* incomplete type */ +typedef LZ4F_dctx* LZ4F_decompressionContext_t; /* compatibility with previous API versions */ + +typedef struct { + unsigned stableDst; /* pledges that last 64KB decompressed data will remain available unmodified. This optimization skips storage operations in tmp buffers. */ + unsigned reserved[3]; /* must be set to zero for forward compatibility */ +} LZ4F_decompressOptions_t; + + +/* Resource management */ + +/*! LZ4F_createDecompressionContext() : + * Create an LZ4F_dctx object, to track all decompression operations. + * The version provided MUST be LZ4F_VERSION. + * The function provides a pointer to an allocated and initialized LZ4F_dctx object. + * The result is an errorCode, which can be tested using LZ4F_isError(). + * dctx memory can be released using LZ4F_freeDecompressionContext(); + * Result of LZ4F_freeDecompressionContext() indicates current state of decompressionContext when being released. + * That is, it should be == 0 if decompression has been completed fully and correctly. + */ +LZ4FLIB_API LZ4F_errorCode_t LZ4F_createDecompressionContext(LZ4F_dctx** dctxPtr, unsigned version); +LZ4FLIB_API LZ4F_errorCode_t LZ4F_freeDecompressionContext(LZ4F_dctx* dctx); + + +/*-*********************************** +* Streaming decompression functions +*************************************/ + +/*! LZ4F_getFrameInfo() : + * This function extracts frame parameters (max blockSize, dictID, etc.). + * Its usage is optional. + * Extracted information is typically useful for allocation and dictionary. + * This function works in 2 situations : + * - At the beginning of a new frame, in which case + * it will decode information from `srcBuffer`, starting the decoding process. + * Input size must be large enough to successfully decode the entire frame header. + * Frame header size is variable, but is guaranteed to be <= LZ4F_HEADER_SIZE_MAX bytes. + * It's allowed to provide more input data than this minimum. + * - After decoding has been started. + * In which case, no input is read, frame parameters are extracted from dctx. + * - If decoding has barely started, but not yet extracted information from header, + * LZ4F_getFrameInfo() will fail. + * The number of bytes consumed from srcBuffer will be updated within *srcSizePtr (necessarily <= original value). + * Decompression must resume from (srcBuffer + *srcSizePtr). + * @return : an hint about how many srcSize bytes LZ4F_decompress() expects for next call, + * or an error code which can be tested using LZ4F_isError(). + * note 1 : in case of error, dctx is not modified. Decoding operation can resume from beginning safely. + * note 2 : frame parameters are *copied into* an already allocated LZ4F_frameInfo_t structure. + */ +LZ4FLIB_API size_t LZ4F_getFrameInfo(LZ4F_dctx* dctx, + LZ4F_frameInfo_t* frameInfoPtr, + const void* srcBuffer, size_t* srcSizePtr); + +/*! LZ4F_decompress() : + * Call this function repetitively to regenerate compressed data from `srcBuffer`. + * The function will read up to *srcSizePtr bytes from srcBuffer, + * and decompress data into dstBuffer, of capacity *dstSizePtr. + * + * The nb of bytes consumed from srcBuffer will be written into *srcSizePtr (necessarily <= original value). + * The nb of bytes decompressed into dstBuffer will be written into *dstSizePtr (necessarily <= original value). + * + * The function does not necessarily read all input bytes, so always check value in *srcSizePtr. + * Unconsumed source data must be presented again in subsequent invocations. + * + * `dstBuffer` can freely change between each consecutive function invocation. + * `dstBuffer` content will be overwritten. + * + * @return : an hint of how many `srcSize` bytes LZ4F_decompress() expects for next call. + * Schematically, it's the size of the current (or remaining) compressed block + header of next block. + * Respecting the hint provides some small speed benefit, because it skips intermediate buffers. + * This is just a hint though, it's always possible to provide any srcSize. + * + * When a frame is fully decoded, @return will be 0 (no more data expected). + * When provided with more bytes than necessary to decode a frame, + * LZ4F_decompress() will stop reading exactly at end of current frame, and @return 0. + * + * If decompression failed, @return is an error code, which can be tested using LZ4F_isError(). + * After a decompression error, the `dctx` context is not resumable. + * Use LZ4F_resetDecompressionContext() to return to clean state. + * + * After a frame is fully decoded, dctx can be used again to decompress another frame. + */ +LZ4FLIB_API size_t LZ4F_decompress(LZ4F_dctx* dctx, + void* dstBuffer, size_t* dstSizePtr, + const void* srcBuffer, size_t* srcSizePtr, + const LZ4F_decompressOptions_t* dOptPtr); + + +/*! LZ4F_resetDecompressionContext() : added in v1.8.0 + * In case of an error, the context is left in "undefined" state. + * In which case, it's necessary to reset it, before re-using it. + * This method can also be used to abruptly stop any unfinished decompression, + * and start a new one using same context resources. */ +LZ4FLIB_API void LZ4F_resetDecompressionContext(LZ4F_dctx* dctx); /* always successful */ + + + +#if defined (__cplusplus) +} +#endif + +#endif /* LZ4F_H_09782039843 */ + +#if defined(LZ4F_STATIC_LINKING_ONLY) && !defined(LZ4F_H_STATIC_09782039843) +#define LZ4F_H_STATIC_09782039843 + +#if defined (__cplusplus) +extern "C" { +#endif + +/* These declarations are not stable and may change in the future. They are + * therefore only safe to depend on when the caller is statically linked + * against the library. To access their declarations, define + * LZ4F_STATIC_LINKING_ONLY. + * + * There is a further protection mechanism where these symbols aren't published + * into shared/dynamic libraries. You can override this behavior and force + * them to be published by defining LZ4F_PUBLISH_STATIC_FUNCTIONS. Use at + * your own risk. + */ +#ifdef LZ4F_PUBLISH_STATIC_FUNCTIONS +#define LZ4FLIB_STATIC_API LZ4FLIB_API +#else +#define LZ4FLIB_STATIC_API +#endif + + +/* --- Error List --- */ +#define LZ4F_LIST_ERRORS(ITEM) \ + ITEM(OK_NoError) \ + ITEM(ERROR_GENERIC) \ + ITEM(ERROR_maxBlockSize_invalid) \ + ITEM(ERROR_blockMode_invalid) \ + ITEM(ERROR_contentChecksumFlag_invalid) \ + ITEM(ERROR_compressionLevel_invalid) \ + ITEM(ERROR_headerVersion_wrong) \ + ITEM(ERROR_blockChecksum_invalid) \ + ITEM(ERROR_reservedFlag_set) \ + ITEM(ERROR_allocation_failed) \ + ITEM(ERROR_srcSize_tooLarge) \ + ITEM(ERROR_dstMaxSize_tooSmall) \ + ITEM(ERROR_frameHeader_incomplete) \ + ITEM(ERROR_frameType_unknown) \ + ITEM(ERROR_frameSize_wrong) \ + ITEM(ERROR_srcPtr_wrong) \ + ITEM(ERROR_decompressionFailed) \ + ITEM(ERROR_headerChecksum_invalid) \ + ITEM(ERROR_contentChecksum_invalid) \ + ITEM(ERROR_frameDecoding_alreadyStarted) \ + ITEM(ERROR_maxCode) + +#define LZ4F_GENERATE_ENUM(ENUM) LZ4F_##ENUM, + +/* enum list is exposed, to handle specific errors */ +typedef enum { LZ4F_LIST_ERRORS(LZ4F_GENERATE_ENUM) } LZ4F_errorCodes; + +LZ4FLIB_STATIC_API LZ4F_errorCodes LZ4F_getErrorCode(size_t functionResult); + + + +/********************************** + * Bulk processing dictionary API + *********************************/ +typedef struct LZ4F_CDict_s LZ4F_CDict; + +/*! LZ4_createCDict() : + * When compressing multiple messages / blocks with the same dictionary, it's recommended to load it just once. + * LZ4_createCDict() will create a digested dictionary, ready to start future compression operations without startup delay. + * LZ4_CDict can be created once and shared by multiple threads concurrently, since its usage is read-only. + * `dictBuffer` can be released after LZ4_CDict creation, since its content is copied within CDict */ +LZ4FLIB_STATIC_API LZ4F_CDict* LZ4F_createCDict(const void* dictBuffer, size_t dictSize); +LZ4FLIB_STATIC_API void LZ4F_freeCDict(LZ4F_CDict* CDict); + + +/*! LZ4_compressFrame_usingCDict() : + * Compress an entire srcBuffer into a valid LZ4 frame using a digested Dictionary. + * cctx must point to a context created by LZ4F_createCompressionContext(). + * If cdict==NULL, compress without a dictionary. + * dstBuffer MUST be >= LZ4F_compressFrameBound(srcSize, preferencesPtr). + * If this condition is not respected, function will fail (@return an errorCode). + * The LZ4F_preferences_t structure is optional : you may provide NULL as argument, + * but it's not recommended, as it's the only way to provide dictID in the frame header. + * @return : number of bytes written into dstBuffer. + * or an error code if it fails (can be tested using LZ4F_isError()) */ +LZ4FLIB_STATIC_API size_t LZ4F_compressFrame_usingCDict( + LZ4F_cctx* cctx, + void* dst, size_t dstCapacity, + const void* src, size_t srcSize, + const LZ4F_CDict* cdict, + const LZ4F_preferences_t* preferencesPtr); + + +/*! LZ4F_compressBegin_usingCDict() : + * Inits streaming dictionary compression, and writes the frame header into dstBuffer. + * dstCapacity must be >= LZ4F_HEADER_SIZE_MAX bytes. + * `prefsPtr` is optional : you may provide NULL as argument, + * however, it's the only way to provide dictID in the frame header. + * @return : number of bytes written into dstBuffer for the header, + * or an error code (which can be tested using LZ4F_isError()) */ +LZ4FLIB_STATIC_API size_t LZ4F_compressBegin_usingCDict( + LZ4F_cctx* cctx, + void* dstBuffer, size_t dstCapacity, + const LZ4F_CDict* cdict, + const LZ4F_preferences_t* prefsPtr); + + +/*! LZ4F_decompress_usingDict() : + * Same as LZ4F_decompress(), using a predefined dictionary. + * Dictionary is used "in place", without any preprocessing. + * It must remain accessible throughout the entire frame decoding. */ +LZ4FLIB_STATIC_API size_t LZ4F_decompress_usingDict( + LZ4F_dctx* dctxPtr, + void* dstBuffer, size_t* dstSizePtr, + const void* srcBuffer, size_t* srcSizePtr, + const void* dict, size_t dictSize, + const LZ4F_decompressOptions_t* decompressOptionsPtr); + +#if defined (__cplusplus) +} +#endif + +#endif /* defined(LZ4F_STATIC_LINKING_ONLY) && !defined(LZ4F_H_STATIC_09782039843) */ diff --git a/r5dev/thirdparty/cppnet/cppkore_incl/LZ4_XXHash/lz4hc.h b/r5dev/thirdparty/cppnet/cppkore_incl/LZ4_XXHash/lz4hc.h new file mode 100644 index 00000000..970fa396 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore_incl/LZ4_XXHash/lz4hc.h @@ -0,0 +1,355 @@ +/* + LZ4 HC - High Compression Mode of LZ4 + Header File + Copyright (C) 2011-2017, Yann Collet. + BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + You can contact the author at : + - LZ4 source repository : https://github.com/lz4/lz4 + - LZ4 public forum : https://groups.google.com/forum/#!forum/lz4c +*/ +#ifndef LZ4_HC_H_19834876238432 +#define LZ4_HC_H_19834876238432 + +#if defined (__cplusplus) +extern "C" { +#endif + +/* --- Dependency --- */ +/* note : lz4hc requires lz4.h/lz4.c for compilation */ +#include "lz4.h" /* stddef, LZ4LIB_API, LZ4_DEPRECATED */ + + +/* --- Useful constants --- */ +#define LZ4HC_CLEVEL_MIN 3 +#define LZ4HC_CLEVEL_DEFAULT 9 +#define LZ4HC_CLEVEL_OPT_MIN 10 +#define LZ4HC_CLEVEL_MAX 12 + + +/*-************************************ + * Block Compression + **************************************/ +/*! LZ4_compress_HC() : + * Compress data from `src` into `dst`, using the more powerful but slower "HC" algorithm. + * `dst` must be already allocated. + * Compression is guaranteed to succeed if `dstCapacity >= LZ4_compressBound(srcSize)` (see "lz4.h") + * Max supported `srcSize` value is LZ4_MAX_INPUT_SIZE (see "lz4.h") + * `compressionLevel` : any value between 1 and LZ4HC_CLEVEL_MAX will work. + * Values > LZ4HC_CLEVEL_MAX behave the same as LZ4HC_CLEVEL_MAX. + * @return : the number of bytes written into 'dst' + * or 0 if compression fails. + */ +LZ4LIB_API int LZ4_compress_HC (const char* src, char* dst, int srcSize, int dstCapacity, int compressionLevel); + + +/* Note : + * Decompression functions are provided within "lz4.h" (BSD license) + */ + + +/*! LZ4_compress_HC_extStateHC() : + * Same as LZ4_compress_HC(), but using an externally allocated memory segment for `state`. + * `state` size is provided by LZ4_sizeofStateHC(). + * Memory segment must be aligned on 8-bytes boundaries (which a normal malloc() should do properly). + */ +LZ4LIB_API int LZ4_sizeofStateHC(void); +LZ4LIB_API int LZ4_compress_HC_extStateHC(void* state, const char* src, char* dst, int srcSize, int maxDstSize, int compressionLevel); + + +/*-************************************ + * Streaming Compression + * Bufferless synchronous API + **************************************/ + typedef union LZ4_streamHC_u LZ4_streamHC_t; /* incomplete type (defined later) */ + +/*! LZ4_createStreamHC() and LZ4_freeStreamHC() : + * These functions create and release memory for LZ4 HC streaming state. + * Newly created states are automatically initialized. + * Existing states can be re-used several times, using LZ4_resetStreamHC(). + * These methods are API and ABI stable, they can be used in combination with a DLL. + */ +LZ4LIB_API LZ4_streamHC_t* LZ4_createStreamHC(void); +LZ4LIB_API int LZ4_freeStreamHC (LZ4_streamHC_t* streamHCPtr); + +LZ4LIB_API void LZ4_resetStreamHC (LZ4_streamHC_t* streamHCPtr, int compressionLevel); +LZ4LIB_API int LZ4_loadDictHC (LZ4_streamHC_t* streamHCPtr, const char* dictionary, int dictSize); + +LZ4LIB_API int LZ4_compress_HC_continue (LZ4_streamHC_t* streamHCPtr, const char* src, char* dst, int srcSize, int maxDstSize); + +LZ4LIB_API int LZ4_saveDictHC (LZ4_streamHC_t* streamHCPtr, char* safeBuffer, int maxDictSize); + +/* + These functions compress data in successive blocks of any size, using previous blocks as dictionary. + One key assumption is that previous blocks (up to 64 KB) remain read-accessible while compressing next blocks. + There is an exception for ring buffers, which can be smaller than 64 KB. + Ring buffers scenario is automatically detected and handled by LZ4_compress_HC_continue(). + + Before starting compression, state must be properly initialized, using LZ4_resetStreamHC(). + A first "fictional block" can then be designated as initial dictionary, using LZ4_loadDictHC() (Optional). + + Then, use LZ4_compress_HC_continue() to compress each successive block. + Previous memory blocks (including initial dictionary when present) must remain accessible and unmodified during compression. + 'dst' buffer should be sized to handle worst case scenarios (see LZ4_compressBound()), to ensure operation success. + Because in case of failure, the API does not guarantee context recovery, and context will have to be reset. + If `dst` buffer budget cannot be >= LZ4_compressBound(), consider using LZ4_compress_HC_continue_destSize() instead. + + If, for any reason, previous data block can't be preserved unmodified in memory for next compression block, + you can save it to a more stable memory space, using LZ4_saveDictHC(). + Return value of LZ4_saveDictHC() is the size of dictionary effectively saved into 'safeBuffer'. +*/ + + +/*-************************************************************** + * PRIVATE DEFINITIONS : + * Do not use these definitions. + * They are exposed to allow static allocation of `LZ4_streamHC_t`. + * Using these definitions makes the code vulnerable to potential API break when upgrading LZ4 + ****************************************************************/ +#define LZ4HC_DICTIONARY_LOGSIZE 16 +#define LZ4HC_MAXD (1<= 199901L) /* C99 */) +#include + +typedef struct LZ4HC_CCtx_internal LZ4HC_CCtx_internal; +struct LZ4HC_CCtx_internal +{ + uint32_t hashTable[LZ4HC_HASHTABLESIZE]; + uint16_t chainTable[LZ4HC_MAXD]; + const uint8_t* end; /* next block here to continue on current prefix */ + const uint8_t* base; /* All index relative to this position */ + const uint8_t* dictBase; /* alternate base for extDict */ + uint32_t dictLimit; /* below that point, need extDict */ + uint32_t lowLimit; /* below that point, no more dict */ + uint32_t nextToUpdate; /* index from which to continue dictionary update */ + short compressionLevel; + short favorDecSpeed; + const LZ4HC_CCtx_internal* dictCtx; +}; + +#else + +typedef struct LZ4HC_CCtx_internal LZ4HC_CCtx_internal; +struct LZ4HC_CCtx_internal +{ + unsigned int hashTable[LZ4HC_HASHTABLESIZE]; + unsigned short chainTable[LZ4HC_MAXD]; + const unsigned char* end; /* next block here to continue on current prefix */ + const unsigned char* base; /* All index relative to this position */ + const unsigned char* dictBase; /* alternate base for extDict */ + unsigned int dictLimit; /* below that point, need extDict */ + unsigned int lowLimit; /* below that point, no more dict */ + unsigned int nextToUpdate; /* index from which to continue dictionary update */ + short compressionLevel; + short favorDecSpeed; + const LZ4HC_CCtx_internal* dictCtx; +}; + +#endif + +#define LZ4_STREAMHCSIZE (4*LZ4HC_HASHTABLESIZE + 2*LZ4HC_MAXD + 56) /* 262200 */ +#define LZ4_STREAMHCSIZE_SIZET (LZ4_STREAMHCSIZE / sizeof(size_t)) +union LZ4_streamHC_u { + size_t table[LZ4_STREAMHCSIZE_SIZET]; + LZ4HC_CCtx_internal internal_donotuse; +}; /* previously typedef'd to LZ4_streamHC_t */ +/* + LZ4_streamHC_t : + This structure allows static allocation of LZ4 HC streaming state. + State must be initialized using LZ4_resetStreamHC() before first use. + + Static allocation shall only be used in combination with static linking. + When invoking LZ4 from a DLL, use create/free functions instead, which are API and ABI stable. +*/ + + +/*-************************************ +* Deprecated Functions +**************************************/ +/* see lz4.h LZ4_DISABLE_DEPRECATE_WARNINGS to turn off deprecation warnings */ + +/* deprecated compression functions */ +LZ4_DEPRECATED("use LZ4_compress_HC() instead") LZ4LIB_API int LZ4_compressHC (const char* source, char* dest, int inputSize); +LZ4_DEPRECATED("use LZ4_compress_HC() instead") LZ4LIB_API int LZ4_compressHC_limitedOutput (const char* source, char* dest, int inputSize, int maxOutputSize); +LZ4_DEPRECATED("use LZ4_compress_HC() instead") LZ4LIB_API int LZ4_compressHC2 (const char* source, char* dest, int inputSize, int compressionLevel); +LZ4_DEPRECATED("use LZ4_compress_HC() instead") LZ4LIB_API int LZ4_compressHC2_limitedOutput (const char* source, char* dest, int inputSize, int maxOutputSize, int compressionLevel); +LZ4_DEPRECATED("use LZ4_compress_HC_extStateHC() instead") LZ4LIB_API int LZ4_compressHC_withStateHC (void* state, const char* source, char* dest, int inputSize); +LZ4_DEPRECATED("use LZ4_compress_HC_extStateHC() instead") LZ4LIB_API int LZ4_compressHC_limitedOutput_withStateHC (void* state, const char* source, char* dest, int inputSize, int maxOutputSize); +LZ4_DEPRECATED("use LZ4_compress_HC_extStateHC() instead") LZ4LIB_API int LZ4_compressHC2_withStateHC (void* state, const char* source, char* dest, int inputSize, int compressionLevel); +LZ4_DEPRECATED("use LZ4_compress_HC_extStateHC() instead") LZ4LIB_API int LZ4_compressHC2_limitedOutput_withStateHC(void* state, const char* source, char* dest, int inputSize, int maxOutputSize, int compressionLevel); +LZ4_DEPRECATED("use LZ4_compress_HC_continue() instead") LZ4LIB_API int LZ4_compressHC_continue (LZ4_streamHC_t* LZ4_streamHCPtr, const char* source, char* dest, int inputSize); +LZ4_DEPRECATED("use LZ4_compress_HC_continue() instead") LZ4LIB_API int LZ4_compressHC_limitedOutput_continue (LZ4_streamHC_t* LZ4_streamHCPtr, const char* source, char* dest, int inputSize, int maxOutputSize); + +/* Obsolete streaming functions; degraded functionality; do not use! + * + * In order to perform streaming compression, these functions depended on data + * that is no longer tracked in the state. They have been preserved as well as + * possible: using them will still produce a correct output. However, use of + * LZ4_slideInputBufferHC() will truncate the history of the stream, rather + * than preserve a window-sized chunk of history. + */ +LZ4_DEPRECATED("use LZ4_createStreamHC() instead") LZ4LIB_API void* LZ4_createHC (const char* inputBuffer); +LZ4_DEPRECATED("use LZ4_saveDictHC() instead") LZ4LIB_API char* LZ4_slideInputBufferHC (void* LZ4HC_Data); +LZ4_DEPRECATED("use LZ4_freeStreamHC() instead") LZ4LIB_API int LZ4_freeHC (void* LZ4HC_Data); +LZ4_DEPRECATED("use LZ4_compress_HC_continue() instead") LZ4LIB_API int LZ4_compressHC2_continue (void* LZ4HC_Data, const char* source, char* dest, int inputSize, int compressionLevel); +LZ4_DEPRECATED("use LZ4_compress_HC_continue() instead") LZ4LIB_API int LZ4_compressHC2_limitedOutput_continue (void* LZ4HC_Data, const char* source, char* dest, int inputSize, int maxOutputSize, int compressionLevel); +LZ4_DEPRECATED("use LZ4_createStreamHC() instead") LZ4LIB_API int LZ4_sizeofStreamStateHC(void); +LZ4_DEPRECATED("use LZ4_resetStreamHC() instead") LZ4LIB_API int LZ4_resetStreamStateHC(void* state, char* inputBuffer); + + +#if defined (__cplusplus) +} +#endif + +#endif /* LZ4_HC_H_19834876238432 */ + + +/*-************************************************** + * !!!!! STATIC LINKING ONLY !!!!! + * Following definitions are considered experimental. + * They should not be linked from DLL, + * as there is no guarantee of API stability yet. + * Prototypes will be promoted to "stable" status + * after successfull usage in real-life scenarios. + ***************************************************/ +#ifdef LZ4_HC_STATIC_LINKING_ONLY /* protection macro */ +#ifndef LZ4_HC_SLO_098092834 +#define LZ4_HC_SLO_098092834 + +#if defined (__cplusplus) +extern "C" { +#endif + +/*! LZ4_compress_HC_destSize() : v1.8.0 (experimental) + * Will try to compress as much data from `src` as possible + * that can fit into `targetDstSize` budget. + * Result is provided in 2 parts : + * @return : the number of bytes written into 'dst' + * or 0 if compression fails. + * `srcSizePtr` : value will be updated to indicate how much bytes were read from `src` + */ +int LZ4_compress_HC_destSize(void* LZ4HC_Data, + const char* src, char* dst, + int* srcSizePtr, int targetDstSize, + int compressionLevel); + +/*! LZ4_compress_HC_continue_destSize() : v1.8.0 (experimental) + * Similar as LZ4_compress_HC_continue(), + * but will read a variable nb of bytes from `src` + * to fit into `targetDstSize` budget. + * Result is provided in 2 parts : + * @return : the number of bytes written into 'dst' + * or 0 if compression fails. + * `srcSizePtr` : value will be updated to indicate how much bytes were read from `src`. + */ +int LZ4_compress_HC_continue_destSize(LZ4_streamHC_t* LZ4_streamHCPtr, + const char* src, char* dst, + int* srcSizePtr, int targetDstSize); + +/*! LZ4_setCompressionLevel() : v1.8.0 (experimental) + * It's possible to change compression level between 2 invocations of LZ4_compress_HC_continue*() + */ +void LZ4_setCompressionLevel(LZ4_streamHC_t* LZ4_streamHCPtr, int compressionLevel); + +/*! LZ4_favorDecompressionSpeed() : v1.8.2 (experimental) + * Parser will select decisions favoring decompression over compression ratio. + * Only work at highest compression settings (level >= LZ4HC_CLEVEL_OPT_MIN) + */ +void LZ4_favorDecompressionSpeed(LZ4_streamHC_t* LZ4_streamHCPtr, int favor); + +/*! LZ4_resetStreamHC_fast() : + * When an LZ4_streamHC_t is known to be in a internally coherent state, + * it can often be prepared for a new compression with almost no work, only + * sometimes falling back to the full, expensive reset that is always required + * when the stream is in an indeterminate state (i.e., the reset performed by + * LZ4_resetStreamHC()). + * + * LZ4_streamHCs are guaranteed to be in a valid state when: + * - returned from LZ4_createStreamHC() + * - reset by LZ4_resetStreamHC() + * - memset(stream, 0, sizeof(LZ4_streamHC_t)) + * - the stream was in a valid state and was reset by LZ4_resetStreamHC_fast() + * - the stream was in a valid state and was then used in any compression call + * that returned success + * - the stream was in an indeterminate state and was used in a compression + * call that fully reset the state (LZ4_compress_HC_extStateHC()) and that + * returned success + */ +void LZ4_resetStreamHC_fast(LZ4_streamHC_t* LZ4_streamHCPtr, int compressionLevel); + +/*! LZ4_compress_HC_extStateHC_fastReset() : + * A variant of LZ4_compress_HC_extStateHC(). + * + * Using this variant avoids an expensive initialization step. It is only safe + * to call if the state buffer is known to be correctly initialized already + * (see above comment on LZ4_resetStreamHC_fast() for a definition of + * "correctly initialized"). From a high level, the difference is that this + * function initializes the provided state with a call to + * LZ4_resetStreamHC_fast() while LZ4_compress_HC_extStateHC() starts with a + * call to LZ4_resetStreamHC(). + */ +int LZ4_compress_HC_extStateHC_fastReset (void* state, const char* src, char* dst, int srcSize, int dstCapacity, int compressionLevel); + +/*! LZ4_attach_HC_dictionary() : + * This is an experimental API that allows for the efficient use of a + * static dictionary many times. + * + * Rather than re-loading the dictionary buffer into a working context before + * each compression, or copying a pre-loaded dictionary's LZ4_streamHC_t into a + * working LZ4_streamHC_t, this function introduces a no-copy setup mechanism, + * in which the working stream references the dictionary stream in-place. + * + * Several assumptions are made about the state of the dictionary stream. + * Currently, only streams which have been prepared by LZ4_loadDictHC() should + * be expected to work. + * + * Alternatively, the provided dictionary stream pointer may be NULL, in which + * case any existing dictionary stream is unset. + * + * A dictionary should only be attached to a stream without any history (i.e., + * a stream that has just been reset). + * + * The dictionary will remain attached to the working stream only for the + * current stream session. Calls to LZ4_resetStreamHC(_fast) will remove the + * dictionary context association from the working stream. The dictionary + * stream (and source buffer) must remain in-place / accessible / unchanged + * through the lifetime of the stream session. + */ +LZ4LIB_API void LZ4_attach_HC_dictionary(LZ4_streamHC_t *working_stream, const LZ4_streamHC_t *dictionary_stream); + +#if defined (__cplusplus) +} +#endif + +#endif /* LZ4_HC_SLO_098092834 */ +#endif /* LZ4_HC_STATIC_LINKING_ONLY */ diff --git a/r5dev/thirdparty/cppnet/cppkore_incl/LZ4_XXHash/xxhash.h b/r5dev/thirdparty/cppnet/cppkore_incl/LZ4_XXHash/xxhash.h new file mode 100644 index 00000000..870a6d91 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore_incl/LZ4_XXHash/xxhash.h @@ -0,0 +1,293 @@ +/* + xxHash - Extremely Fast Hash algorithm + Header File + Copyright (C) 2012-2016, Yann Collet. + + BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + You can contact the author at : + - xxHash source repository : https://github.com/Cyan4973/xxHash +*/ + +/* Notice extracted from xxHash homepage : + +xxHash is an extremely fast Hash algorithm, running at RAM speed limits. +It also successfully passes all tests from the SMHasher suite. + +Comparison (single thread, Windows Seven 32 bits, using SMHasher on a Core 2 Duo @3GHz) + +Name Speed Q.Score Author +xxHash 5.4 GB/s 10 +CrapWow 3.2 GB/s 2 Andrew +MumurHash 3a 2.7 GB/s 10 Austin Appleby +SpookyHash 2.0 GB/s 10 Bob Jenkins +SBox 1.4 GB/s 9 Bret Mulvey +Lookup3 1.2 GB/s 9 Bob Jenkins +SuperFastHash 1.2 GB/s 1 Paul Hsieh +CityHash64 1.05 GB/s 10 Pike & Alakuijala +FNV 0.55 GB/s 5 Fowler, Noll, Vo +CRC32 0.43 GB/s 9 +MD5-32 0.33 GB/s 10 Ronald L. Rivest +SHA1-32 0.28 GB/s 10 + +Q.Score is a measure of quality of the hash function. +It depends on successfully passing SMHasher test set. +10 is a perfect score. + +A 64-bits version, named XXH64, is available since r35. +It offers much better speed, but for 64-bits applications only. +Name Speed on 64 bits Speed on 32 bits +XXH64 13.8 GB/s 1.9 GB/s +XXH32 6.8 GB/s 6.0 GB/s +*/ + +#ifndef XXHASH_H_5627135585666179 +#define XXHASH_H_5627135585666179 1 + +#if defined (__cplusplus) +extern "C" { +#endif + + +/* **************************** +* Definitions +******************************/ +#include /* size_t */ +typedef enum { XXH_OK=0, XXH_ERROR } XXH_errorcode; + + +/* **************************** +* API modifier +******************************/ +/** XXH_PRIVATE_API +* This is useful to include xxhash functions in `static` mode +* in order to inline them, and remove their symbol from the public list. +* Methodology : +* #define XXH_PRIVATE_API +* #include "xxhash.h" +* `xxhash.c` is automatically included. +* It's not useful to compile and link it as a separate module. +*/ +#ifdef XXH_PRIVATE_API +# ifndef XXH_STATIC_LINKING_ONLY +# define XXH_STATIC_LINKING_ONLY +# endif +# if defined(__GNUC__) +# define XXH_PUBLIC_API static __inline __attribute__((unused)) +# elif defined (__cplusplus) || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) +# define XXH_PUBLIC_API static inline +# elif defined(_MSC_VER) +# define XXH_PUBLIC_API static __inline +# else +# define XXH_PUBLIC_API static /* this version may generate warnings for unused static functions; disable the relevant warning */ +# endif +#else +# define XXH_PUBLIC_API /* do nothing */ +#endif /* XXH_PRIVATE_API */ + +/*!XXH_NAMESPACE, aka Namespace Emulation : + +If you want to include _and expose_ xxHash functions from within your own library, +but also want to avoid symbol collisions with other libraries which may also include xxHash, + +you can use XXH_NAMESPACE, to automatically prefix any public symbol from xxhash library +with the value of XXH_NAMESPACE (therefore, avoid NULL and numeric values). + +Note that no change is required within the calling program as long as it includes `xxhash.h` : +regular symbol name will be automatically translated by this header. +*/ +#ifdef XXH_NAMESPACE +# define XXH_CAT(A,B) A##B +# define XXH_NAME2(A,B) XXH_CAT(A,B) +# define XXH_versionNumber XXH_NAME2(XXH_NAMESPACE, XXH_versionNumber) +# define XXH32 XXH_NAME2(XXH_NAMESPACE, XXH32) +# define XXH32_createState XXH_NAME2(XXH_NAMESPACE, XXH32_createState) +# define XXH32_freeState XXH_NAME2(XXH_NAMESPACE, XXH32_freeState) +# define XXH32_reset XXH_NAME2(XXH_NAMESPACE, XXH32_reset) +# define XXH32_update XXH_NAME2(XXH_NAMESPACE, XXH32_update) +# define XXH32_digest XXH_NAME2(XXH_NAMESPACE, XXH32_digest) +# define XXH32_copyState XXH_NAME2(XXH_NAMESPACE, XXH32_copyState) +# define XXH32_canonicalFromHash XXH_NAME2(XXH_NAMESPACE, XXH32_canonicalFromHash) +# define XXH32_hashFromCanonical XXH_NAME2(XXH_NAMESPACE, XXH32_hashFromCanonical) +# define XXH64 XXH_NAME2(XXH_NAMESPACE, XXH64) +# define XXH64_createState XXH_NAME2(XXH_NAMESPACE, XXH64_createState) +# define XXH64_freeState XXH_NAME2(XXH_NAMESPACE, XXH64_freeState) +# define XXH64_reset XXH_NAME2(XXH_NAMESPACE, XXH64_reset) +# define XXH64_update XXH_NAME2(XXH_NAMESPACE, XXH64_update) +# define XXH64_digest XXH_NAME2(XXH_NAMESPACE, XXH64_digest) +# define XXH64_copyState XXH_NAME2(XXH_NAMESPACE, XXH64_copyState) +# define XXH64_canonicalFromHash XXH_NAME2(XXH_NAMESPACE, XXH64_canonicalFromHash) +# define XXH64_hashFromCanonical XXH_NAME2(XXH_NAMESPACE, XXH64_hashFromCanonical) +#endif + + +/* ************************************* +* Version +***************************************/ +#define XXH_VERSION_MAJOR 0 +#define XXH_VERSION_MINOR 6 +#define XXH_VERSION_RELEASE 2 +#define XXH_VERSION_NUMBER (XXH_VERSION_MAJOR *100*100 + XXH_VERSION_MINOR *100 + XXH_VERSION_RELEASE) +XXH_PUBLIC_API unsigned XXH_versionNumber (void); + + +/*-********************************************************************** +* 32-bits hash +************************************************************************/ +typedef unsigned int XXH32_hash_t; + +/*! XXH32() : + Calculate the 32-bits hash of sequence "length" bytes stored at memory address "input". + The memory between input & input+length must be valid (allocated and read-accessible). + "seed" can be used to alter the result predictably. + Speed on Core 2 Duo @ 3 GHz (single thread, SMHasher benchmark) : 5.4 GB/s */ +XXH_PUBLIC_API XXH32_hash_t XXH32 (const void* input, size_t length, unsigned int seed); + +/*====== Streaming ======*/ +typedef struct XXH32_state_s XXH32_state_t; /* incomplete type */ +XXH_PUBLIC_API XXH32_state_t* XXH32_createState(void); +XXH_PUBLIC_API XXH_errorcode XXH32_freeState(XXH32_state_t* statePtr); +XXH_PUBLIC_API void XXH32_copyState(XXH32_state_t* dst_state, const XXH32_state_t* src_state); + +XXH_PUBLIC_API XXH_errorcode XXH32_reset (XXH32_state_t* statePtr, unsigned int seed); +XXH_PUBLIC_API XXH_errorcode XXH32_update (XXH32_state_t* statePtr, const void* input, size_t length); +XXH_PUBLIC_API XXH32_hash_t XXH32_digest (const XXH32_state_t* statePtr); + +/* +These functions generate the xxHash of an input provided in multiple segments. +Note that, for small input, they are slower than single-call functions, due to state management. +For small input, prefer `XXH32()` and `XXH64()` . + +XXH state must first be allocated, using XXH*_createState() . + +Start a new hash by initializing state with a seed, using XXH*_reset(). + +Then, feed the hash state by calling XXH*_update() as many times as necessary. +Obviously, input must be allocated and read accessible. +The function returns an error code, with 0 meaning OK, and any other value meaning there is an error. + +Finally, a hash value can be produced anytime, by using XXH*_digest(). +This function returns the nn-bits hash as an int or long long. + +It's still possible to continue inserting input into the hash state after a digest, +and generate some new hashes later on, by calling again XXH*_digest(). + +When done, free XXH state space if it was allocated dynamically. +*/ + +/*====== Canonical representation ======*/ + +typedef struct { unsigned char digest[4]; } XXH32_canonical_t; +XXH_PUBLIC_API void XXH32_canonicalFromHash(XXH32_canonical_t* dst, XXH32_hash_t hash); +XXH_PUBLIC_API XXH32_hash_t XXH32_hashFromCanonical(const XXH32_canonical_t* src); + +/* Default result type for XXH functions are primitive unsigned 32 and 64 bits. +* The canonical representation uses human-readable write convention, aka big-endian (large digits first). +* These functions allow transformation of hash result into and from its canonical format. +* This way, hash values can be written into a file / memory, and remain comparable on different systems and programs. +*/ + + +#ifndef XXH_NO_LONG_LONG +/*-********************************************************************** +* 64-bits hash +************************************************************************/ +typedef unsigned long long XXH64_hash_t; + +/*! XXH64() : + Calculate the 64-bits hash of sequence of length "len" stored at memory address "input". + "seed" can be used to alter the result predictably. + This function runs faster on 64-bits systems, but slower on 32-bits systems (see benchmark). +*/ +XXH_PUBLIC_API XXH64_hash_t XXH64 (const void* input, size_t length, unsigned long long seed); + +/*====== Streaming ======*/ +typedef struct XXH64_state_s XXH64_state_t; /* incomplete type */ +XXH_PUBLIC_API XXH64_state_t* XXH64_createState(void); +XXH_PUBLIC_API XXH_errorcode XXH64_freeState(XXH64_state_t* statePtr); +XXH_PUBLIC_API void XXH64_copyState(XXH64_state_t* dst_state, const XXH64_state_t* src_state); + +XXH_PUBLIC_API XXH_errorcode XXH64_reset (XXH64_state_t* statePtr, unsigned long long seed); +XXH_PUBLIC_API XXH_errorcode XXH64_update (XXH64_state_t* statePtr, const void* input, size_t length); +XXH_PUBLIC_API XXH64_hash_t XXH64_digest (const XXH64_state_t* statePtr); + +/*====== Canonical representation ======*/ +typedef struct { unsigned char digest[8]; } XXH64_canonical_t; +XXH_PUBLIC_API void XXH64_canonicalFromHash(XXH64_canonical_t* dst, XXH64_hash_t hash); +XXH_PUBLIC_API XXH64_hash_t XXH64_hashFromCanonical(const XXH64_canonical_t* src); +#endif /* XXH_NO_LONG_LONG */ + + +#ifdef XXH_STATIC_LINKING_ONLY + +/* ================================================================================================ + This section contains definitions which are not guaranteed to remain stable. + They may change in future versions, becoming incompatible with a different version of the library. + They shall only be used with static linking. + Never use these definitions in association with dynamic linking ! +=================================================================================================== */ + +/* These definitions are only meant to allow allocation of XXH state + statically, on stack, or in a struct for example. + Do not use members directly. */ + + struct XXH32_state_s { + unsigned total_len_32; + unsigned large_len; + unsigned v1; + unsigned v2; + unsigned v3; + unsigned v4; + unsigned mem32[4]; /* buffer defined as U32 for alignment */ + unsigned memsize; + unsigned reserved; /* never read nor write, will be removed in a future version */ + }; /* typedef'd to XXH32_state_t */ + +#ifndef XXH_NO_LONG_LONG + struct XXH64_state_s { + unsigned long long total_len; + unsigned long long v1; + unsigned long long v2; + unsigned long long v3; + unsigned long long v4; + unsigned long long mem64[4]; /* buffer defined as U64 for alignment */ + unsigned memsize; + unsigned reserved[2]; /* never read nor write, will be removed in a future version */ + }; /* typedef'd to XXH64_state_t */ +#endif + +# ifdef XXH_PRIVATE_API +# include "xxhash.c" /* include xxhash function bodies as `static`, for inlining */ +# endif + +#endif /* XXH_STATIC_LINKING_ONLY */ + + +#if defined (__cplusplus) +} +#endif + +#endif /* XXHASH_H_5627135585666179 */ diff --git a/r5dev/thirdparty/cppnet/cppkore_incl/LZHAM/lzham.h b/r5dev/thirdparty/cppnet/cppkore_incl/LZHAM/lzham.h new file mode 100644 index 00000000..33727bec --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore_incl/LZHAM/lzham.h @@ -0,0 +1,779 @@ +// File: lzham.h - Copyright (c) 2009-2012 Richard Geldreich, Jr. +// LZHAM uses the MIT License. See Copyright Notice and license at the end of this file. +// +// This is the main header file, includable from C or C++ files, which defines all the publically available API's, structs, and types used by the LZHAM codec. +// +// Notes: +// +// As of LZHAM alpha8, there are now two sets of API's: +// - The first (oldest) API directly exposes all of the codec's functionality. See lzham_compress_init(), lzham_decompress_init(), etc. This API has the lowest overhead +// and is the most tested. +// - The new API implements the most useful/popular subset of the zlib API, but doesn't expose all of the codec's functionality yet. See the lzham_z* functions. +// This functionality is provided because most users of compression libraries are already very familiar with the nuts and bolts of the zlib API. +// For the most common zlib usage cases LZHAM is an almost drop-in replacement for zlib. To make switching from zlib even easier, you can define the LZHAM_DEFINE_ZLIB_API macro, +// which causes this header to #define most zlib symbols to their LZHAM equivalents. +// Note that LZHAM does not actually implement the deflate/inflate algorithm, so it cannot decompress streams created by standard zlib yet (and of course, zlib cannot decompress +// streams created by LZHAM). Internally, this API is mostly implemented via the older low-level LZHAM API. + +#ifndef __LZHAM_H__ +#define __LZHAM_H__ + +#ifdef _MSC_VER +#pragma once +#endif + +#include + +// Upper byte = major version +// Lower byte = minor version +#define LZHAM_DLL_VERSION 0x1010 + +#if defined(_WIN64) || defined(__MINGW64__) || defined(_LP64) || defined(__LP64__) + #define LZHAM_64BIT 1 +#endif + +#if defined(_MSC_VER) + #define LZHAM_CDECL __cdecl +#else + #define LZHAM_CDECL +#endif + +#ifdef LZHAM_EXPORTS + #define LZHAM_DLL_EXPORT __declspec(dllexport) +#else + #define LZHAM_DLL_EXPORT +#endif + +#ifdef __cplusplus +extern "C" { +#endif + + typedef unsigned char lzham_uint8; + typedef signed int lzham_int32; + typedef unsigned int lzham_uint32; + typedef unsigned int lzham_bool; + + // Returns DLL version (LZHAM_DLL_VERSION). + LZHAM_DLL_EXPORT lzham_uint32 LZHAM_CDECL lzham_get_version(void); + + // User provided memory allocation + + // Custom allocation function must return pointers with LZHAM_MIN_ALLOC_ALIGNMENT (or better). + #define LZHAM_MIN_ALLOC_ALIGNMENT sizeof(size_t) * 2 + + typedef void* (LZHAM_CDECL *lzham_realloc_func)(void* p, size_t size, size_t* pActual_size, lzham_bool movable, void* pUser_data); + typedef size_t (LZHAM_CDECL *lzham_msize_func)(void* p, void* pUser_data); + + // Call this function to force LZHAM to use custom memory malloc(), realloc(), free() and msize functions. + LZHAM_DLL_EXPORT void LZHAM_CDECL lzham_set_memory_callbacks(lzham_realloc_func pRealloc, lzham_msize_func pMSize, void* pUser_data); + + // lzham_flush_t must map directly to the zlib-style API flush types (LZHAM_Z_NO_FLUSH, etc.) + typedef enum + { + LZHAM_NO_FLUSH = 0, + LZHAM_SYNC_FLUSH = 2, + LZHAM_FULL_FLUSH = 3, + LZHAM_FINISH = 4, + LZHAM_TABLE_FLUSH = 10 + } lzham_flush_t; + + // Compression (keep in sync with g_num_lzx_position_slots[]) + #define LZHAM_MIN_DICT_SIZE_LOG2 15 + #define LZHAM_MAX_DICT_SIZE_LOG2_X86 26 + #define LZHAM_MAX_DICT_SIZE_LOG2_X64 29 + + #define LZHAM_MAX_HELPER_THREADS 64 + + typedef enum + { + LZHAM_COMP_STATUS_NOT_FINISHED = 0, + LZHAM_COMP_STATUS_NEEDS_MORE_INPUT, + LZHAM_COMP_STATUS_HAS_MORE_OUTPUT, + + // All the following enums must indicate failure/success. + + LZHAM_COMP_STATUS_FIRST_SUCCESS_OR_FAILURE_CODE, + LZHAM_COMP_STATUS_SUCCESS = LZHAM_COMP_STATUS_FIRST_SUCCESS_OR_FAILURE_CODE, + + LZHAM_COMP_STATUS_FIRST_FAILURE_CODE, + LZHAM_COMP_STATUS_FAILED = LZHAM_COMP_STATUS_FIRST_FAILURE_CODE, + LZHAM_COMP_STATUS_FAILED_INITIALIZING, + LZHAM_COMP_STATUS_INVALID_PARAMETER, + LZHAM_COMP_STATUS_OUTPUT_BUF_TOO_SMALL, + + LZHAM_COMP_STATUS_FORCE_DWORD = 0xFFFFFFFF + } lzham_compress_status_t; + + typedef enum + { + LZHAM_COMP_LEVEL_FASTEST = 0, + LZHAM_COMP_LEVEL_FASTER, + LZHAM_COMP_LEVEL_DEFAULT, + LZHAM_COMP_LEVEL_BETTER, + LZHAM_COMP_LEVEL_UBER, + + LZHAM_TOTAL_COMP_LEVELS, + + LZHAM_COMP_LEVEL_FORCE_DWORD = 0xFFFFFFFF + } lzham_compress_level; + + // Streaming compression + typedef void *lzham_compress_state_ptr; + + typedef enum + { + LZHAM_COMP_FLAG_EXTREME_PARSING = 2, // Improves ratio by allowing the compressor's parse graph to grow "higher" (up to 4 parent nodes per output node), but is much slower. + LZHAM_COMP_FLAG_DETERMINISTIC_PARSING = 4, // Guarantees that the compressed output will always be the same given the same input and parameters (no variation between runs due to kernel threading scheduling). + + // If enabled, the compressor is free to use any optimizations which could lower the decompression rate (such + // as adaptively resetting the Huffman table update rate to maximum frequency, which is costly for the decompressor). + LZHAM_COMP_FLAG_TRADEOFF_DECOMPRESSION_RATE_FOR_COMP_RATIO = 16, + + LZHAM_COMP_FLAG_WRITE_ZLIB_STREAM = 32, + } lzham_compress_flags; + + typedef enum + { + LZHAM_INSANELY_SLOW_TABLE_UPDATE_RATE = 1, // 1=insanely slow decompression, here for reference, use 2! + LZHAM_SLOWEST_TABLE_UPDATE_RATE = 2, + LZHAM_DEFAULT_TABLE_UPDATE_RATE = 8, + LZHAM_FASTEST_TABLE_UPDATE_RATE = 20 + } lzham_table_update_rate; + + // Compression parameters struct. + // IMPORTANT: The values of m_dict_size_log2, m_table_update_rate, m_table_max_update_interval, and m_table_update_interval_slow_rate MUST + // match during compression and decompression. The codec does not verify these values for you, if you don't use the same settings during + // decompression it will fail (usually with a LZHAM_DECOMP_STATUS_FAILED_BAD_CODE error). + // The seed buffer's contents and size must match the seed buffer used during decompression. + typedef struct + { + lzham_uint32 m_struct_size; // set to sizeof(lzham_compress_params) + lzham_uint32 m_dict_size_log2; // set to the log2(dictionary_size), must range between [LZHAM_MIN_DICT_SIZE_LOG2, LZHAM_MAX_DICT_SIZE_LOG2_X86] for x86 LZHAM_MAX_DICT_SIZE_LOG2_X64 for x64 + lzham_compress_level m_level; // set to LZHAM_COMP_LEVEL_FASTEST, etc. + lzham_uint32 m_table_update_rate; // Controls tradeoff between ratio and decompression throughput. 0=default, or [1,LZHAM_MAX_TABLE_UPDATE_RATE], higher=faster but lower ratio. + lzham_int32 m_max_helper_threads; // max # of additional "helper" threads to create, must range between [-1,LZHAM_MAX_HELPER_THREADS], where -1=max practical + lzham_uint32 m_compress_flags; // optional compression flags (see lzham_compress_flags enum) + lzham_uint32 m_num_seed_bytes; // for delta compression (optional) - number of seed bytes pointed to by m_pSeed_bytes + const void *m_pSeed_bytes; // for delta compression (optional) - pointer to seed bytes buffer, must be at least m_num_seed_bytes long + + // Advanced settings - set to 0 if you don't care. + // m_table_max_update_interval/m_table_update_interval_slow_rate override m_table_update_rate and allow finer control over the table update settings. + // If either are non-zero they will override whatever m_table_update_rate is set to. Just leave them 0 unless you are specifically customizing them for your data. + + // def=0, typical range 12-128 (LZHAM_DEFAULT_TABLE_UPDATE_RATE=64), controls the max interval between table updates, higher=longer max interval (faster decode/lower ratio). Was 16 in prev. releases. + lzham_uint32 m_table_max_update_interval; + // def=0, 32 or higher (LZHAM_DEFAULT_TABLE_UPDATE_RATE=64), scaled by 32, controls the slowing of the update update freq, higher=more rapid slowing (faster decode/lower ratio). Was 40 in prev. releases. + lzham_uint32 m_table_update_interval_slow_rate; + + } lzham_compress_params; + + // Initializes a compressor. Returns a pointer to the compressor's internal state, or NULL on failure. + // pParams cannot be NULL. Be sure to initialize the pParams->m_struct_size member to sizeof(lzham_compress_params) (along with the other members to reasonable values) before calling this function. + LZHAM_DLL_EXPORT lzham_compress_state_ptr LZHAM_CDECL lzham_compress_init(const lzham_compress_params *pParams); + + LZHAM_DLL_EXPORT lzham_compress_state_ptr LZHAM_CDECL lzham_compress_reinit(lzham_compress_state_ptr pState); + + // Deinitializes a compressor, releasing all allocated memory. + // returns adler32 of source data (valid only on success). + LZHAM_DLL_EXPORT lzham_uint32 LZHAM_CDECL lzham_compress_deinit(lzham_compress_state_ptr pState); + + // Compresses an arbitrarily sized block of data, writing as much available compressed data as possible to the output buffer. + // This method may be called as many times as needed, but for best perf. try not to call it with tiny buffers. + // pState - Pointer to internal compression state, created by lzham_compress_init. + // pIn_buf, pIn_buf_size - Pointer to input data buffer, and pointer to a size_t containing the number of bytes available in this buffer. + // On return, *pIn_buf_size will be set to the number of bytes read from the buffer. + // pOut_buf, pOut_buf_size - Pointer to the output data buffer, and a pointer to a size_t containing the max number of bytes that can be written to this buffer. + // On return, *pOut_buf_size will be set to the number of bytes written to this buffer. + // no_more_input_bytes_flag - Set to true to indicate that no more input bytes are available to compress (EOF). Once you call this function with this param set to true, it must stay set to true in all future calls. + // + // Normal return status codes: + // LZHAM_COMP_STATUS_NOT_FINISHED - Compression can continue, but the compressor needs more input, or it needs more room in the output buffer. + // LZHAM_COMP_STATUS_NEEDS_MORE_INPUT - Compression can contintue, but the compressor has no more output, and has no input but we're not at EOF. Supply more input to continue. + // Success/failure return status codes: + // LZHAM_COMP_STATUS_SUCCESS - Compression has completed successfully. + // LZHAM_COMP_STATUS_FAILED, LZHAM_COMP_STATUS_FAILED_INITIALIZING, LZHAM_COMP_STATUS_INVALID_PARAMETER - Something went wrong. + LZHAM_DLL_EXPORT lzham_compress_status_t LZHAM_CDECL lzham_compress( + lzham_compress_state_ptr pState, + const lzham_uint8 *pIn_buf, size_t *pIn_buf_size, + lzham_uint8 *pOut_buf, size_t *pOut_buf_size, + lzham_bool no_more_input_bytes_flag); + + LZHAM_DLL_EXPORT lzham_compress_status_t LZHAM_CDECL lzham_compress2( + lzham_compress_state_ptr pState, + const lzham_uint8 *pIn_buf, size_t *pIn_buf_size, + lzham_uint8 *pOut_buf, size_t *pOut_buf_size, + lzham_flush_t flush_type); + + // Single function call compression interface. + // Same return codes as lzham_compress, except this function can also return LZHAM_COMP_STATUS_OUTPUT_BUF_TOO_SMALL. + LZHAM_DLL_EXPORT lzham_compress_status_t LZHAM_CDECL lzham_compress_memory( + const lzham_compress_params *pParams, + lzham_uint8* pDst_buf, + size_t *pDst_len, + const lzham_uint8* pSrc_buf, + size_t src_len, + lzham_uint32 *pAdler32); + + // Decompression + typedef enum + { + // LZHAM_DECOMP_STATUS_NOT_FINISHED indicates that the decompressor is flushing its internal buffer to the caller's output buffer. + // There may be more bytes available to decompress on the next call, but there is no guarantee. + LZHAM_DECOMP_STATUS_NOT_FINISHED = 0, + + // LZHAM_DECOMP_STATUS_HAS_MORE_OUTPUT indicates that the decompressor is trying to flush its internal buffer to the caller's output buffer, + // but the caller hasn't provided any space to copy this data to the caller's output buffer. Call the lzham_decompress() again with a non-empty sized output buffer. + LZHAM_DECOMP_STATUS_HAS_MORE_OUTPUT, + + // LZHAM_DECOMP_STATUS_NEEDS_MORE_INPUT indicates that the decompressor has consumed all input bytes, has not encountered an "end of stream" code, + // and the caller hasn't set no_more_input_bytes_flag to true, so it's expecting more input to proceed. + LZHAM_DECOMP_STATUS_NEEDS_MORE_INPUT, + + // All the following enums always (and MUST) indicate failure/success. + LZHAM_DECOMP_STATUS_FIRST_SUCCESS_OR_FAILURE_CODE, + + // LZHAM_DECOMP_STATUS_SUCCESS indicates decompression has successfully completed. + LZHAM_DECOMP_STATUS_SUCCESS = LZHAM_DECOMP_STATUS_FIRST_SUCCESS_OR_FAILURE_CODE, + + // The remaining status codes indicate a failure of some sort. Most failures are unrecoverable. TODO: Document which codes are recoverable. + LZHAM_DECOMP_STATUS_FIRST_FAILURE_CODE, + + LZHAM_DECOMP_STATUS_FAILED_INITIALIZING = LZHAM_DECOMP_STATUS_FIRST_FAILURE_CODE, + LZHAM_DECOMP_STATUS_FAILED_DEST_BUF_TOO_SMALL, + LZHAM_DECOMP_STATUS_FAILED_EXPECTED_MORE_RAW_BYTES, + LZHAM_DECOMP_STATUS_FAILED_BAD_CODE, + LZHAM_DECOMP_STATUS_FAILED_ADLER32, + LZHAM_DECOMP_STATUS_FAILED_BAD_RAW_BLOCK, + LZHAM_DECOMP_STATUS_FAILED_BAD_COMP_BLOCK_SYNC_CHECK, + LZHAM_DECOMP_STATUS_FAILED_BAD_ZLIB_HEADER, + LZHAM_DECOMP_STATUS_FAILED_NEED_SEED_BYTES, + LZHAM_DECOMP_STATUS_FAILED_BAD_SEED_BYTES, + LZHAM_DECOMP_STATUS_FAILED_BAD_SYNC_BLOCK, + LZHAM_DECOMP_STATUS_INVALID_PARAMETER, + } lzham_decompress_status_t; + + typedef void *lzham_decompress_state_ptr; + + typedef enum + { + LZHAM_DECOMP_FLAG_OUTPUT_UNBUFFERED = 1, + LZHAM_DECOMP_FLAG_COMPUTE_ADLER32 = 2, + LZHAM_DECOMP_FLAG_READ_ZLIB_STREAM = 4, + } lzham_decompress_flags; + + // Decompression parameters structure. + // Notes: + // m_dict_size_log2 MUST match the value used during compression! + // If m_num_seed_bytes != 0, LZHAM_DECOMP_FLAG_OUTPUT_UNBUFFERED must not be set (i.e. static "seed" dictionaries are not compatible with unbuffered decompression). + // The seed buffer's contents and size must match the seed buffer used during compression. + // m_table_update_rate (or m_table_max_update_interval/m_table_update_interval_slow_rate) MUST match the values used for compression! + typedef struct + { + lzham_uint32 m_struct_size; // set to sizeof(lzham_decompress_params) + lzham_uint32 m_dict_size_log2; // set to the log2(dictionary_size), must range between [LZHAM_MIN_DICT_SIZE_LOG2, LZHAM_MAX_DICT_SIZE_LOG2_X86] for x86 LZHAM_MAX_DICT_SIZE_LOG2_X64 for x64 + lzham_uint32 m_table_update_rate; // Controls tradeoff between ratio and decompression throughput. 0=default, or [1,LZHAM_MAX_TABLE_UPDATE_RATE], higher=faster but lower ratio. + lzham_uint32 m_decompress_flags; // optional decompression flags (see lzham_decompress_flags enum) + lzham_uint32 m_num_seed_bytes; // for delta compression (optional) - number of seed bytes pointed to by m_pSeed_bytes + const void *m_pSeed_bytes; // for delta compression (optional) - pointer to seed bytes buffer, must be at least m_num_seed_bytes long + + // Advanced settings - set to 0 if you don't care. + // m_table_max_update_interval/m_table_update_interval_slow_rate override m_table_update_rate and allow finer control over the table update settings. + // If either are non-zero they will override whatever m_table_update_rate is set to. Just leave them 0 unless you are specifically customizing them for your data. + + // def=0, typical range 12-128 (LZHAM_DEFAULT_TABLE_UPDATE_RATE=64), controls the max interval between table updates, higher=longer max interval (faster decode/lower ratio). Was 16 in prev. releases. + lzham_uint32 m_table_max_update_interval; + // def=0, 32 or higher (LZHAM_DEFAULT_TABLE_UPDATE_RATE=64), scaled by 32, controls the slowing of the update update freq, higher=more rapid slowing (faster decode/lower ratio). Was 40 in prev. releases. + lzham_uint32 m_table_update_interval_slow_rate; + + } lzham_decompress_params; + + // Initializes a decompressor. + // pParams cannot be NULL. Be sure to initialize the pParams->m_struct_size member to sizeof(lzham_decompress_params) (along with the other members to reasonable values) before calling this function. + // Note: With large dictionaries this function could take a while (due to memory allocation). To serially decompress multiple streams, it's faster to init a compressor once and + // reuse it using by calling lzham_decompress_reinit(). + LZHAM_DLL_EXPORT lzham_decompress_state_ptr LZHAM_CDECL lzham_decompress_init(const lzham_decompress_params *pParams); + + // Quickly re-initializes the decompressor to its initial state given an already allocated/initialized state (doesn't do any memory alloc unless necessary). + LZHAM_DLL_EXPORT lzham_decompress_state_ptr LZHAM_CDECL lzham_decompress_reinit(lzham_decompress_state_ptr pState, const lzham_decompress_params *pParams); + + // Deinitializes a decompressor. + // returns adler32 of decompressed data if compute_adler32 was true, otherwise it returns the adler32 from the compressed stream. + LZHAM_DLL_EXPORT lzham_uint32 LZHAM_CDECL lzham_decompress_deinit(lzham_decompress_state_ptr pState); + + // Decompresses an arbitrarily sized block of compressed data, writing as much available decompressed data as possible to the output buffer. + // This method is implemented as a coroutine so it may be called as many times as needed. However, for best perf. try not to call it with tiny buffers. + // pState - Pointer to internal decompression state, originally created by lzham_decompress_init. + // pIn_buf, pIn_buf_size - Pointer to input data buffer, and pointer to a size_t containing the number of bytes available in this buffer. + // On return, *pIn_buf_size will be set to the number of bytes read from the buffer. + // pOut_buf, pOut_buf_size - Pointer to the output data buffer, and a pointer to a size_t containing the max number of bytes that can be written to this buffer. + // On return, *pOut_buf_size will be set to the number of bytes written to this buffer. + // no_more_input_bytes_flag - Set to true to indicate that no more input bytes are available to compress (EOF). Once you call this function with this param set to true, it must stay set to true in all future calls. + // Notes: + // In unbuffered mode, the output buffer MUST be large enough to hold the entire decompressed stream. Otherwise, you'll receive the + // LZHAM_DECOMP_STATUS_FAILED_DEST_BUF_TOO_SMALL error (which is currently unrecoverable during unbuffered decompression). + // In buffered mode, if the output buffer's size is 0 bytes, the caller is indicating that no more output bytes are expected from the + // decompressor. In this case, if the decompressor actually has more bytes you'll receive the LZHAM_DECOMP_STATUS_HAS_MORE_OUTPUT + // error (which is recoverable in the buffered case - just call lzham_decompress() again with a non-zero size output buffer). + LZHAM_DLL_EXPORT lzham_decompress_status_t LZHAM_CDECL lzham_decompress( + lzham_decompress_state_ptr pState, + const lzham_uint8 *pIn_buf, size_t *pIn_buf_size, + lzham_uint8 *pOut_buf, size_t *pOut_buf_size, + lzham_bool no_more_input_bytes_flag); + + // Single function call interface. + LZHAM_DLL_EXPORT lzham_decompress_status_t LZHAM_CDECL lzham_decompress_memory( + const lzham_decompress_params *pParams, + lzham_uint8* pDst_buf, + size_t *pDst_len, + const lzham_uint8* pSrc_buf, + size_t src_len, + lzham_uint32 *pAdler32); + + // ------------------- zlib-style API Definitions. + + // Important note: LZHAM doesn't internally support the Deflate algorithm, but for API compatibility the "Deflate" and "Inflate" names are retained here. + + typedef unsigned long lzham_z_ulong; + + // Heap allocation callbacks. + // Note that lzham_alloc_func parameter types purposely differ from zlib's: items/size is size_t, not unsigned long. + typedef void *(*lzham_z_alloc_func)(void *opaque, size_t items, size_t size); + typedef void (*lzham_z_free_func)(void *opaque, void *address); + typedef void *(*lzham_z_realloc_func)(void *opaque, void *address, size_t items, size_t size); + + #define LZHAM_Z_ADLER32_INIT (1) + // lzham_adler32() returns the initial adler-32 value to use when called with ptr==NULL. + LZHAM_DLL_EXPORT lzham_z_ulong lzham_z_adler32(lzham_z_ulong adler, const unsigned char *ptr, size_t buf_len); + + #define LZHAM_Z_CRC32_INIT (0) + // lzham_crc32() returns the initial CRC-32 value to use when called with ptr==NULL. + LZHAM_DLL_EXPORT lzham_z_ulong lzham_z_crc32(lzham_z_ulong crc, const unsigned char *ptr, size_t buf_len); + + // Compression strategies. + enum + { + LZHAM_Z_DEFAULT_STRATEGY = 0, + LZHAM_Z_FILTERED = 1, + LZHAM_Z_HUFFMAN_ONLY = 2, + LZHAM_Z_RLE = 3, + LZHAM_Z_FIXED = 4 + }; + + // Method + #define LZHAM_Z_DEFLATED 8 + #define LZHAM_Z_LZHAM 14 + + #define LZHAM_Z_VERSION "10.8.1" + #define LZHAM_Z_VERNUM 0xA810 + #define LZHAM_Z_VER_MAJOR 10 + #define LZHAM_Z_VER_MINOR 8 + #define LZHAM_Z_VER_REVISION 1 + #define LZHAM_Z_VER_SUBREVISION 0 + + // Flush values. + // For compression, you typically only need to use LZHAM_NO_FLUSH and LZHAM_FINISH. + // LZHAM_Z_SYNC_FLUSH and LZHAM_Z_FULL_FLUSH during compression forces compression of all buffered input. + // + // For decompression, you typically only need to use LZHAM_Z_SYNC_FLUSH or LZHAM_Z_FINISH. + // LZHAM_Z_FINISH during decompression guarantees that the output buffer is large enough to hold all remaining data to decompress. + // See http://www.bolet.org/~pornin/deflate-flush.html + // Must directly map to lzham_flush_t + enum + { + LZHAM_Z_NO_FLUSH = 0, // compression/decompression + LZHAM_Z_PARTIAL_FLUSH = 1, // compression/decompression, same as LZHAM_Z_SYNC_FLUSH + LZHAM_Z_SYNC_FLUSH = 2, // compression/decompression, when compressing: flush current block (if any), always outputs sync block (aligns output to byte boundary, a 0xFFFF0000 marker will appear in the output stream) + LZHAM_Z_FULL_FLUSH = 3, // compression/decompression, when compressing: same as LZHAM_Z_SYNC_FLUSH but also forces a full state flush (LZ dictionary, all symbol statistics) + LZHAM_Z_FINISH = 4, // compression/decompression + LZHAM_Z_BLOCK = 5, // not supported + LZHAM_Z_TABLE_FLUSH = 10 // compression only, resets all symbol table update rates to maximum frequency (LZHAM extension) + }; + + // Return status codes. LZHAM_Z_PARAM_ERROR is non-standard. + enum + { + LZHAM_Z_OK = 0, + LZHAM_Z_STREAM_END = 1, + LZHAM_Z_NEED_DICT = 2, + LZHAM_Z_ERRNO = -1, + LZHAM_Z_STREAM_ERROR = -2, + LZHAM_Z_DATA_ERROR = -3, + LZHAM_Z_MEM_ERROR = -4, + LZHAM_Z_BUF_ERROR = -5, + LZHAM_Z_VERSION_ERROR = -6, + LZHAM_Z_PARAM_ERROR = -10000 + }; + + // Compression levels. + enum + { + LZHAM_Z_NO_COMPRESSION = 0, + LZHAM_Z_BEST_SPEED = 1, + LZHAM_Z_BEST_COMPRESSION = 9, + LZHAM_Z_UBER_COMPRESSION = 10, // uber = best with extreme parsing (can be very slow) + LZHAM_Z_DEFAULT_COMPRESSION = -1 + }; + + // Window bits + // Important note: The zlib-style API's default to 32KB dictionary for API compatibility. For improved compression, be sure to call deflateInit2/inflateInit2 and specify larger custom window_bits values! + // If changing the calling code isn't practical, unremark LZHAM_Z_API_FORCE_WINDOW_BITS. + #define LZHAM_Z_DEFAULT_WINDOW_BITS 15 + + // Define LZHAM_Z_API_FORCE_WINDOW_BITS to force the entire library to use a constant value for window_bits (helps with porting) in all zlib API's. + //#define LZHAM_Z_API_FORCE_WINDOW_BITS 23 + + // Data types + #define LZHAM_Z_BINARY 0 + #define LZHAM_Z_TEXT 1 + #define LZHAM_Z_ASCII 1 + #define LZHAM_Z_UNKNOWN 2 + + struct lzham_z_internal_state; + + // Compression/decompression stream struct. + typedef struct + { + const unsigned char *next_in; // pointer to next byte to read + unsigned int avail_in; // number of bytes available at next_in + lzham_z_ulong total_in; // total number of bytes consumed so far + + unsigned char *next_out; // pointer to next byte to write + unsigned int avail_out; // number of bytes that can be written to next_out + lzham_z_ulong total_out; // total number of bytes produced so far + + char *msg; // error msg (unused) + struct lzham_z_internal_state *state; // internal state, allocated by zalloc/zfree + + // LZHAM does not support per-stream heap callbacks. Use lzham_set_memory_callbacks() instead. + // These members are ignored - they are here for backwards compatibility with zlib. + lzham_z_alloc_func zalloc; // optional heap allocation function (defaults to malloc) + lzham_z_free_func zfree; // optional heap free function (defaults to free) + void *opaque; // heap alloc function user pointer + + int data_type; // data_type (unused) + lzham_z_ulong adler; // adler32 of the source or uncompressed data + lzham_z_ulong reserved; // not used + } lzham_z_stream; + + typedef lzham_z_stream *lzham_z_streamp; + + LZHAM_DLL_EXPORT const char *lzham_z_version(void); + + // lzham_deflateInit() initializes a compressor with default options: + // Parameters: + // pStream must point to an initialized lzham_stream struct. + // level must be between [LZHAM_NO_COMPRESSION, LZHAM_BEST_COMPRESSION]. + // level 1 enables a specially optimized compression function that's been optimized purely for performance, not ratio. + // Return values: + // LZHAM_OK on success. + // LZHAM_STREAM_ERROR if the stream is bogus. + // LZHAM_PARAM_ERROR if the input parameters are bogus. + // LZHAM_MEM_ERROR on out of memory. + LZHAM_DLL_EXPORT int lzham_z_deflateInit(lzham_z_streamp pStream, int level); + + // lzham_deflateInit2() is like lzham_deflate(), except with more control: + // Additional parameters: + // method must be LZHAM_Z_DEFLATED or LZHAM_Z_LZHAM (LZHAM_Z_DEFLATED will be internally converted to LZHAM_Z_LZHAM with a windowsize of LZHAM_Z_DEFAULT_WINDOW_BITS) + // window_bits must be LZHAM_DEFAULT_WINDOW_BITS (to wrap the deflate stream with zlib header/adler-32 footer) or -LZHAM_Z_DEFAULT_WINDOW_BITS (raw deflate/no header or footer) + // mem_level must be between [1, 9] (it's checked but ignored by lzham) + LZHAM_DLL_EXPORT int lzham_z_deflateInit2(lzham_z_streamp pStream, int level, int method, int window_bits, int mem_level, int strategy); + + // Quickly resets a compressor without having to reallocate anything. Same as calling lzham_z_deflateEnd() followed by lzham_z_deflateInit()/lzham_z_deflateInit2(). + LZHAM_DLL_EXPORT int lzham_z_deflateReset(lzham_z_streamp pStream); + + // lzham_deflate() compresses the input to output, consuming as much of the input and producing as much output as possible. + // Parameters: + // pStream is the stream to read from and write to. You must initialize/update the next_in, avail_in, next_out, and avail_out members. + // flush may be LZHAM_Z_NO_FLUSH, LZHAM_Z_PARTIAL_FLUSH/LZHAM_Z_SYNC_FLUSH, LZHAM_Z_FULL_FLUSH, or LZHAM_Z_FINISH. + // Return values: + // LZHAM_Z_OK on success (when flushing, or if more input is needed but not available, and/or there's more output to be written but the output buffer is full). + // LZHAM_Z_STREAM_END if all input has been consumed and all output bytes have been written. Don't call lzham_z_deflate() on the stream anymore. + // LZHAM_Z_STREAM_ERROR if the stream is bogus. + // LZHAM_Z_PARAM_ERROR if one of the parameters is invalid. + // LZHAM_Z_BUF_ERROR if no forward progress is possible because the input and/or output buffers are empty. (Fill up the input buffer or free up some output space and try again.) + LZHAM_DLL_EXPORT int lzham_z_deflate(lzham_z_streamp pStream, int flush); + + // lzham_deflateEnd() deinitializes a compressor: + // Return values: + // LZHAM_Z_OK on success. + // LZHAM_Z_STREAM_ERROR if the stream is bogus. + LZHAM_DLL_EXPORT int lzham_z_deflateEnd(lzham_z_streamp pStream); + + // lzham_deflateBound() returns a (very) conservative upper bound on the amount of data that could be generated by lzham_z_deflate(), assuming flush is set to only LZHAM_Z_NO_FLUSH or LZHAM_Z_FINISH. + LZHAM_DLL_EXPORT lzham_z_ulong lzham_z_deflateBound(lzham_z_streamp pStream, lzham_z_ulong source_len); + + // Single-call compression functions lzham_z_compress() and lzham_z_compress2(): + // Returns LZHAM_Z_OK on success, or one of the error codes from lzham_z_deflate() on failure. + LZHAM_DLL_EXPORT int lzham_z_compress(unsigned char *pDest, lzham_z_ulong *pDest_len, const unsigned char *pSource, lzham_z_ulong source_len); + LZHAM_DLL_EXPORT int lzham_z_compress2(unsigned char *pDest, lzham_z_ulong *pDest_len, const unsigned char *pSource, lzham_z_ulong source_len, int level); + + // lzham_z_compressBound() returns a (very) conservative upper bound on the amount of data that could be generated by calling lzham_z_compress(). + LZHAM_DLL_EXPORT lzham_z_ulong lzham_z_compressBound(lzham_z_ulong source_len); + + // Initializes a decompressor. + LZHAM_DLL_EXPORT int lzham_z_inflateInit(lzham_z_streamp pStream); + + // lzham_z_inflateInit2() is like lzham_z_inflateInit() with an additional option that controls the window size and whether or not the stream has been wrapped with a zlib header/footer: + // window_bits must be LZHAM_Z_DEFAULT_WINDOW_BITS (to parse zlib header/footer) or -LZHAM_Z_DEFAULT_WINDOW_BITS (raw stream with no zlib header/footer). + LZHAM_DLL_EXPORT int lzham_z_inflateInit2(lzham_z_streamp pStream, int window_bits); + + LZHAM_DLL_EXPORT int lzham_z_inflateReset(lzham_z_streamp pStream); + + // Decompresses the input stream to the output, consuming only as much of the input as needed, and writing as much to the output as possible. + // Parameters: + // pStream is the stream to read from and write to. You must initialize/update the next_in, avail_in, next_out, and avail_out members. + // flush may be LZHAM_Z_NO_FLUSH, LZHAM_Z_SYNC_FLUSH, or LZHAM_Z_FINISH. + // On the first call, if flush is LZHAM_Z_FINISH it's assumed the input and output buffers are both sized large enough to decompress the entire stream in a single call (this is slightly faster). + // LZHAM_Z_FINISH implies that there are no more source bytes available beside what's already in the input buffer, and that the output buffer is large enough to hold the rest of the decompressed data. + // Return values: + // LZHAM_Z_OK on success. Either more input is needed but not available, and/or there's more output to be written but the output buffer is full. + // LZHAM_Z_STREAM_END if all needed input has been consumed and all output bytes have been written. For zlib streams, the adler-32 of the decompressed data has also been verified. + // LZHAM_Z_STREAM_ERROR if the stream is bogus. + // LZHAM_Z_DATA_ERROR if the deflate stream is invalid. + // LZHAM_Z_PARAM_ERROR if one of the parameters is invalid. + // LZHAM_Z_BUF_ERROR if no forward progress is possible because the input buffer is empty but the inflater needs more input to continue, or if the output buffer is not large enough. Call lzham_inflate() again + // with more input data, or with more room in the output buffer (except when using single call decompression, described above). + LZHAM_DLL_EXPORT int lzham_z_inflate(lzham_z_streamp pStream, int flush); + + // Deinitializes a decompressor. + LZHAM_DLL_EXPORT int lzham_z_inflateEnd(lzham_z_streamp pStream); + + // Single-call decompression. + // Returns LZHAM_OK on success, or one of the error codes from lzham_inflate() on failure. + LZHAM_DLL_EXPORT int lzham_z_uncompress(unsigned char *pDest, lzham_z_ulong *pDest_len, const unsigned char *pSource, lzham_z_ulong source_len); + + // Returns a string description of the specified error code, or NULL if the error code is invalid. + LZHAM_DLL_EXPORT const char *lzham_z_error(int err); + + // Redefine zlib-compatible names to lzham equivalents, so lzham can be used as a more or less drop-in replacement for the subset of zlib that lzham supports. + // Define LZHAM_NO_ZLIB_COMPATIBLE_NAMES to disable zlib-compatibility if you use zlib in the same project. + #ifdef LZHAM_DEFINE_ZLIB_API + typedef unsigned char Byte; + typedef unsigned int uInt; + typedef lzham_z_ulong uLong; + typedef Byte Bytef; + typedef uInt uIntf; + typedef char charf; + typedef int intf; + typedef void *voidpf; + typedef uLong uLongf; + typedef void *voidp; + typedef void *const voidpc; + #define Z_NULL 0 + #define Z_NO_FLUSH LZHAM_Z_NO_FLUSH + #define Z_PARTIAL_FLUSH LZHAM_Z_PARTIAL_FLUSH + #define Z_SYNC_FLUSH LZHAM_Z_SYNC_FLUSH + #define Z_FULL_FLUSH LZHAM_Z_FULL_FLUSH + #define Z_FINISH LZHAM_Z_FINISH + #define Z_BLOCK LZHAM_Z_BLOCK + #define Z_OK LZHAM_Z_OK + #define Z_STREAM_END LZHAM_Z_STREAM_END + #define Z_NEED_DICT LZHAM_Z_NEED_DICT + #define Z_ERRNO LZHAM_Z_ERRNO + #define Z_STREAM_ERROR LZHAM_Z_STREAM_ERROR + #define Z_DATA_ERROR LZHAM_Z_DATA_ERROR + #define Z_MEM_ERROR LZHAM_Z_MEM_ERROR + #define Z_BUF_ERROR LZHAM_Z_BUF_ERROR + #define Z_VERSION_ERROR LZHAM_Z_VERSION_ERROR + #define Z_PARAM_ERROR LZHAM_Z_PARAM_ERROR + #define Z_NO_COMPRESSION LZHAM_Z_NO_COMPRESSION + #define Z_BEST_SPEED LZHAM_Z_BEST_SPEED + #define Z_BEST_COMPRESSION LZHAM_Z_BEST_COMPRESSION + #define Z_DEFAULT_COMPRESSION LZHAM_Z_DEFAULT_COMPRESSION + #define Z_DEFAULT_STRATEGY LZHAM_Z_DEFAULT_STRATEGY + #define Z_FILTERED LZHAM_Z_FILTERED + #define Z_HUFFMAN_ONLY LZHAM_Z_HUFFMAN_ONLY + #define Z_RLE LZHAM_Z_RLE + #define Z_FIXED LZHAM_Z_FIXED + #define Z_DEFLATED LZHAM_Z_DEFLATED + #define Z_DEFAULT_WINDOW_BITS LZHAM_Z_DEFAULT_WINDOW_BITS + #define alloc_func lzham_z_alloc_func + #define free_func lzham_z_free_func + #define internal_state lzham_z_internal_state + #define z_stream lzham_z_stream + #define deflateInit lzham_z_deflateInit + #define deflateInit2 lzham_z_deflateInit2 + #define deflateReset lzham_z_deflateReset + #define deflate lzham_z_deflate + #define deflateEnd lzham_z_deflateEnd + #define deflateBound lzham_z_deflateBound + #define compress lzham_z_compress + #define compress2 lzham_z_compress2 + #define compressBound lzham_z_compressBound + #define inflateInit lzham_z_inflateInit + #define inflateInit2 lzham_z_inflateInit2 + #define inflateReset lzham_z_inflateReset + #define inflate lzham_z_inflate + #define inflateEnd lzham_z_inflateEnd + #define uncompress lzham_z_uncompress + #define crc32 lzham_z_crc32 + #define adler32 lzham_z_adler32 + #define MAX_WBITS 26 + #define MAX_MEM_LEVEL 9 + #define zError lzham_z_error + #define ZLIB_VERSION LZHAM_Z_VERSION + #define ZLIB_VERNUM LZHAM_Z_VERNUM + #define ZLIB_VER_MAJOR LZHAM_Z_VER_MAJOR + #define ZLIB_VER_MINOR LZHAM_Z_VER_MINOR + #define ZLIB_VER_REVISION LZHAM_Z_VER_REVISION + #define ZLIB_VER_SUBREVISION LZHAM_Z_VER_SUBREVISION + #define zlibVersion lzham_z_version + #define zlib_version lzham_z_version() + #define Z_BINARY LZHAM_Z_BINARY + #define Z_TEXT LZHAM_Z_TEST + #define Z_ASCII LZHAM_Z_ASCII + #define Z_UNKNOWN LZHAM_Z_UNKNOWN + #endif // #ifdef LZHAM_DEFINE_ZLIB_API + + // Exported function typedefs, to simplify loading the LZHAM DLL dynamically. + typedef lzham_uint32 (LZHAM_CDECL *lzham_get_version_func)(void); + typedef void (LZHAM_CDECL *lzham_set_memory_callbacks_func)(lzham_realloc_func pRealloc, lzham_msize_func pMSize, void* pUser_data); + + typedef lzham_compress_state_ptr (LZHAM_CDECL *lzham_compress_init_func)(const lzham_compress_params *pParams); + typedef lzham_compress_state_ptr (LZHAM_CDECL *lzham_compress_reinit_func)(lzham_compress_state_ptr pState); + typedef lzham_uint32 (LZHAM_CDECL *lzham_compress_deinit_func)(lzham_compress_state_ptr pState); + typedef lzham_compress_status_t (LZHAM_CDECL *lzham_compress_func)(lzham_compress_state_ptr pState, const lzham_uint8 *pIn_buf, size_t *pIn_buf_size, lzham_uint8 *pOut_buf, size_t *pOut_buf_size, lzham_bool no_more_input_bytes_flag); + typedef lzham_compress_status_t (LZHAM_CDECL *lzham_compress2_func)(lzham_compress_state_ptr pState, const lzham_uint8 *pIn_buf, size_t *pIn_buf_size, lzham_uint8 *pOut_buf, size_t *pOut_buf_size, lzham_flush_t flush_type); + typedef lzham_compress_status_t (LZHAM_CDECL *lzham_compress_memory_func)(const lzham_compress_params *pParams, lzham_uint8* pDst_buf, size_t *pDst_len, const lzham_uint8* pSrc_buf, size_t src_len, lzham_uint32 *pAdler32); + + typedef lzham_decompress_state_ptr (LZHAM_CDECL *lzham_decompress_init_func)(const lzham_decompress_params *pParams); + typedef lzham_decompress_state_ptr (LZHAM_CDECL *lzham_decompress_reinit_func)(lzham_compress_state_ptr pState, const lzham_decompress_params *pParams); + typedef lzham_uint32 (LZHAM_CDECL *lzham_decompress_deinit_func)(lzham_decompress_state_ptr pState); + typedef lzham_decompress_status_t (LZHAM_CDECL *lzham_decompress_func)(lzham_decompress_state_ptr pState, const lzham_uint8 *pIn_buf, size_t *pIn_buf_size, lzham_uint8 *pOut_buf, size_t *pOut_buf_size, lzham_bool no_more_input_bytes_flag); + typedef lzham_decompress_status_t (LZHAM_CDECL *lzham_decompress_memory_func)(const lzham_decompress_params *pParams, lzham_uint8* pDst_buf, size_t *pDst_len, const lzham_uint8* pSrc_buf, size_t src_len, lzham_uint32 *pAdler32); + + typedef const char *(LZHAM_CDECL *lzham_z_version_func)(void); + typedef int (LZHAM_CDECL *lzham_z_deflateInit_func)(lzham_z_streamp pStream, int level); + typedef int (LZHAM_CDECL *lzham_z_deflateInit2_func)(lzham_z_streamp pStream, int level, int method, int window_bits, int mem_level, int strategy); + typedef int (LZHAM_CDECL *lzham_z_deflateReset_func)(lzham_z_streamp pStream); + typedef int (LZHAM_CDECL *lzham_z_deflate_func)(lzham_z_streamp pStream, int flush); + typedef int (LZHAM_CDECL *lzham_z_deflateEnd_func)(lzham_z_streamp pStream); + typedef lzham_z_ulong (LZHAM_CDECL *lzham_z_deflateBound_func)(lzham_z_streamp pStream, lzham_z_ulong source_len); + typedef int (LZHAM_CDECL *lzham_z_compress_func)(unsigned char *pDest, lzham_z_ulong *pDest_len, const unsigned char *pSource, lzham_z_ulong source_len); + typedef int (LZHAM_CDECL *lzham_z_compress2_func)(unsigned char *pDest, lzham_z_ulong *pDest_len, const unsigned char *pSource, lzham_z_ulong source_len, int level); + typedef lzham_z_ulong (LZHAM_CDECL *lzham_z_compressBound_func)(lzham_z_ulong source_len); + typedef int (LZHAM_CDECL *lzham_z_inflateInit_func)(lzham_z_streamp pStream); + typedef int (LZHAM_CDECL *lzham_z_inflateInit2_func)(lzham_z_streamp pStream, int window_bits); + typedef int (LZHAM_CDECL *lzham_z_inflateReset_func)(lzham_z_streamp pStream); + typedef int (LZHAM_CDECL *lzham_z_inflate_func)(lzham_z_streamp pStream, int flush); + typedef int (LZHAM_CDECL *lzham_z_inflateEnd_func)(lzham_z_streamp pStream); + typedef int (LZHAM_CDECL *lzham_z_uncompress_func)(unsigned char *pDest, lzham_z_ulong *pDest_len, const unsigned char *pSource, lzham_z_ulong source_len); + typedef const char *(LZHAM_CDECL *lzham_z_error_func)(int err); + +#ifdef __cplusplus +} +#endif + +#ifdef __cplusplus +// This optional interface is used by the dynamic/static link helpers defined in lzham_dynamic_lib.h and lzham_static_lib.h. +// It allows code to always call LZHAM the same way, independent of how it was linked into the app (statically or dynamically). +class ilzham +{ + ilzham(const ilzham &other); + ilzham& operator= (const ilzham &rhs); + +public: + ilzham() { clear(); } + + virtual ~ilzham() { } + virtual bool load() = 0; + virtual void unload() = 0; + virtual bool is_loaded() = 0; + + void clear() + { + this->lzham_get_version = NULL; + this->lzham_set_memory_callbacks = NULL; + + this->lzham_compress_init = NULL; + this->lzham_compress_reinit = NULL; + this->lzham_compress_deinit = NULL; + this->lzham_compress = NULL; + this->lzham_compress2 = NULL; + this->lzham_compress_memory = NULL; + + this->lzham_decompress_init = NULL; + this->lzham_decompress_reinit = NULL; + this->lzham_decompress_deinit = NULL; + this->lzham_decompress = NULL; + this->lzham_decompress_memory = NULL; + + this->lzham_z_version = NULL; + this->lzham_z_deflateInit = NULL; + this->lzham_z_deflateInit2 = NULL; + this->lzham_z_deflateReset = NULL; + this->lzham_z_deflate = NULL; + this->lzham_z_deflateEnd = NULL; + this->lzham_z_deflateBound = NULL; + this->lzham_z_compress = NULL; + this->lzham_z_compress2 = NULL; + this->lzham_z_compressBound = NULL; + this->lzham_z_inflateInit = NULL; + this->lzham_z_inflateInit2 = NULL; + this->lzham_z_inflate = NULL; + this->lzham_z_inflateEnd = NULL; + this->lzham_z_inflateReset = NULL; + this->lzham_z_uncompress = NULL; + this->lzham_z_error = NULL; + } + + lzham_get_version_func lzham_get_version; + lzham_set_memory_callbacks_func lzham_set_memory_callbacks; + + lzham_compress_init_func lzham_compress_init; + lzham_compress_reinit_func lzham_compress_reinit; + lzham_compress_deinit_func lzham_compress_deinit; + lzham_compress_func lzham_compress; + lzham_compress2_func lzham_compress2; + lzham_compress_memory_func lzham_compress_memory; + + lzham_decompress_init_func lzham_decompress_init; + lzham_decompress_reinit_func lzham_decompress_reinit; + lzham_decompress_deinit_func lzham_decompress_deinit; + lzham_decompress_func lzham_decompress; + lzham_decompress_memory_func lzham_decompress_memory; + + lzham_z_version_func lzham_z_version; + lzham_z_deflateInit_func lzham_z_deflateInit; + lzham_z_deflateInit2_func lzham_z_deflateInit2; + lzham_z_deflateReset_func lzham_z_deflateReset; + lzham_z_deflate_func lzham_z_deflate; + lzham_z_deflateEnd_func lzham_z_deflateEnd; + lzham_z_deflateBound_func lzham_z_deflateBound; + lzham_z_compress_func lzham_z_compress; + lzham_z_compress2_func lzham_z_compress2; + lzham_z_compressBound_func lzham_z_compressBound; + lzham_z_inflateInit_func lzham_z_inflateInit; + lzham_z_inflateInit2_func lzham_z_inflateInit2; + lzham_z_inflateReset_func lzham_z_inflateReset; + lzham_z_inflate_func lzham_z_inflate; + lzham_z_inflateEnd_func lzham_z_inflateEnd; + lzham_z_uncompress_func lzham_z_uncompress; + lzham_z_error_func lzham_z_error; +}; +#endif // #ifdef __cplusplus + +#endif // #ifndef __LZHAM_H__ + +// Copyright (c) 2009-2012 Richard Geldreich, Jr. +// +// LZHAM uses the MIT License: +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + diff --git a/r5dev/thirdparty/cppnet/cppkore_incl/LZHAM_ALPHA/lzham.h b/r5dev/thirdparty/cppnet/cppkore_incl/LZHAM_ALPHA/lzham.h new file mode 100644 index 00000000..526c0ab7 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore_incl/LZHAM_ALPHA/lzham.h @@ -0,0 +1,765 @@ +// File: lzham.h - Copyright (c) 2009-2012 Richard Geldreich, Jr. +// LZHAM uses the MIT License. See Copyright Notice and license at the end of this file. +// +// This is the main header file, includable from C or C++ files, which defines all the publically available API's, structs, and types used by the LZHAM codec. +// +// Notes: +// +// As of LZHAM alpha8, there are now two sets of API's: +// - The first (oldest) API directly exposes all of the codec's functionality. See lzham_compress_init(), lzham_decompress_init(), etc. This API has the lowest overhead +// and is the most tested. +// - The new API implements the most useful/popular subset of the zlib API, but doesn't expose all of the codec's functionality yet. See the lzham_z* functions. +// This functionality is provided because most users of compression libraries are already very familiar with the nuts and bolts of the zlib API. +// For the most common zlib usage cases LZHAM is an almost drop-in replacement for zlib. To make switching from zlib even easier, you can define the LZHAM_DEFINE_ZLIB_API macro, +// which causes this header to #define most zlib symbols to their LZHAM equivalents. +// Note that LZHAM does not actually implement the deflate/inflate algorithm, so it cannot decompress streams created by standard zlib yet (and of course, zlib cannot decompress +// streams created by LZHAM). Internally, this API is mostly implemented via the older low-level LZHAM API. + +#ifndef __LZHAM_H__ +#define __LZHAM_H__ + +#ifdef _MSC_VER +#pragma once +#endif + +#include + +// Upper byte = major version +// Lower byte = minor version +#define LZHAM_DLL_VERSION 0x1008 + +#if defined(_WIN64) || defined(__MINGW64__) || defined(_LP64) || defined(__LP64__) + #define LZHAM_64BIT 1 +#endif + +#if defined(_MSC_VER) + #define LZHAM_CDECL __cdecl +#else + #define LZHAM_CDECL +#endif + +#ifdef LZHAM_EXPORTS + #define LZHAM_DLL_EXPORT __declspec(dllexport) +#else + #define LZHAM_DLL_EXPORT +#endif + +#ifdef __cplusplus +extern "C" { +#endif + + typedef unsigned char lzham_uint8; + typedef signed int lzham_int32; + typedef unsigned int lzham_uint32; + typedef unsigned int lzham_bool; + + // Returns DLL version (LZHAM_DLL_VERSION). + LZHAM_DLL_EXPORT lzham_uint32 LZHAM_CDECL lzham_get_version(void); + + // User provided memory allocation + + // Custom allocation function must return pointers with LZHAM_MIN_ALLOC_ALIGNMENT (or better). + #define LZHAM_MIN_ALLOC_ALIGNMENT sizeof(size_t) * 2 + + typedef void* (LZHAM_CDECL *lzham_realloc_func)(void* p, size_t size, size_t* pActual_size, lzham_bool movable, void* pUser_data); + typedef size_t (LZHAM_CDECL *lzham_msize_func)(void* p, void* pUser_data); + + // Call this function to force LZHAM to use custom memory malloc(), realloc(), free() and msize functions. + LZHAM_DLL_EXPORT void LZHAM_CDECL lzham_set_memory_callbacks(lzham_realloc_func pRealloc, lzham_msize_func pMSize, void* pUser_data); + + // lzham_flush_t must map directly to the zlib-style API flush types (LZHAM_Z_NO_FLUSH, etc.) + typedef enum + { + LZHAM_NO_FLUSH = 0, + LZHAM_SYNC_FLUSH = 2, + LZHAM_FULL_FLUSH = 3, + LZHAM_FINISH = 4, + LZHAM_TABLE_FLUSH = 10 + } lzham_flush_t; + + // Compression + #define LZHAM_MIN_DICT_SIZE_LOG2 15 + #define LZHAM_MAX_DICT_SIZE_LOG2_X86 26 + #define LZHAM_MAX_DICT_SIZE_LOG2_X64 29 + + #define LZHAM_MAX_HELPER_THREADS 64 + + typedef enum + { + LZHAM_COMP_STATUS_NOT_FINISHED = 0, + LZHAM_COMP_STATUS_NEEDS_MORE_INPUT, + LZHAM_COMP_STATUS_HAS_MORE_OUTPUT, + + // All the following enums must indicate failure/success. + + LZHAM_COMP_STATUS_FIRST_SUCCESS_OR_FAILURE_CODE, + LZHAM_COMP_STATUS_SUCCESS = LZHAM_COMP_STATUS_FIRST_SUCCESS_OR_FAILURE_CODE, + + LZHAM_COMP_STATUS_FIRST_FAILURE_CODE, + LZHAM_COMP_STATUS_FAILED = LZHAM_COMP_STATUS_FIRST_FAILURE_CODE, + LZHAM_COMP_STATUS_FAILED_INITIALIZING, + LZHAM_COMP_STATUS_INVALID_PARAMETER, + LZHAM_COMP_STATUS_OUTPUT_BUF_TOO_SMALL, + + LZHAM_COMP_STATUS_FORCE_DWORD = 0xFFFFFFFF + } lzham_compress_status_t; + + typedef enum + { + LZHAM_COMP_LEVEL_FASTEST = 0, + LZHAM_COMP_LEVEL_FASTER, + LZHAM_COMP_LEVEL_DEFAULT, + LZHAM_COMP_LEVEL_BETTER, + LZHAM_COMP_LEVEL_UBER, + + LZHAM_TOTAL_COMP_LEVELS, + + LZHAM_COMP_LEVEL_FORCE_DWORD = 0xFFFFFFFF + } lzham_compress_level; + + // Streaming compression + typedef void *lzham_compress_state_ptr; + + typedef enum + { + LZHAM_COMP_FLAG_FORCE_POLAR_CODING = 1, // Forces Polar codes vs. Huffman, for a slight increase in decompression speed. + LZHAM_COMP_FLAG_EXTREME_PARSING = 2, // Improves ratio by allowing the compressor's parse graph to grow "higher" (up to 4 parent nodes per output node), but is much slower. + LZHAM_COMP_FLAG_DETERMINISTIC_PARSING = 4, // Guarantees that the compressed output will always be the same given the same input and parameters (no variation between runs due to kernel threading scheduling). + + // If enabled, the compressor is free to use any optimizations which could lower the decompression rate (such + // as adaptively resetting the Huffman table update rate to maximum frequency, which is costly for the decompressor). + LZHAM_COMP_FLAG_TRADEOFF_DECOMPRESSION_RATE_FOR_COMP_RATIO = 16, + + LZHAM_COMP_FLAG_WRITE_ZLIB_STREAM = 32, + } lzham_compress_flags; + + typedef struct + { + lzham_uint32 m_struct_size; // set to sizeof(lzham_compress_params) + lzham_uint32 m_dict_size_log2; // set to the log2(dictionary_size), must range between [LZHAM_MIN_DICT_SIZE_LOG2, LZHAM_MAX_DICT_SIZE_LOG2_X86] for x86 LZHAM_MAX_DICT_SIZE_LOG2_X64 for x64 + lzham_compress_level m_level; // set to LZHAM_COMP_LEVEL_FASTEST, etc. + lzham_int32 m_max_helper_threads; // max # of additional "helper" threads to create, must range between [-1,LZHAM_MAX_HELPER_THREADS], where -1=max practical + lzham_uint32 m_cpucache_total_lines; // set to 0 (optimize compressed stream to avoid L1/L2 cache misses - not currently supported) + lzham_uint32 m_cpucache_line_size; // set to 0 + lzham_uint32 m_compress_flags; // optional compression flags (see lzham_compress_flags enum) + lzham_uint32 m_num_seed_bytes; // for delta compression (optional) - number of seed bytes pointed to by m_pSeed_bytes + const void *m_pSeed_bytes; // for delta compression (optional) - pointer to seed bytes buffer, must be at least m_num_seed_bytes long + } lzham_compress_params; + + typedef struct + { + lzham_uint32 adler32; + lzham_uint32 crc32; + } lzham_compress_checksums; + + // Initializes a compressor. Returns a pointer to the compressor's internal state, or NULL on failure. + // pParams cannot be NULL. Be sure to initialize the pParams->m_struct_size member to sizeof(lzham_compress_params) (along with the other members to reasonable values) before calling this function. + // TODO: With large dictionaries this function could take a while (due to memory allocation). I need to add a reinit() API for compression (decompression already has one). + LZHAM_DLL_EXPORT lzham_compress_state_ptr LZHAM_CDECL lzham_compress_init(const lzham_compress_params *pParams); + + LZHAM_DLL_EXPORT lzham_compress_state_ptr LZHAM_CDECL lzham_compress_reinit(lzham_compress_state_ptr pState); + + // Deinitializes a compressor, releasing all allocated memory. + // returns adler32 and crc32 of source data (valid only on success). + LZHAM_DLL_EXPORT lzham_compress_checksums* LZHAM_CDECL lzham_compress_deinit(lzham_compress_state_ptr pState); + + // Compresses an arbitrarily sized block of data, writing as much available compressed data as possible to the output buffer. + // This method may be called as many times as needed, but for best perf. try not to call it with tiny buffers. + // pState - Pointer to internal compression state, created by lzham_compress_init. + // pIn_buf, pIn_buf_size - Pointer to input data buffer, and pointer to a size_t containing the number of bytes available in this buffer. + // On return, *pIn_buf_size will be set to the number of bytes read from the buffer. + // pOut_buf, pOut_buf_size - Pointer to the output data buffer, and a pointer to a size_t containing the max number of bytes that can be written to this buffer. + // On return, *pOut_buf_size will be set to the number of bytes written to this buffer. + // no_more_input_bytes_flag - Set to true to indicate that no more input bytes are available to compress (EOF). Once you call this function with this param set to true, it must stay set to true in all future calls. + // + // Normal return status codes: + // LZHAM_COMP_STATUS_NOT_FINISHED - Compression can continue, but the compressor needs more input, or it needs more room in the output buffer. + // LZHAM_COMP_STATUS_NEEDS_MORE_INPUT - Compression can contintue, but the compressor has no more output, and has no input but we're not at EOF. Supply more input to continue. + // Success/failure return status codes: + // LZHAM_COMP_STATUS_SUCCESS - Compression has completed successfully. + // LZHAM_COMP_STATUS_FAILED, LZHAM_COMP_STATUS_FAILED_INITIALIZING, LZHAM_COMP_STATUS_INVALID_PARAMETER - Something went wrong. + LZHAM_DLL_EXPORT lzham_compress_status_t LZHAM_CDECL lzham_compress( + lzham_compress_state_ptr pState, + const lzham_uint8 *pIn_buf, size_t *pIn_buf_size, + lzham_uint8 *pOut_buf, size_t *pOut_buf_size, + lzham_bool no_more_input_bytes_flag); + + LZHAM_DLL_EXPORT lzham_compress_status_t LZHAM_CDECL lzham_compress2( + lzham_compress_state_ptr pState, + const lzham_uint8 *pIn_buf, size_t *pIn_buf_size, + lzham_uint8 *pOut_buf, size_t *pOut_buf_size, + lzham_flush_t flush_type); + + // Single function call compression interface. + // Same return codes as lzham_compress, except this function can also return LZHAM_COMP_STATUS_OUTPUT_BUF_TOO_SMALL. + LZHAM_DLL_EXPORT lzham_compress_status_t LZHAM_CDECL lzham_compress_memory( + const lzham_compress_params *pParams, + lzham_uint8* pDst_buf, + size_t *pDst_len, + const lzham_uint8* pSrc_buf, + size_t src_len, + lzham_uint32 *pAdler32, + lzham_uint32 *pCrc32); + + // Decompression + typedef enum + { + // LZHAM_DECOMP_STATUS_NOT_FINISHED indicates that the decompressor is flushing its internal buffer to the caller's output buffer. + // There may be more bytes available to decompress on the next call, but there is no guarantee. + LZHAM_DECOMP_STATUS_NOT_FINISHED = 0, + + // LZHAM_DECOMP_STATUS_HAS_MORE_OUTPUT indicates that the decompressor is trying to flush its internal buffer to the caller's output buffer, + // but the caller hasn't provided any space to copy this data to the caller's output buffer. Call the lzham_decompress() again with a non-empty sized output buffer. + LZHAM_DECOMP_STATUS_HAS_MORE_OUTPUT, + + // LZHAM_DECOMP_STATUS_NEEDS_MORE_INPUT indicates that the decompressor has consumed all input bytes, has not encountered an "end of stream" code, + // and the caller hasn't set no_more_input_bytes_flag to true, so it's expecting more input to proceed. + LZHAM_DECOMP_STATUS_NEEDS_MORE_INPUT, + + // All the following enums always (and MUST) indicate failure/success. + LZHAM_DECOMP_STATUS_FIRST_SUCCESS_OR_FAILURE_CODE, + + // LZHAM_DECOMP_STATUS_SUCCESS indicates decompression has successfully completed. + LZHAM_DECOMP_STATUS_SUCCESS = LZHAM_DECOMP_STATUS_FIRST_SUCCESS_OR_FAILURE_CODE, + + // The remaining status codes indicate a failure of some sort. Most failures are unrecoverable. TODO: Document which codes are recoverable. + LZHAM_DECOMP_STATUS_FIRST_FAILURE_CODE, + + LZHAM_DECOMP_STATUS_FAILED_INITIALIZING = LZHAM_DECOMP_STATUS_FIRST_FAILURE_CODE, + LZHAM_DECOMP_STATUS_FAILED_DEST_BUF_TOO_SMALL, + LZHAM_DECOMP_STATUS_FAILED_EXPECTED_MORE_RAW_BYTES, + LZHAM_DECOMP_STATUS_FAILED_BAD_CODE, + LZHAM_DECOMP_STATUS_FAILED_ADLER32, + LZHAM_DECOMP_STATUS_FAILED_CRC32, + LZHAM_DECOMP_STATUS_FAILED_BAD_RAW_BLOCK, + LZHAM_DECOMP_STATUS_FAILED_BAD_COMP_BLOCK_SYNC_CHECK, + LZHAM_DECOMP_STATUS_FAILED_BAD_ZLIB_HEADER, + LZHAM_DECOMP_STATUS_FAILED_NEED_SEED_BYTES, + LZHAM_DECOMP_STATUS_FAILED_BAD_SEED_BYTES, + LZHAM_DECOMP_STATUS_FAILED_BAD_SYNC_BLOCK, + LZHAM_DECOMP_STATUS_INVALID_PARAMETER, + } lzham_decompress_status_t; + + typedef void *lzham_decompress_state_ptr; + + typedef enum + { + LZHAM_DECOMP_FLAG_NONE = 0, + LZHAM_DECOMP_FLAG_OUTPUT_UNBUFFERED = 1 << 0, + LZHAM_DECOMP_FLAG_COMPUTE_ADLER32 = 1 << 1, + LZHAM_DECOMP_FLAG_COMPUTE_CRC32 = 1 << 2, + LZHAM_DECOMP_FLAG_READ_ZLIB_STREAM = 1 << 3, + } lzham_decompress_flags; + + // Decompression parameters structure. + // Notes: + // m_dict_size_log2 MUST match the value used during compression! + // If m_num_seed_bytes != 0, LZHAM_DECOMP_FLAG_OUTPUT_UNBUFFERED must not be set (i.e. static "seed" dictionaries are not compatible with unbuffered decompression). + // The seed buffer's contents and size must match the seed buffer used during compression. + typedef struct + { + lzham_uint32 m_struct_size; // set to sizeof(lzham_decompress_params) + lzham_uint32 m_dict_size_log2; // set to the log2(dictionary_size), must range between [LZHAM_MIN_DICT_SIZE_LOG2, LZHAM_MAX_DICT_SIZE_LOG2_X86] for x86 LZHAM_MAX_DICT_SIZE_LOG2_X64 for x64 + lzham_uint32 m_decompress_flags; // optional decompression flags (see lzham_decompress_flags enum) + lzham_uint32 m_num_seed_bytes; // for delta compression (optional) - number of seed bytes pointed to by m_pSeed_bytes + const void *m_pSeed_bytes; // for delta compression (optional) - pointer to seed bytes buffer, must be at least m_num_seed_bytes long + } lzham_decompress_params; + + typedef struct + { + lzham_uint32 adler32; + lzham_uint32 crc32; + } lzham_decompress_checksums; + + // Initializes a decompressor. + // pParams cannot be NULL. Be sure to initialize the pParams->m_struct_size member to sizeof(lzham_decompress_params) (along with the other members to reasonable values) before calling this function. + // Note: With large dictionaries this function could take a while (due to memory allocation). To serially decompress multiple streams, it's faster to init a compressor once and + // reuse it using by calling lzham_decompress_reinit(). + LZHAM_DLL_EXPORT lzham_decompress_state_ptr LZHAM_CDECL lzham_decompress_init(const lzham_decompress_params *pParams); + + // Quickly re-initializes the decompressor to its initial state given an already allocated/initialized state (doesn't do any memory alloc unless necessary). + LZHAM_DLL_EXPORT lzham_decompress_state_ptr LZHAM_CDECL lzham_decompress_reinit(lzham_decompress_state_ptr pState, const lzham_decompress_params *pParams); + + // Deinitializes a decompressor. + // returns adler32 of decompressed data if compute_adler32 was true, otherwise it returns the adler32 from the compressed stream. + LZHAM_DLL_EXPORT lzham_decompress_checksums* LZHAM_CDECL lzham_decompress_deinit(lzham_decompress_state_ptr pState); + + // Decompresses an arbitrarily sized block of compressed data, writing as much available decompressed data as possible to the output buffer. + // This method is implemented as a coroutine so it may be called as many times as needed. However, for best perf. try not to call it with tiny buffers. + // pState - Pointer to internal decompression state, originally created by lzham_decompress_init. + // pIn_buf, pIn_buf_size - Pointer to input data buffer, and pointer to a size_t containing the number of bytes available in this buffer. + // On return, *pIn_buf_size will be set to the number of bytes read from the buffer. + // pOut_buf, pOut_buf_size - Pointer to the output data buffer, and a pointer to a size_t containing the max number of bytes that can be written to this buffer. + // On return, *pOut_buf_size will be set to the number of bytes written to this buffer. + // no_more_input_bytes_flag - Set to true to indicate that no more input bytes are available to compress (EOF). Once you call this function with this param set to true, it must stay set to true in all future calls. + // Notes: + // In unbuffered mode, the output buffer MUST be large enough to hold the entire decompressed stream. Otherwise, you'll receive the + // LZHAM_DECOMP_STATUS_FAILED_DEST_BUF_TOO_SMALL error (which is currently unrecoverable during unbuffered decompression). + // In buffered mode, if the output buffer's size is 0 bytes, the caller is indicating that no more output bytes are expected from the + // decompressor. In this case, if the decompressor actually has more bytes you'll receive the LZHAM_DECOMP_STATUS_HAS_MORE_OUTPUT + // error (which is recoverable in the buffered case - just call lzham_decompress() again with a non-zero size output buffer). + LZHAM_DLL_EXPORT lzham_decompress_status_t LZHAM_CDECL lzham_decompress( + lzham_decompress_state_ptr pState, + const lzham_uint8 *pIn_buf, size_t *pIn_buf_size, + lzham_uint8 *pOut_buf, size_t *pOut_buf_size, + lzham_bool no_more_input_bytes_flag); + + // Single function call interface. + LZHAM_DLL_EXPORT lzham_decompress_status_t LZHAM_CDECL lzham_decompress_memory( + const lzham_decompress_params *pParams, + lzham_uint8* pDst_buf, + size_t *pDst_len, + const lzham_uint8* pSrc_buf, + size_t src_len, + lzham_uint32 *pAdler32, + lzham_uint32 *pCrc32); + + // ------------------- zlib-style API Definitions. + + // Important note: LZHAM doesn't internally support the Deflate algorithm, but for API compatibility the "Deflate" and "Inflate" names are retained here. + + typedef unsigned long lzham_z_ulong; + + // Heap allocation callbacks. + // Note that lzham_alloc_func parameter types purposely differ from zlib's: items/size is size_t, not unsigned long. + typedef void *(*lzham_z_alloc_func)(void *opaque, size_t items, size_t size); + typedef void (*lzham_z_free_func)(void *opaque, void *address); + typedef void *(*lzham_z_realloc_func)(void *opaque, void *address, size_t items, size_t size); + + #define LZHAM_Z_ADLER32_INIT (1) + // lzham_adler32() returns the initial adler-32 value to use when called with ptr==NULL. + LZHAM_DLL_EXPORT lzham_z_ulong lzham_z_adler32(lzham_z_ulong adler, const unsigned char *ptr, size_t buf_len); + + #define LZHAM_Z_CRC32_INIT (0) + // lzham_crc32() returns the initial CRC-32 value to use when called with ptr==NULL. + LZHAM_DLL_EXPORT lzham_z_ulong lzham_z_crc32(lzham_z_ulong crc, const unsigned char *ptr, size_t buf_len); + + // Compression strategies. + enum + { + LZHAM_Z_DEFAULT_STRATEGY = 0, + LZHAM_Z_FILTERED = 1, + LZHAM_Z_HUFFMAN_ONLY = 2, + LZHAM_Z_RLE = 3, + LZHAM_Z_FIXED = 4 + }; + + // Method + #define LZHAM_Z_DEFLATED 8 + #define LZHAM_Z_LZHAM 14 + + #define LZHAM_Z_VERSION "10.8.1" + #define LZHAM_Z_VERNUM 0xA810 + #define LZHAM_Z_VER_MAJOR 10 + #define LZHAM_Z_VER_MINOR 8 + #define LZHAM_Z_VER_REVISION 1 + #define LZHAM_Z_VER_SUBREVISION 0 + + // Flush values. + // For compression, you typically only need to use LZHAM_NO_FLUSH and LZHAM_FINISH. + // LZHAM_Z_SYNC_FLUSH and LZHAM_Z_FULL_FLUSH during compression forces compression of all buffered input. + // + // For decompression, you typically only need to use LZHAM_Z_SYNC_FLUSH or LZHAM_Z_FINISH. + // LZHAM_Z_FINISH during decompression guarantees that the output buffer is large enough to hold all remaining data to decompress. + // See http://www.bolet.org/~pornin/deflate-flush.html + // Must directly map to lzham_flush_t + enum + { + LZHAM_Z_NO_FLUSH = 0, // compression/decompression + LZHAM_Z_PARTIAL_FLUSH = 1, // compression/decompression, same as LZHAM_Z_SYNC_FLUSH + LZHAM_Z_SYNC_FLUSH = 2, // compression/decompression, when compressing: flush current block (if any), always outputs sync block (aligns output to byte boundary, a 0xFFFF0000 marker will appear in the output stream) + LZHAM_Z_FULL_FLUSH = 3, // compression/decompression, when compressing: same as LZHAM_Z_SYNC_FLUSH but also forces a full state flush (LZ dictionary, all symbol statistics) + LZHAM_Z_FINISH = 4, // compression/decompression + LZHAM_Z_BLOCK = 5, // not supported + LZHAM_Z_TABLE_FLUSH = 10 // compression only, resets all symbol table update rates to maximum frequency (LZHAM extension) + }; + + // Return status codes. LZHAM_Z_PARAM_ERROR is non-standard. + enum + { + LZHAM_Z_OK = 0, + LZHAM_Z_STREAM_END = 1, + LZHAM_Z_NEED_DICT = 2, + LZHAM_Z_ERRNO = -1, + LZHAM_Z_STREAM_ERROR = -2, + LZHAM_Z_DATA_ERROR = -3, + LZHAM_Z_MEM_ERROR = -4, + LZHAM_Z_BUF_ERROR = -5, + LZHAM_Z_VERSION_ERROR = -6, + LZHAM_Z_PARAM_ERROR = -10000 + }; + + // Compression levels. + enum + { + LZHAM_Z_NO_COMPRESSION = 0, + LZHAM_Z_BEST_SPEED = 1, + LZHAM_Z_BEST_COMPRESSION = 9, + LZHAM_Z_UBER_COMPRESSION = 10, // uber = best with extreme parsing (can be very slow) + LZHAM_Z_DEFAULT_COMPRESSION = -1 + }; + + // Window bits + // Important note: The zlib-style API's default to 32KB dictionary for API compatibility. For improved compression, be sure to call deflateInit2/inflateInit2 and specify larger custom window_bits values! + // If changing the calling code isn't practical, unremark LZHAM_Z_API_FORCE_WINDOW_BITS. + #define LZHAM_Z_DEFAULT_WINDOW_BITS 15 + + // Define LZHAM_Z_API_FORCE_WINDOW_BITS to force the entire library to use a constant value for window_bits (helps with porting) in all zlib API's. + // TODO: Might be useful to provide an API to control this at runtime. + //#define LZHAM_Z_API_FORCE_WINDOW_BITS 23 + + // Data types + #define LZHAM_Z_BINARY 0 + #define LZHAM_Z_TEXT 1 + #define LZHAM_Z_ASCII 1 + #define LZHAM_Z_UNKNOWN 2 + + struct lzham_z_internal_state; + + // Compression/decompression stream struct. + typedef struct + { + const unsigned char *next_in; // pointer to next byte to read + unsigned int avail_in; // number of bytes available at next_in + lzham_z_ulong total_in; // total number of bytes consumed so far + + unsigned char *next_out; // pointer to next byte to write + unsigned int avail_out; // number of bytes that can be written to next_out + lzham_z_ulong total_out; // total number of bytes produced so far + + char *msg; // error msg (unused) + struct lzham_z_internal_state *state; // internal state, allocated by zalloc/zfree + + // LZHAM does not support per-stream heap callbacks. Use lzham_set_memory_callbacks() instead. + // These members are ignored - they are here for backwards compatibility with zlib. + lzham_z_alloc_func zalloc; // optional heap allocation function (defaults to malloc) + lzham_z_free_func zfree; // optional heap free function (defaults to free) + void *opaque; // heap alloc function user pointer + + int data_type; // data_type (unused) + lzham_z_ulong adler32; // adler32 of the source or uncompressed data + lzham_z_ulong crc32; // crc32 of the source or uncompressed data + lzham_z_ulong reserved; // not used + } lzham_z_stream; + + typedef lzham_z_stream *lzham_z_streamp; + + LZHAM_DLL_EXPORT const char *lzham_z_version(void); + + // lzham_deflateInit() initializes a compressor with default options: + // Parameters: + // pStream must point to an initialized lzham_stream struct. + // level must be between [LZHAM_NO_COMPRESSION, LZHAM_BEST_COMPRESSION]. + // level 1 enables a specially optimized compression function that's been optimized purely for performance, not ratio. + // Return values: + // LZHAM_OK on success. + // LZHAM_STREAM_ERROR if the stream is bogus. + // LZHAM_PARAM_ERROR if the input parameters are bogus. + // LZHAM_MEM_ERROR on out of memory. + LZHAM_DLL_EXPORT int lzham_z_deflateInit(lzham_z_streamp pStream, int level); + + // lzham_deflateInit2() is like lzham_deflate(), except with more control: + // Additional parameters: + // method must be LZHAM_Z_DEFLATED or LZHAM_Z_LZHAM (LZHAM_Z_DEFLATED will be internally converted to LZHAM_Z_LZHAM with a windowsize of LZHAM_Z_DEFAULT_WINDOW_BITS) + // window_bits must be LZHAM_DEFAULT_WINDOW_BITS (to wrap the deflate stream with zlib header/adler-32 footer) or -LZHAM_Z_DEFAULT_WINDOW_BITS (raw deflate/no header or footer) + // mem_level must be between [1, 9] (it's checked but ignored by lzham) + LZHAM_DLL_EXPORT int lzham_z_deflateInit2(lzham_z_streamp pStream, int level, int method, int window_bits, int mem_level, int strategy); + + // Quickly resets a compressor without having to reallocate anything. Same as calling lzham_z_deflateEnd() followed by lzham_z_deflateInit()/lzham_z_deflateInit2(). + LZHAM_DLL_EXPORT int lzham_z_deflateReset(lzham_z_streamp pStream); + + // lzham_deflate() compresses the input to output, consuming as much of the input and producing as much output as possible. + // Parameters: + // pStream is the stream to read from and write to. You must initialize/update the next_in, avail_in, next_out, and avail_out members. + // flush may be LZHAM_Z_NO_FLUSH, LZHAM_Z_PARTIAL_FLUSH/LZHAM_Z_SYNC_FLUSH, LZHAM_Z_FULL_FLUSH, or LZHAM_Z_FINISH. + // Return values: + // LZHAM_Z_OK on success (when flushing, or if more input is needed but not available, and/or there's more output to be written but the output buffer is full). + // LZHAM_Z_STREAM_END if all input has been consumed and all output bytes have been written. Don't call lzham_z_deflate() on the stream anymore. + // LZHAM_Z_STREAM_ERROR if the stream is bogus. + // LZHAM_Z_PARAM_ERROR if one of the parameters is invalid. + // LZHAM_Z_BUF_ERROR if no forward progress is possible because the input and/or output buffers are empty. (Fill up the input buffer or free up some output space and try again.) + LZHAM_DLL_EXPORT int lzham_z_deflate(lzham_z_streamp pStream, int flush); + + // lzham_deflateEnd() deinitializes a compressor: + // Return values: + // LZHAM_Z_OK on success. + // LZHAM_Z_STREAM_ERROR if the stream is bogus. + LZHAM_DLL_EXPORT int lzham_z_deflateEnd(lzham_z_streamp pStream); + + // lzham_deflateBound() returns a (very) conservative upper bound on the amount of data that could be generated by lzham_z_deflate(), assuming flush is set to only LZHAM_Z_NO_FLUSH or LZHAM_Z_FINISH. + LZHAM_DLL_EXPORT lzham_z_ulong lzham_z_deflateBound(lzham_z_streamp pStream, lzham_z_ulong source_len); + + // Single-call compression functions lzham_z_compress() and lzham_z_compress2(): + // Returns LZHAM_Z_OK on success, or one of the error codes from lzham_z_deflate() on failure. + LZHAM_DLL_EXPORT int lzham_z_compress(unsigned char *pDest, lzham_z_ulong *pDest_len, const unsigned char *pSource, lzham_z_ulong source_len); + LZHAM_DLL_EXPORT int lzham_z_compress2(unsigned char *pDest, lzham_z_ulong *pDest_len, const unsigned char *pSource, lzham_z_ulong source_len, int level); + + // lzham_z_compressBound() returns a (very) conservative upper bound on the amount of data that could be generated by calling lzham_z_compress(). + LZHAM_DLL_EXPORT lzham_z_ulong lzham_z_compressBound(lzham_z_ulong source_len); + + // Initializes a decompressor. + LZHAM_DLL_EXPORT int lzham_z_inflateInit(lzham_z_streamp pStream); + + // lzham_z_inflateInit2() is like lzham_z_inflateInit() with an additional option that controls the window size and whether or not the stream has been wrapped with a zlib header/footer: + // window_bits must be LZHAM_Z_DEFAULT_WINDOW_BITS (to parse zlib header/footer) or -LZHAM_Z_DEFAULT_WINDOW_BITS (raw stream with no zlib header/footer). + LZHAM_DLL_EXPORT int lzham_z_inflateInit2(lzham_z_streamp pStream, int window_bits); + + LZHAM_DLL_EXPORT int lzham_z_inflateReset(lzham_z_streamp pStream); + + // Decompresses the input stream to the output, consuming only as much of the input as needed, and writing as much to the output as possible. + // Parameters: + // pStream is the stream to read from and write to. You must initialize/update the next_in, avail_in, next_out, and avail_out members. + // flush may be LZHAM_Z_NO_FLUSH, LZHAM_Z_SYNC_FLUSH, or LZHAM_Z_FINISH. + // On the first call, if flush is LZHAM_Z_FINISH it's assumed the input and output buffers are both sized large enough to decompress the entire stream in a single call (this is slightly faster). + // LZHAM_Z_FINISH implies that there are no more source bytes available beside what's already in the input buffer, and that the output buffer is large enough to hold the rest of the decompressed data. + // Return values: + // LZHAM_Z_OK on success. Either more input is needed but not available, and/or there's more output to be written but the output buffer is full. + // LZHAM_Z_STREAM_END if all needed input has been consumed and all output bytes have been written. For zlib streams, the adler-32 of the decompressed data has also been verified. + // LZHAM_Z_STREAM_ERROR if the stream is bogus. + // LZHAM_Z_DATA_ERROR if the deflate stream is invalid. + // LZHAM_Z_PARAM_ERROR if one of the parameters is invalid. + // LZHAM_Z_BUF_ERROR if no forward progress is possible because the input buffer is empty but the inflater needs more input to continue, or if the output buffer is not large enough. Call lzham_inflate() again + // with more input data, or with more room in the output buffer (except when using single call decompression, described above). + LZHAM_DLL_EXPORT int lzham_z_inflate(lzham_z_streamp pStream, int flush); + + // Deinitializes a decompressor. + LZHAM_DLL_EXPORT int lzham_z_inflateEnd(lzham_z_streamp pStream); + + // Single-call decompression. + // Returns LZHAM_OK on success, or one of the error codes from lzham_inflate() on failure. + LZHAM_DLL_EXPORT int lzham_z_uncompress(unsigned char *pDest, lzham_z_ulong *pDest_len, const unsigned char *pSource, lzham_z_ulong source_len); + + // Returns a string description of the specified error code, or NULL if the error code is invalid. + LZHAM_DLL_EXPORT const char *lzham_z_error(int err); + + // Redefine zlib-compatible names to lzham equivalents, so lzham can be used as a more or less drop-in replacement for the subset of zlib that lzham supports. + // Define LZHAM_NO_ZLIB_COMPATIBLE_NAMES to disable zlib-compatibility if you use zlib in the same project. + #ifdef LZHAM_DEFINE_ZLIB_API + typedef unsigned char Byte; + typedef unsigned int uInt; + typedef lzham_z_ulong uLong; + typedef Byte Bytef; + typedef uInt uIntf; + typedef char charf; + typedef int intf; + typedef void *voidpf; + typedef uLong uLongf; + typedef void *voidp; + typedef void *const voidpc; + #define Z_NULL 0 + #define Z_NO_FLUSH LZHAM_Z_NO_FLUSH + #define Z_PARTIAL_FLUSH LZHAM_Z_PARTIAL_FLUSH + #define Z_SYNC_FLUSH LZHAM_Z_SYNC_FLUSH + #define Z_FULL_FLUSH LZHAM_Z_FULL_FLUSH + #define Z_FINISH LZHAM_Z_FINISH + #define Z_BLOCK LZHAM_Z_BLOCK + #define Z_OK LZHAM_Z_OK + #define Z_STREAM_END LZHAM_Z_STREAM_END + #define Z_NEED_DICT LZHAM_Z_NEED_DICT + #define Z_ERRNO LZHAM_Z_ERRNO + #define Z_STREAM_ERROR LZHAM_Z_STREAM_ERROR + #define Z_DATA_ERROR LZHAM_Z_DATA_ERROR + #define Z_MEM_ERROR LZHAM_Z_MEM_ERROR + #define Z_BUF_ERROR LZHAM_Z_BUF_ERROR + #define Z_VERSION_ERROR LZHAM_Z_VERSION_ERROR + #define Z_PARAM_ERROR LZHAM_Z_PARAM_ERROR + #define Z_NO_COMPRESSION LZHAM_Z_NO_COMPRESSION + #define Z_BEST_SPEED LZHAM_Z_BEST_SPEED + #define Z_BEST_COMPRESSION LZHAM_Z_BEST_COMPRESSION + #define Z_DEFAULT_COMPRESSION LZHAM_Z_DEFAULT_COMPRESSION + #define Z_DEFAULT_STRATEGY LZHAM_Z_DEFAULT_STRATEGY + #define Z_FILTERED LZHAM_Z_FILTERED + #define Z_HUFFMAN_ONLY LZHAM_Z_HUFFMAN_ONLY + #define Z_RLE LZHAM_Z_RLE + #define Z_FIXED LZHAM_Z_FIXED + #define Z_DEFLATED LZHAM_Z_DEFLATED + #define Z_DEFAULT_WINDOW_BITS LZHAM_Z_DEFAULT_WINDOW_BITS + #define alloc_func lzham_z_alloc_func + #define free_func lzham_z_free_func + #define internal_state lzham_z_internal_state + #define z_stream lzham_z_stream + #define deflateInit lzham_z_deflateInit + #define deflateInit2 lzham_z_deflateInit2 + #define deflateReset lzham_z_deflateReset + #define deflate lzham_z_deflate + #define deflateEnd lzham_z_deflateEnd + #define deflateBound lzham_z_deflateBound + #define compress lzham_z_compress + #define compress2 lzham_z_compress2 + #define compressBound lzham_z_compressBound + #define inflateInit lzham_z_inflateInit + #define inflateInit2 lzham_z_inflateInit2 + #define inflateReset lzham_z_inflateReset + #define inflate lzham_z_inflate + #define inflateEnd lzham_z_inflateEnd + #define uncompress lzham_z_uncompress + #define crc32 lzham_z_crc32 + #define adler32 lzham_z_adler32 + #define MAX_WBITS 26 + #define MAX_MEM_LEVEL 9 + #define zError lzham_z_error + #define ZLIB_VERSION LZHAM_Z_VERSION + #define ZLIB_VERNUM LZHAM_Z_VERNUM + #define ZLIB_VER_MAJOR LZHAM_Z_VER_MAJOR + #define ZLIB_VER_MINOR LZHAM_Z_VER_MINOR + #define ZLIB_VER_REVISION LZHAM_Z_VER_REVISION + #define ZLIB_VER_SUBREVISION LZHAM_Z_VER_SUBREVISION + #define zlibVersion lzham_z_version + #define zlib_version lzham_z_version() + #define Z_BINARY LZHAM_Z_BINARY + #define Z_TEXT LZHAM_Z_TEST + #define Z_ASCII LZHAM_Z_ASCII + #define Z_UNKNOWN LZHAM_Z_UNKNOWN + #endif // #ifdef LZHAM_DEFINE_ZLIB_API + + // Exported function typedefs, to simplify loading the LZHAM DLL dynamically. + typedef lzham_uint32 (LZHAM_CDECL *lzham_get_version_func)(void); + typedef void (LZHAM_CDECL *lzham_set_memory_callbacks_func)(lzham_realloc_func pRealloc, lzham_msize_func pMSize, void* pUser_data); + + typedef lzham_compress_state_ptr (LZHAM_CDECL *lzham_compress_init_func)(const lzham_compress_params *pParams); + typedef lzham_compress_state_ptr (LZHAM_CDECL *lzham_compress_reinit_func)(lzham_compress_state_ptr pState); + typedef lzham_compress_checksums* (LZHAM_CDECL *lzham_compress_deinit_func)(lzham_compress_state_ptr pState); + typedef lzham_compress_status_t (LZHAM_CDECL *lzham_compress_func)(lzham_compress_state_ptr pState, const lzham_uint8 *pIn_buf, size_t *pIn_buf_size, lzham_uint8 *pOut_buf, size_t *pOut_buf_size, lzham_bool no_more_input_bytes_flag); + typedef lzham_compress_status_t (LZHAM_CDECL *lzham_compress2_func)(lzham_compress_state_ptr pState, const lzham_uint8 *pIn_buf, size_t *pIn_buf_size, lzham_uint8 *pOut_buf, size_t *pOut_buf_size, lzham_flush_t flush_type); + typedef lzham_compress_status_t (LZHAM_CDECL *lzham_compress_memory_func)(const lzham_compress_params *pParams, lzham_uint8* pDst_buf, size_t *pDst_len, const lzham_uint8* pSrc_buf, size_t src_len, lzham_uint32 *pAdler32, lzham_uint32* pCrc32); + + typedef lzham_decompress_state_ptr (LZHAM_CDECL *lzham_decompress_init_func)(const lzham_decompress_params *pParams); + typedef lzham_decompress_state_ptr (LZHAM_CDECL *lzham_decompress_reinit_func)(lzham_compress_state_ptr pState, const lzham_decompress_params *pParams); + typedef lzham_decompress_checksums* (LZHAM_CDECL *lzham_decompress_deinit_func)(lzham_decompress_state_ptr pState); + typedef lzham_decompress_status_t (LZHAM_CDECL *lzham_decompress_func)(lzham_decompress_state_ptr pState, const lzham_uint8 *pIn_buf, size_t *pIn_buf_size, lzham_uint8 *pOut_buf, size_t *pOut_buf_size, lzham_bool no_more_input_bytes_flag); + typedef lzham_decompress_status_t (LZHAM_CDECL *lzham_decompress_memory_func)(const lzham_decompress_params *pParams, lzham_uint8* pDst_buf, size_t *pDst_len, const lzham_uint8* pSrc_buf, size_t src_len, lzham_uint32 *pAdler32, lzham_uint32 *pCrc32); + + typedef const char *(LZHAM_CDECL *lzham_z_version_func)(void); + typedef int (LZHAM_CDECL *lzham_z_deflateInit_func)(lzham_z_streamp pStream, int level); + typedef int (LZHAM_CDECL *lzham_z_deflateInit2_func)(lzham_z_streamp pStream, int level, int method, int window_bits, int mem_level, int strategy); + typedef int (LZHAM_CDECL *lzham_z_deflateReset_func)(lzham_z_streamp pStream); + typedef int (LZHAM_CDECL *lzham_z_deflate_func)(lzham_z_streamp pStream, int flush); + typedef int (LZHAM_CDECL *lzham_z_deflateEnd_func)(lzham_z_streamp pStream); + typedef lzham_z_ulong (LZHAM_CDECL *lzham_z_deflateBound_func)(lzham_z_streamp pStream, lzham_z_ulong source_len); + typedef int (LZHAM_CDECL *lzham_z_compress_func)(unsigned char *pDest, lzham_z_ulong *pDest_len, const unsigned char *pSource, lzham_z_ulong source_len); + typedef int (LZHAM_CDECL *lzham_z_compress2_func)(unsigned char *pDest, lzham_z_ulong *pDest_len, const unsigned char *pSource, lzham_z_ulong source_len, int level); + typedef lzham_z_ulong (LZHAM_CDECL *lzham_z_compressBound_func)(lzham_z_ulong source_len); + typedef int (LZHAM_CDECL *lzham_z_inflateInit_func)(lzham_z_streamp pStream); + typedef int (LZHAM_CDECL *lzham_z_inflateInit2_func)(lzham_z_streamp pStream, int window_bits); + typedef int (LZHAM_CDECL *lzham_z_inflateReset_func)(lzham_z_streamp pStream); + typedef int (LZHAM_CDECL *lzham_z_inflate_func)(lzham_z_streamp pStream, int flush); + typedef int (LZHAM_CDECL *lzham_z_inflateEnd_func)(lzham_z_streamp pStream); + typedef int (LZHAM_CDECL *lzham_z_uncompress_func)(unsigned char *pDest, lzham_z_ulong *pDest_len, const unsigned char *pSource, lzham_z_ulong source_len); + typedef const char *(LZHAM_CDECL *lzham_z_error_func)(int err); + +#ifdef __cplusplus +} +#endif + +#ifdef __cplusplus +// This optional interface is used by the dynamic/static link helpers defined in lzham_dynamic_lib.h and lzham_static_lib.h. +// It allows code to always call LZHAM the same way, independent of how it was linked into the app (statically or dynamically). +class ilzham +{ + ilzham(const ilzham &other); + ilzham& operator= (const ilzham &rhs); + +public: + ilzham() { clear(); } + + virtual ~ilzham() { } + virtual bool load() = 0; + virtual void unload() = 0; + virtual bool is_loaded() = 0; + + void clear() + { + this->lzham_get_version = NULL; + this->lzham_set_memory_callbacks = NULL; + + this->lzham_compress_init = NULL; + this->lzham_compress_reinit = NULL; + this->lzham_compress_deinit = NULL; + this->lzham_compress = NULL; + this->lzham_compress2 = NULL; + this->lzham_compress_memory = NULL; + + this->lzham_decompress_init = NULL; + this->lzham_decompress_reinit = NULL; + this->lzham_decompress_deinit = NULL; + this->lzham_decompress = NULL; + this->lzham_decompress_memory = NULL; + + this->lzham_z_version = NULL; + this->lzham_z_deflateInit = NULL; + this->lzham_z_deflateInit2 = NULL; + this->lzham_z_deflateReset = NULL; + this->lzham_z_deflate = NULL; + this->lzham_z_deflateEnd = NULL; + this->lzham_z_deflateBound = NULL; + this->lzham_z_compress = NULL; + this->lzham_z_compress2 = NULL; + this->lzham_z_compressBound = NULL; + this->lzham_z_inflateInit = NULL; + this->lzham_z_inflateInit2 = NULL; + this->lzham_z_inflate = NULL; + this->lzham_z_inflateEnd = NULL; + this->lzham_z_uncompress = NULL; + this->lzham_z_error = NULL; + } + + lzham_get_version_func lzham_get_version; + lzham_set_memory_callbacks_func lzham_set_memory_callbacks; + + lzham_compress_init_func lzham_compress_init; + lzham_compress_reinit_func lzham_compress_reinit; + lzham_compress_deinit_func lzham_compress_deinit; + lzham_compress_func lzham_compress; + lzham_compress2_func lzham_compress2; + lzham_compress_memory_func lzham_compress_memory; + + lzham_decompress_init_func lzham_decompress_init; + lzham_decompress_reinit_func lzham_decompress_reinit; + lzham_decompress_deinit_func lzham_decompress_deinit; + lzham_decompress_func lzham_decompress; + lzham_decompress_memory_func lzham_decompress_memory; + + lzham_z_version_func lzham_z_version; + lzham_z_deflateInit_func lzham_z_deflateInit; + lzham_z_deflateInit2_func lzham_z_deflateInit2; + lzham_z_deflateReset_func lzham_z_deflateReset; + lzham_z_deflate_func lzham_z_deflate; + lzham_z_deflateEnd_func lzham_z_deflateEnd; + lzham_z_deflateBound_func lzham_z_deflateBound; + lzham_z_compress_func lzham_z_compress; + lzham_z_compress2_func lzham_z_compress2; + lzham_z_compressBound_func lzham_z_compressBound; + lzham_z_inflateInit_func lzham_z_inflateInit; + lzham_z_inflateInit2_func lzham_z_inflateInit2; + lzham_z_inflateReset_func lzham_z_inflateReset; + lzham_z_inflate_func lzham_z_inflate; + lzham_z_inflateEnd_func lzham_z_inflateEnd; + lzham_z_uncompress_func lzham_z_uncompress; + lzham_z_error_func lzham_z_error; +}; +#endif // #ifdef __cplusplus + +#endif // #ifndef __LZHAM_H__ + +// Copyright (c) 2009-2012 Richard Geldreich, Jr. +// +// LZHAM uses the MIT License: +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + diff --git a/r5dev/thirdparty/cppnet/cppkore_incl/LZO1X/lzoconf.h b/r5dev/thirdparty/cppnet/cppkore_incl/LZO1X/lzoconf.h new file mode 100644 index 00000000..f9a8bdbe --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore_incl/LZO1X/lzoconf.h @@ -0,0 +1,453 @@ +/* lzoconf.h -- configuration of the LZO data compression library + + This file is part of the LZO real-time data compression library. + + Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#ifndef __LZOCONF_H_INCLUDED +#define __LZOCONF_H_INCLUDED 1 + +#define LZO_VERSION 0x20a0 /* 2.10 */ +#define LZO_VERSION_STRING "2.10" +#define LZO_VERSION_DATE "Mar 01 2017" + +/* internal Autoconf configuration file - only used when building LZO */ +#if defined(LZO_HAVE_CONFIG_H) +# include +#endif +#include +#include + + +/*********************************************************************** +// LZO requires a conforming +************************************************************************/ + +#if !defined(CHAR_BIT) || (CHAR_BIT != 8) +# error "invalid CHAR_BIT" +#endif +#if !defined(UCHAR_MAX) || !defined(USHRT_MAX) || !defined(UINT_MAX) || !defined(ULONG_MAX) +# error "check your compiler installation" +#endif +#if (USHRT_MAX < 1) || (UINT_MAX < 1) || (ULONG_MAX < 1) +# error "your limits.h macros are broken" +#endif + +/* get OS and architecture defines */ +#ifndef __LZODEFS_H_INCLUDED +#include +#endif + + +#ifdef __cplusplus +extern "C" { +#endif + + +/*********************************************************************** +// some core defines +************************************************************************/ + +/* memory checkers */ +#if !defined(__LZO_CHECKER) +# if defined(__BOUNDS_CHECKING_ON) +# define __LZO_CHECKER 1 +# elif defined(__CHECKER__) +# define __LZO_CHECKER 1 +# elif defined(__INSURE__) +# define __LZO_CHECKER 1 +# elif defined(__PURIFY__) +# define __LZO_CHECKER 1 +# endif +#endif + + +/*********************************************************************** +// integral and pointer types +************************************************************************/ + +/* lzo_uint must match size_t */ +#if !defined(LZO_UINT_MAX) +# if (LZO_ABI_LLP64) +# if (LZO_OS_WIN64) + typedef unsigned __int64 lzo_uint; + typedef __int64 lzo_int; +# define LZO_TYPEOF_LZO_INT LZO_TYPEOF___INT64 +# else + typedef lzo_ullong_t lzo_uint; + typedef lzo_llong_t lzo_int; +# define LZO_TYPEOF_LZO_INT LZO_TYPEOF_LONG_LONG +# endif +# define LZO_SIZEOF_LZO_INT 8 +# define LZO_UINT_MAX 0xffffffffffffffffull +# define LZO_INT_MAX 9223372036854775807LL +# define LZO_INT_MIN (-1LL - LZO_INT_MAX) +# elif (LZO_ABI_IP32L64) /* MIPS R5900 */ + typedef unsigned int lzo_uint; + typedef int lzo_int; +# define LZO_SIZEOF_LZO_INT LZO_SIZEOF_INT +# define LZO_TYPEOF_LZO_INT LZO_TYPEOF_INT +# define LZO_UINT_MAX UINT_MAX +# define LZO_INT_MAX INT_MAX +# define LZO_INT_MIN INT_MIN +# elif (ULONG_MAX >= LZO_0xffffffffL) + typedef unsigned long lzo_uint; + typedef long lzo_int; +# define LZO_SIZEOF_LZO_INT LZO_SIZEOF_LONG +# define LZO_TYPEOF_LZO_INT LZO_TYPEOF_LONG +# define LZO_UINT_MAX ULONG_MAX +# define LZO_INT_MAX LONG_MAX +# define LZO_INT_MIN LONG_MIN +# else +# error "lzo_uint" +# endif +#endif + +/* The larger type of lzo_uint and lzo_uint32_t. */ +#if (LZO_SIZEOF_LZO_INT >= 4) +# define lzo_xint lzo_uint +#else +# define lzo_xint lzo_uint32_t +#endif + +typedef int lzo_bool; + +/* sanity checks */ +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int) == LZO_SIZEOF_LZO_INT) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) == LZO_SIZEOF_LZO_INT) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_xint) >= sizeof(lzo_uint)) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_xint) >= sizeof(lzo_uint32_t)) + +#ifndef __LZO_MMODEL +#define __LZO_MMODEL /*empty*/ +#endif + +/* no typedef here because of const-pointer issues */ +#define lzo_bytep unsigned char __LZO_MMODEL * +#define lzo_charp char __LZO_MMODEL * +#define lzo_voidp void __LZO_MMODEL * +#define lzo_shortp short __LZO_MMODEL * +#define lzo_ushortp unsigned short __LZO_MMODEL * +#define lzo_intp lzo_int __LZO_MMODEL * +#define lzo_uintp lzo_uint __LZO_MMODEL * +#define lzo_xintp lzo_xint __LZO_MMODEL * +#define lzo_voidpp lzo_voidp __LZO_MMODEL * +#define lzo_bytepp lzo_bytep __LZO_MMODEL * + +#define lzo_int8_tp lzo_int8_t __LZO_MMODEL * +#define lzo_uint8_tp lzo_uint8_t __LZO_MMODEL * +#define lzo_int16_tp lzo_int16_t __LZO_MMODEL * +#define lzo_uint16_tp lzo_uint16_t __LZO_MMODEL * +#define lzo_int32_tp lzo_int32_t __LZO_MMODEL * +#define lzo_uint32_tp lzo_uint32_t __LZO_MMODEL * +#if defined(lzo_int64_t) +#define lzo_int64_tp lzo_int64_t __LZO_MMODEL * +#define lzo_uint64_tp lzo_uint64_t __LZO_MMODEL * +#endif + +/* Older LZO versions used to support ancient systems and memory models + * such as 16-bit MSDOS with __huge pointers or Cray PVP, but these + * obsolete configurations are not supported any longer. + */ +#if defined(__LZO_MMODEL_HUGE) +#error "__LZO_MMODEL_HUGE memory model is unsupported" +#endif +#if (LZO_MM_PVP) +#error "LZO_MM_PVP memory model is unsupported" +#endif +#if (LZO_SIZEOF_INT < 4) +#error "LZO_SIZEOF_INT < 4 is unsupported" +#endif +#if (__LZO_UINTPTR_T_IS_POINTER) +#error "__LZO_UINTPTR_T_IS_POINTER is unsupported" +#endif +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(int) >= 4) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) >= 4) +/* Strange configurations where sizeof(lzo_uint) != sizeof(size_t) should + * work but have not received much testing lately, so be strict here. + */ +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) == sizeof(size_t)) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) == sizeof(ptrdiff_t)) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) == sizeof(lzo_uintptr_t)) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(void *) == sizeof(lzo_uintptr_t)) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(char *) == sizeof(lzo_uintptr_t)) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long *) == sizeof(lzo_uintptr_t)) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(void *) == sizeof(lzo_voidp)) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(char *) == sizeof(lzo_bytep)) + + +/*********************************************************************** +// function types +************************************************************************/ + +/* name mangling */ +#if !defined(__LZO_EXTERN_C) +# ifdef __cplusplus +# define __LZO_EXTERN_C extern "C" +# else +# define __LZO_EXTERN_C extern +# endif +#endif + +/* calling convention */ +#if !defined(__LZO_CDECL) +# define __LZO_CDECL __lzo_cdecl +#endif + +/* DLL export information */ +#if !defined(__LZO_EXPORT1) +# define __LZO_EXPORT1 /*empty*/ +#endif +#if !defined(__LZO_EXPORT2) +# define __LZO_EXPORT2 /*empty*/ +#endif + +/* __cdecl calling convention for public C and assembly functions */ +#if !defined(LZO_PUBLIC) +# define LZO_PUBLIC(r) __LZO_EXPORT1 r __LZO_EXPORT2 __LZO_CDECL +#endif +#if !defined(LZO_EXTERN) +# define LZO_EXTERN(r) __LZO_EXTERN_C LZO_PUBLIC(r) +#endif +#if !defined(LZO_PRIVATE) +# define LZO_PRIVATE(r) static r __LZO_CDECL +#endif + +/* function types */ +typedef int +(__LZO_CDECL *lzo_compress_t) ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); + +typedef int +(__LZO_CDECL *lzo_decompress_t) ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); + +typedef int +(__LZO_CDECL *lzo_optimize_t) ( lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); + +typedef int +(__LZO_CDECL *lzo_compress_dict_t)(const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem, + const lzo_bytep dict, lzo_uint dict_len ); + +typedef int +(__LZO_CDECL *lzo_decompress_dict_t)(const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem, + const lzo_bytep dict, lzo_uint dict_len ); + + +/* Callback interface. Currently only the progress indicator ("nprogress") + * is used, but this may change in a future release. */ + +struct lzo_callback_t; +typedef struct lzo_callback_t lzo_callback_t; +#define lzo_callback_p lzo_callback_t __LZO_MMODEL * + +/* malloc & free function types */ +typedef lzo_voidp (__LZO_CDECL *lzo_alloc_func_t) + (lzo_callback_p self, lzo_uint items, lzo_uint size); +typedef void (__LZO_CDECL *lzo_free_func_t) + (lzo_callback_p self, lzo_voidp ptr); + +/* a progress indicator callback function */ +typedef void (__LZO_CDECL *lzo_progress_func_t) + (lzo_callback_p, lzo_uint, lzo_uint, int); + +struct lzo_callback_t +{ + /* custom allocators (set to 0 to disable) */ + lzo_alloc_func_t nalloc; /* [not used right now] */ + lzo_free_func_t nfree; /* [not used right now] */ + + /* a progress indicator callback function (set to 0 to disable) */ + lzo_progress_func_t nprogress; + + /* INFO: the first parameter "self" of the nalloc/nfree/nprogress + * callbacks points back to this struct, so you are free to store + * some extra info in the following variables. */ + lzo_voidp user1; + lzo_xint user2; + lzo_xint user3; +}; + + +/*********************************************************************** +// error codes and prototypes +************************************************************************/ + +/* Error codes for the compression/decompression functions. Negative + * values are errors, positive values will be used for special but + * normal events. + */ +#define LZO_E_OK 0 +#define LZO_E_ERROR (-1) +#define LZO_E_OUT_OF_MEMORY (-2) /* [lzo_alloc_func_t failure] */ +#define LZO_E_NOT_COMPRESSIBLE (-3) /* [not used right now] */ +#define LZO_E_INPUT_OVERRUN (-4) +#define LZO_E_OUTPUT_OVERRUN (-5) +#define LZO_E_LOOKBEHIND_OVERRUN (-6) +#define LZO_E_EOF_NOT_FOUND (-7) +#define LZO_E_INPUT_NOT_CONSUMED (-8) +#define LZO_E_NOT_YET_IMPLEMENTED (-9) /* [not used right now] */ +#define LZO_E_INVALID_ARGUMENT (-10) +#define LZO_E_INVALID_ALIGNMENT (-11) /* pointer argument is not properly aligned */ +#define LZO_E_OUTPUT_NOT_CONSUMED (-12) +#define LZO_E_INTERNAL_ERROR (-99) + + +#ifndef lzo_sizeof_dict_t +# define lzo_sizeof_dict_t ((unsigned)sizeof(lzo_bytep)) +#endif + +/* lzo_init() should be the first function you call. + * Check the return code ! + * + * lzo_init() is a macro to allow checking that the library and the + * compiler's view of various types are consistent. + */ +#define lzo_init() __lzo_init_v2(LZO_VERSION,(int)sizeof(short),(int)sizeof(int),\ + (int)sizeof(long),(int)sizeof(lzo_uint32_t),(int)sizeof(lzo_uint),\ + (int)lzo_sizeof_dict_t,(int)sizeof(char *),(int)sizeof(lzo_voidp),\ + (int)sizeof(lzo_callback_t)) +LZO_EXTERN(int) __lzo_init_v2(unsigned,int,int,int,int,int,int,int,int,int); + +/* version functions (useful for shared libraries) */ +LZO_EXTERN(unsigned) lzo_version(void); +LZO_EXTERN(const char *) lzo_version_string(void); +LZO_EXTERN(const char *) lzo_version_date(void); +LZO_EXTERN(const lzo_charp) _lzo_version_string(void); +LZO_EXTERN(const lzo_charp) _lzo_version_date(void); + +/* string functions */ +LZO_EXTERN(int) + lzo_memcmp(const lzo_voidp a, const lzo_voidp b, lzo_uint len); +LZO_EXTERN(lzo_voidp) + lzo_memcpy(lzo_voidp dst, const lzo_voidp src, lzo_uint len); +LZO_EXTERN(lzo_voidp) + lzo_memmove(lzo_voidp dst, const lzo_voidp src, lzo_uint len); +LZO_EXTERN(lzo_voidp) + lzo_memset(lzo_voidp buf, int c, lzo_uint len); + +/* checksum functions */ +LZO_EXTERN(lzo_uint32_t) + lzo_adler32(lzo_uint32_t c, const lzo_bytep buf, lzo_uint len); +LZO_EXTERN(lzo_uint32_t) + lzo_crc32(lzo_uint32_t c, const lzo_bytep buf, lzo_uint len); +LZO_EXTERN(const lzo_uint32_tp) + lzo_get_crc32_table(void); + +/* misc. */ +LZO_EXTERN(int) _lzo_config_check(void); +typedef union { + lzo_voidp a00; lzo_bytep a01; lzo_uint a02; lzo_xint a03; lzo_uintptr_t a04; + void *a05; unsigned char *a06; unsigned long a07; size_t a08; ptrdiff_t a09; +#if defined(lzo_int64_t) + lzo_uint64_t a10; +#endif +} lzo_align_t; + +/* align a char pointer on a boundary that is a multiple of 'size' */ +LZO_EXTERN(unsigned) __lzo_align_gap(const lzo_voidp p, lzo_uint size); +#define LZO_PTR_ALIGN_UP(p,size) \ + ((p) + (lzo_uint) __lzo_align_gap((const lzo_voidp)(p),(lzo_uint)(size))) + + +/*********************************************************************** +// deprecated macros - only for backward compatibility +************************************************************************/ + +/* deprecated - use 'lzo_bytep' instead of 'lzo_byte *' */ +#define lzo_byte unsigned char +/* deprecated type names */ +#define lzo_int32 lzo_int32_t +#define lzo_uint32 lzo_uint32_t +#define lzo_int32p lzo_int32_t __LZO_MMODEL * +#define lzo_uint32p lzo_uint32_t __LZO_MMODEL * +#define LZO_INT32_MAX LZO_INT32_C(2147483647) +#define LZO_UINT32_MAX LZO_UINT32_C(4294967295) +#if defined(lzo_int64_t) +#define lzo_int64 lzo_int64_t +#define lzo_uint64 lzo_uint64_t +#define lzo_int64p lzo_int64_t __LZO_MMODEL * +#define lzo_uint64p lzo_uint64_t __LZO_MMODEL * +#define LZO_INT64_MAX LZO_INT64_C(9223372036854775807) +#define LZO_UINT64_MAX LZO_UINT64_C(18446744073709551615) +#endif +/* deprecated types */ +typedef union { lzo_bytep a; lzo_uint b; } __lzo_pu_u; +typedef union { lzo_bytep a; lzo_uint32_t b; } __lzo_pu32_u; +/* deprecated defines */ +#if !defined(LZO_SIZEOF_LZO_UINT) +# define LZO_SIZEOF_LZO_UINT LZO_SIZEOF_LZO_INT +#endif + +#if defined(LZO_CFG_COMPAT) + +#define __LZOCONF_H 1 + +#if defined(LZO_ARCH_I086) +# define __LZO_i386 1 +#elif defined(LZO_ARCH_I386) +# define __LZO_i386 1 +#endif + +#if defined(LZO_OS_DOS16) +# define __LZO_DOS 1 +# define __LZO_DOS16 1 +#elif defined(LZO_OS_DOS32) +# define __LZO_DOS 1 +#elif defined(LZO_OS_WIN16) +# define __LZO_WIN 1 +# define __LZO_WIN16 1 +#elif defined(LZO_OS_WIN32) +# define __LZO_WIN 1 +#endif + +#define __LZO_CMODEL /*empty*/ +#define __LZO_DMODEL /*empty*/ +#define __LZO_ENTRY __LZO_CDECL +#define LZO_EXTERN_CDECL LZO_EXTERN +#define LZO_ALIGN LZO_PTR_ALIGN_UP + +#define lzo_compress_asm_t lzo_compress_t +#define lzo_decompress_asm_t lzo_decompress_t + +#endif /* LZO_CFG_COMPAT */ + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* already included */ + + +/* vim:set ts=4 sw=4 et: */ diff --git a/r5dev/thirdparty/cppnet/cppkore_incl/LZO1X/lzodefs.h b/r5dev/thirdparty/cppnet/cppkore_incl/LZO1X/lzodefs.h new file mode 100644 index 00000000..c3e2bcf5 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore_incl/LZO1X/lzodefs.h @@ -0,0 +1,3268 @@ +/* lzodefs.h -- architecture, OS and compiler specific defines + + This file is part of the LZO real-time data compression library. + + Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#ifndef __LZODEFS_H_INCLUDED +#define __LZODEFS_H_INCLUDED 1 + +#if defined(__CYGWIN32__) && !defined(__CYGWIN__) +# define __CYGWIN__ __CYGWIN32__ +#endif +#if 1 && defined(__INTERIX) && defined(__GNUC__) && !defined(_ALL_SOURCE) +# define _ALL_SOURCE 1 +#endif +#if defined(__mips__) && defined(__R5900__) +# if !defined(__LONG_MAX__) +# define __LONG_MAX__ 9223372036854775807L +# endif +#endif +#if 0 +#elif !defined(__LZO_LANG_OVERRIDE) +#if (defined(__clang__) || defined(__GNUC__)) && defined(__ASSEMBLER__) +# if (__ASSEMBLER__+0) <= 0 +# error "__ASSEMBLER__" +# else +# define LZO_LANG_ASSEMBLER 1 +# endif +#elif defined(__cplusplus) +# if (__cplusplus+0) <= 0 +# error "__cplusplus" +# elif (__cplusplus < 199711L) +# define LZO_LANG_CXX 1 +# elif defined(_MSC_VER) && defined(_MSVC_LANG) && (_MSVC_LANG+0 >= 201402L) && 1 +# define LZO_LANG_CXX _MSVC_LANG +# else +# define LZO_LANG_CXX __cplusplus +# endif +# define LZO_LANG_CPLUSPLUS LZO_LANG_CXX +#else +# if defined(__STDC_VERSION__) && (__STDC_VERSION__+0 >= 199409L) +# define LZO_LANG_C __STDC_VERSION__ +# else +# define LZO_LANG_C 1 +# endif +#endif +#endif +#if !defined(LZO_CFG_NO_DISABLE_WUNDEF) +#if defined(__ARMCC_VERSION) +# pragma diag_suppress 193 +#elif defined(__clang__) && defined(__clang_minor__) +# pragma clang diagnostic ignored "-Wundef" +#elif defined(__INTEL_COMPILER) +# pragma warning(disable: 193) +#elif defined(__KEIL__) && defined(__C166__) +# pragma warning disable = 322 +#elif defined(__GNUC__) && defined(__GNUC_MINOR__) && !defined(__PATHSCALE__) +# if ((__GNUC__-0) >= 5 || ((__GNUC__-0) == 4 && (__GNUC_MINOR__-0) >= 2)) +# pragma GCC diagnostic ignored "-Wundef" +# endif +#elif defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER) && !defined(__MWERKS__) +# if ((_MSC_VER-0) >= 1300) +# pragma warning(disable: 4668) +# endif +#endif +#endif +#if 0 && defined(__POCC__) && defined(_WIN32) +# if (__POCC__ >= 400) +# pragma warn(disable: 2216) +# endif +#endif +#if 0 && defined(__WATCOMC__) +# if (__WATCOMC__ >= 1050) && (__WATCOMC__ < 1060) +# pragma warning 203 9 +# endif +#endif +#if defined(__BORLANDC__) && defined(__MSDOS__) && !defined(__FLAT__) +# pragma option -h +#endif +#if !(LZO_CFG_NO_DISABLE_WCRTNONSTDC) +#ifndef _CRT_NONSTDC_NO_DEPRECATE +#define _CRT_NONSTDC_NO_DEPRECATE 1 +#endif +#ifndef _CRT_NONSTDC_NO_WARNINGS +#define _CRT_NONSTDC_NO_WARNINGS 1 +#endif +#ifndef _CRT_SECURE_NO_DEPRECATE +#define _CRT_SECURE_NO_DEPRECATE 1 +#endif +#ifndef _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS 1 +#endif +#endif +#if 0 +#define LZO_0xffffUL 0xfffful +#define LZO_0xffffffffUL 0xfffffffful +#else +#define LZO_0xffffUL 65535ul +#define LZO_0xffffffffUL 4294967295ul +#endif +#define LZO_0xffffL LZO_0xffffUL +#define LZO_0xffffffffL LZO_0xffffffffUL +#if (LZO_0xffffL == LZO_0xffffffffL) +# error "your preprocessor is broken 1" +#endif +#if (16ul * 16384ul != 262144ul) +# error "your preprocessor is broken 2" +#endif +#if 0 +#if (32767 >= 4294967295ul) +# error "your preprocessor is broken 3" +#endif +#if (65535u >= 4294967295ul) +# error "your preprocessor is broken 4" +#endif +#endif +#if defined(__COUNTER__) +# ifndef LZO_CFG_USE_COUNTER +# define LZO_CFG_USE_COUNTER 1 +# endif +#else +# undef LZO_CFG_USE_COUNTER +#endif +#if (UINT_MAX == LZO_0xffffL) +#if defined(__ZTC__) && defined(__I86__) && !defined(__OS2__) +# if !defined(MSDOS) +# define MSDOS 1 +# endif +# if !defined(_MSDOS) +# define _MSDOS 1 +# endif +#elif 0 && defined(__VERSION) && defined(MB_LEN_MAX) +# if (__VERSION == 520) && (MB_LEN_MAX == 1) +# if !defined(__AZTEC_C__) +# define __AZTEC_C__ __VERSION +# endif +# if !defined(__DOS__) +# define __DOS__ 1 +# endif +# endif +#endif +#endif +#if (UINT_MAX == LZO_0xffffL) +#if defined(_MSC_VER) && defined(M_I86HM) +# define ptrdiff_t long +# define _PTRDIFF_T_DEFINED 1 +#endif +#endif +#if (UINT_MAX == LZO_0xffffL) +# undef __LZO_RENAME_A +# undef __LZO_RENAME_B +# if defined(__AZTEC_C__) && defined(__DOS__) +# define __LZO_RENAME_A 1 +# elif defined(_MSC_VER) && defined(MSDOS) +# if (_MSC_VER < 600) +# define __LZO_RENAME_A 1 +# elif (_MSC_VER < 700) +# define __LZO_RENAME_B 1 +# endif +# elif defined(__TSC__) && defined(__OS2__) +# define __LZO_RENAME_A 1 +# elif defined(__MSDOS__) && defined(__TURBOC__) && (__TURBOC__ < 0x0410) +# define __LZO_RENAME_A 1 +# elif defined(__PACIFIC__) && defined(DOS) +# if !defined(__far) +# define __far far +# endif +# if !defined(__near) +# define __near near +# endif +# endif +# if defined(__LZO_RENAME_A) +# if !defined(__cdecl) +# define __cdecl cdecl +# endif +# if !defined(__far) +# define __far far +# endif +# if !defined(__huge) +# define __huge huge +# endif +# if !defined(__near) +# define __near near +# endif +# if !defined(__pascal) +# define __pascal pascal +# endif +# if !defined(__huge) +# define __huge huge +# endif +# elif defined(__LZO_RENAME_B) +# if !defined(__cdecl) +# define __cdecl _cdecl +# endif +# if !defined(__far) +# define __far _far +# endif +# if !defined(__huge) +# define __huge _huge +# endif +# if !defined(__near) +# define __near _near +# endif +# if !defined(__pascal) +# define __pascal _pascal +# endif +# elif (defined(__PUREC__) || defined(__TURBOC__)) && defined(__TOS__) +# if !defined(__cdecl) +# define __cdecl cdecl +# endif +# if !defined(__pascal) +# define __pascal pascal +# endif +# endif +# undef __LZO_RENAME_A +# undef __LZO_RENAME_B +#endif +#if (UINT_MAX == LZO_0xffffL) +#if defined(__AZTEC_C__) && defined(__DOS__) +# define LZO_BROKEN_CDECL_ALT_SYNTAX 1 +#elif defined(_MSC_VER) && defined(MSDOS) +# if (_MSC_VER < 600) +# define LZO_BROKEN_INTEGRAL_CONSTANTS 1 +# endif +# if (_MSC_VER < 700) +# define LZO_BROKEN_INTEGRAL_PROMOTION 1 +# define LZO_BROKEN_SIZEOF 1 +# endif +#elif defined(__PACIFIC__) && defined(DOS) +# define LZO_BROKEN_INTEGRAL_CONSTANTS 1 +#elif defined(__TURBOC__) && defined(__MSDOS__) +# if (__TURBOC__ < 0x0150) +# define LZO_BROKEN_CDECL_ALT_SYNTAX 1 +# define LZO_BROKEN_INTEGRAL_CONSTANTS 1 +# define LZO_BROKEN_INTEGRAL_PROMOTION 1 +# endif +# if (__TURBOC__ < 0x0200) +# define LZO_BROKEN_SIZEOF 1 +# endif +# if (__TURBOC__ < 0x0400) && defined(__cplusplus) +# define LZO_BROKEN_CDECL_ALT_SYNTAX 1 +# endif +#elif (defined(__PUREC__) || defined(__TURBOC__)) && defined(__TOS__) +# define LZO_BROKEN_CDECL_ALT_SYNTAX 1 +# define LZO_BROKEN_SIZEOF 1 +#endif +#endif +#if defined(__WATCOMC__) && (__WATCOMC__ < 900) +# define LZO_BROKEN_INTEGRAL_CONSTANTS 1 +#endif +#if defined(_CRAY) && defined(_CRAY1) +# define LZO_BROKEN_SIGNED_RIGHT_SHIFT 1 +#endif +#define LZO_PP_STRINGIZE(x) #x +#define LZO_PP_MACRO_EXPAND(x) LZO_PP_STRINGIZE(x) +#define LZO_PP_CONCAT0() /*empty*/ +#define LZO_PP_CONCAT1(a) a +#define LZO_PP_CONCAT2(a,b) a ## b +#define LZO_PP_CONCAT3(a,b,c) a ## b ## c +#define LZO_PP_CONCAT4(a,b,c,d) a ## b ## c ## d +#define LZO_PP_CONCAT5(a,b,c,d,e) a ## b ## c ## d ## e +#define LZO_PP_CONCAT6(a,b,c,d,e,f) a ## b ## c ## d ## e ## f +#define LZO_PP_CONCAT7(a,b,c,d,e,f,g) a ## b ## c ## d ## e ## f ## g +#define LZO_PP_ECONCAT0() LZO_PP_CONCAT0() +#define LZO_PP_ECONCAT1(a) LZO_PP_CONCAT1(a) +#define LZO_PP_ECONCAT2(a,b) LZO_PP_CONCAT2(a,b) +#define LZO_PP_ECONCAT3(a,b,c) LZO_PP_CONCAT3(a,b,c) +#define LZO_PP_ECONCAT4(a,b,c,d) LZO_PP_CONCAT4(a,b,c,d) +#define LZO_PP_ECONCAT5(a,b,c,d,e) LZO_PP_CONCAT5(a,b,c,d,e) +#define LZO_PP_ECONCAT6(a,b,c,d,e,f) LZO_PP_CONCAT6(a,b,c,d,e,f) +#define LZO_PP_ECONCAT7(a,b,c,d,e,f,g) LZO_PP_CONCAT7(a,b,c,d,e,f,g) +#define LZO_PP_EMPTY /*empty*/ +#define LZO_PP_EMPTY0() /*empty*/ +#define LZO_PP_EMPTY1(a) /*empty*/ +#define LZO_PP_EMPTY2(a,b) /*empty*/ +#define LZO_PP_EMPTY3(a,b,c) /*empty*/ +#define LZO_PP_EMPTY4(a,b,c,d) /*empty*/ +#define LZO_PP_EMPTY5(a,b,c,d,e) /*empty*/ +#define LZO_PP_EMPTY6(a,b,c,d,e,f) /*empty*/ +#define LZO_PP_EMPTY7(a,b,c,d,e,f,g) /*empty*/ +#if 1 +#define LZO_CPP_STRINGIZE(x) #x +#define LZO_CPP_MACRO_EXPAND(x) LZO_CPP_STRINGIZE(x) +#define LZO_CPP_CONCAT2(a,b) a ## b +#define LZO_CPP_CONCAT3(a,b,c) a ## b ## c +#define LZO_CPP_CONCAT4(a,b,c,d) a ## b ## c ## d +#define LZO_CPP_CONCAT5(a,b,c,d,e) a ## b ## c ## d ## e +#define LZO_CPP_CONCAT6(a,b,c,d,e,f) a ## b ## c ## d ## e ## f +#define LZO_CPP_CONCAT7(a,b,c,d,e,f,g) a ## b ## c ## d ## e ## f ## g +#define LZO_CPP_ECONCAT2(a,b) LZO_CPP_CONCAT2(a,b) +#define LZO_CPP_ECONCAT3(a,b,c) LZO_CPP_CONCAT3(a,b,c) +#define LZO_CPP_ECONCAT4(a,b,c,d) LZO_CPP_CONCAT4(a,b,c,d) +#define LZO_CPP_ECONCAT5(a,b,c,d,e) LZO_CPP_CONCAT5(a,b,c,d,e) +#define LZO_CPP_ECONCAT6(a,b,c,d,e,f) LZO_CPP_CONCAT6(a,b,c,d,e,f) +#define LZO_CPP_ECONCAT7(a,b,c,d,e,f,g) LZO_CPP_CONCAT7(a,b,c,d,e,f,g) +#endif +#define __LZO_MASK_GEN(o,b) (((((o) << ((b)-((b)!=0))) - (o)) << 1) + (o)*((b)!=0)) +#if 1 && defined(__cplusplus) +# if !defined(__STDC_CONSTANT_MACROS) +# define __STDC_CONSTANT_MACROS 1 +# endif +# if !defined(__STDC_LIMIT_MACROS) +# define __STDC_LIMIT_MACROS 1 +# endif +#endif +#if defined(__cplusplus) +# define LZO_EXTERN_C extern "C" +# define LZO_EXTERN_C_BEGIN extern "C" { +# define LZO_EXTERN_C_END } +#else +# define LZO_EXTERN_C extern +# define LZO_EXTERN_C_BEGIN /*empty*/ +# define LZO_EXTERN_C_END /*empty*/ +#endif +#if !defined(__LZO_OS_OVERRIDE) +#if (LZO_OS_FREESTANDING) +# define LZO_INFO_OS "freestanding" +#elif (LZO_OS_EMBEDDED) +# define LZO_INFO_OS "embedded" +#elif 1 && defined(__IAR_SYSTEMS_ICC__) +# define LZO_OS_EMBEDDED 1 +# define LZO_INFO_OS "embedded" +#elif defined(__CYGWIN__) && defined(__GNUC__) +# define LZO_OS_CYGWIN 1 +# define LZO_INFO_OS "cygwin" +#elif defined(__EMX__) && defined(__GNUC__) +# define LZO_OS_EMX 1 +# define LZO_INFO_OS "emx" +#elif defined(__BEOS__) +# define LZO_OS_BEOS 1 +# define LZO_INFO_OS "beos" +#elif defined(__Lynx__) +# define LZO_OS_LYNXOS 1 +# define LZO_INFO_OS "lynxos" +#elif defined(__OS400__) +# define LZO_OS_OS400 1 +# define LZO_INFO_OS "os400" +#elif defined(__QNX__) +# define LZO_OS_QNX 1 +# define LZO_INFO_OS "qnx" +#elif defined(__BORLANDC__) && defined(__DPMI32__) && (__BORLANDC__ >= 0x0460) +# define LZO_OS_DOS32 1 +# define LZO_INFO_OS "dos32" +#elif defined(__BORLANDC__) && defined(__DPMI16__) +# define LZO_OS_DOS16 1 +# define LZO_INFO_OS "dos16" +#elif defined(__ZTC__) && defined(DOS386) +# define LZO_OS_DOS32 1 +# define LZO_INFO_OS "dos32" +#elif defined(__OS2__) || defined(__OS2V2__) +# if (UINT_MAX == LZO_0xffffL) +# define LZO_OS_OS216 1 +# define LZO_INFO_OS "os216" +# elif (UINT_MAX == LZO_0xffffffffL) +# define LZO_OS_OS2 1 +# define LZO_INFO_OS "os2" +# else +# error "check your limits.h header" +# endif +#elif defined(__WIN64__) || defined(_WIN64) || defined(WIN64) +# define LZO_OS_WIN64 1 +# define LZO_INFO_OS "win64" +#elif defined(__WIN32__) || defined(_WIN32) || defined(WIN32) || defined(__WINDOWS_386__) +# define LZO_OS_WIN32 1 +# define LZO_INFO_OS "win32" +#elif defined(__MWERKS__) && defined(__INTEL__) +# define LZO_OS_WIN32 1 +# define LZO_INFO_OS "win32" +#elif defined(__WINDOWS__) || defined(_WINDOWS) || defined(_Windows) +# if (UINT_MAX == LZO_0xffffL) +# define LZO_OS_WIN16 1 +# define LZO_INFO_OS "win16" +# elif (UINT_MAX == LZO_0xffffffffL) +# define LZO_OS_WIN32 1 +# define LZO_INFO_OS "win32" +# else +# error "check your limits.h header" +# endif +#elif defined(__DOS__) || defined(__MSDOS__) || defined(_MSDOS) || defined(MSDOS) || (defined(__PACIFIC__) && defined(DOS)) +# if (UINT_MAX == LZO_0xffffL) +# define LZO_OS_DOS16 1 +# define LZO_INFO_OS "dos16" +# elif (UINT_MAX == LZO_0xffffffffL) +# define LZO_OS_DOS32 1 +# define LZO_INFO_OS "dos32" +# else +# error "check your limits.h header" +# endif +#elif defined(__WATCOMC__) +# if defined(__NT__) && (UINT_MAX == LZO_0xffffL) +# define LZO_OS_DOS16 1 +# define LZO_INFO_OS "dos16" +# elif defined(__NT__) && (__WATCOMC__ < 1100) +# define LZO_OS_WIN32 1 +# define LZO_INFO_OS "win32" +# elif defined(__linux__) || defined(__LINUX__) +# define LZO_OS_POSIX 1 +# define LZO_INFO_OS "posix" +# else +# error "please specify a target using the -bt compiler option" +# endif +#elif defined(__palmos__) +# define LZO_OS_PALMOS 1 +# define LZO_INFO_OS "palmos" +#elif defined(__TOS__) || defined(__atarist__) +# define LZO_OS_TOS 1 +# define LZO_INFO_OS "tos" +#elif defined(macintosh) && !defined(__arm__) && !defined(__i386__) && !defined(__ppc__) && !defined(__x64_64__) +# define LZO_OS_MACCLASSIC 1 +# define LZO_INFO_OS "macclassic" +#elif defined(__VMS) +# define LZO_OS_VMS 1 +# define LZO_INFO_OS "vms" +#elif (defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__) +# define LZO_OS_CONSOLE 1 +# define LZO_OS_CONSOLE_PS2 1 +# define LZO_INFO_OS "console" +# define LZO_INFO_OS_CONSOLE "ps2" +#elif defined(__mips__) && defined(__psp__) +# define LZO_OS_CONSOLE 1 +# define LZO_OS_CONSOLE_PSP 1 +# define LZO_INFO_OS "console" +# define LZO_INFO_OS_CONSOLE "psp" +#else +# define LZO_OS_POSIX 1 +# define LZO_INFO_OS "posix" +#endif +#if (LZO_OS_POSIX) +# if defined(_AIX) || defined(__AIX__) || defined(__aix__) +# define LZO_OS_POSIX_AIX 1 +# define LZO_INFO_OS_POSIX "aix" +# elif defined(__FreeBSD__) +# define LZO_OS_POSIX_FREEBSD 1 +# define LZO_INFO_OS_POSIX "freebsd" +# elif defined(__hpux__) || defined(__hpux) +# define LZO_OS_POSIX_HPUX 1 +# define LZO_INFO_OS_POSIX "hpux" +# elif defined(__INTERIX) +# define LZO_OS_POSIX_INTERIX 1 +# define LZO_INFO_OS_POSIX "interix" +# elif defined(__IRIX__) || defined(__irix__) +# define LZO_OS_POSIX_IRIX 1 +# define LZO_INFO_OS_POSIX "irix" +# elif defined(__linux__) || defined(__linux) || defined(__LINUX__) +# define LZO_OS_POSIX_LINUX 1 +# define LZO_INFO_OS_POSIX "linux" +# elif defined(__APPLE__) && defined(__MACH__) +# if ((__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__-0) >= 20000) +# define LZO_OS_POSIX_DARWIN 1040 +# define LZO_INFO_OS_POSIX "darwin_iphone" +# elif ((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0) >= 1040) +# define LZO_OS_POSIX_DARWIN __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ +# define LZO_INFO_OS_POSIX "darwin" +# else +# define LZO_OS_POSIX_DARWIN 1 +# define LZO_INFO_OS_POSIX "darwin" +# endif +# define LZO_OS_POSIX_MACOSX LZO_OS_POSIX_DARWIN +# elif defined(__minix__) || defined(__minix) +# define LZO_OS_POSIX_MINIX 1 +# define LZO_INFO_OS_POSIX "minix" +# elif defined(__NetBSD__) +# define LZO_OS_POSIX_NETBSD 1 +# define LZO_INFO_OS_POSIX "netbsd" +# elif defined(__OpenBSD__) +# define LZO_OS_POSIX_OPENBSD 1 +# define LZO_INFO_OS_POSIX "openbsd" +# elif defined(__osf__) +# define LZO_OS_POSIX_OSF 1 +# define LZO_INFO_OS_POSIX "osf" +# elif defined(__solaris__) || defined(__sun) +# if defined(__SVR4) || defined(__svr4__) +# define LZO_OS_POSIX_SOLARIS 1 +# define LZO_INFO_OS_POSIX "solaris" +# else +# define LZO_OS_POSIX_SUNOS 1 +# define LZO_INFO_OS_POSIX "sunos" +# endif +# elif defined(__ultrix__) || defined(__ultrix) +# define LZO_OS_POSIX_ULTRIX 1 +# define LZO_INFO_OS_POSIX "ultrix" +# elif defined(_UNICOS) +# define LZO_OS_POSIX_UNICOS 1 +# define LZO_INFO_OS_POSIX "unicos" +# else +# define LZO_OS_POSIX_UNKNOWN 1 +# define LZO_INFO_OS_POSIX "unknown" +# endif +#endif +#endif +#if (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16) +# if (UINT_MAX != LZO_0xffffL) +# error "unexpected configuration - check your compiler defines" +# endif +# if (ULONG_MAX != LZO_0xffffffffL) +# error "unexpected configuration - check your compiler defines" +# endif +#endif +#if (LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_WIN32 || LZO_OS_WIN64) +# if (UINT_MAX != LZO_0xffffffffL) +# error "unexpected configuration - check your compiler defines" +# endif +# if (ULONG_MAX != LZO_0xffffffffL) +# error "unexpected configuration - check your compiler defines" +# endif +#endif +#if defined(CIL) && defined(_GNUCC) && defined(__GNUC__) +# define LZO_CC_CILLY 1 +# define LZO_INFO_CC "Cilly" +# if defined(__CILLY__) +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__CILLY__) +# else +# define LZO_INFO_CCVER "unknown" +# endif +#elif 0 && defined(SDCC) && defined(__VERSION__) && !defined(__GNUC__) +# define LZO_CC_SDCC 1 +# define LZO_INFO_CC "sdcc" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(SDCC) +#elif defined(__PATHSCALE__) && defined(__PATHCC_PATCHLEVEL__) +# define LZO_CC_PATHSCALE (__PATHCC__ * 0x10000L + (__PATHCC_MINOR__-0) * 0x100 + (__PATHCC_PATCHLEVEL__-0)) +# define LZO_INFO_CC "Pathscale C" +# define LZO_INFO_CCVER __PATHSCALE__ +# if defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__) +# define LZO_CC_PATHSCALE_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0)) +# endif +#elif defined(__INTEL_COMPILER) && ((__INTEL_COMPILER-0) > 0) +# define LZO_CC_INTELC __INTEL_COMPILER +# define LZO_INFO_CC "Intel C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__INTEL_COMPILER) +# if defined(_MSC_VER) && ((_MSC_VER-0) > 0) +# define LZO_CC_INTELC_MSC _MSC_VER +# elif defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__) +# define LZO_CC_INTELC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0)) +# endif +#elif defined(__POCC__) && defined(_WIN32) +# define LZO_CC_PELLESC 1 +# define LZO_INFO_CC "Pelles C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__POCC__) +#elif defined(__ARMCC_VERSION) && defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__) +# if defined(__GNUC_PATCHLEVEL__) +# define LZO_CC_ARMCC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0)) +# else +# define LZO_CC_ARMCC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100) +# endif +# define LZO_CC_ARMCC __ARMCC_VERSION +# define LZO_INFO_CC "ARM C Compiler" +# define LZO_INFO_CCVER __VERSION__ +#elif defined(__clang__) && defined(__c2__) && defined(__c2_version__) && defined(_MSC_VER) +# define LZO_CC_CLANG (__clang_major__ * 0x10000L + (__clang_minor__-0) * 0x100 + (__clang_patchlevel__-0)) +# define LZO_CC_CLANG_C2 _MSC_VER +# define LZO_CC_CLANG_VENDOR_MICROSOFT 1 +# define LZO_INFO_CC "clang/c2" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__c2_version__) +#elif defined(__clang__) && defined(__llvm__) && defined(__VERSION__) +# if defined(__clang_major__) && defined(__clang_minor__) && defined(__clang_patchlevel__) +# define LZO_CC_CLANG (__clang_major__ * 0x10000L + (__clang_minor__-0) * 0x100 + (__clang_patchlevel__-0)) +# else +# define LZO_CC_CLANG 0x010000L +# endif +# if defined(_MSC_VER) && ((_MSC_VER-0) > 0) +# define LZO_CC_CLANG_MSC _MSC_VER +# elif defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__) +# define LZO_CC_CLANG_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0)) +# endif +# if defined(__APPLE_CC__) +# define LZO_CC_CLANG_VENDOR_APPLE 1 +# define LZO_INFO_CC "clang/apple" +# else +# define LZO_CC_CLANG_VENDOR_LLVM 1 +# define LZO_INFO_CC "clang" +# endif +# if defined(__clang_version__) +# define LZO_INFO_CCVER __clang_version__ +# else +# define LZO_INFO_CCVER __VERSION__ +# endif +#elif defined(__llvm__) && defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__) +# if defined(__GNUC_PATCHLEVEL__) +# define LZO_CC_LLVM_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0)) +# else +# define LZO_CC_LLVM_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100) +# endif +# define LZO_CC_LLVM LZO_CC_LLVM_GNUC +# define LZO_INFO_CC "llvm-gcc" +# define LZO_INFO_CCVER __VERSION__ +#elif defined(__ACK__) && defined(_ACK) +# define LZO_CC_ACK 1 +# define LZO_INFO_CC "Amsterdam Compiler Kit C" +# define LZO_INFO_CCVER "unknown" +#elif defined(__ARMCC_VERSION) && !defined(__GNUC__) +# define LZO_CC_ARMCC __ARMCC_VERSION +# define LZO_CC_ARMCC_ARMCC __ARMCC_VERSION +# define LZO_INFO_CC "ARM C Compiler" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__ARMCC_VERSION) +#elif defined(__AZTEC_C__) +# define LZO_CC_AZTECC 1 +# define LZO_INFO_CC "Aztec C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__AZTEC_C__) +#elif defined(__CODEGEARC__) +# define LZO_CC_CODEGEARC 1 +# define LZO_INFO_CC "CodeGear C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__CODEGEARC__) +#elif defined(__BORLANDC__) +# define LZO_CC_BORLANDC 1 +# define LZO_INFO_CC "Borland C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__BORLANDC__) +#elif defined(_CRAYC) && defined(_RELEASE) +# define LZO_CC_CRAYC 1 +# define LZO_INFO_CC "Cray C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_RELEASE) +#elif defined(__DMC__) && defined(__SC__) +# define LZO_CC_DMC 1 +# define LZO_INFO_CC "Digital Mars C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__DMC__) +#elif defined(__DECC) +# define LZO_CC_DECC 1 +# define LZO_INFO_CC "DEC C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__DECC) +#elif (defined(__ghs) || defined(__ghs__)) && defined(__GHS_VERSION_NUMBER) && ((__GHS_VERSION_NUMBER-0) > 0) +# define LZO_CC_GHS 1 +# define LZO_INFO_CC "Green Hills C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__GHS_VERSION_NUMBER) +# if defined(_MSC_VER) && ((_MSC_VER-0) > 0) +# define LZO_CC_GHS_MSC _MSC_VER +# elif defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__) +# define LZO_CC_GHS_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0)) +# endif +#elif defined(__HIGHC__) +# define LZO_CC_HIGHC 1 +# define LZO_INFO_CC "MetaWare High C" +# define LZO_INFO_CCVER "unknown" +#elif defined(__HP_aCC) && ((__HP_aCC-0) > 0) +# define LZO_CC_HPACC __HP_aCC +# define LZO_INFO_CC "HP aCC" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__HP_aCC) +#elif defined(__IAR_SYSTEMS_ICC__) +# define LZO_CC_IARC 1 +# define LZO_INFO_CC "IAR C" +# if defined(__VER__) +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__VER__) +# else +# define LZO_INFO_CCVER "unknown" +# endif +#elif defined(__IBMC__) && ((__IBMC__-0) > 0) +# define LZO_CC_IBMC __IBMC__ +# define LZO_INFO_CC "IBM C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__IBMC__) +#elif defined(__IBMCPP__) && ((__IBMCPP__-0) > 0) +# define LZO_CC_IBMC __IBMCPP__ +# define LZO_INFO_CC "IBM C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__IBMCPP__) +#elif defined(__KEIL__) && defined(__C166__) +# define LZO_CC_KEILC 1 +# define LZO_INFO_CC "Keil C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__C166__) +#elif defined(__LCC__) && defined(_WIN32) && defined(__LCCOPTIMLEVEL) +# define LZO_CC_LCCWIN32 1 +# define LZO_INFO_CC "lcc-win32" +# define LZO_INFO_CCVER "unknown" +#elif defined(__LCC__) +# define LZO_CC_LCC 1 +# define LZO_INFO_CC "lcc" +# if defined(__LCC_VERSION__) +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__LCC_VERSION__) +# else +# define LZO_INFO_CCVER "unknown" +# endif +#elif defined(__MWERKS__) && ((__MWERKS__-0) > 0) +# define LZO_CC_MWERKS __MWERKS__ +# define LZO_INFO_CC "Metrowerks C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__MWERKS__) +#elif (defined(__NDPC__) || defined(__NDPX__)) && defined(__i386) +# define LZO_CC_NDPC 1 +# define LZO_INFO_CC "Microway NDP C" +# define LZO_INFO_CCVER "unknown" +#elif defined(__PACIFIC__) +# define LZO_CC_PACIFICC 1 +# define LZO_INFO_CC "Pacific C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__PACIFIC__) +#elif defined(__PGI) && defined(__PGIC__) && defined(__PGIC_MINOR__) +# if defined(__PGIC_PATCHLEVEL__) +# define LZO_CC_PGI (__PGIC__ * 0x10000L + (__PGIC_MINOR__-0) * 0x100 + (__PGIC_PATCHLEVEL__-0)) +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__PGIC__) "." LZO_PP_MACRO_EXPAND(__PGIC_MINOR__) "." LZO_PP_MACRO_EXPAND(__PGIC_PATCHLEVEL__) +# else +# define LZO_CC_PGI (__PGIC__ * 0x10000L + (__PGIC_MINOR__-0) * 0x100) +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__PGIC__) "." LZO_PP_MACRO_EXPAND(__PGIC_MINOR__) ".0" +# endif +# define LZO_INFO_CC "Portland Group PGI C" +#elif defined(__PGI) && (defined(__linux__) || defined(__WIN32__)) +# define LZO_CC_PGI 1 +# define LZO_INFO_CC "Portland Group PGI C" +# define LZO_INFO_CCVER "unknown" +#elif defined(__PUREC__) && defined(__TOS__) +# define LZO_CC_PUREC 1 +# define LZO_INFO_CC "Pure C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__PUREC__) +#elif defined(__SC__) && defined(__ZTC__) +# define LZO_CC_SYMANTECC 1 +# define LZO_INFO_CC "Symantec C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__SC__) +#elif defined(__SUNPRO_C) +# define LZO_INFO_CC "SunPro C" +# if ((__SUNPRO_C-0) > 0) +# define LZO_CC_SUNPROC __SUNPRO_C +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__SUNPRO_C) +# else +# define LZO_CC_SUNPROC 1 +# define LZO_INFO_CCVER "unknown" +# endif +#elif defined(__SUNPRO_CC) +# define LZO_INFO_CC "SunPro C" +# if ((__SUNPRO_CC-0) > 0) +# define LZO_CC_SUNPROC __SUNPRO_CC +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__SUNPRO_CC) +# else +# define LZO_CC_SUNPROC 1 +# define LZO_INFO_CCVER "unknown" +# endif +#elif defined(__TINYC__) +# define LZO_CC_TINYC 1 +# define LZO_INFO_CC "Tiny C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__TINYC__) +#elif defined(__TSC__) +# define LZO_CC_TOPSPEEDC 1 +# define LZO_INFO_CC "TopSpeed C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__TSC__) +#elif defined(__WATCOMC__) +# define LZO_CC_WATCOMC 1 +# define LZO_INFO_CC "Watcom C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__WATCOMC__) +#elif defined(__TURBOC__) +# define LZO_CC_TURBOC 1 +# define LZO_INFO_CC "Turbo C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__TURBOC__) +#elif defined(__ZTC__) +# define LZO_CC_ZORTECHC 1 +# define LZO_INFO_CC "Zortech C" +# if ((__ZTC__-0) == 0x310) +# define LZO_INFO_CCVER "0x310" +# else +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__ZTC__) +# endif +#elif defined(__GNUC__) && defined(__VERSION__) +# if defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__) +# define LZO_CC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0)) +# elif defined(__GNUC_MINOR__) +# define LZO_CC_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100) +# else +# define LZO_CC_GNUC (__GNUC__ * 0x10000L) +# endif +# define LZO_INFO_CC "gcc" +# define LZO_INFO_CCVER __VERSION__ +#elif defined(_MSC_VER) && ((_MSC_VER-0) > 0) +# define LZO_CC_MSC _MSC_VER +# define LZO_INFO_CC "Microsoft C" +# if defined(_MSC_FULL_VER) +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_MSC_VER) "." LZO_PP_MACRO_EXPAND(_MSC_FULL_VER) +# else +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_MSC_VER) +# endif +#else +# define LZO_CC_UNKNOWN 1 +# define LZO_INFO_CC "unknown" +# define LZO_INFO_CCVER "unknown" +#endif +#if (LZO_CC_GNUC) && defined(__OPEN64__) +# if defined(__OPENCC__) && defined(__OPENCC_MINOR__) && defined(__OPENCC_PATCHLEVEL__) +# define LZO_CC_OPEN64 (__OPENCC__ * 0x10000L + (__OPENCC_MINOR__-0) * 0x100 + (__OPENCC_PATCHLEVEL__-0)) +# define LZO_CC_OPEN64_GNUC LZO_CC_GNUC +# endif +#endif +#if (LZO_CC_GNUC) && defined(__PCC__) +# if defined(__PCC__) && defined(__PCC_MINOR__) && defined(__PCC_MINORMINOR__) +# define LZO_CC_PCC (__PCC__ * 0x10000L + (__PCC_MINOR__-0) * 0x100 + (__PCC_MINORMINOR__-0)) +# define LZO_CC_PCC_GNUC LZO_CC_GNUC +# endif +#endif +#if 0 && (LZO_CC_MSC && (_MSC_VER >= 1200)) && !defined(_MSC_FULL_VER) +# error "LZO_CC_MSC: _MSC_FULL_VER is not defined" +#endif +#if !defined(__LZO_ARCH_OVERRIDE) && !(LZO_ARCH_GENERIC) && defined(_CRAY) +# if (UINT_MAX > LZO_0xffffffffL) && defined(_CRAY) +# if defined(_CRAYMPP) || defined(_CRAYT3D) || defined(_CRAYT3E) +# define LZO_ARCH_CRAY_MPP 1 +# elif defined(_CRAY1) +# define LZO_ARCH_CRAY_PVP 1 +# endif +# endif +#endif +#if !defined(__LZO_ARCH_OVERRIDE) +#if (LZO_ARCH_GENERIC) +# define LZO_INFO_ARCH "generic" +#elif (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16) +# define LZO_ARCH_I086 1 +# define LZO_INFO_ARCH "i086" +#elif defined(__aarch64__) || defined(_M_ARM64) +# define LZO_ARCH_ARM64 1 +# define LZO_INFO_ARCH "arm64" +#elif defined(__alpha__) || defined(__alpha) || defined(_M_ALPHA) +# define LZO_ARCH_ALPHA 1 +# define LZO_INFO_ARCH "alpha" +#elif (LZO_ARCH_CRAY_MPP) && (defined(_CRAYT3D) || defined(_CRAYT3E)) +# define LZO_ARCH_ALPHA 1 +# define LZO_INFO_ARCH "alpha" +#elif defined(__amd64__) || defined(__x86_64__) || defined(_M_AMD64) +# define LZO_ARCH_AMD64 1 +# define LZO_INFO_ARCH "amd64" +#elif defined(__arm__) || defined(_M_ARM) +# define LZO_ARCH_ARM 1 +# define LZO_INFO_ARCH "arm" +#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCARM__) +# define LZO_ARCH_ARM 1 +# define LZO_INFO_ARCH "arm" +#elif (UINT_MAX <= LZO_0xffffL) && defined(__AVR__) +# define LZO_ARCH_AVR 1 +# define LZO_INFO_ARCH "avr" +#elif defined(__avr32__) || defined(__AVR32__) +# define LZO_ARCH_AVR32 1 +# define LZO_INFO_ARCH "avr32" +#elif defined(__bfin__) +# define LZO_ARCH_BLACKFIN 1 +# define LZO_INFO_ARCH "blackfin" +#elif (UINT_MAX == LZO_0xffffL) && defined(__C166__) +# define LZO_ARCH_C166 1 +# define LZO_INFO_ARCH "c166" +#elif defined(__cris__) +# define LZO_ARCH_CRIS 1 +# define LZO_INFO_ARCH "cris" +#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCEZ80__) +# define LZO_ARCH_EZ80 1 +# define LZO_INFO_ARCH "ez80" +#elif defined(__H8300__) || defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__) +# define LZO_ARCH_H8300 1 +# define LZO_INFO_ARCH "h8300" +#elif defined(__hppa__) || defined(__hppa) +# define LZO_ARCH_HPPA 1 +# define LZO_INFO_ARCH "hppa" +#elif defined(__386__) || defined(__i386__) || defined(__i386) || defined(_M_IX86) || defined(_M_I386) +# define LZO_ARCH_I386 1 +# define LZO_ARCH_IA32 1 +# define LZO_INFO_ARCH "i386" +#elif (LZO_CC_ZORTECHC && defined(__I86__)) +# define LZO_ARCH_I386 1 +# define LZO_ARCH_IA32 1 +# define LZO_INFO_ARCH "i386" +#elif (LZO_OS_DOS32 && LZO_CC_HIGHC) && defined(_I386) +# define LZO_ARCH_I386 1 +# define LZO_ARCH_IA32 1 +# define LZO_INFO_ARCH "i386" +#elif defined(__ia64__) || defined(__ia64) || defined(_M_IA64) +# define LZO_ARCH_IA64 1 +# define LZO_INFO_ARCH "ia64" +#elif (UINT_MAX == LZO_0xffffL) && defined(__m32c__) +# define LZO_ARCH_M16C 1 +# define LZO_INFO_ARCH "m16c" +#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCM16C__) +# define LZO_ARCH_M16C 1 +# define LZO_INFO_ARCH "m16c" +#elif defined(__m32r__) +# define LZO_ARCH_M32R 1 +# define LZO_INFO_ARCH "m32r" +#elif (LZO_OS_TOS) || defined(__m68k__) || defined(__m68000__) || defined(__mc68000__) || defined(__mc68020__) || defined(_M_M68K) +# define LZO_ARCH_M68K 1 +# define LZO_INFO_ARCH "m68k" +#elif (UINT_MAX == LZO_0xffffL) && defined(__C251__) +# define LZO_ARCH_MCS251 1 +# define LZO_INFO_ARCH "mcs251" +#elif (UINT_MAX == LZO_0xffffL) && defined(__C51__) +# define LZO_ARCH_MCS51 1 +# define LZO_INFO_ARCH "mcs51" +#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICC8051__) +# define LZO_ARCH_MCS51 1 +# define LZO_INFO_ARCH "mcs51" +#elif defined(__mips__) || defined(__mips) || defined(_MIPS_ARCH) || defined(_M_MRX000) +# define LZO_ARCH_MIPS 1 +# define LZO_INFO_ARCH "mips" +#elif (UINT_MAX == LZO_0xffffL) && defined(__MSP430__) +# define LZO_ARCH_MSP430 1 +# define LZO_INFO_ARCH "msp430" +#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICC430__) +# define LZO_ARCH_MSP430 1 +# define LZO_INFO_ARCH "msp430" +#elif defined(__powerpc__) || defined(__powerpc) || defined(__ppc__) || defined(__PPC__) || defined(_M_PPC) || defined(_ARCH_PPC) || defined(_ARCH_PWR) +# define LZO_ARCH_POWERPC 1 +# define LZO_INFO_ARCH "powerpc" +#elif defined(__powerpc64__) || defined(__powerpc64) || defined(__ppc64__) || defined(__PPC64__) +# define LZO_ARCH_POWERPC 1 +# define LZO_INFO_ARCH "powerpc" +#elif defined(__powerpc64le__) || defined(__powerpc64le) || defined(__ppc64le__) || defined(__PPC64LE__) +# define LZO_ARCH_POWERPC 1 +# define LZO_INFO_ARCH "powerpc" +#elif defined(__riscv) +# define LZO_ARCH_RISCV 1 +# define LZO_INFO_ARCH "riscv" +#elif defined(__s390__) || defined(__s390) || defined(__s390x__) || defined(__s390x) +# define LZO_ARCH_S390 1 +# define LZO_INFO_ARCH "s390" +#elif defined(__sh__) || defined(_M_SH) +# define LZO_ARCH_SH 1 +# define LZO_INFO_ARCH "sh" +#elif defined(__sparc__) || defined(__sparc) || defined(__sparcv8) +# define LZO_ARCH_SPARC 1 +# define LZO_INFO_ARCH "sparc" +#elif defined(__SPU__) +# define LZO_ARCH_SPU 1 +# define LZO_INFO_ARCH "spu" +#elif (UINT_MAX == LZO_0xffffL) && defined(__z80) +# define LZO_ARCH_Z80 1 +# define LZO_INFO_ARCH "z80" +#elif (LZO_ARCH_CRAY_PVP) +# if defined(_CRAYSV1) +# define LZO_ARCH_CRAY_SV1 1 +# define LZO_INFO_ARCH "cray_sv1" +# elif (_ADDR64) +# define LZO_ARCH_CRAY_T90 1 +# define LZO_INFO_ARCH "cray_t90" +# elif (_ADDR32) +# define LZO_ARCH_CRAY_YMP 1 +# define LZO_INFO_ARCH "cray_ymp" +# else +# define LZO_ARCH_CRAY_XMP 1 +# define LZO_INFO_ARCH "cray_xmp" +# endif +#else +# define LZO_ARCH_UNKNOWN 1 +# define LZO_INFO_ARCH "unknown" +#endif +#endif +#if !defined(LZO_ARCH_ARM_THUMB2) +#if (LZO_ARCH_ARM) +# if defined(__thumb__) || defined(__thumb) || defined(_M_THUMB) +# if defined(__thumb2__) +# define LZO_ARCH_ARM_THUMB2 1 +# elif 1 && defined(__TARGET_ARCH_THUMB) && ((__TARGET_ARCH_THUMB)+0 >= 4) +# define LZO_ARCH_ARM_THUMB2 1 +# elif 1 && defined(_MSC_VER) && defined(_M_THUMB) && ((_M_THUMB)+0 >= 7) +# define LZO_ARCH_ARM_THUMB2 1 +# endif +# endif +#endif +#endif +#if (LZO_ARCH_ARM_THUMB2) +# undef LZO_INFO_ARCH +# define LZO_INFO_ARCH "arm_thumb2" +#endif +#if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_DOS32 || LZO_OS_OS2) +# error "FIXME - missing define for CPU architecture" +#endif +#if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_WIN32) +# error "FIXME - missing LZO_OS_WIN32 define for CPU architecture" +#endif +#if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_WIN64) +# error "FIXME - missing LZO_OS_WIN64 define for CPU architecture" +#endif +#if (LZO_OS_OS216 || LZO_OS_WIN16) +# define LZO_ARCH_I086PM 1 +#elif 1 && (LZO_OS_DOS16 && defined(BLX286)) +# define LZO_ARCH_I086PM 1 +#elif 1 && (LZO_OS_DOS16 && defined(DOSX286)) +# define LZO_ARCH_I086PM 1 +#elif 1 && (LZO_OS_DOS16 && LZO_CC_BORLANDC && defined(__DPMI16__)) +# define LZO_ARCH_I086PM 1 +#endif +#if (LZO_ARCH_AMD64 && !LZO_ARCH_X64) +# define LZO_ARCH_X64 1 +#elif (!LZO_ARCH_AMD64 && LZO_ARCH_X64) && defined(__LZO_ARCH_OVERRIDE) +# define LZO_ARCH_AMD64 1 +#endif +#if (LZO_ARCH_ARM64 && !LZO_ARCH_AARCH64) +# define LZO_ARCH_AARCH64 1 +#elif (!LZO_ARCH_ARM64 && LZO_ARCH_AARCH64) && defined(__LZO_ARCH_OVERRIDE) +# define LZO_ARCH_ARM64 1 +#endif +#if (LZO_ARCH_I386 && !LZO_ARCH_X86) +# define LZO_ARCH_X86 1 +#elif (!LZO_ARCH_I386 && LZO_ARCH_X86) && defined(__LZO_ARCH_OVERRIDE) +# define LZO_ARCH_I386 1 +#endif +#if (LZO_ARCH_AMD64 && !LZO_ARCH_X64) || (!LZO_ARCH_AMD64 && LZO_ARCH_X64) +# error "unexpected configuration - check your compiler defines" +#endif +#if (LZO_ARCH_ARM64 && !LZO_ARCH_AARCH64) || (!LZO_ARCH_ARM64 && LZO_ARCH_AARCH64) +# error "unexpected configuration - check your compiler defines" +#endif +#if (LZO_ARCH_I386 && !LZO_ARCH_X86) || (!LZO_ARCH_I386 && LZO_ARCH_X86) +# error "unexpected configuration - check your compiler defines" +#endif +#if (LZO_ARCH_ARM_THUMB1 && !LZO_ARCH_ARM) +# error "unexpected configuration - check your compiler defines" +#endif +#if (LZO_ARCH_ARM_THUMB2 && !LZO_ARCH_ARM) +# error "unexpected configuration - check your compiler defines" +#endif +#if (LZO_ARCH_ARM_THUMB1 && LZO_ARCH_ARM_THUMB2) +# error "unexpected configuration - check your compiler defines" +#endif +#if (LZO_ARCH_I086PM && !LZO_ARCH_I086) +# error "unexpected configuration - check your compiler defines" +#endif +#if (LZO_ARCH_I086) +# if (UINT_MAX != LZO_0xffffL) +# error "unexpected configuration - check your compiler defines" +# endif +# if (ULONG_MAX != LZO_0xffffffffL) +# error "unexpected configuration - check your compiler defines" +# endif +#endif +#if (LZO_ARCH_I386) +# if (UINT_MAX != LZO_0xffffL) && defined(__i386_int16__) +# error "unexpected configuration - check your compiler defines" +# endif +# if (UINT_MAX != LZO_0xffffffffL) && !defined(__i386_int16__) +# error "unexpected configuration - check your compiler defines" +# endif +# if (ULONG_MAX != LZO_0xffffffffL) +# error "unexpected configuration - check your compiler defines" +# endif +#endif +#if (LZO_ARCH_AMD64 || LZO_ARCH_I386) +# if !defined(LZO_TARGET_FEATURE_SSE2) +# if defined(__SSE2__) +# define LZO_TARGET_FEATURE_SSE2 1 +# elif defined(_MSC_VER) && (defined(_M_IX86_FP) && ((_M_IX86_FP)+0 >= 2)) +# define LZO_TARGET_FEATURE_SSE2 1 +# elif (LZO_CC_INTELC_MSC || LZO_CC_MSC) && defined(_M_AMD64) +# define LZO_TARGET_FEATURE_SSE2 1 +# endif +# endif +# if !defined(LZO_TARGET_FEATURE_SSSE3) +# if (LZO_TARGET_FEATURE_SSE2) +# if defined(__SSSE3__) +# define LZO_TARGET_FEATURE_SSSE3 1 +# elif defined(_MSC_VER) && defined(__AVX__) +# define LZO_TARGET_FEATURE_SSSE3 1 +# endif +# endif +# endif +# if !defined(LZO_TARGET_FEATURE_SSE4_2) +# if (LZO_TARGET_FEATURE_SSSE3) +# if defined(__SSE4_2__) +# define LZO_TARGET_FEATURE_SSE4_2 1 +# endif +# endif +# endif +# if !defined(LZO_TARGET_FEATURE_AVX) +# if (LZO_TARGET_FEATURE_SSSE3) +# if defined(__AVX__) +# define LZO_TARGET_FEATURE_AVX 1 +# endif +# endif +# endif +# if !defined(LZO_TARGET_FEATURE_AVX2) +# if (LZO_TARGET_FEATURE_AVX) +# if defined(__AVX2__) +# define LZO_TARGET_FEATURE_AVX2 1 +# endif +# endif +# endif +#endif +#if (LZO_TARGET_FEATURE_SSSE3 && !(LZO_TARGET_FEATURE_SSE2)) +# error "unexpected configuration - check your compiler defines" +#endif +#if (LZO_TARGET_FEATURE_SSE4_2 && !(LZO_TARGET_FEATURE_SSSE3)) +# error "unexpected configuration - check your compiler defines" +#endif +#if (LZO_TARGET_FEATURE_AVX && !(LZO_TARGET_FEATURE_SSSE3)) +# error "unexpected configuration - check your compiler defines" +#endif +#if (LZO_TARGET_FEATURE_AVX2 && !(LZO_TARGET_FEATURE_AVX)) +# error "unexpected configuration - check your compiler defines" +#endif +#if (LZO_ARCH_ARM) +# if !defined(LZO_TARGET_FEATURE_NEON) +# if defined(__ARM_NEON) && ((__ARM_NEON)+0) +# define LZO_TARGET_FEATURE_NEON 1 +# elif 1 && defined(__ARM_NEON__) && ((__ARM_NEON__)+0) +# define LZO_TARGET_FEATURE_NEON 1 +# elif 1 && defined(__TARGET_FEATURE_NEON) && ((__TARGET_FEATURE_NEON)+0) +# define LZO_TARGET_FEATURE_NEON 1 +# endif +# endif +#elif (LZO_ARCH_ARM64) +# if !defined(LZO_TARGET_FEATURE_NEON) +# if 1 +# define LZO_TARGET_FEATURE_NEON 1 +# endif +# endif +#endif +#if 0 +#elif !defined(__LZO_MM_OVERRIDE) +#if (LZO_ARCH_I086) +#if (UINT_MAX != LZO_0xffffL) +# error "unexpected configuration - check your compiler defines" +#endif +#if defined(__TINY__) || defined(M_I86TM) || defined(_M_I86TM) +# define LZO_MM_TINY 1 +#elif defined(__HUGE__) || defined(_HUGE_) || defined(M_I86HM) || defined(_M_I86HM) +# define LZO_MM_HUGE 1 +#elif defined(__SMALL__) || defined(M_I86SM) || defined(_M_I86SM) || defined(SMALL_MODEL) +# define LZO_MM_SMALL 1 +#elif defined(__MEDIUM__) || defined(M_I86MM) || defined(_M_I86MM) +# define LZO_MM_MEDIUM 1 +#elif defined(__COMPACT__) || defined(M_I86CM) || defined(_M_I86CM) +# define LZO_MM_COMPACT 1 +#elif defined(__LARGE__) || defined(M_I86LM) || defined(_M_I86LM) || defined(LARGE_MODEL) +# define LZO_MM_LARGE 1 +#elif (LZO_CC_AZTECC) +# if defined(_LARGE_CODE) && defined(_LARGE_DATA) +# define LZO_MM_LARGE 1 +# elif defined(_LARGE_CODE) +# define LZO_MM_MEDIUM 1 +# elif defined(_LARGE_DATA) +# define LZO_MM_COMPACT 1 +# else +# define LZO_MM_SMALL 1 +# endif +#elif (LZO_CC_ZORTECHC && defined(__VCM__)) +# define LZO_MM_LARGE 1 +#else +# error "unknown LZO_ARCH_I086 memory model" +#endif +#if (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16) +#define LZO_HAVE_MM_HUGE_PTR 1 +#define LZO_HAVE_MM_HUGE_ARRAY 1 +#if (LZO_MM_TINY) +# undef LZO_HAVE_MM_HUGE_ARRAY +#endif +#if (LZO_CC_AZTECC || LZO_CC_PACIFICC || LZO_CC_ZORTECHC) +# undef LZO_HAVE_MM_HUGE_PTR +# undef LZO_HAVE_MM_HUGE_ARRAY +#elif (LZO_CC_DMC || LZO_CC_SYMANTECC) +# undef LZO_HAVE_MM_HUGE_ARRAY +#elif (LZO_CC_MSC && defined(_QC)) +# undef LZO_HAVE_MM_HUGE_ARRAY +# if (_MSC_VER < 600) +# undef LZO_HAVE_MM_HUGE_PTR +# endif +#elif (LZO_CC_TURBOC && (__TURBOC__ < 0x0295)) +# undef LZO_HAVE_MM_HUGE_ARRAY +#endif +#if (LZO_ARCH_I086PM) && !(LZO_HAVE_MM_HUGE_PTR) +# if (LZO_OS_DOS16) +# error "unexpected configuration - check your compiler defines" +# elif (LZO_CC_ZORTECHC) +# else +# error "unexpected configuration - check your compiler defines" +# endif +#endif +#if defined(__cplusplus) +extern "C" { +#endif +#if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0200)) + extern void __near __cdecl _AHSHIFT(void); +# define LZO_MM_AHSHIFT ((unsigned) _AHSHIFT) +#elif (LZO_CC_DMC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC) + extern void __near __cdecl _AHSHIFT(void); +# define LZO_MM_AHSHIFT ((unsigned) _AHSHIFT) +#elif (LZO_CC_MSC || LZO_CC_TOPSPEEDC) + extern void __near __cdecl _AHSHIFT(void); +# define LZO_MM_AHSHIFT ((unsigned) _AHSHIFT) +#elif (LZO_CC_TURBOC && (__TURBOC__ >= 0x0295)) + extern void __near __cdecl _AHSHIFT(void); +# define LZO_MM_AHSHIFT ((unsigned) _AHSHIFT) +#elif ((LZO_CC_AZTECC || LZO_CC_PACIFICC || LZO_CC_TURBOC) && LZO_OS_DOS16) +# define LZO_MM_AHSHIFT 12 +#elif (LZO_CC_WATCOMC) + extern unsigned char _HShift; +# define LZO_MM_AHSHIFT ((unsigned) _HShift) +#else +# error "FIXME - implement LZO_MM_AHSHIFT" +#endif +#if defined(__cplusplus) +} +#endif +#endif +#elif (LZO_ARCH_C166) +#if !defined(__MODEL__) +# error "FIXME - LZO_ARCH_C166 __MODEL__" +#elif ((__MODEL__) == 0) +# define LZO_MM_SMALL 1 +#elif ((__MODEL__) == 1) +# define LZO_MM_SMALL 1 +#elif ((__MODEL__) == 2) +# define LZO_MM_LARGE 1 +#elif ((__MODEL__) == 3) +# define LZO_MM_TINY 1 +#elif ((__MODEL__) == 4) +# define LZO_MM_XTINY 1 +#elif ((__MODEL__) == 5) +# define LZO_MM_XSMALL 1 +#else +# error "FIXME - LZO_ARCH_C166 __MODEL__" +#endif +#elif (LZO_ARCH_MCS251) +#if !defined(__MODEL__) +# error "FIXME - LZO_ARCH_MCS251 __MODEL__" +#elif ((__MODEL__) == 0) +# define LZO_MM_SMALL 1 +#elif ((__MODEL__) == 2) +# define LZO_MM_LARGE 1 +#elif ((__MODEL__) == 3) +# define LZO_MM_TINY 1 +#elif ((__MODEL__) == 4) +# define LZO_MM_XTINY 1 +#elif ((__MODEL__) == 5) +# define LZO_MM_XSMALL 1 +#else +# error "FIXME - LZO_ARCH_MCS251 __MODEL__" +#endif +#elif (LZO_ARCH_MCS51) +#if !defined(__MODEL__) +# error "FIXME - LZO_ARCH_MCS51 __MODEL__" +#elif ((__MODEL__) == 1) +# define LZO_MM_SMALL 1 +#elif ((__MODEL__) == 2) +# define LZO_MM_LARGE 1 +#elif ((__MODEL__) == 3) +# define LZO_MM_TINY 1 +#elif ((__MODEL__) == 4) +# define LZO_MM_XTINY 1 +#elif ((__MODEL__) == 5) +# define LZO_MM_XSMALL 1 +#else +# error "FIXME - LZO_ARCH_MCS51 __MODEL__" +#endif +#elif (LZO_ARCH_CRAY_PVP) +# define LZO_MM_PVP 1 +#else +# define LZO_MM_FLAT 1 +#endif +#if (LZO_MM_COMPACT) +# define LZO_INFO_MM "compact" +#elif (LZO_MM_FLAT) +# define LZO_INFO_MM "flat" +#elif (LZO_MM_HUGE) +# define LZO_INFO_MM "huge" +#elif (LZO_MM_LARGE) +# define LZO_INFO_MM "large" +#elif (LZO_MM_MEDIUM) +# define LZO_INFO_MM "medium" +#elif (LZO_MM_PVP) +# define LZO_INFO_MM "pvp" +#elif (LZO_MM_SMALL) +# define LZO_INFO_MM "small" +#elif (LZO_MM_TINY) +# define LZO_INFO_MM "tiny" +#else +# error "unknown memory model" +#endif +#endif +#if !defined(__lzo_gnuc_extension__) +#if (LZO_CC_GNUC >= 0x020800ul) +# define __lzo_gnuc_extension__ __extension__ +#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_gnuc_extension__ __extension__ +#elif (LZO_CC_IBMC >= 600) +# define __lzo_gnuc_extension__ __extension__ +#endif +#endif +#if !defined(__lzo_gnuc_extension__) +# define __lzo_gnuc_extension__ /*empty*/ +#endif +#if !defined(lzo_has_builtin) +#if (LZO_CC_CLANG) && defined(__has_builtin) +# define lzo_has_builtin __has_builtin +#endif +#endif +#if !defined(lzo_has_builtin) +# define lzo_has_builtin(x) 0 +#endif +#if !defined(lzo_has_attribute) +#if (LZO_CC_CLANG) && defined(__has_attribute) +# define lzo_has_attribute __has_attribute +#endif +#endif +#if !defined(lzo_has_attribute) +# define lzo_has_attribute(x) 0 +#endif +#if !defined(lzo_has_declspec_attribute) +#if (LZO_CC_CLANG) && defined(__has_declspec_attribute) +# define lzo_has_declspec_attribute __has_declspec_attribute +#endif +#endif +#if !defined(lzo_has_declspec_attribute) +# define lzo_has_declspec_attribute(x) 0 +#endif +#if !defined(lzo_has_feature) +#if (LZO_CC_CLANG) && defined(__has_feature) +# define lzo_has_feature __has_feature +#endif +#endif +#if !defined(lzo_has_feature) +# define lzo_has_feature(x) 0 +#endif +#if !defined(lzo_has_extension) +#if (LZO_CC_CLANG) && defined(__has_extension) +# define lzo_has_extension __has_extension +#elif (LZO_CC_CLANG) && defined(__has_feature) +# define lzo_has_extension __has_feature +#endif +#endif +#if !defined(lzo_has_extension) +# define lzo_has_extension(x) 0 +#endif +#if !defined(LZO_CFG_USE_NEW_STYLE_CASTS) && defined(__cplusplus) && 0 +# if (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020800ul)) +# define LZO_CFG_USE_NEW_STYLE_CASTS 0 +# elif (LZO_CC_INTELC && (__INTEL_COMPILER < 1200)) +# define LZO_CFG_USE_NEW_STYLE_CASTS 0 +# else +# define LZO_CFG_USE_NEW_STYLE_CASTS 1 +# endif +#endif +#if !defined(LZO_CFG_USE_NEW_STYLE_CASTS) +# define LZO_CFG_USE_NEW_STYLE_CASTS 0 +#endif +#if !defined(__cplusplus) +# if defined(LZO_CFG_USE_NEW_STYLE_CASTS) +# undef LZO_CFG_USE_NEW_STYLE_CASTS +# endif +# define LZO_CFG_USE_NEW_STYLE_CASTS 0 +#endif +#if !defined(LZO_REINTERPRET_CAST) +# if (LZO_CFG_USE_NEW_STYLE_CASTS) +# define LZO_REINTERPRET_CAST(t,e) (reinterpret_cast (e)) +# endif +#endif +#if !defined(LZO_REINTERPRET_CAST) +# define LZO_REINTERPRET_CAST(t,e) ((t) (e)) +#endif +#if !defined(LZO_STATIC_CAST) +# if (LZO_CFG_USE_NEW_STYLE_CASTS) +# define LZO_STATIC_CAST(t,e) (static_cast (e)) +# endif +#endif +#if !defined(LZO_STATIC_CAST) +# define LZO_STATIC_CAST(t,e) ((t) (e)) +#endif +#if !defined(LZO_STATIC_CAST2) +# define LZO_STATIC_CAST2(t1,t2,e) LZO_STATIC_CAST(t1, LZO_STATIC_CAST(t2, e)) +#endif +#if !defined(LZO_UNCONST_CAST) +# if (LZO_CFG_USE_NEW_STYLE_CASTS) +# define LZO_UNCONST_CAST(t,e) (const_cast (e)) +# elif (LZO_HAVE_MM_HUGE_PTR) +# define LZO_UNCONST_CAST(t,e) ((t) (e)) +# elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define LZO_UNCONST_CAST(t,e) ((t) ((void *) ((lzo_uintptr_t) ((const void *) (e))))) +# endif +#endif +#if !defined(LZO_UNCONST_CAST) +# define LZO_UNCONST_CAST(t,e) ((t) ((void *) ((const void *) (e)))) +#endif +#if !defined(LZO_UNCONST_VOLATILE_CAST) +# if (LZO_CFG_USE_NEW_STYLE_CASTS) +# define LZO_UNCONST_VOLATILE_CAST(t,e) (const_cast (e)) +# elif (LZO_HAVE_MM_HUGE_PTR) +# define LZO_UNCONST_VOLATILE_CAST(t,e) ((t) (e)) +# elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define LZO_UNCONST_VOLATILE_CAST(t,e) ((t) ((volatile void *) ((lzo_uintptr_t) ((volatile const void *) (e))))) +# endif +#endif +#if !defined(LZO_UNCONST_VOLATILE_CAST) +# define LZO_UNCONST_VOLATILE_CAST(t,e) ((t) ((volatile void *) ((volatile const void *) (e)))) +#endif +#if !defined(LZO_UNVOLATILE_CAST) +# if (LZO_CFG_USE_NEW_STYLE_CASTS) +# define LZO_UNVOLATILE_CAST(t,e) (const_cast (e)) +# elif (LZO_HAVE_MM_HUGE_PTR) +# define LZO_UNVOLATILE_CAST(t,e) ((t) (e)) +# elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define LZO_UNVOLATILE_CAST(t,e) ((t) ((void *) ((lzo_uintptr_t) ((volatile void *) (e))))) +# endif +#endif +#if !defined(LZO_UNVOLATILE_CAST) +# define LZO_UNVOLATILE_CAST(t,e) ((t) ((void *) ((volatile void *) (e)))) +#endif +#if !defined(LZO_UNVOLATILE_CONST_CAST) +# if (LZO_CFG_USE_NEW_STYLE_CASTS) +# define LZO_UNVOLATILE_CONST_CAST(t,e) (const_cast (e)) +# elif (LZO_HAVE_MM_HUGE_PTR) +# define LZO_UNVOLATILE_CONST_CAST(t,e) ((t) (e)) +# elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define LZO_UNVOLATILE_CONST_CAST(t,e) ((t) ((const void *) ((lzo_uintptr_t) ((volatile const void *) (e))))) +# endif +#endif +#if !defined(LZO_UNVOLATILE_CONST_CAST) +# define LZO_UNVOLATILE_CONST_CAST(t,e) ((t) ((const void *) ((volatile const void *) (e)))) +#endif +#if !defined(LZO_PCAST) +# if (LZO_HAVE_MM_HUGE_PTR) +# define LZO_PCAST(t,e) ((t) (e)) +# endif +#endif +#if !defined(LZO_PCAST) +# define LZO_PCAST(t,e) LZO_STATIC_CAST(t, LZO_STATIC_CAST(void *, e)) +#endif +#if !defined(LZO_CCAST) +# if (LZO_HAVE_MM_HUGE_PTR) +# define LZO_CCAST(t,e) ((t) (e)) +# endif +#endif +#if !defined(LZO_CCAST) +# define LZO_CCAST(t,e) LZO_STATIC_CAST(t, LZO_STATIC_CAST(const void *, e)) +#endif +#if !defined(LZO_ICONV) +# define LZO_ICONV(t,e) LZO_STATIC_CAST(t, e) +#endif +#if !defined(LZO_ICAST) +# define LZO_ICAST(t,e) LZO_STATIC_CAST(t, e) +#endif +#if !defined(LZO_ITRUNC) +# define LZO_ITRUNC(t,e) LZO_STATIC_CAST(t, e) +#endif +#if !defined(__lzo_cte) +# if (LZO_CC_MSC || LZO_CC_WATCOMC) +# define __lzo_cte(e) ((void)0,(e)) +# elif 1 +# define __lzo_cte(e) ((void)0,(e)) +# endif +#endif +#if !defined(__lzo_cte) +# define __lzo_cte(e) (e) +#endif +#if !defined(LZO_BLOCK_BEGIN) +# define LZO_BLOCK_BEGIN do { +# define LZO_BLOCK_END } while __lzo_cte(0) +#endif +#if !defined(LZO_UNUSED) +# if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0600)) +# define LZO_UNUSED(var) ((void) &var) +# elif (LZO_CC_BORLANDC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PELLESC || LZO_CC_TURBOC) +# define LZO_UNUSED(var) if (&var) ; else +# elif (LZO_CC_CLANG && (LZO_CC_CLANG >= 0x030200ul)) +# define LZO_UNUSED(var) ((void) &var) +# elif (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define LZO_UNUSED(var) ((void) var) +# elif (LZO_CC_MSC && (_MSC_VER < 900)) +# define LZO_UNUSED(var) if (&var) ; else +# elif (LZO_CC_KEILC) +# define LZO_UNUSED(var) {extern int lzo_unused__[1-2*!(sizeof(var)>0)]; (void)lzo_unused__;} +# elif (LZO_CC_PACIFICC) +# define LZO_UNUSED(var) ((void) sizeof(var)) +# elif (LZO_CC_WATCOMC) && defined(__cplusplus) +# define LZO_UNUSED(var) ((void) var) +# else +# define LZO_UNUSED(var) ((void) &var) +# endif +#endif +#if !defined(LZO_UNUSED_RESULT) +# define LZO_UNUSED_RESULT(var) LZO_UNUSED(var) +#endif +#if !defined(LZO_UNUSED_FUNC) +# if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0600)) +# define LZO_UNUSED_FUNC(func) ((void) func) +# elif (LZO_CC_BORLANDC || LZO_CC_NDPC || LZO_CC_TURBOC) +# define LZO_UNUSED_FUNC(func) if (func) ; else +# elif (LZO_CC_CLANG || LZO_CC_LLVM) +# define LZO_UNUSED_FUNC(func) ((void) &func) +# elif (LZO_CC_MSC && (_MSC_VER < 900)) +# define LZO_UNUSED_FUNC(func) if (func) ; else +# elif (LZO_CC_MSC) +# define LZO_UNUSED_FUNC(func) ((void) &func) +# elif (LZO_CC_KEILC || LZO_CC_PELLESC) +# define LZO_UNUSED_FUNC(func) {extern int lzo_unused__[1-2*!(sizeof((int)func)>0)]; (void)lzo_unused__;} +# else +# define LZO_UNUSED_FUNC(func) ((void) func) +# endif +#endif +#if !defined(LZO_UNUSED_LABEL) +# if (LZO_CC_CLANG >= 0x020800ul) +# define LZO_UNUSED_LABEL(l) (__lzo_gnuc_extension__ ((void) ((const void *) &&l))) +# elif (LZO_CC_ARMCC || LZO_CC_CLANG || LZO_CC_INTELC || LZO_CC_WATCOMC) +# define LZO_UNUSED_LABEL(l) if __lzo_cte(0) goto l +# else +# define LZO_UNUSED_LABEL(l) switch (0) case 1:goto l +# endif +#endif +#if !defined(LZO_DEFINE_UNINITIALIZED_VAR) +# if 0 +# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var +# elif 0 && (LZO_CC_GNUC) +# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = var +# else +# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = init +# endif +#endif +#if !defined(__lzo_inline) +#if (LZO_CC_TURBOC && (__TURBOC__ <= 0x0295)) +#elif defined(__cplusplus) +# define __lzo_inline inline +#elif defined(__STDC_VERSION__) && (__STDC_VERSION__-0 >= 199901L) +# define __lzo_inline inline +#elif (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0550)) +# define __lzo_inline __inline +#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CILLY || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI) +# define __lzo_inline __inline__ +#elif (LZO_CC_DMC) +# define __lzo_inline __inline +#elif (LZO_CC_GHS) +# define __lzo_inline __inline__ +#elif (LZO_CC_IBMC >= 600) +# define __lzo_inline __inline__ +#elif (LZO_CC_INTELC) +# define __lzo_inline __inline +#elif (LZO_CC_MWERKS && (__MWERKS__ >= 0x2405)) +# define __lzo_inline __inline +#elif (LZO_CC_MSC && (_MSC_VER >= 900)) +# define __lzo_inline __inline +#elif (LZO_CC_SUNPROC >= 0x5100) +# define __lzo_inline __inline__ +#endif +#endif +#if defined(__lzo_inline) +# ifndef __lzo_HAVE_inline +# define __lzo_HAVE_inline 1 +# endif +#else +# define __lzo_inline /*empty*/ +#endif +#if !defined(__lzo_forceinline) +#if (LZO_CC_GNUC >= 0x030200ul) +# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) +#elif (LZO_CC_IBMC >= 700) +# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) +#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 450)) +# define __lzo_forceinline __forceinline +#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 800)) +# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) +#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) +#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) +# define __lzo_forceinline __forceinline +#elif (LZO_CC_PGI >= 0x0d0a00ul) +# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) +#elif (LZO_CC_SUNPROC >= 0x5100) +# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) +#endif +#endif +#if defined(__lzo_forceinline) +# ifndef __lzo_HAVE_forceinline +# define __lzo_HAVE_forceinline 1 +# endif +#else +# define __lzo_forceinline __lzo_inline +#endif +#if !defined(__lzo_noinline) +#if 1 && (LZO_ARCH_I386) && (LZO_CC_GNUC >= 0x040000ul) && (LZO_CC_GNUC < 0x040003ul) +# define __lzo_noinline __attribute__((__noinline__,__used__)) +#elif (LZO_CC_GNUC >= 0x030200ul) +# define __lzo_noinline __attribute__((__noinline__)) +#elif (LZO_CC_IBMC >= 700) +# define __lzo_noinline __attribute__((__noinline__)) +#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 600)) +# define __lzo_noinline __declspec(noinline) +#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 800)) +# define __lzo_noinline __attribute__((__noinline__)) +#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_noinline __attribute__((__noinline__)) +#elif (LZO_CC_MSC && (_MSC_VER >= 1300)) +# define __lzo_noinline __declspec(noinline) +#elif (LZO_CC_MWERKS && (__MWERKS__ >= 0x3200) && (LZO_OS_WIN32 || LZO_OS_WIN64)) +# if defined(__cplusplus) +# else +# define __lzo_noinline __declspec(noinline) +# endif +#elif (LZO_CC_PGI >= 0x0d0a00ul) +# define __lzo_noinline __attribute__((__noinline__)) +#elif (LZO_CC_SUNPROC >= 0x5100) +# define __lzo_noinline __attribute__((__noinline__)) +#endif +#endif +#if defined(__lzo_noinline) +# ifndef __lzo_HAVE_noinline +# define __lzo_HAVE_noinline 1 +# endif +#else +# define __lzo_noinline /*empty*/ +#endif +#if (__lzo_HAVE_forceinline || __lzo_HAVE_noinline) && !(__lzo_HAVE_inline) +# error "unexpected configuration - check your compiler defines" +#endif +#if !defined(__lzo_static_inline) +#if (LZO_CC_IBMC) +# define __lzo_static_inline __lzo_gnuc_extension__ static __lzo_inline +#endif +#endif +#if !defined(__lzo_static_inline) +# define __lzo_static_inline static __lzo_inline +#endif +#if !defined(__lzo_static_forceinline) +#if (LZO_CC_IBMC) +# define __lzo_static_forceinline __lzo_gnuc_extension__ static __lzo_forceinline +#endif +#endif +#if !defined(__lzo_static_forceinline) +# define __lzo_static_forceinline static __lzo_forceinline +#endif +#if !defined(__lzo_static_noinline) +#if (LZO_CC_IBMC) +# define __lzo_static_noinline __lzo_gnuc_extension__ static __lzo_noinline +#endif +#endif +#if !defined(__lzo_static_noinline) +# define __lzo_static_noinline static __lzo_noinline +#endif +#if !defined(__lzo_c99_extern_inline) +#if defined(__GNUC_GNU_INLINE__) +# define __lzo_c99_extern_inline __lzo_inline +#elif defined(__GNUC_STDC_INLINE__) +# define __lzo_c99_extern_inline extern __lzo_inline +#elif defined(__STDC_VERSION__) && (__STDC_VERSION__-0 >= 199901L) +# define __lzo_c99_extern_inline extern __lzo_inline +#endif +#if !defined(__lzo_c99_extern_inline) && (__lzo_HAVE_inline) +# define __lzo_c99_extern_inline __lzo_inline +#endif +#endif +#if defined(__lzo_c99_extern_inline) +# ifndef __lzo_HAVE_c99_extern_inline +# define __lzo_HAVE_c99_extern_inline 1 +# endif +#else +# define __lzo_c99_extern_inline /*empty*/ +#endif +#if !defined(__lzo_may_alias) +#if (LZO_CC_GNUC >= 0x030400ul) +# define __lzo_may_alias __attribute__((__may_alias__)) +#elif (LZO_CC_CLANG >= 0x020900ul) +# define __lzo_may_alias __attribute__((__may_alias__)) +#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 1210)) && 0 +# define __lzo_may_alias __attribute__((__may_alias__)) +#elif (LZO_CC_PGI >= 0x0d0a00ul) && 0 +# define __lzo_may_alias __attribute__((__may_alias__)) +#endif +#endif +#if defined(__lzo_may_alias) +# ifndef __lzo_HAVE_may_alias +# define __lzo_HAVE_may_alias 1 +# endif +#else +# define __lzo_may_alias /*empty*/ +#endif +#if !defined(__lzo_noreturn) +#if (LZO_CC_GNUC >= 0x020700ul) +# define __lzo_noreturn __attribute__((__noreturn__)) +#elif (LZO_CC_IBMC >= 700) +# define __lzo_noreturn __attribute__((__noreturn__)) +#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 450)) +# define __lzo_noreturn __declspec(noreturn) +#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 600)) +# define __lzo_noreturn __attribute__((__noreturn__)) +#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_noreturn __attribute__((__noreturn__)) +#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) +# define __lzo_noreturn __declspec(noreturn) +#elif (LZO_CC_PGI >= 0x0d0a00ul) +# define __lzo_noreturn __attribute__((__noreturn__)) +#endif +#endif +#if defined(__lzo_noreturn) +# ifndef __lzo_HAVE_noreturn +# define __lzo_HAVE_noreturn 1 +# endif +#else +# define __lzo_noreturn /*empty*/ +#endif +#if !defined(__lzo_nothrow) +#if (LZO_CC_GNUC >= 0x030300ul) +# define __lzo_nothrow __attribute__((__nothrow__)) +#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 450)) && defined(__cplusplus) +# define __lzo_nothrow __declspec(nothrow) +#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 900)) +# define __lzo_nothrow __attribute__((__nothrow__)) +#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_nothrow __attribute__((__nothrow__)) +#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) && defined(__cplusplus) +# define __lzo_nothrow __declspec(nothrow) +#endif +#endif +#if defined(__lzo_nothrow) +# ifndef __lzo_HAVE_nothrow +# define __lzo_HAVE_nothrow 1 +# endif +#else +# define __lzo_nothrow /*empty*/ +#endif +#if !defined(__lzo_restrict) +#if (LZO_CC_GNUC >= 0x030400ul) +# define __lzo_restrict __restrict__ +#elif (LZO_CC_IBMC >= 800) && !defined(__cplusplus) +# define __lzo_restrict __restrict__ +#elif (LZO_CC_IBMC >= 1210) +# define __lzo_restrict __restrict__ +#elif (LZO_CC_INTELC_MSC && (__INTEL_COMPILER >= 600)) +#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 600)) +# define __lzo_restrict __restrict__ +#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM) +# define __lzo_restrict __restrict__ +#elif (LZO_CC_MSC && (_MSC_VER >= 1400)) +# define __lzo_restrict __restrict +#elif (LZO_CC_PGI >= 0x0d0a00ul) +# define __lzo_restrict __restrict__ +#endif +#endif +#if defined(__lzo_restrict) +# ifndef __lzo_HAVE_restrict +# define __lzo_HAVE_restrict 1 +# endif +#else +# define __lzo_restrict /*empty*/ +#endif +#if !defined(__lzo_alignof) +#if (LZO_CC_ARMCC || LZO_CC_CILLY || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI) +# define __lzo_alignof(e) __alignof__(e) +#elif (LZO_CC_GHS) && !defined(__cplusplus) +# define __lzo_alignof(e) __alignof__(e) +#elif (LZO_CC_IBMC >= 600) +# define __lzo_alignof(e) (__lzo_gnuc_extension__ __alignof__(e)) +#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 700)) +# define __lzo_alignof(e) __alignof__(e) +#elif (LZO_CC_MSC && (_MSC_VER >= 1300)) +# define __lzo_alignof(e) __alignof(e) +#elif (LZO_CC_SUNPROC >= 0x5100) +# define __lzo_alignof(e) __alignof__(e) +#endif +#endif +#if defined(__lzo_alignof) +# ifndef __lzo_HAVE_alignof +# define __lzo_HAVE_alignof 1 +# endif +#endif +#if !defined(__lzo_struct_packed) +#if (LZO_CC_CLANG && (LZO_CC_CLANG < 0x020800ul)) && defined(__cplusplus) +#elif (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020700ul)) +#elif (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020800ul)) && defined(__cplusplus) +#elif (LZO_CC_PCC && (LZO_CC_PCC < 0x010100ul)) +#elif (LZO_CC_SUNPROC && (LZO_CC_SUNPROC < 0x5110)) && !defined(__cplusplus) +#elif (LZO_CC_GNUC >= 0x030400ul) && !(LZO_CC_PCC_GNUC) && (LZO_ARCH_AMD64 || LZO_ARCH_I386) +# define __lzo_struct_packed(s) struct s { +# define __lzo_struct_packed_end() } __attribute__((__gcc_struct__,__packed__)); +# define __lzo_struct_packed_ma_end() } __lzo_may_alias __attribute__((__gcc_struct__,__packed__)); +#elif (LZO_CC_ARMCC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || (LZO_CC_PGI >= 0x0d0a00ul) || (LZO_CC_SUNPROC >= 0x5100)) +# define __lzo_struct_packed(s) struct s { +# define __lzo_struct_packed_end() } __attribute__((__packed__)); +# define __lzo_struct_packed_ma_end() } __lzo_may_alias __attribute__((__packed__)); +#elif (LZO_CC_IBMC >= 700) +# define __lzo_struct_packed(s) __lzo_gnuc_extension__ struct s { +# define __lzo_struct_packed_end() } __attribute__((__packed__)); +# define __lzo_struct_packed_ma_end() } __lzo_may_alias __attribute__((__packed__)); +#elif (LZO_CC_INTELC_MSC) || (LZO_CC_MSC && (_MSC_VER >= 1300)) +# define __lzo_struct_packed(s) __pragma(pack(push,1)) struct s { +# define __lzo_struct_packed_end() } __pragma(pack(pop)); +#elif (LZO_CC_WATCOMC && (__WATCOMC__ >= 900)) +# define __lzo_struct_packed(s) _Packed struct s { +# define __lzo_struct_packed_end() }; +#endif +#endif +#if defined(__lzo_struct_packed) && !defined(__lzo_struct_packed_ma) +# define __lzo_struct_packed_ma(s) __lzo_struct_packed(s) +#endif +#if defined(__lzo_struct_packed_end) && !defined(__lzo_struct_packed_ma_end) +# define __lzo_struct_packed_ma_end() __lzo_struct_packed_end() +#endif +#if !defined(__lzo_byte_struct) +#if defined(__lzo_struct_packed) +# define __lzo_byte_struct(s,n) __lzo_struct_packed(s) unsigned char a[n]; __lzo_struct_packed_end() +# define __lzo_byte_struct_ma(s,n) __lzo_struct_packed_ma(s) unsigned char a[n]; __lzo_struct_packed_ma_end() +#elif (LZO_CC_CILLY || LZO_CC_CLANG || LZO_CC_PGI || (LZO_CC_SUNPROC >= 0x5100)) +# define __lzo_byte_struct(s,n) struct s { unsigned char a[n]; } __attribute__((__packed__)); +# define __lzo_byte_struct_ma(s,n) struct s { unsigned char a[n]; } __lzo_may_alias __attribute__((__packed__)); +#endif +#endif +#if defined(__lzo_byte_struct) && !defined(__lzo_byte_struct_ma) +# define __lzo_byte_struct_ma(s,n) __lzo_byte_struct(s,n) +#endif +#if !defined(__lzo_struct_align16) && (__lzo_HAVE_alignof) +#if (LZO_CC_GNUC && (LZO_CC_GNUC < 0x030000ul)) +#elif (LZO_CC_CLANG && (LZO_CC_CLANG < 0x020800ul)) && defined(__cplusplus) +#elif (LZO_CC_CILLY || LZO_CC_PCC) +#elif (LZO_CC_INTELC_MSC) || (LZO_CC_MSC && (_MSC_VER >= 1300)) +# define __lzo_struct_align16(s) struct __declspec(align(16)) s { +# define __lzo_struct_align16_end() }; +# define __lzo_struct_align32(s) struct __declspec(align(32)) s { +# define __lzo_struct_align32_end() }; +# define __lzo_struct_align64(s) struct __declspec(align(64)) s { +# define __lzo_struct_align64_end() }; +#elif (LZO_CC_ARMCC || LZO_CC_CLANG || LZO_CC_GNUC || (LZO_CC_IBMC >= 700) || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_struct_align16(s) struct s { +# define __lzo_struct_align16_end() } __attribute__((__aligned__(16))); +# define __lzo_struct_align32(s) struct s { +# define __lzo_struct_align32_end() } __attribute__((__aligned__(32))); +# define __lzo_struct_align64(s) struct s { +# define __lzo_struct_align64_end() } __attribute__((__aligned__(64))); +#endif +#endif +#if !defined(__lzo_union_um) +#if (LZO_CC_CLANG && (LZO_CC_CLANG < 0x020800ul)) && defined(__cplusplus) +#elif (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020700ul)) +#elif (LZO_CC_GNUC && (LZO_CC_GNUC < 0x020800ul)) && defined(__cplusplus) +#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER < 810)) +#elif (LZO_CC_PCC && (LZO_CC_PCC < 0x010100ul)) +#elif (LZO_CC_SUNPROC && (LZO_CC_SUNPROC < 0x5110)) && !defined(__cplusplus) +#elif (LZO_CC_ARMCC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || (LZO_CC_PGI >= 0x0d0a00ul) || (LZO_CC_SUNPROC >= 0x5100)) +# define __lzo_union_am(s) union s { +# define __lzo_union_am_end() } __lzo_may_alias; +# define __lzo_union_um(s) union s { +# define __lzo_union_um_end() } __lzo_may_alias __attribute__((__packed__)); +#elif (LZO_CC_IBMC >= 700) +# define __lzo_union_am(s) __lzo_gnuc_extension__ union s { +# define __lzo_union_am_end() } __lzo_may_alias; +# define __lzo_union_um(s) __lzo_gnuc_extension__ union s { +# define __lzo_union_um_end() } __lzo_may_alias __attribute__((__packed__)); +#elif (LZO_CC_INTELC_MSC) || (LZO_CC_MSC && (_MSC_VER >= 1300)) +# define __lzo_union_um(s) __pragma(pack(push,1)) union s { +# define __lzo_union_um_end() } __pragma(pack(pop)); +#elif (LZO_CC_WATCOMC && (__WATCOMC__ >= 900)) +# define __lzo_union_um(s) _Packed union s { +# define __lzo_union_um_end() }; +#endif +#endif +#if !defined(__lzo_union_am) +# define __lzo_union_am(s) union s { +# define __lzo_union_am_end() }; +#endif +#if !defined(__lzo_constructor) +#if (LZO_CC_GNUC >= 0x030400ul) +# define __lzo_constructor __attribute__((__constructor__,__used__)) +#elif (LZO_CC_GNUC >= 0x020700ul) +# define __lzo_constructor __attribute__((__constructor__)) +#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 800)) +# define __lzo_constructor __attribute__((__constructor__,__used__)) +#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_constructor __attribute__((__constructor__)) +#endif +#endif +#if defined(__lzo_constructor) +# ifndef __lzo_HAVE_constructor +# define __lzo_HAVE_constructor 1 +# endif +#endif +#if !defined(__lzo_destructor) +#if (LZO_CC_GNUC >= 0x030400ul) +# define __lzo_destructor __attribute__((__destructor__,__used__)) +#elif (LZO_CC_GNUC >= 0x020700ul) +# define __lzo_destructor __attribute__((__destructor__)) +#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 800)) +# define __lzo_destructor __attribute__((__destructor__,__used__)) +#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_destructor __attribute__((__destructor__)) +#endif +#endif +#if defined(__lzo_destructor) +# ifndef __lzo_HAVE_destructor +# define __lzo_HAVE_destructor 1 +# endif +#endif +#if (__lzo_HAVE_destructor) && !(__lzo_HAVE_constructor) +# error "unexpected configuration - check your compiler defines" +#endif +#if !defined(__lzo_likely) && !defined(__lzo_unlikely) +#if (LZO_CC_GNUC >= 0x030200ul) +# define __lzo_likely(e) (__builtin_expect(!!(e),1)) +# define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) +#elif (LZO_CC_IBMC >= 1010) +# define __lzo_likely(e) (__builtin_expect(!!(e),1)) +# define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) +#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800)) +# define __lzo_likely(e) (__builtin_expect(!!(e),1)) +# define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) +#elif (LZO_CC_CLANG && LZO_CC_CLANG_C2) +#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_likely(e) (__builtin_expect(!!(e),1)) +# define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) +#endif +#endif +#if defined(__lzo_likely) +# ifndef __lzo_HAVE_likely +# define __lzo_HAVE_likely 1 +# endif +#else +# define __lzo_likely(e) (e) +#endif +#if defined(__lzo_very_likely) +# ifndef __lzo_HAVE_very_likely +# define __lzo_HAVE_very_likely 1 +# endif +#else +# define __lzo_very_likely(e) __lzo_likely(e) +#endif +#if defined(__lzo_unlikely) +# ifndef __lzo_HAVE_unlikely +# define __lzo_HAVE_unlikely 1 +# endif +#else +# define __lzo_unlikely(e) (e) +#endif +#if defined(__lzo_very_unlikely) +# ifndef __lzo_HAVE_very_unlikely +# define __lzo_HAVE_very_unlikely 1 +# endif +#else +# define __lzo_very_unlikely(e) __lzo_unlikely(e) +#endif +#if !defined(__lzo_loop_forever) +# if (LZO_CC_IBMC) +# define __lzo_loop_forever() LZO_BLOCK_BEGIN for (;;) { ; } LZO_BLOCK_END +# else +# define __lzo_loop_forever() do { ; } while __lzo_cte(1) +# endif +#endif +#if !defined(__lzo_unreachable) +#if (LZO_CC_CLANG && (LZO_CC_CLANG >= 0x020800ul)) && lzo_has_builtin(__builtin_unreachable) +# define __lzo_unreachable() __builtin_unreachable(); +#elif (LZO_CC_GNUC >= 0x040500ul) +# define __lzo_unreachable() __builtin_unreachable(); +#elif (LZO_CC_INTELC_GNUC && (__INTEL_COMPILER >= 1300)) && 1 +# define __lzo_unreachable() __builtin_unreachable(); +#endif +#endif +#if defined(__lzo_unreachable) +# ifndef __lzo_HAVE_unreachable +# define __lzo_HAVE_unreachable 1 +# endif +#else +# if 0 +# define __lzo_unreachable() ((void)0); +# else +# define __lzo_unreachable() __lzo_loop_forever(); +# endif +#endif +#if !defined(lzo_unused_funcs_impl) +# if 1 && (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || (LZO_CC_GNUC >= 0x020700ul) || LZO_CC_INTELC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI) +# define lzo_unused_funcs_impl(r,f) static r __attribute__((__unused__)) f +# elif 1 && (LZO_CC_BORLANDC || LZO_CC_GNUC) +# define lzo_unused_funcs_impl(r,f) static r f +# else +# define lzo_unused_funcs_impl(r,f) __lzo_static_forceinline r f +# endif +#endif +#ifndef __LZO_CTA_NAME +#if (LZO_CFG_USE_COUNTER) +# define __LZO_CTA_NAME(a) LZO_PP_ECONCAT2(a,__COUNTER__) +#else +# define __LZO_CTA_NAME(a) LZO_PP_ECONCAT2(a,__LINE__) +#endif +#endif +#if !defined(LZO_COMPILE_TIME_ASSERT_HEADER) +# if (LZO_CC_AZTECC || LZO_CC_ZORTECHC) +# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN extern int __LZO_CTA_NAME(lzo_cta__)[1-!(e)]; LZO_EXTERN_C_END +# elif (LZO_CC_DMC || LZO_CC_SYMANTECC) +# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN extern int __LZO_CTA_NAME(lzo_cta__)[1u-2*!(e)]; LZO_EXTERN_C_END +# elif (LZO_CC_TURBOC && (__TURBOC__ == 0x0295)) +# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN extern int __LZO_CTA_NAME(lzo_cta__)[1-!(e)]; LZO_EXTERN_C_END +# elif (LZO_CC_CLANG && (LZO_CC_CLANG < 0x020900ul)) && defined(__cplusplus) +# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN int __LZO_CTA_NAME(lzo_cta_f__)(int [1-2*!(e)]); LZO_EXTERN_C_END +# elif (LZO_CC_GNUC) && defined(__CHECKER__) && defined(__SPARSE_CHECKER__) +# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN enum {__LZO_CTA_NAME(lzo_cta_e__)=1/!!(e)} __attribute__((__unused__)); LZO_EXTERN_C_END +# else +# define LZO_COMPILE_TIME_ASSERT_HEADER(e) LZO_EXTERN_C_BEGIN extern int __LZO_CTA_NAME(lzo_cta__)[1-2*!(e)]; LZO_EXTERN_C_END +# endif +#endif +#if !defined(LZO_COMPILE_TIME_ASSERT) +# if (LZO_CC_AZTECC) +# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __LZO_CTA_NAME(lzo_cta_t__)[1-!(e)];} +# elif (LZO_CC_CLANG && (LZO_CC_CLANG >= 0x030000ul)) +# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __LZO_CTA_NAME(lzo_cta_t__)[1-2*!(e)] __attribute__((__unused__));} +# elif (LZO_CC_DMC || LZO_CC_PACIFICC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC) +# define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break; +# elif (LZO_CC_GNUC) && defined(__CHECKER__) && defined(__SPARSE_CHECKER__) +# define LZO_COMPILE_TIME_ASSERT(e) {(void) (0/!!(e));} +# elif (LZO_CC_GNUC >= 0x040700ul) && (LZO_CFG_USE_COUNTER) && defined(__cplusplus) +# define LZO_COMPILE_TIME_ASSERT(e) {enum {__LZO_CTA_NAME(lzo_cta_e__)=1/!!(e)} __attribute__((__unused__));} +# elif (LZO_CC_GNUC >= 0x040700ul) +# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __LZO_CTA_NAME(lzo_cta_t__)[1-2*!(e)] __attribute__((__unused__));} +# elif (LZO_CC_MSC && (_MSC_VER < 900)) +# define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break; +# elif (LZO_CC_TURBOC && (__TURBOC__ == 0x0295)) +# define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break; +# else +# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __LZO_CTA_NAME(lzo_cta_t__)[1-2*!(e)];} +# endif +#endif +#if (LZO_LANG_ASSEMBLER) +# undef LZO_COMPILE_TIME_ASSERT_HEADER +# define LZO_COMPILE_TIME_ASSERT_HEADER(e) /*empty*/ +#else +LZO_COMPILE_TIME_ASSERT_HEADER(1 == 1) +#if defined(__cplusplus) +extern "C" { LZO_COMPILE_TIME_ASSERT_HEADER(2 == 2) } +#endif +LZO_COMPILE_TIME_ASSERT_HEADER(3 == 3) +#endif +#if (LZO_ARCH_I086 || LZO_ARCH_I386) && (LZO_OS_DOS16 || LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_OS216 || LZO_OS_WIN16 || LZO_OS_WIN32 || LZO_OS_WIN64) +# if (LZO_CC_GNUC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PACIFICC) +# elif (LZO_CC_DMC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC) +# define __lzo_cdecl __cdecl +# define __lzo_cdecl_atexit /*empty*/ +# define __lzo_cdecl_main __cdecl +# if (LZO_OS_OS2 && (LZO_CC_DMC || LZO_CC_SYMANTECC)) +# define __lzo_cdecl_qsort __pascal +# elif (LZO_OS_OS2 && (LZO_CC_ZORTECHC)) +# define __lzo_cdecl_qsort _stdcall +# else +# define __lzo_cdecl_qsort __cdecl +# endif +# elif (LZO_CC_WATCOMC) +# define __lzo_cdecl __cdecl +# else +# define __lzo_cdecl __cdecl +# define __lzo_cdecl_atexit __cdecl +# define __lzo_cdecl_main __cdecl +# define __lzo_cdecl_qsort __cdecl +# endif +# if (LZO_CC_GNUC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PACIFICC || LZO_CC_WATCOMC) +# elif (LZO_OS_OS2 && (LZO_CC_DMC || LZO_CC_SYMANTECC)) +# define __lzo_cdecl_sighandler __pascal +# elif (LZO_OS_OS2 && (LZO_CC_ZORTECHC)) +# define __lzo_cdecl_sighandler _stdcall +# elif (LZO_CC_MSC && (_MSC_VER >= 1400)) && defined(_M_CEE_PURE) +# define __lzo_cdecl_sighandler __clrcall +# elif (LZO_CC_MSC && (_MSC_VER >= 600 && _MSC_VER < 700)) +# if defined(_DLL) +# define __lzo_cdecl_sighandler _far _cdecl _loadds +# elif defined(_MT) +# define __lzo_cdecl_sighandler _far _cdecl +# else +# define __lzo_cdecl_sighandler _cdecl +# endif +# else +# define __lzo_cdecl_sighandler __cdecl +# endif +#elif (LZO_ARCH_I386) && (LZO_CC_WATCOMC) +# define __lzo_cdecl __cdecl +#elif (LZO_ARCH_M68K && LZO_OS_TOS && (LZO_CC_PUREC || LZO_CC_TURBOC)) +# define __lzo_cdecl cdecl +#endif +#if !defined(__lzo_cdecl) +# define __lzo_cdecl /*empty*/ +#endif +#if !defined(__lzo_cdecl_atexit) +# define __lzo_cdecl_atexit /*empty*/ +#endif +#if !defined(__lzo_cdecl_main) +# define __lzo_cdecl_main /*empty*/ +#endif +#if !defined(__lzo_cdecl_qsort) +# define __lzo_cdecl_qsort /*empty*/ +#endif +#if !defined(__lzo_cdecl_sighandler) +# define __lzo_cdecl_sighandler /*empty*/ +#endif +#if !defined(__lzo_cdecl_va) +# define __lzo_cdecl_va __lzo_cdecl +#endif +#if !(LZO_CFG_NO_WINDOWS_H) +#if !defined(LZO_HAVE_WINDOWS_H) +#if (LZO_OS_CYGWIN || (LZO_OS_EMX && defined(__RSXNT__)) || LZO_OS_WIN32 || LZO_OS_WIN64) +# if (LZO_CC_WATCOMC && (__WATCOMC__ < 1000)) +# elif ((LZO_OS_WIN32 && defined(__PW32__)) && (LZO_CC_GNUC && (LZO_CC_GNUC < 0x030000ul))) +# elif ((LZO_OS_CYGWIN || defined(__MINGW32__)) && (LZO_CC_GNUC && (LZO_CC_GNUC < 0x025f00ul))) +# else +# define LZO_HAVE_WINDOWS_H 1 +# endif +#endif +#endif +#endif +#define LZO_SIZEOF_CHAR 1 +#ifndef LZO_SIZEOF_SHORT +#if defined(SIZEOF_SHORT) +# define LZO_SIZEOF_SHORT (SIZEOF_SHORT) +#elif defined(__SIZEOF_SHORT__) +# define LZO_SIZEOF_SHORT (__SIZEOF_SHORT__) +#endif +#endif +#ifndef LZO_SIZEOF_INT +#if defined(SIZEOF_INT) +# define LZO_SIZEOF_INT (SIZEOF_INT) +#elif defined(__SIZEOF_INT__) +# define LZO_SIZEOF_INT (__SIZEOF_INT__) +#endif +#endif +#ifndef LZO_SIZEOF_LONG +#if defined(SIZEOF_LONG) +# define LZO_SIZEOF_LONG (SIZEOF_LONG) +#elif defined(__SIZEOF_LONG__) +# define LZO_SIZEOF_LONG (__SIZEOF_LONG__) +#endif +#endif +#ifndef LZO_SIZEOF_LONG_LONG +#if defined(SIZEOF_LONG_LONG) +# define LZO_SIZEOF_LONG_LONG (SIZEOF_LONG_LONG) +#elif defined(__SIZEOF_LONG_LONG__) +# define LZO_SIZEOF_LONG_LONG (__SIZEOF_LONG_LONG__) +#endif +#endif +#ifndef LZO_SIZEOF___INT16 +#if defined(SIZEOF___INT16) +# define LZO_SIZEOF___INT16 (SIZEOF___INT16) +#endif +#endif +#ifndef LZO_SIZEOF___INT32 +#if defined(SIZEOF___INT32) +# define LZO_SIZEOF___INT32 (SIZEOF___INT32) +#endif +#endif +#ifndef LZO_SIZEOF___INT64 +#if defined(SIZEOF___INT64) +# define LZO_SIZEOF___INT64 (SIZEOF___INT64) +#endif +#endif +#ifndef LZO_SIZEOF_VOID_P +#if defined(SIZEOF_VOID_P) +# define LZO_SIZEOF_VOID_P (SIZEOF_VOID_P) +#elif defined(__SIZEOF_POINTER__) +# define LZO_SIZEOF_VOID_P (__SIZEOF_POINTER__) +#endif +#endif +#ifndef LZO_SIZEOF_SIZE_T +#if defined(SIZEOF_SIZE_T) +# define LZO_SIZEOF_SIZE_T (SIZEOF_SIZE_T) +#elif defined(__SIZEOF_SIZE_T__) +# define LZO_SIZEOF_SIZE_T (__SIZEOF_SIZE_T__) +#endif +#endif +#ifndef LZO_SIZEOF_PTRDIFF_T +#if defined(SIZEOF_PTRDIFF_T) +# define LZO_SIZEOF_PTRDIFF_T (SIZEOF_PTRDIFF_T) +#elif defined(__SIZEOF_PTRDIFF_T__) +# define LZO_SIZEOF_PTRDIFF_T (__SIZEOF_PTRDIFF_T__) +#endif +#endif +#define __LZO_LSR(x,b) (((x)+0ul) >> (b)) +#if !defined(LZO_SIZEOF_SHORT) +# if (LZO_ARCH_CRAY_PVP) +# define LZO_SIZEOF_SHORT 8 +# elif (USHRT_MAX == LZO_0xffffL) +# define LZO_SIZEOF_SHORT 2 +# elif (__LZO_LSR(USHRT_MAX,7) == 1) +# define LZO_SIZEOF_SHORT 1 +# elif (__LZO_LSR(USHRT_MAX,15) == 1) +# define LZO_SIZEOF_SHORT 2 +# elif (__LZO_LSR(USHRT_MAX,31) == 1) +# define LZO_SIZEOF_SHORT 4 +# elif (__LZO_LSR(USHRT_MAX,63) == 1) +# define LZO_SIZEOF_SHORT 8 +# elif (__LZO_LSR(USHRT_MAX,127) == 1) +# define LZO_SIZEOF_SHORT 16 +# else +# error "LZO_SIZEOF_SHORT" +# endif +#endif +LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_SHORT == sizeof(short)) +#if !defined(LZO_SIZEOF_INT) +# if (LZO_ARCH_CRAY_PVP) +# define LZO_SIZEOF_INT 8 +# elif (UINT_MAX == LZO_0xffffL) +# define LZO_SIZEOF_INT 2 +# elif (UINT_MAX == LZO_0xffffffffL) +# define LZO_SIZEOF_INT 4 +# elif (__LZO_LSR(UINT_MAX,7) == 1) +# define LZO_SIZEOF_INT 1 +# elif (__LZO_LSR(UINT_MAX,15) == 1) +# define LZO_SIZEOF_INT 2 +# elif (__LZO_LSR(UINT_MAX,31) == 1) +# define LZO_SIZEOF_INT 4 +# elif (__LZO_LSR(UINT_MAX,63) == 1) +# define LZO_SIZEOF_INT 8 +# elif (__LZO_LSR(UINT_MAX,127) == 1) +# define LZO_SIZEOF_INT 16 +# else +# error "LZO_SIZEOF_INT" +# endif +#endif +LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_INT == sizeof(int)) +#if !defined(LZO_SIZEOF_LONG) +# if (ULONG_MAX == LZO_0xffffffffL) +# define LZO_SIZEOF_LONG 4 +# elif (__LZO_LSR(ULONG_MAX,7) == 1) +# define LZO_SIZEOF_LONG 1 +# elif (__LZO_LSR(ULONG_MAX,15) == 1) +# define LZO_SIZEOF_LONG 2 +# elif (__LZO_LSR(ULONG_MAX,31) == 1) +# define LZO_SIZEOF_LONG 4 +# elif (__LZO_LSR(ULONG_MAX,39) == 1) +# define LZO_SIZEOF_LONG 5 +# elif (__LZO_LSR(ULONG_MAX,63) == 1) +# define LZO_SIZEOF_LONG 8 +# elif (__LZO_LSR(ULONG_MAX,127) == 1) +# define LZO_SIZEOF_LONG 16 +# else +# error "LZO_SIZEOF_LONG" +# endif +#endif +LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_LONG == sizeof(long)) +#if !defined(LZO_SIZEOF_LONG_LONG) && !defined(LZO_SIZEOF___INT64) +#if (LZO_SIZEOF_LONG > 0 && LZO_SIZEOF_LONG < 8) +# if defined(__LONG_MAX__) && defined(__LONG_LONG_MAX__) +# if (LZO_CC_GNUC >= 0x030300ul) +# if ((__LONG_MAX__-0) == (__LONG_LONG_MAX__-0)) +# define LZO_SIZEOF_LONG_LONG LZO_SIZEOF_LONG +# elif (__LZO_LSR(__LONG_LONG_MAX__,30) == 1) +# define LZO_SIZEOF_LONG_LONG 4 +# endif +# endif +# endif +#endif +#endif +#if !defined(LZO_SIZEOF_LONG_LONG) && !defined(LZO_SIZEOF___INT64) +#if (LZO_SIZEOF_LONG > 0 && LZO_SIZEOF_LONG < 8) +#if (LZO_ARCH_I086 && LZO_CC_DMC) +#elif (LZO_CC_CILLY) && defined(__GNUC__) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_CC_ARMCC_GNUC || LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define LZO_SIZEOF_LONG_LONG 8 +#elif ((LZO_OS_WIN32 || LZO_OS_WIN64 || defined(_WIN32)) && LZO_CC_MSC && (_MSC_VER >= 1400)) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_OS_WIN64 || defined(_WIN64)) +# define LZO_SIZEOF___INT64 8 +#elif (LZO_ARCH_I386 && (LZO_CC_DMC)) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_ARCH_I386 && (LZO_CC_SYMANTECC && (__SC__ >= 0x700))) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_ARCH_I386 && (LZO_CC_INTELC && defined(__linux__))) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_ARCH_I386 && (LZO_CC_MWERKS || LZO_CC_PELLESC || LZO_CC_PGI || LZO_CC_SUNPROC)) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_ARCH_I386 && (LZO_CC_INTELC || LZO_CC_MSC)) +# define LZO_SIZEOF___INT64 8 +#elif ((LZO_OS_WIN32 || defined(_WIN32)) && (LZO_CC_MSC)) +# define LZO_SIZEOF___INT64 8 +#elif (LZO_ARCH_I386 && (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0520))) +# define LZO_SIZEOF___INT64 8 +#elif (LZO_ARCH_I386 && (LZO_CC_WATCOMC && (__WATCOMC__ >= 1100))) +# define LZO_SIZEOF___INT64 8 +#elif (LZO_CC_GHS && defined(__LLONG_BIT) && ((__LLONG_BIT-0) == 64)) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_CC_WATCOMC && defined(_INTEGRAL_MAX_BITS) && ((_INTEGRAL_MAX_BITS-0) == 64)) +# define LZO_SIZEOF___INT64 8 +#elif (LZO_OS_OS400 || defined(__OS400__)) && defined(__LLP64_IFC__) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (defined(__vms) || defined(__VMS)) && ((__INITIAL_POINTER_SIZE-0) == 64) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_CC_SDCC) && (LZO_SIZEOF_INT == 2) +#elif 1 && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) +# define LZO_SIZEOF_LONG_LONG 8 +#endif +#endif +#endif +#if defined(__cplusplus) && (LZO_CC_GNUC) +# if (LZO_CC_GNUC < 0x020800ul) +# undef LZO_SIZEOF_LONG_LONG +# endif +#endif +#if (LZO_CFG_NO_LONG_LONG) +# undef LZO_SIZEOF_LONG_LONG +#elif defined(__NO_LONG_LONG) +# undef LZO_SIZEOF_LONG_LONG +#elif defined(_NO_LONGLONG) +# undef LZO_SIZEOF_LONG_LONG +#endif +#if !defined(LZO_WORDSIZE) +#if (LZO_ARCH_ALPHA) +# define LZO_WORDSIZE 8 +#elif (LZO_ARCH_AMD64) +# define LZO_WORDSIZE 8 +#elif (LZO_ARCH_ARM64) +# define LZO_WORDSIZE 8 +#elif (LZO_ARCH_AVR) +# define LZO_WORDSIZE 1 +#elif (LZO_ARCH_H8300) +# if defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__) +# define LZO_WORDSIZE 4 +# else +# define LZO_WORDSIZE 2 +# endif +#elif (LZO_ARCH_I086) +# define LZO_WORDSIZE 2 +#elif (LZO_ARCH_IA64) +# define LZO_WORDSIZE 8 +#elif (LZO_ARCH_M16C) +# define LZO_WORDSIZE 2 +#elif (LZO_ARCH_SPU) +# define LZO_WORDSIZE 4 +#elif (LZO_ARCH_Z80) +# define LZO_WORDSIZE 1 +#elif (LZO_SIZEOF_LONG == 8) && ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__)) +# define LZO_WORDSIZE 8 +#elif (LZO_OS_OS400 || defined(__OS400__)) +# define LZO_WORDSIZE 8 +#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64) +# define LZO_WORDSIZE 8 +#endif +#endif +#if !defined(LZO_SIZEOF_VOID_P) +#if defined(__ILP32__) || defined(__ILP32) || defined(_ILP32) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(int) == 4) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long) == 4) +# define LZO_SIZEOF_VOID_P 4 +#elif defined(__ILP64__) || defined(__ILP64) || defined(_ILP64) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(int) == 8) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long) == 8) +# define LZO_SIZEOF_VOID_P 8 +#elif defined(__LLP64__) || defined(__LLP64) || defined(_LLP64) || defined(_WIN64) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long) == 4) +# define LZO_SIZEOF_VOID_P 8 +#elif defined(__LP64__) || defined(__LP64) || defined(_LP64) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long) == 8) +# define LZO_SIZEOF_VOID_P 8 +#elif (LZO_ARCH_AVR) +# define LZO_SIZEOF_VOID_P 2 +#elif (LZO_ARCH_C166 || LZO_ARCH_MCS51 || LZO_ARCH_MCS251 || LZO_ARCH_MSP430) +# define LZO_SIZEOF_VOID_P 2 +#elif (LZO_ARCH_H8300) +# if defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__) + LZO_COMPILE_TIME_ASSERT_HEADER(LZO_WORDSIZE == 4) +# if defined(__NORMAL_MODE__) +# define LZO_SIZEOF_VOID_P 2 +# else +# define LZO_SIZEOF_VOID_P 4 +# endif +# else + LZO_COMPILE_TIME_ASSERT_HEADER(LZO_WORDSIZE == 2) +# define LZO_SIZEOF_VOID_P 2 +# endif +# if (LZO_CC_GNUC && (LZO_CC_GNUC < 0x040000ul)) && (LZO_SIZEOF_INT == 4) +# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_INT +# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_INT +# endif +#elif (LZO_ARCH_I086) +# if (LZO_MM_TINY || LZO_MM_SMALL || LZO_MM_MEDIUM) +# define LZO_SIZEOF_VOID_P 2 +# elif (LZO_MM_COMPACT || LZO_MM_LARGE || LZO_MM_HUGE) +# define LZO_SIZEOF_VOID_P 4 +# else +# error "invalid LZO_ARCH_I086 memory model" +# endif +#elif (LZO_ARCH_M16C) +# if defined(__m32c_cpu__) || defined(__m32cm_cpu__) +# define LZO_SIZEOF_VOID_P 4 +# else +# define LZO_SIZEOF_VOID_P 2 +# endif +#elif (LZO_ARCH_SPU) +# define LZO_SIZEOF_VOID_P 4 +#elif (LZO_ARCH_Z80) +# define LZO_SIZEOF_VOID_P 2 +#elif (LZO_SIZEOF_LONG == 8) && ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__)) +# define LZO_SIZEOF_VOID_P 4 +#elif (LZO_OS_OS400 || defined(__OS400__)) +# if defined(__LLP64_IFC__) +# define LZO_SIZEOF_VOID_P 8 +# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG +# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG +# else +# define LZO_SIZEOF_VOID_P 16 +# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG +# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG +# endif +#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64) +# define LZO_SIZEOF_VOID_P 8 +# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG +# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG +#endif +#endif +#if !defined(LZO_SIZEOF_VOID_P) +# define LZO_SIZEOF_VOID_P LZO_SIZEOF_LONG +#endif +LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_VOID_P == sizeof(void *)) +#if !defined(LZO_SIZEOF_SIZE_T) +#if (LZO_ARCH_I086 || LZO_ARCH_M16C) +# define LZO_SIZEOF_SIZE_T 2 +#endif +#endif +#if !defined(LZO_SIZEOF_SIZE_T) +# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_VOID_P +#endif +#if defined(offsetof) +LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_SIZE_T == sizeof(size_t)) +#endif +#if !defined(LZO_SIZEOF_PTRDIFF_T) +#if (LZO_ARCH_I086) +# if (LZO_MM_TINY || LZO_MM_SMALL || LZO_MM_MEDIUM || LZO_MM_HUGE) +# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_VOID_P +# elif (LZO_MM_COMPACT || LZO_MM_LARGE) +# if (LZO_CC_BORLANDC || LZO_CC_TURBOC) +# define LZO_SIZEOF_PTRDIFF_T 4 +# else +# define LZO_SIZEOF_PTRDIFF_T 2 +# endif +# else +# error "invalid LZO_ARCH_I086 memory model" +# endif +#endif +#endif +#if !defined(LZO_SIZEOF_PTRDIFF_T) +# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_SIZE_T +#endif +#if defined(offsetof) +LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_PTRDIFF_T == sizeof(ptrdiff_t)) +#endif +#if !defined(LZO_WORDSIZE) +# define LZO_WORDSIZE LZO_SIZEOF_VOID_P +#endif +#if (LZO_ABI_NEUTRAL_ENDIAN) +# undef LZO_ABI_BIG_ENDIAN +# undef LZO_ABI_LITTLE_ENDIAN +#elif !(LZO_ABI_BIG_ENDIAN) && !(LZO_ABI_LITTLE_ENDIAN) +#if (LZO_ARCH_ALPHA) && (LZO_ARCH_CRAY_MPP) +# define LZO_ABI_BIG_ENDIAN 1 +#elif (LZO_ARCH_IA64) && (LZO_OS_POSIX_LINUX || LZO_OS_WIN64) +# define LZO_ABI_LITTLE_ENDIAN 1 +#elif (LZO_ARCH_ALPHA || LZO_ARCH_AMD64 || LZO_ARCH_BLACKFIN || LZO_ARCH_CRIS || LZO_ARCH_I086 || LZO_ARCH_I386 || LZO_ARCH_MSP430 || LZO_ARCH_RISCV) +# define LZO_ABI_LITTLE_ENDIAN 1 +#elif (LZO_ARCH_AVR32 || LZO_ARCH_M68K || LZO_ARCH_S390 || LZO_ARCH_SPU) +# define LZO_ABI_BIG_ENDIAN 1 +#elif 1 && defined(__IAR_SYSTEMS_ICC__) && defined(__LITTLE_ENDIAN__) +# if (__LITTLE_ENDIAN__ == 1) +# define LZO_ABI_LITTLE_ENDIAN 1 +# else +# define LZO_ABI_BIG_ENDIAN 1 +# endif +#elif 1 && defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__) +# define LZO_ABI_BIG_ENDIAN 1 +#elif 1 && defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__) +# define LZO_ABI_LITTLE_ENDIAN 1 +#elif 1 && (LZO_ARCH_ARM) && defined(__ARM_BIG_ENDIAN) && ((__ARM_BIG_ENDIAN)+0) +# define LZO_ABI_BIG_ENDIAN 1 +#elif 1 && (LZO_ARCH_ARM) && defined(__ARMEB__) && !defined(__ARMEL__) +# define LZO_ABI_BIG_ENDIAN 1 +#elif 1 && (LZO_ARCH_ARM) && defined(__ARMEL__) && !defined(__ARMEB__) +# define LZO_ABI_LITTLE_ENDIAN 1 +#elif 1 && (LZO_ARCH_ARM) && defined(_MSC_VER) && defined(_WIN32) +# define LZO_ABI_LITTLE_ENDIAN 1 +#elif 1 && (LZO_ARCH_ARM && LZO_CC_ARMCC_ARMCC) +# if defined(__BIG_ENDIAN) && defined(__LITTLE_ENDIAN) +# error "unexpected configuration - check your compiler defines" +# elif defined(__BIG_ENDIAN) +# define LZO_ABI_BIG_ENDIAN 1 +# else +# define LZO_ABI_LITTLE_ENDIAN 1 +# endif +# define LZO_ABI_LITTLE_ENDIAN 1 +#elif 1 && (LZO_ARCH_ARM64) && defined(__ARM_BIG_ENDIAN) && ((__ARM_BIG_ENDIAN)+0) +# define LZO_ABI_BIG_ENDIAN 1 +#elif 1 && (LZO_ARCH_ARM64) && defined(__AARCH64EB__) && !defined(__AARCH64EL__) +# define LZO_ABI_BIG_ENDIAN 1 +#elif 1 && (LZO_ARCH_ARM64) && defined(__AARCH64EL__) && !defined(__AARCH64EB__) +# define LZO_ABI_LITTLE_ENDIAN 1 +#elif 1 && (LZO_ARCH_ARM64) && defined(_MSC_VER) && defined(_WIN32) +# define LZO_ABI_LITTLE_ENDIAN 1 +#elif 1 && (LZO_ARCH_MIPS) && defined(__MIPSEB__) && !defined(__MIPSEL__) +# define LZO_ABI_BIG_ENDIAN 1 +#elif 1 && (LZO_ARCH_MIPS) && defined(__MIPSEL__) && !defined(__MIPSEB__) +# define LZO_ABI_LITTLE_ENDIAN 1 +#endif +#endif +#if (LZO_ABI_BIG_ENDIAN) && (LZO_ABI_LITTLE_ENDIAN) +# error "unexpected configuration - check your compiler defines" +#endif +#if (LZO_ABI_BIG_ENDIAN) +# define LZO_INFO_ABI_ENDIAN "be" +#elif (LZO_ABI_LITTLE_ENDIAN) +# define LZO_INFO_ABI_ENDIAN "le" +#elif (LZO_ABI_NEUTRAL_ENDIAN) +# define LZO_INFO_ABI_ENDIAN "neutral" +#endif +#if (LZO_SIZEOF_INT == 1 && LZO_SIZEOF_LONG == 2 && LZO_SIZEOF_VOID_P == 2) +# define LZO_ABI_I8LP16 1 +# define LZO_INFO_ABI_PM "i8lp16" +#elif (LZO_SIZEOF_INT == 2 && LZO_SIZEOF_LONG == 2 && LZO_SIZEOF_VOID_P == 2) +# define LZO_ABI_ILP16 1 +# define LZO_INFO_ABI_PM "ilp16" +#elif (LZO_SIZEOF_INT == 2 && LZO_SIZEOF_LONG == 4 && LZO_SIZEOF_VOID_P == 4) +# define LZO_ABI_LP32 1 +# define LZO_INFO_ABI_PM "lp32" +#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 4 && LZO_SIZEOF_VOID_P == 4) +# define LZO_ABI_ILP32 1 +# define LZO_INFO_ABI_PM "ilp32" +#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 4 && LZO_SIZEOF_VOID_P == 8 && LZO_SIZEOF_SIZE_T == 8) +# define LZO_ABI_LLP64 1 +# define LZO_INFO_ABI_PM "llp64" +#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 8) +# define LZO_ABI_LP64 1 +# define LZO_INFO_ABI_PM "lp64" +#elif (LZO_SIZEOF_INT == 8 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 8) +# define LZO_ABI_ILP64 1 +# define LZO_INFO_ABI_PM "ilp64" +#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 4) +# define LZO_ABI_IP32L64 1 +# define LZO_INFO_ABI_PM "ip32l64" +#endif +#if (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_VOID_P == 4 && LZO_WORDSIZE == 8) +# define LZO_ABI_IP32W64 1 +# ifndef LZO_INFO_ABI_PM +# define LZO_INFO_ABI_PM "ip32w64" +# endif +#endif +#if 0 +#elif !defined(__LZO_LIBC_OVERRIDE) +#if (LZO_LIBC_NAKED) +# define LZO_INFO_LIBC "naked" +#elif (LZO_LIBC_FREESTANDING) +# define LZO_INFO_LIBC "freestanding" +#elif (LZO_LIBC_MOSTLY_FREESTANDING) +# define LZO_INFO_LIBC "mfreestanding" +#elif (LZO_LIBC_ISOC90) +# define LZO_INFO_LIBC "isoc90" +#elif (LZO_LIBC_ISOC99) +# define LZO_INFO_LIBC "isoc99" +#elif (LZO_CC_ARMCC_ARMCC) && defined(__ARMCLIB_VERSION) +# define LZO_LIBC_ISOC90 1 +# define LZO_INFO_LIBC "isoc90" +#elif defined(__dietlibc__) +# define LZO_LIBC_DIETLIBC 1 +# define LZO_INFO_LIBC "dietlibc" +#elif defined(_NEWLIB_VERSION) +# define LZO_LIBC_NEWLIB 1 +# define LZO_INFO_LIBC "newlib" +#elif defined(__UCLIBC__) && defined(__UCLIBC_MAJOR__) && defined(__UCLIBC_MINOR__) +# if defined(__UCLIBC_SUBLEVEL__) +# define LZO_LIBC_UCLIBC (__UCLIBC_MAJOR__ * 0x10000L + (__UCLIBC_MINOR__-0) * 0x100 + (__UCLIBC_SUBLEVEL__-0)) +# else +# define LZO_LIBC_UCLIBC 0x00090bL +# endif +# define LZO_INFO_LIBC "uc" "libc" +#elif defined(__GLIBC__) && defined(__GLIBC_MINOR__) +# define LZO_LIBC_GLIBC (__GLIBC__ * 0x10000L + (__GLIBC_MINOR__-0) * 0x100) +# define LZO_INFO_LIBC "glibc" +#elif (LZO_CC_MWERKS) && defined(__MSL__) +# define LZO_LIBC_MSL __MSL__ +# define LZO_INFO_LIBC "msl" +#elif 1 && defined(__IAR_SYSTEMS_ICC__) +# define LZO_LIBC_ISOC90 1 +# define LZO_INFO_LIBC "isoc90" +#else +# define LZO_LIBC_DEFAULT 1 +# define LZO_INFO_LIBC "default" +#endif +#endif +#if (LZO_ARCH_I386 && (LZO_OS_DOS32 || LZO_OS_WIN32) && (LZO_CC_DMC || LZO_CC_INTELC || LZO_CC_MSC || LZO_CC_PELLESC)) +# define LZO_ASM_SYNTAX_MSC 1 +#elif (LZO_OS_WIN64 && (LZO_CC_DMC || LZO_CC_INTELC || LZO_CC_MSC || LZO_CC_PELLESC)) +#elif (LZO_ARCH_I386 && LZO_CC_GNUC && (LZO_CC_GNUC == 0x011f00ul)) +#elif (LZO_ARCH_I386 && (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC || LZO_CC_PATHSCALE)) +# define LZO_ASM_SYNTAX_GNUC 1 +#elif (LZO_ARCH_AMD64 && (LZO_CC_CLANG || LZO_CC_GNUC || LZO_CC_INTELC || LZO_CC_PATHSCALE)) +# define LZO_ASM_SYNTAX_GNUC 1 +#elif (LZO_CC_GNUC) +# define LZO_ASM_SYNTAX_GNUC 1 +#endif +#if (LZO_ASM_SYNTAX_GNUC) +#if (LZO_ARCH_I386 && LZO_CC_GNUC && (LZO_CC_GNUC < 0x020000ul)) +# define __LZO_ASM_CLOBBER "ax" +# define __LZO_ASM_CLOBBER_LIST_CC /*empty*/ +# define __LZO_ASM_CLOBBER_LIST_CC_MEMORY /*empty*/ +# define __LZO_ASM_CLOBBER_LIST_EMPTY /*empty*/ +#elif (LZO_CC_INTELC && (__INTEL_COMPILER < 1000)) +# define __LZO_ASM_CLOBBER "memory" +# define __LZO_ASM_CLOBBER_LIST_CC /*empty*/ +# define __LZO_ASM_CLOBBER_LIST_CC_MEMORY : "memory" +# define __LZO_ASM_CLOBBER_LIST_EMPTY /*empty*/ +#else +# define __LZO_ASM_CLOBBER "cc", "memory" +# define __LZO_ASM_CLOBBER_LIST_CC : "cc" +# define __LZO_ASM_CLOBBER_LIST_CC_MEMORY : "cc", "memory" +# define __LZO_ASM_CLOBBER_LIST_EMPTY /*empty*/ +#endif +#endif +#if (LZO_ARCH_ALPHA) +# define LZO_OPT_AVOID_UINT_INDEX 1 +#elif (LZO_ARCH_AMD64) +# define LZO_OPT_AVOID_INT_INDEX 1 +# define LZO_OPT_AVOID_UINT_INDEX 1 +# ifndef LZO_OPT_UNALIGNED16 +# define LZO_OPT_UNALIGNED16 1 +# endif +# ifndef LZO_OPT_UNALIGNED32 +# define LZO_OPT_UNALIGNED32 1 +# endif +# ifndef LZO_OPT_UNALIGNED64 +# define LZO_OPT_UNALIGNED64 1 +# endif +#elif (LZO_ARCH_ARM) +# if defined(__ARM_FEATURE_UNALIGNED) +# if ((__ARM_FEATURE_UNALIGNED)+0) +# ifndef LZO_OPT_UNALIGNED16 +# define LZO_OPT_UNALIGNED16 1 +# endif +# ifndef LZO_OPT_UNALIGNED32 +# define LZO_OPT_UNALIGNED32 1 +# endif +# endif +# elif 1 && (LZO_ARCH_ARM_THUMB2) +# ifndef LZO_OPT_UNALIGNED16 +# define LZO_OPT_UNALIGNED16 1 +# endif +# ifndef LZO_OPT_UNALIGNED32 +# define LZO_OPT_UNALIGNED32 1 +# endif +# elif 1 && defined(__ARM_ARCH) && ((__ARM_ARCH)+0 >= 7) +# ifndef LZO_OPT_UNALIGNED16 +# define LZO_OPT_UNALIGNED16 1 +# endif +# ifndef LZO_OPT_UNALIGNED32 +# define LZO_OPT_UNALIGNED32 1 +# endif +# elif 1 && defined(__TARGET_ARCH_ARM) && ((__TARGET_ARCH_ARM)+0 >= 7) +# ifndef LZO_OPT_UNALIGNED16 +# define LZO_OPT_UNALIGNED16 1 +# endif +# ifndef LZO_OPT_UNALIGNED32 +# define LZO_OPT_UNALIGNED32 1 +# endif +# elif 1 && defined(__TARGET_ARCH_ARM) && ((__TARGET_ARCH_ARM)+0 >= 6) && (defined(__TARGET_PROFILE_A) || defined(__TARGET_PROFILE_R)) +# ifndef LZO_OPT_UNALIGNED16 +# define LZO_OPT_UNALIGNED16 1 +# endif +# ifndef LZO_OPT_UNALIGNED32 +# define LZO_OPT_UNALIGNED32 1 +# endif +# elif 1 && defined(_MSC_VER) && defined(_M_ARM) && ((_M_ARM)+0 >= 7) +# ifndef LZO_OPT_UNALIGNED16 +# define LZO_OPT_UNALIGNED16 1 +# endif +# ifndef LZO_OPT_UNALIGNED32 +# define LZO_OPT_UNALIGNED32 1 +# endif +# endif +#elif (LZO_ARCH_ARM64) +# ifndef LZO_OPT_UNALIGNED16 +# define LZO_OPT_UNALIGNED16 1 +# endif +# ifndef LZO_OPT_UNALIGNED32 +# define LZO_OPT_UNALIGNED32 1 +# endif +# ifndef LZO_OPT_UNALIGNED64 +# define LZO_OPT_UNALIGNED64 1 +# endif +#elif (LZO_ARCH_CRIS) +# ifndef LZO_OPT_UNALIGNED16 +# define LZO_OPT_UNALIGNED16 1 +# endif +# ifndef LZO_OPT_UNALIGNED32 +# define LZO_OPT_UNALIGNED32 1 +# endif +#elif (LZO_ARCH_I386) +# ifndef LZO_OPT_UNALIGNED16 +# define LZO_OPT_UNALIGNED16 1 +# endif +# ifndef LZO_OPT_UNALIGNED32 +# define LZO_OPT_UNALIGNED32 1 +# endif +#elif (LZO_ARCH_IA64) +# define LZO_OPT_AVOID_INT_INDEX 1 +# define LZO_OPT_AVOID_UINT_INDEX 1 +# define LZO_OPT_PREFER_POSTINC 1 +#elif (LZO_ARCH_M68K) +# define LZO_OPT_PREFER_POSTINC 1 +# define LZO_OPT_PREFER_PREDEC 1 +# if defined(__mc68020__) && !defined(__mcoldfire__) +# ifndef LZO_OPT_UNALIGNED16 +# define LZO_OPT_UNALIGNED16 1 +# endif +# ifndef LZO_OPT_UNALIGNED32 +# define LZO_OPT_UNALIGNED32 1 +# endif +# endif +#elif (LZO_ARCH_MIPS) +# define LZO_OPT_AVOID_UINT_INDEX 1 +#elif (LZO_ARCH_POWERPC) +# define LZO_OPT_PREFER_PREINC 1 +# define LZO_OPT_PREFER_PREDEC 1 +# if (LZO_ABI_BIG_ENDIAN) || (LZO_WORDSIZE == 8) +# ifndef LZO_OPT_UNALIGNED16 +# define LZO_OPT_UNALIGNED16 1 +# endif +# ifndef LZO_OPT_UNALIGNED32 +# define LZO_OPT_UNALIGNED32 1 +# endif +# if (LZO_WORDSIZE == 8) +# ifndef LZO_OPT_UNALIGNED64 +# define LZO_OPT_UNALIGNED64 1 +# endif +# endif +# endif +#elif (LZO_ARCH_RISCV) +# define LZO_OPT_AVOID_UINT_INDEX 1 +# ifndef LZO_OPT_UNALIGNED16 +# define LZO_OPT_UNALIGNED16 1 +# endif +# ifndef LZO_OPT_UNALIGNED32 +# define LZO_OPT_UNALIGNED32 1 +# endif +# if (LZO_WORDSIZE == 8) +# ifndef LZO_OPT_UNALIGNED64 +# define LZO_OPT_UNALIGNED64 1 +# endif +# endif +#elif (LZO_ARCH_S390) +# ifndef LZO_OPT_UNALIGNED16 +# define LZO_OPT_UNALIGNED16 1 +# endif +# ifndef LZO_OPT_UNALIGNED32 +# define LZO_OPT_UNALIGNED32 1 +# endif +# if (LZO_WORDSIZE == 8) +# ifndef LZO_OPT_UNALIGNED64 +# define LZO_OPT_UNALIGNED64 1 +# endif +# endif +#elif (LZO_ARCH_SH) +# define LZO_OPT_PREFER_POSTINC 1 +# define LZO_OPT_PREFER_PREDEC 1 +#endif +#ifndef LZO_CFG_NO_INLINE_ASM +#if (LZO_ABI_NEUTRAL_ENDIAN) || (LZO_ARCH_GENERIC) +# define LZO_CFG_NO_INLINE_ASM 1 +#elif (LZO_CC_LLVM) +# define LZO_CFG_NO_INLINE_ASM 1 +#endif +#endif +#if (LZO_CFG_NO_INLINE_ASM) +# undef LZO_ASM_SYNTAX_MSC +# undef LZO_ASM_SYNTAX_GNUC +# undef __LZO_ASM_CLOBBER +# undef __LZO_ASM_CLOBBER_LIST_CC +# undef __LZO_ASM_CLOBBER_LIST_CC_MEMORY +# undef __LZO_ASM_CLOBBER_LIST_EMPTY +#endif +#ifndef LZO_CFG_NO_UNALIGNED +#if (LZO_ABI_NEUTRAL_ENDIAN) || (LZO_ARCH_GENERIC) +# define LZO_CFG_NO_UNALIGNED 1 +#endif +#endif +#if (LZO_CFG_NO_UNALIGNED) +# undef LZO_OPT_UNALIGNED16 +# undef LZO_OPT_UNALIGNED32 +# undef LZO_OPT_UNALIGNED64 +#endif +#if defined(__LZO_INFOSTR_MM) +#elif (LZO_MM_FLAT) && (defined(__LZO_INFOSTR_PM) || defined(LZO_INFO_ABI_PM)) +# define __LZO_INFOSTR_MM "" +#elif defined(LZO_INFO_MM) +# define __LZO_INFOSTR_MM "." LZO_INFO_MM +#else +# define __LZO_INFOSTR_MM "" +#endif +#if defined(__LZO_INFOSTR_PM) +#elif defined(LZO_INFO_ABI_PM) +# define __LZO_INFOSTR_PM "." LZO_INFO_ABI_PM +#else +# define __LZO_INFOSTR_PM "" +#endif +#if defined(__LZO_INFOSTR_ENDIAN) +#elif defined(LZO_INFO_ABI_ENDIAN) +# define __LZO_INFOSTR_ENDIAN "." LZO_INFO_ABI_ENDIAN +#else +# define __LZO_INFOSTR_ENDIAN "" +#endif +#if defined(__LZO_INFOSTR_OSNAME) +#elif defined(LZO_INFO_OS_CONSOLE) +# define __LZO_INFOSTR_OSNAME LZO_INFO_OS "." LZO_INFO_OS_CONSOLE +#elif defined(LZO_INFO_OS_POSIX) +# define __LZO_INFOSTR_OSNAME LZO_INFO_OS "." LZO_INFO_OS_POSIX +#else +# define __LZO_INFOSTR_OSNAME LZO_INFO_OS +#endif +#if defined(__LZO_INFOSTR_LIBC) +#elif defined(LZO_INFO_LIBC) +# define __LZO_INFOSTR_LIBC "." LZO_INFO_LIBC +#else +# define __LZO_INFOSTR_LIBC "" +#endif +#if defined(__LZO_INFOSTR_CCVER) +#elif defined(LZO_INFO_CCVER) +# define __LZO_INFOSTR_CCVER " " LZO_INFO_CCVER +#else +# define __LZO_INFOSTR_CCVER "" +#endif +#define LZO_INFO_STRING \ + LZO_INFO_ARCH __LZO_INFOSTR_MM __LZO_INFOSTR_PM __LZO_INFOSTR_ENDIAN \ + " " __LZO_INFOSTR_OSNAME __LZO_INFOSTR_LIBC " " LZO_INFO_CC __LZO_INFOSTR_CCVER +#if !(LZO_CFG_SKIP_LZO_TYPES) +#if (!(LZO_SIZEOF_SHORT+0 > 0 && LZO_SIZEOF_INT+0 > 0 && LZO_SIZEOF_LONG+0 > 0)) +# error "missing defines for sizes" +#endif +#if (!(LZO_SIZEOF_PTRDIFF_T+0 > 0 && LZO_SIZEOF_SIZE_T+0 > 0 && LZO_SIZEOF_VOID_P+0 > 0)) +# error "missing defines for sizes" +#endif +#define LZO_TYPEOF_CHAR 1u +#define LZO_TYPEOF_SHORT 2u +#define LZO_TYPEOF_INT 3u +#define LZO_TYPEOF_LONG 4u +#define LZO_TYPEOF_LONG_LONG 5u +#define LZO_TYPEOF___INT8 17u +#define LZO_TYPEOF___INT16 18u +#define LZO_TYPEOF___INT32 19u +#define LZO_TYPEOF___INT64 20u +#define LZO_TYPEOF___INT128 21u +#define LZO_TYPEOF___INT256 22u +#define LZO_TYPEOF___MODE_QI 33u +#define LZO_TYPEOF___MODE_HI 34u +#define LZO_TYPEOF___MODE_SI 35u +#define LZO_TYPEOF___MODE_DI 36u +#define LZO_TYPEOF___MODE_TI 37u +#define LZO_TYPEOF_CHAR_P 129u +#if !defined(lzo_llong_t) +#if (LZO_SIZEOF_LONG_LONG+0 > 0) +# if !(LZO_LANG_ASSEMBLER) + __lzo_gnuc_extension__ typedef long long lzo_llong_t__; + __lzo_gnuc_extension__ typedef unsigned long long lzo_ullong_t__; +# endif +# define lzo_llong_t lzo_llong_t__ +# define lzo_ullong_t lzo_ullong_t__ +#endif +#endif +#if !defined(lzo_int16e_t) +#if (LZO_CFG_PREFER_TYPEOF_ACC_INT16E_T == LZO_TYPEOF_SHORT) && (LZO_SIZEOF_SHORT != 2) +# undef LZO_CFG_PREFER_TYPEOF_ACC_INT16E_T +#endif +#if (LZO_SIZEOF_LONG == 2) && !(LZO_CFG_PREFER_TYPEOF_ACC_INT16E_T == LZO_TYPEOF_SHORT) +# define lzo_int16e_t long +# define lzo_uint16e_t unsigned long +# define LZO_TYPEOF_LZO_INT16E_T LZO_TYPEOF_LONG +#elif (LZO_SIZEOF_INT == 2) && !(LZO_CFG_PREFER_TYPEOF_ACC_INT16E_T == LZO_TYPEOF_SHORT) +# define lzo_int16e_t int +# define lzo_uint16e_t unsigned int +# define LZO_TYPEOF_LZO_INT16E_T LZO_TYPEOF_INT +#elif (LZO_SIZEOF_SHORT == 2) +# define lzo_int16e_t short int +# define lzo_uint16e_t unsigned short int +# define LZO_TYPEOF_LZO_INT16E_T LZO_TYPEOF_SHORT +#elif 1 && !(LZO_CFG_TYPE_NO_MODE_HI) && (LZO_CC_CLANG || (LZO_CC_GNUC >= 0x025f00ul) || LZO_CC_LLVM) +# if !(LZO_LANG_ASSEMBLER) + typedef int lzo_int16e_hi_t__ __attribute__((__mode__(__HI__))); + typedef unsigned int lzo_uint16e_hi_t__ __attribute__((__mode__(__HI__))); +# endif +# define lzo_int16e_t lzo_int16e_hi_t__ +# define lzo_uint16e_t lzo_uint16e_hi_t__ +# define LZO_TYPEOF_LZO_INT16E_T LZO_TYPEOF___MODE_HI +#elif (LZO_SIZEOF___INT16 == 2) +# define lzo_int16e_t __int16 +# define lzo_uint16e_t unsigned __int16 +# define LZO_TYPEOF_LZO_INT16E_T LZO_TYPEOF___INT16 +#else +#endif +#endif +#if defined(lzo_int16e_t) +# define LZO_SIZEOF_LZO_INT16E_T 2 + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int16e_t) == 2) + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int16e_t) == LZO_SIZEOF_LZO_INT16E_T) +#endif +#if !defined(lzo_int32e_t) +#if (LZO_CFG_PREFER_TYPEOF_ACC_INT32E_T == LZO_TYPEOF_INT) && (LZO_SIZEOF_INT != 4) +# undef LZO_CFG_PREFER_TYPEOF_ACC_INT32E_T +#endif +#if (LZO_SIZEOF_LONG == 4) && !(LZO_CFG_PREFER_TYPEOF_ACC_INT32E_T == LZO_TYPEOF_INT) +# define lzo_int32e_t long int +# define lzo_uint32e_t unsigned long int +# define LZO_TYPEOF_LZO_INT32E_T LZO_TYPEOF_LONG +#elif (LZO_SIZEOF_INT == 4) +# define lzo_int32e_t int +# define lzo_uint32e_t unsigned int +# define LZO_TYPEOF_LZO_INT32E_T LZO_TYPEOF_INT +#elif (LZO_SIZEOF_SHORT == 4) +# define lzo_int32e_t short int +# define lzo_uint32e_t unsigned short int +# define LZO_TYPEOF_LZO_INT32E_T LZO_TYPEOF_SHORT +#elif (LZO_SIZEOF_LONG_LONG == 4) +# define lzo_int32e_t lzo_llong_t +# define lzo_uint32e_t lzo_ullong_t +# define LZO_TYPEOF_LZO_INT32E_T LZO_TYPEOF_LONG_LONG +#elif 1 && !(LZO_CFG_TYPE_NO_MODE_SI) && (LZO_CC_CLANG || (LZO_CC_GNUC >= 0x025f00ul) || LZO_CC_LLVM) && (__INT_MAX__+0 > 2147483647L) +# if !(LZO_LANG_ASSEMBLER) + typedef int lzo_int32e_si_t__ __attribute__((__mode__(__SI__))); + typedef unsigned int lzo_uint32e_si_t__ __attribute__((__mode__(__SI__))); +# endif +# define lzo_int32e_t lzo_int32e_si_t__ +# define lzo_uint32e_t lzo_uint32e_si_t__ +# define LZO_TYPEOF_LZO_INT32E_T LZO_TYPEOF___MODE_SI +#elif 1 && !(LZO_CFG_TYPE_NO_MODE_SI) && (LZO_CC_GNUC >= 0x025f00ul) && defined(__AVR__) && (__LONG_MAX__+0 == 32767L) +# if !(LZO_LANG_ASSEMBLER) + typedef int lzo_int32e_si_t__ __attribute__((__mode__(__SI__))); + typedef unsigned int lzo_uint32e_si_t__ __attribute__((__mode__(__SI__))); +# endif +# define lzo_int32e_t lzo_int32e_si_t__ +# define lzo_uint32e_t lzo_uint32e_si_t__ +# define LZO_INT32_C(c) (c##LL) +# define LZO_UINT32_C(c) (c##ULL) +# define LZO_TYPEOF_LZO_INT32E_T LZO_TYPEOF___MODE_SI +#elif (LZO_SIZEOF___INT32 == 4) +# define lzo_int32e_t __int32 +# define lzo_uint32e_t unsigned __int32 +# define LZO_TYPEOF_LZO_INT32E_T LZO_TYPEOF___INT32 +#else +#endif +#endif +#if defined(lzo_int32e_t) +# define LZO_SIZEOF_LZO_INT32E_T 4 + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32e_t) == 4) + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32e_t) == LZO_SIZEOF_LZO_INT32E_T) +#endif +#if !defined(lzo_int64e_t) +#if (LZO_SIZEOF___INT64 == 8) +# if (LZO_CC_BORLANDC) && !defined(LZO_CFG_PREFER_TYPEOF_ACC_INT64E_T) +# define LZO_CFG_PREFER_TYPEOF_ACC_INT64E_T LZO_TYPEOF___INT64 +# endif +#endif +#if (LZO_CFG_PREFER_TYPEOF_ACC_INT64E_T == LZO_TYPEOF_LONG_LONG) && (LZO_SIZEOF_LONG_LONG != 8) +# undef LZO_CFG_PREFER_TYPEOF_ACC_INT64E_T +#endif +#if (LZO_CFG_PREFER_TYPEOF_ACC_INT64E_T == LZO_TYPEOF___INT64) && (LZO_SIZEOF___INT64 != 8) +# undef LZO_CFG_PREFER_TYPEOF_ACC_INT64E_T +#endif +#if (LZO_SIZEOF_INT == 8) && (LZO_SIZEOF_INT < LZO_SIZEOF_LONG) +# define lzo_int64e_t int +# define lzo_uint64e_t unsigned int +# define LZO_TYPEOF_LZO_INT64E_T LZO_TYPEOF_INT +#elif (LZO_SIZEOF_LONG == 8) && !(LZO_CFG_PREFER_TYPEOF_ACC_INT64E_T == LZO_TYPEOF_LONG_LONG) && !(LZO_CFG_PREFER_TYPEOF_ACC_INT64E_T == LZO_TYPEOF___INT64) +# define lzo_int64e_t long int +# define lzo_uint64e_t unsigned long int +# define LZO_TYPEOF_LZO_INT64E_T LZO_TYPEOF_LONG +#elif (LZO_SIZEOF_LONG_LONG == 8) && !(LZO_CFG_PREFER_TYPEOF_ACC_INT64E_T == LZO_TYPEOF___INT64) +# define lzo_int64e_t lzo_llong_t +# define lzo_uint64e_t lzo_ullong_t +# define LZO_TYPEOF_LZO_INT64E_T LZO_TYPEOF_LONG_LONG +# if (LZO_CC_BORLANDC) +# define LZO_INT64_C(c) ((c) + 0ll) +# define LZO_UINT64_C(c) ((c) + 0ull) +# elif 0 +# define LZO_INT64_C(c) (__lzo_gnuc_extension__ (c##LL)) +# define LZO_UINT64_C(c) (__lzo_gnuc_extension__ (c##ULL)) +# else +# define LZO_INT64_C(c) (c##LL) +# define LZO_UINT64_C(c) (c##ULL) +# endif +#elif (LZO_SIZEOF___INT64 == 8) +# define lzo_int64e_t __int64 +# define lzo_uint64e_t unsigned __int64 +# define LZO_TYPEOF_LZO_INT64E_T LZO_TYPEOF___INT64 +# if (LZO_CC_BORLANDC) +# define LZO_INT64_C(c) ((c) + 0i64) +# define LZO_UINT64_C(c) ((c) + 0ui64) +# else +# define LZO_INT64_C(c) (c##i64) +# define LZO_UINT64_C(c) (c##ui64) +# endif +#else +#endif +#endif +#if defined(lzo_int64e_t) +# define LZO_SIZEOF_LZO_INT64E_T 8 + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64e_t) == 8) + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64e_t) == LZO_SIZEOF_LZO_INT64E_T) +#endif +#if !defined(lzo_int32l_t) +#if defined(lzo_int32e_t) +# define lzo_int32l_t lzo_int32e_t +# define lzo_uint32l_t lzo_uint32e_t +# define LZO_SIZEOF_LZO_INT32L_T LZO_SIZEOF_LZO_INT32E_T +# define LZO_TYPEOF_LZO_INT32L_T LZO_TYPEOF_LZO_INT32E_T +#elif (LZO_SIZEOF_INT >= 4) && (LZO_SIZEOF_INT < LZO_SIZEOF_LONG) +# define lzo_int32l_t int +# define lzo_uint32l_t unsigned int +# define LZO_SIZEOF_LZO_INT32L_T LZO_SIZEOF_INT +# define LZO_TYPEOF_LZO_INT32L_T LZO_SIZEOF_INT +#elif (LZO_SIZEOF_LONG >= 4) +# define lzo_int32l_t long int +# define lzo_uint32l_t unsigned long int +# define LZO_SIZEOF_LZO_INT32L_T LZO_SIZEOF_LONG +# define LZO_TYPEOF_LZO_INT32L_T LZO_SIZEOF_LONG +#else +# error "lzo_int32l_t" +#endif +#endif +#if 1 + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32l_t) >= 4) + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32l_t) == LZO_SIZEOF_LZO_INT32L_T) +#endif +#if !defined(lzo_int64l_t) +#if defined(lzo_int64e_t) +# define lzo_int64l_t lzo_int64e_t +# define lzo_uint64l_t lzo_uint64e_t +# define LZO_SIZEOF_LZO_INT64L_T LZO_SIZEOF_LZO_INT64E_T +# define LZO_TYPEOF_LZO_INT64L_T LZO_TYPEOF_LZO_INT64E_T +#else +#endif +#endif +#if defined(lzo_int64l_t) + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64l_t) >= 8) + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64l_t) == LZO_SIZEOF_LZO_INT64L_T) +#endif +#if !defined(lzo_int32f_t) +#if (LZO_SIZEOF_SIZE_T >= 8) +# define lzo_int32f_t lzo_int64l_t +# define lzo_uint32f_t lzo_uint64l_t +# define LZO_SIZEOF_LZO_INT32F_T LZO_SIZEOF_LZO_INT64L_T +# define LZO_TYPEOF_LZO_INT32F_T LZO_TYPEOF_LZO_INT64L_T +#else +# define lzo_int32f_t lzo_int32l_t +# define lzo_uint32f_t lzo_uint32l_t +# define LZO_SIZEOF_LZO_INT32F_T LZO_SIZEOF_LZO_INT32L_T +# define LZO_TYPEOF_LZO_INT32F_T LZO_TYPEOF_LZO_INT32L_T +#endif +#endif +#if 1 + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32f_t) >= 4) + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32f_t) == LZO_SIZEOF_LZO_INT32F_T) +#endif +#if !defined(lzo_int64f_t) +#if defined(lzo_int64l_t) +# define lzo_int64f_t lzo_int64l_t +# define lzo_uint64f_t lzo_uint64l_t +# define LZO_SIZEOF_LZO_INT64F_T LZO_SIZEOF_LZO_INT64L_T +# define LZO_TYPEOF_LZO_INT64F_T LZO_TYPEOF_LZO_INT64L_T +#else +#endif +#endif +#if defined(lzo_int64f_t) + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64f_t) >= 8) + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64f_t) == LZO_SIZEOF_LZO_INT64F_T) +#endif +#if !defined(lzo_intptr_t) +#if 1 && (LZO_OS_OS400 && (LZO_SIZEOF_VOID_P == 16)) +# define __LZO_INTPTR_T_IS_POINTER 1 +# if !(LZO_LANG_ASSEMBLER) + typedef char * lzo_intptr_t; + typedef char * lzo_uintptr_t; +# endif +# define lzo_intptr_t lzo_intptr_t +# define lzo_uintptr_t lzo_uintptr_t +# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_VOID_P +# define LZO_TYPEOF_LZO_INTPTR_T LZO_TYPEOF_CHAR_P +#elif (LZO_CC_MSC && (_MSC_VER >= 1300) && (LZO_SIZEOF_VOID_P == 4) && (LZO_SIZEOF_INT == 4)) +# if !(LZO_LANG_ASSEMBLER) + typedef __w64 int lzo_intptr_t; + typedef __w64 unsigned int lzo_uintptr_t; +# endif +# define lzo_intptr_t lzo_intptr_t +# define lzo_uintptr_t lzo_uintptr_t +# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_INT +# define LZO_TYPEOF_LZO_INTPTR_T LZO_TYPEOF_INT +#elif (LZO_SIZEOF_SHORT == LZO_SIZEOF_VOID_P) && (LZO_SIZEOF_INT > LZO_SIZEOF_VOID_P) +# define lzo_intptr_t short +# define lzo_uintptr_t unsigned short +# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_SHORT +# define LZO_TYPEOF_LZO_INTPTR_T LZO_TYPEOF_SHORT +#elif (LZO_SIZEOF_INT >= LZO_SIZEOF_VOID_P) && (LZO_SIZEOF_INT < LZO_SIZEOF_LONG) +# define lzo_intptr_t int +# define lzo_uintptr_t unsigned int +# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_INT +# define LZO_TYPEOF_LZO_INTPTR_T LZO_TYPEOF_INT +#elif (LZO_SIZEOF_LONG >= LZO_SIZEOF_VOID_P) +# define lzo_intptr_t long +# define lzo_uintptr_t unsigned long +# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_LONG +# define LZO_TYPEOF_LZO_INTPTR_T LZO_TYPEOF_LONG +#elif (LZO_SIZEOF_LZO_INT64L_T >= LZO_SIZEOF_VOID_P) +# define lzo_intptr_t lzo_int64l_t +# define lzo_uintptr_t lzo_uint64l_t +# define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_LZO_INT64L_T +# define LZO_TYPEOF_LZO_INTPTR_T LZO_TYPEOF_LZO_INT64L_T +#else +# error "lzo_intptr_t" +#endif +#endif +#if 1 + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_intptr_t) >= sizeof(void *)) + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_intptr_t) == sizeof(lzo_uintptr_t)) +#endif +#if !defined(lzo_word_t) +#if defined(LZO_WORDSIZE) && (LZO_WORDSIZE+0 > 0) +#if (LZO_WORDSIZE == LZO_SIZEOF_LZO_INTPTR_T) && !(__LZO_INTPTR_T_IS_POINTER) +# define lzo_word_t lzo_uintptr_t +# define lzo_sword_t lzo_intptr_t +# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_LZO_INTPTR_T +# define LZO_TYPEOF_LZO_WORD_T LZO_TYPEOF_LZO_INTPTR_T +#elif (LZO_WORDSIZE == LZO_SIZEOF_LONG) +# define lzo_word_t unsigned long +# define lzo_sword_t long +# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_LONG +# define LZO_TYPEOF_LZO_WORD_T LZO_TYPEOF_LONG +#elif (LZO_WORDSIZE == LZO_SIZEOF_INT) +# define lzo_word_t unsigned int +# define lzo_sword_t int +# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_INT +# define LZO_TYPEOF_LZO_WORD_T LZO_TYPEOF_INT +#elif (LZO_WORDSIZE == LZO_SIZEOF_SHORT) +# define lzo_word_t unsigned short +# define lzo_sword_t short +# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_SHORT +# define LZO_TYPEOF_LZO_WORD_T LZO_TYPEOF_SHORT +#elif (LZO_WORDSIZE == 1) +# define lzo_word_t unsigned char +# define lzo_sword_t signed char +# define LZO_SIZEOF_LZO_WORD_T 1 +# define LZO_TYPEOF_LZO_WORD_T LZO_TYPEOF_CHAR +#elif (LZO_WORDSIZE == LZO_SIZEOF_LZO_INT64L_T) +# define lzo_word_t lzo_uint64l_t +# define lzo_sword_t lzo_int64l_t +# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_LZO_INT64L_T +# define LZO_TYPEOF_LZO_WORD_T LZO_SIZEOF_LZO_INT64L_T +#elif (LZO_ARCH_SPU) && (LZO_CC_GNUC) +#if 0 +# if !(LZO_LANG_ASSEMBLER) + typedef unsigned lzo_word_t __attribute__((__mode__(__V16QI__))); + typedef int lzo_sword_t __attribute__((__mode__(__V16QI__))); +# endif +# define lzo_word_t lzo_word_t +# define lzo_sword_t lzo_sword_t +# define LZO_SIZEOF_LZO_WORD_T 16 +# define LZO_TYPEOF_LZO_WORD_T LZO_TYPEOF___MODE_V16QI +#endif +#else +# error "lzo_word_t" +#endif +#endif +#endif +#if 1 && defined(lzo_word_t) + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_word_t) == LZO_WORDSIZE) + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_sword_t) == LZO_WORDSIZE) +#endif +#if 1 +#define lzo_int8_t signed char +#define lzo_uint8_t unsigned char +#define LZO_SIZEOF_LZO_INT8_T 1 +#define LZO_TYPEOF_LZO_INT8_T LZO_TYPEOF_CHAR +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int8_t) == 1) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int8_t) == sizeof(lzo_uint8_t)) +#endif +#if defined(lzo_int16e_t) +#define lzo_int16_t lzo_int16e_t +#define lzo_uint16_t lzo_uint16e_t +#define LZO_SIZEOF_LZO_INT16_T LZO_SIZEOF_LZO_INT16E_T +#define LZO_TYPEOF_LZO_INT16_T LZO_TYPEOF_LZO_INT16E_T +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int16_t) == 2) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int16_t) == sizeof(lzo_uint16_t)) +#endif +#if defined(lzo_int32e_t) +#define lzo_int32_t lzo_int32e_t +#define lzo_uint32_t lzo_uint32e_t +#define LZO_SIZEOF_LZO_INT32_T LZO_SIZEOF_LZO_INT32E_T +#define LZO_TYPEOF_LZO_INT32_T LZO_TYPEOF_LZO_INT32E_T +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32_t) == 4) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int32_t) == sizeof(lzo_uint32_t)) +#endif +#if defined(lzo_int64e_t) +#define lzo_int64_t lzo_int64e_t +#define lzo_uint64_t lzo_uint64e_t +#define LZO_SIZEOF_LZO_INT64_T LZO_SIZEOF_LZO_INT64E_T +#define LZO_TYPEOF_LZO_INT64_T LZO_TYPEOF_LZO_INT64E_T +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64_t) == 8) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int64_t) == sizeof(lzo_uint64_t)) +#endif +#if 1 +#define lzo_int_least32_t lzo_int32l_t +#define lzo_uint_least32_t lzo_uint32l_t +#define LZO_SIZEOF_LZO_INT_LEAST32_T LZO_SIZEOF_LZO_INT32L_T +#define LZO_TYPEOF_LZO_INT_LEAST32_T LZO_TYPEOF_LZO_INT32L_T +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_least32_t) >= 4) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_least32_t) == sizeof(lzo_uint_least32_t)) +#endif +#if defined(lzo_int64l_t) +#define lzo_int_least64_t lzo_int64l_t +#define lzo_uint_least64_t lzo_uint64l_t +#define LZO_SIZEOF_LZO_INT_LEAST64_T LZO_SIZEOF_LZO_INT64L_T +#define LZO_TYPEOF_LZO_INT_LEAST64_T LZO_TYPEOF_LZO_INT64L_T +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_least64_t) >= 8) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_least64_t) == sizeof(lzo_uint_least64_t)) +#endif +#if 1 +#define lzo_int_fast32_t lzo_int32f_t +#define lzo_uint_fast32_t lzo_uint32f_t +#define LZO_SIZEOF_LZO_INT_FAST32_T LZO_SIZEOF_LZO_INT32F_T +#define LZO_TYPEOF_LZO_INT_FAST32_T LZO_TYPEOF_LZO_INT32F_T +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_fast32_t) >= 4) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_fast32_t) == sizeof(lzo_uint_fast32_t)) +#endif +#if defined(lzo_int64f_t) +#define lzo_int_fast64_t lzo_int64f_t +#define lzo_uint_fast64_t lzo_uint64f_t +#define LZO_SIZEOF_LZO_INT_FAST64_T LZO_SIZEOF_LZO_INT64F_T +#define LZO_TYPEOF_LZO_INT_FAST64_T LZO_TYPEOF_LZO_INT64F_T +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_fast64_t) >= 8) +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_fast64_t) == sizeof(lzo_uint_fast64_t)) +#endif +#if !defined(LZO_INT16_C) +# if (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_INT >= 2) +# define LZO_INT16_C(c) ((c) + 0) +# define LZO_UINT16_C(c) ((c) + 0U) +# elif (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_LONG >= 2) +# define LZO_INT16_C(c) ((c) + 0L) +# define LZO_UINT16_C(c) ((c) + 0UL) +# elif (LZO_SIZEOF_INT >= 2) +# define LZO_INT16_C(c) (c) +# define LZO_UINT16_C(c) (c##U) +# elif (LZO_SIZEOF_LONG >= 2) +# define LZO_INT16_C(c) (c##L) +# define LZO_UINT16_C(c) (c##UL) +# else +# error "LZO_INT16_C" +# endif +#endif +#if !defined(LZO_INT32_C) +# if (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_INT >= 4) +# define LZO_INT32_C(c) ((c) + 0) +# define LZO_UINT32_C(c) ((c) + 0U) +# elif (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_LONG >= 4) +# define LZO_INT32_C(c) ((c) + 0L) +# define LZO_UINT32_C(c) ((c) + 0UL) +# elif (LZO_SIZEOF_INT >= 4) +# define LZO_INT32_C(c) (c) +# define LZO_UINT32_C(c) (c##U) +# elif (LZO_SIZEOF_LONG >= 4) +# define LZO_INT32_C(c) (c##L) +# define LZO_UINT32_C(c) (c##UL) +# elif (LZO_SIZEOF_LONG_LONG >= 4) +# define LZO_INT32_C(c) (c##LL) +# define LZO_UINT32_C(c) (c##ULL) +# else +# error "LZO_INT32_C" +# endif +#endif +#if !defined(LZO_INT64_C) && defined(lzo_int64l_t) +# if (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_INT >= 8) +# define LZO_INT64_C(c) ((c) + 0) +# define LZO_UINT64_C(c) ((c) + 0U) +# elif (LZO_BROKEN_INTEGRAL_CONSTANTS) && (LZO_SIZEOF_LONG >= 8) +# define LZO_INT64_C(c) ((c) + 0L) +# define LZO_UINT64_C(c) ((c) + 0UL) +# elif (LZO_SIZEOF_INT >= 8) +# define LZO_INT64_C(c) (c) +# define LZO_UINT64_C(c) (c##U) +# elif (LZO_SIZEOF_LONG >= 8) +# define LZO_INT64_C(c) (c##L) +# define LZO_UINT64_C(c) (c##UL) +# else +# error "LZO_INT64_C" +# endif +#endif +#endif + +#endif /* already included */ + +/* vim:set ts=4 sw=4 et: */ diff --git a/r5dev/thirdparty/cppnet/cppkore_incl/LZO1X/minilzo.h b/r5dev/thirdparty/cppnet/cppkore_incl/LZO1X/minilzo.h new file mode 100644 index 00000000..c1c22975 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore_incl/LZO1X/minilzo.h @@ -0,0 +1,106 @@ +/* minilzo.h -- mini subset of the LZO real-time data compression library + + This file is part of the LZO real-time data compression library. + + Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + The LZO library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + +/* + * NOTE: + * the full LZO package can be found at + * http://www.oberhumer.com/opensource/lzo/ + */ + + +#ifndef __MINILZO_H_INCLUDED +#define __MINILZO_H_INCLUDED 1 + +#define MINILZO_VERSION 0x20a0 /* 2.10 */ + +#if defined(__LZOCONF_H_INCLUDED) +# error "you cannot use both LZO and miniLZO" +#endif + +/* internal Autoconf configuration file - only used when building miniLZO */ +#ifdef MINILZO_HAVE_CONFIG_H +# include +#endif +#include +#include + +#ifndef __LZODEFS_H_INCLUDED +#include "lzodefs.h" +#endif +#undef LZO_HAVE_CONFIG_H +#include "lzoconf.h" + +#if !defined(LZO_VERSION) || (LZO_VERSION != MINILZO_VERSION) +# error "version mismatch in header files" +#endif + + +#ifdef __cplusplus +extern "C" { +#endif + + +/*********************************************************************** +// +************************************************************************/ + +/* Memory required for the wrkmem parameter. + * When the required size is 0, you can also pass a NULL pointer. + */ + +#define LZO1X_MEM_COMPRESS LZO1X_1_MEM_COMPRESS +#define LZO1X_1_MEM_COMPRESS ((lzo_uint32_t) (16384L * lzo_sizeof_dict_t)) +#define LZO1X_MEM_DECOMPRESS (0) + + +/* compression */ +LZO_EXTERN(int) +lzo1x_1_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); + +/* decompression */ +LZO_EXTERN(int) +lzo1x_decompress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem /* NOT USED */ ); + +/* safe decompression with overrun testing */ +LZO_EXTERN(int) +lzo1x_decompress_safe ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem /* NOT USED */ ); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* already included */ + + +/* vim:set ts=4 sw=4 et: */ diff --git a/r5dev/thirdparty/cppnet/cppkore_incl/ZLib/miniz.h b/r5dev/thirdparty/cppnet/cppkore_incl/ZLib/miniz.h new file mode 100644 index 00000000..d8a1aab7 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore_incl/ZLib/miniz.h @@ -0,0 +1,476 @@ +/* miniz.c 2.1.0 - public domain deflate/inflate, zlib-subset, ZIP reading/writing/appending, PNG writing + See "unlicense" statement at the end of this file. + Rich Geldreich , last updated Oct. 13, 2013 + Implements RFC 1950: http://www.ietf.org/rfc/rfc1950.txt and RFC 1951: http://www.ietf.org/rfc/rfc1951.txt + + Most API's defined in miniz.c are optional. For example, to disable the archive related functions just define + MINIZ_NO_ARCHIVE_APIS, or to get rid of all stdio usage define MINIZ_NO_STDIO (see the list below for more macros). + + * Low-level Deflate/Inflate implementation notes: + + Compression: Use the "tdefl" API's. The compressor supports raw, static, and dynamic blocks, lazy or + greedy parsing, match length filtering, RLE-only, and Huffman-only streams. It performs and compresses + approximately as well as zlib. + + Decompression: Use the "tinfl" API's. The entire decompressor is implemented as a single function + coroutine: see tinfl_decompress(). It supports decompression into a 32KB (or larger power of 2) wrapping buffer, or into a memory + block large enough to hold the entire file. + + The low-level tdefl/tinfl API's do not make any use of dynamic memory allocation. + + * zlib-style API notes: + + miniz.c implements a fairly large subset of zlib. There's enough functionality present for it to be a drop-in + zlib replacement in many apps: + The z_stream struct, optional memory allocation callbacks + deflateInit/deflateInit2/deflate/deflateReset/deflateEnd/deflateBound + inflateInit/inflateInit2/inflate/inflateReset/inflateEnd + compress, compress2, compressBound, uncompress + CRC-32, Adler-32 - Using modern, minimal code size, CPU cache friendly routines. + Supports raw deflate streams or standard zlib streams with adler-32 checking. + + Limitations: + The callback API's are not implemented yet. No support for gzip headers or zlib static dictionaries. + I've tried to closely emulate zlib's various flavors of stream flushing and return status codes, but + there are no guarantees that miniz.c pulls this off perfectly. + + * PNG writing: See the tdefl_write_image_to_png_file_in_memory() function, originally written by + Alex Evans. Supports 1-4 bytes/pixel images. + + * ZIP archive API notes: + + The ZIP archive API's where designed with simplicity and efficiency in mind, with just enough abstraction to + get the job done with minimal fuss. There are simple API's to retrieve file information, read files from + existing archives, create new archives, append new files to existing archives, or clone archive data from + one archive to another. It supports archives located in memory or the heap, on disk (using stdio.h), + or you can specify custom file read/write callbacks. + + - Archive reading: Just call this function to read a single file from a disk archive: + + void *mz_zip_extract_archive_file_to_heap(const char *pZip_filename, const char *pArchive_name, + size_t *pSize, mz_uint zip_flags); + + For more complex cases, use the "mz_zip_reader" functions. Upon opening an archive, the entire central + directory is located and read as-is into memory, and subsequent file access only occurs when reading individual files. + + - Archives file scanning: The simple way is to use this function to scan a loaded archive for a specific file: + + int mz_zip_reader_locate_file(mz_zip_archive *pZip, const char *pName, const char *pComment, mz_uint flags); + + The locate operation can optionally check file comments too, which (as one example) can be used to identify + multiple versions of the same file in an archive. This function uses a simple linear search through the central + directory, so it's not very fast. + + Alternately, you can iterate through all the files in an archive (using mz_zip_reader_get_num_files()) and + retrieve detailed info on each file by calling mz_zip_reader_file_stat(). + + - Archive creation: Use the "mz_zip_writer" functions. The ZIP writer immediately writes compressed file data + to disk and builds an exact image of the central directory in memory. The central directory image is written + all at once at the end of the archive file when the archive is finalized. + + The archive writer can optionally align each file's local header and file data to any power of 2 alignment, + which can be useful when the archive will be read from optical media. Also, the writer supports placing + arbitrary data blobs at the very beginning of ZIP archives. Archives written using either feature are still + readable by any ZIP tool. + + - Archive appending: The simple way to add a single file to an archive is to call this function: + + mz_bool mz_zip_add_mem_to_archive_file_in_place(const char *pZip_filename, const char *pArchive_name, + const void *pBuf, size_t buf_size, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags); + + The archive will be created if it doesn't already exist, otherwise it'll be appended to. + Note the appending is done in-place and is not an atomic operation, so if something goes wrong + during the operation it's possible the archive could be left without a central directory (although the local + file headers and file data will be fine, so the archive will be recoverable). + + For more complex archive modification scenarios: + 1. The safest way is to use a mz_zip_reader to read the existing archive, cloning only those bits you want to + preserve into a new archive using using the mz_zip_writer_add_from_zip_reader() function (which compiles the + compressed file data as-is). When you're done, delete the old archive and rename the newly written archive, and + you're done. This is safe but requires a bunch of temporary disk space or heap memory. + + 2. Or, you can convert an mz_zip_reader in-place to an mz_zip_writer using mz_zip_writer_init_from_reader(), + append new files as needed, then finalize the archive which will write an updated central directory to the + original archive. (This is basically what mz_zip_add_mem_to_archive_file_in_place() does.) There's a + possibility that the archive's central directory could be lost with this method if anything goes wrong, though. + + - ZIP archive support limitations: + No zip64 or spanning support. Extraction functions can only handle unencrypted, stored or deflated files. + Requires streams capable of seeking. + + * This is a header file library, like stb_image.c. To get only a header file, either cut and paste the + below header, or create miniz.h, #define MINIZ_HEADER_FILE_ONLY, and then include miniz.c from it. + + * Important: For best perf. be sure to customize the below macros for your target platform: + #define MINIZ_USE_UNALIGNED_LOADS_AND_STORES 1 + #define MINIZ_LITTLE_ENDIAN 1 + #define MINIZ_HAS_64BIT_REGISTERS 1 + + * On platforms using glibc, Be sure to "#define _LARGEFILE64_SOURCE 1" before including miniz.c to ensure miniz + uses the 64-bit variants: fopen64(), stat64(), etc. Otherwise you won't be able to process large files + (i.e. 32-bit stat() fails for me on files > 0x7FFFFFFF bytes). +*/ +#pragma once + +#include "miniz_common.h" +#include "miniz_tdef.h" +#include "miniz_tinfl.h" + +/* Defines to completely disable specific portions of miniz.c: + If all macros here are defined the only functionality remaining will be CRC-32, adler-32, tinfl, and tdefl. */ + +/* Define MINIZ_NO_STDIO to disable all usage and any functions which rely on stdio for file I/O. */ +/*#define MINIZ_NO_STDIO */ + +/* If MINIZ_NO_TIME is specified then the ZIP archive functions will not be able to get the current time, or */ +/* get/set file times, and the C run-time funcs that get/set times won't be called. */ +/* The current downside is the times written to your archives will be from 1979. */ +/*#define MINIZ_NO_TIME */ + +/* Define MINIZ_NO_ARCHIVE_APIS to disable all ZIP archive API's. */ +/*#define MINIZ_NO_ARCHIVE_APIS */ + +/* Define MINIZ_NO_ARCHIVE_WRITING_APIS to disable all writing related ZIP archive API's. */ +/*#define MINIZ_NO_ARCHIVE_WRITING_APIS */ + +/* Define MINIZ_NO_ZLIB_APIS to remove all ZLIB-style compression/decompression API's. */ +/*#define MINIZ_NO_ZLIB_APIS */ + +/* Define MINIZ_NO_ZLIB_COMPATIBLE_NAME to disable zlib names, to prevent conflicts against stock zlib. */ +/*#define MINIZ_NO_ZLIB_COMPATIBLE_NAMES */ + +/* Define MINIZ_NO_MALLOC to disable all calls to malloc, free, and realloc. + Note if MINIZ_NO_MALLOC is defined then the user must always provide custom user alloc/free/realloc + callbacks to the zlib and archive API's, and a few stand-alone helper API's which don't provide custom user + functions (such as tdefl_compress_mem_to_heap() and tinfl_decompress_mem_to_heap()) won't work. */ +/*#define MINIZ_NO_MALLOC */ + +#if defined(__TINYC__) && (defined(__linux) || defined(__linux__)) +#define MINIZ_NO_TIME +#endif + +#include + +#if !defined(MINIZ_NO_TIME) && !defined(MINIZ_NO_ARCHIVE_APIS) +#include +#endif + +#if defined(_M_IX86) || defined(_M_X64) || defined(__i386__) || defined(__i386) || defined(__i486__) || defined(__i486) || defined(i386) || defined(__ia64__) || defined(__x86_64__) +/* MINIZ_X86_OR_X64_CPU is only used to help set the below macros. */ +#define MINIZ_X86_OR_X64_CPU 1 +#else +#define MINIZ_X86_OR_X64_CPU 0 +#endif + +#if (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) || MINIZ_X86_OR_X64_CPU +/* Set MINIZ_LITTLE_ENDIAN to 1 if the processor is little endian. */ +#define MINIZ_LITTLE_ENDIAN 1 +#else +#define MINIZ_LITTLE_ENDIAN 0 +#endif + +/* Set MINIZ_USE_UNALIGNED_LOADS_AND_STORES only if not set */ +#if !defined(MINIZ_USE_UNALIGNED_LOADS_AND_STORES) +#if MINIZ_X86_OR_X64_CPU +/* Set MINIZ_USE_UNALIGNED_LOADS_AND_STORES to 1 on CPU's that permit efficient integer loads and stores from unaligned addresses. */ +#define MINIZ_USE_UNALIGNED_LOADS_AND_STORES 1 +#define MINIZ_UNALIGNED_USE_MEMCPY +#else +#define MINIZ_USE_UNALIGNED_LOADS_AND_STORES 0 +#endif +#endif + +#if defined(_M_X64) || defined(_WIN64) || defined(__MINGW64__) || defined(_LP64) || defined(__LP64__) || defined(__ia64__) || defined(__x86_64__) +/* Set MINIZ_HAS_64BIT_REGISTERS to 1 if operations on 64-bit integers are reasonably fast (and don't involve compiler generated calls to helper functions). */ +#define MINIZ_HAS_64BIT_REGISTERS 1 +#else +#define MINIZ_HAS_64BIT_REGISTERS 0 +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* ------------------- zlib-style API Definitions. */ + +/* For more compatibility with zlib, miniz.c uses unsigned long for some parameters/struct members. Beware: mz_ulong can be either 32 or 64-bits! */ +typedef unsigned long mz_ulong; + +/* mz_free() internally uses the MZ_FREE() macro (which by default calls free() unless you've modified the MZ_MALLOC macro) to release a block allocated from the heap. */ +void mz_free(void *p); + +#define MZ_ADLER32_INIT (1) +/* mz_adler32() returns the initial adler-32 value to use when called with ptr==NULL. */ +mz_ulong mz_adler32(mz_ulong adler, const unsigned char *ptr, size_t buf_len); + +#define MZ_CRC32_INIT (0) +/* mz_crc32() returns the initial CRC-32 value to use when called with ptr==NULL. */ +mz_ulong mz_crc32(mz_ulong crc, const unsigned char *ptr, size_t buf_len); + +/* Compression strategies. */ +enum +{ + MZ_DEFAULT_STRATEGY = 0, + MZ_FILTERED = 1, + MZ_HUFFMAN_ONLY = 2, + MZ_RLE = 3, + MZ_FIXED = 4 +}; + +/* Method */ +#define MZ_DEFLATED 8 + +/* Heap allocation callbacks. +Note that mz_alloc_func parameter types purpsosely differ from zlib's: items/size is size_t, not unsigned long. */ +typedef void *(*mz_alloc_func)(void *opaque, size_t items, size_t size); +typedef void (*mz_free_func)(void *opaque, void *address); +typedef void *(*mz_realloc_func)(void *opaque, void *address, size_t items, size_t size); + +/* Compression levels: 0-9 are the standard zlib-style levels, 10 is best possible compression (not zlib compatible, and may be very slow), MZ_DEFAULT_COMPRESSION=MZ_DEFAULT_LEVEL. */ +enum +{ + MZ_NO_COMPRESSION = 0, + MZ_BEST_SPEED = 1, + MZ_BEST_COMPRESSION = 9, + MZ_UBER_COMPRESSION = 10, + MZ_DEFAULT_LEVEL = 6, + MZ_DEFAULT_COMPRESSION = -1 +}; + +#define MZ_VERSION "10.1.0" +#define MZ_VERNUM 0xA100 +#define MZ_VER_MAJOR 10 +#define MZ_VER_MINOR 1 +#define MZ_VER_REVISION 0 +#define MZ_VER_SUBREVISION 0 + +#ifndef MINIZ_NO_ZLIB_APIS + +/* Flush values. For typical usage you only need MZ_NO_FLUSH and MZ_FINISH. The other values are for advanced use (refer to the zlib docs). */ +enum +{ + MZ_NO_FLUSH = 0, + MZ_PARTIAL_FLUSH = 1, + MZ_SYNC_FLUSH = 2, + MZ_FULL_FLUSH = 3, + MZ_FINISH = 4, + MZ_BLOCK = 5 +}; + +/* Return status codes. MZ_PARAM_ERROR is non-standard. */ +enum +{ + MZ_OK = 0, + MZ_STREAM_END = 1, + MZ_NEED_DICT = 2, + MZ_ERRNO = -1, + MZ_STREAM_ERROR = -2, + MZ_DATA_ERROR = -3, + MZ_MEM_ERROR = -4, + MZ_BUF_ERROR = -5, + MZ_VERSION_ERROR = -6, + MZ_PARAM_ERROR = -10000 +}; + +/* Window bits */ +#define MZ_DEFAULT_WINDOW_BITS 15 + +struct mz_internal_state; + +/* Compression/decompression stream struct. */ +typedef struct mz_stream_s +{ + const unsigned char *next_in; /* pointer to next byte to read */ + unsigned int avail_in; /* number of bytes available at next_in */ + mz_ulong total_in; /* total number of bytes consumed so far */ + + unsigned char *next_out; /* pointer to next byte to write */ + unsigned int avail_out; /* number of bytes that can be written to next_out */ + mz_ulong total_out; /* total number of bytes produced so far */ + + char *msg; /* error msg (unused) */ + struct mz_internal_state *state; /* internal state, allocated by zalloc/zfree */ + + mz_alloc_func zalloc; /* optional heap allocation function (defaults to malloc) */ + mz_free_func zfree; /* optional heap free function (defaults to free) */ + void *opaque; /* heap alloc function user pointer */ + + int data_type; /* data_type (unused) */ + mz_ulong adler; /* adler32 of the source or uncompressed data */ + mz_ulong reserved; /* not used */ +} mz_stream; + +typedef mz_stream *mz_streamp; + +/* Returns the version string of miniz.c. */ +const char *mz_version(void); + +/* mz_deflateInit() initializes a compressor with default options: */ +/* Parameters: */ +/* pStream must point to an initialized mz_stream struct. */ +/* level must be between [MZ_NO_COMPRESSION, MZ_BEST_COMPRESSION]. */ +/* level 1 enables a specially optimized compression function that's been optimized purely for performance, not ratio. */ +/* (This special func. is currently only enabled when MINIZ_USE_UNALIGNED_LOADS_AND_STORES and MINIZ_LITTLE_ENDIAN are defined.) */ +/* Return values: */ +/* MZ_OK on success. */ +/* MZ_STREAM_ERROR if the stream is bogus. */ +/* MZ_PARAM_ERROR if the input parameters are bogus. */ +/* MZ_MEM_ERROR on out of memory. */ +int mz_deflateInit(mz_streamp pStream, int level); + +/* mz_deflateInit2() is like mz_deflate(), except with more control: */ +/* Additional parameters: */ +/* method must be MZ_DEFLATED */ +/* window_bits must be MZ_DEFAULT_WINDOW_BITS (to wrap the deflate stream with zlib header/adler-32 footer) or -MZ_DEFAULT_WINDOW_BITS (raw deflate/no header or footer) */ +/* mem_level must be between [1, 9] (it's checked but ignored by miniz.c) */ +int mz_deflateInit2(mz_streamp pStream, int level, int method, int window_bits, int mem_level, int strategy); + +/* Quickly resets a compressor without having to reallocate anything. Same as calling mz_deflateEnd() followed by mz_deflateInit()/mz_deflateInit2(). */ +int mz_deflateReset(mz_streamp pStream); + +/* mz_deflate() compresses the input to output, consuming as much of the input and producing as much output as possible. */ +/* Parameters: */ +/* pStream is the stream to read from and write to. You must initialize/update the next_in, avail_in, next_out, and avail_out members. */ +/* flush may be MZ_NO_FLUSH, MZ_PARTIAL_FLUSH/MZ_SYNC_FLUSH, MZ_FULL_FLUSH, or MZ_FINISH. */ +/* Return values: */ +/* MZ_OK on success (when flushing, or if more input is needed but not available, and/or there's more output to be written but the output buffer is full). */ +/* MZ_STREAM_END if all input has been consumed and all output bytes have been written. Don't call mz_deflate() on the stream anymore. */ +/* MZ_STREAM_ERROR if the stream is bogus. */ +/* MZ_PARAM_ERROR if one of the parameters is invalid. */ +/* MZ_BUF_ERROR if no forward progress is possible because the input and/or output buffers are empty. (Fill up the input buffer or free up some output space and try again.) */ +int mz_deflate(mz_streamp pStream, int flush); + +/* mz_deflateEnd() deinitializes a compressor: */ +/* Return values: */ +/* MZ_OK on success. */ +/* MZ_STREAM_ERROR if the stream is bogus. */ +int mz_deflateEnd(mz_streamp pStream); + +/* mz_deflateBound() returns a (very) conservative upper bound on the amount of data that could be generated by deflate(), assuming flush is set to only MZ_NO_FLUSH or MZ_FINISH. */ +mz_ulong mz_deflateBound(mz_streamp pStream, mz_ulong source_len); + +/* Single-call compression functions mz_compress() and mz_compress2(): */ +/* Returns MZ_OK on success, or one of the error codes from mz_deflate() on failure. */ +int mz_compress(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char *pSource, mz_ulong source_len); +int mz_compress2(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char *pSource, mz_ulong source_len, int level); + +/* mz_compressBound() returns a (very) conservative upper bound on the amount of data that could be generated by calling mz_compress(). */ +mz_ulong mz_compressBound(mz_ulong source_len); + +/* Initializes a decompressor. */ +int mz_inflateInit(mz_streamp pStream); + +/* mz_inflateInit2() is like mz_inflateInit() with an additional option that controls the window size and whether or not the stream has been wrapped with a zlib header/footer: */ +/* window_bits must be MZ_DEFAULT_WINDOW_BITS (to parse zlib header/footer) or -MZ_DEFAULT_WINDOW_BITS (raw deflate). */ +int mz_inflateInit2(mz_streamp pStream, int window_bits); + +/* Quickly resets a compressor without having to reallocate anything. Same as calling mz_inflateEnd() followed by mz_inflateInit()/mz_inflateInit2(). */ +int mz_inflateReset(mz_streamp pStream); + +/* Decompresses the input stream to the output, consuming only as much of the input as needed, and writing as much to the output as possible. */ +/* Parameters: */ +/* pStream is the stream to read from and write to. You must initialize/update the next_in, avail_in, next_out, and avail_out members. */ +/* flush may be MZ_NO_FLUSH, MZ_SYNC_FLUSH, or MZ_FINISH. */ +/* On the first call, if flush is MZ_FINISH it's assumed the input and output buffers are both sized large enough to decompress the entire stream in a single call (this is slightly faster). */ +/* MZ_FINISH implies that there are no more source bytes available beside what's already in the input buffer, and that the output buffer is large enough to hold the rest of the decompressed data. */ +/* Return values: */ +/* MZ_OK on success. Either more input is needed but not available, and/or there's more output to be written but the output buffer is full. */ +/* MZ_STREAM_END if all needed input has been consumed and all output bytes have been written. For zlib streams, the adler-32 of the decompressed data has also been verified. */ +/* MZ_STREAM_ERROR if the stream is bogus. */ +/* MZ_DATA_ERROR if the deflate stream is invalid. */ +/* MZ_PARAM_ERROR if one of the parameters is invalid. */ +/* MZ_BUF_ERROR if no forward progress is possible because the input buffer is empty but the inflater needs more input to continue, or if the output buffer is not large enough. Call mz_inflate() again */ +/* with more input data, or with more room in the output buffer (except when using single call decompression, described above). */ +int mz_inflate(mz_streamp pStream, int flush); + +/* Deinitializes a decompressor. */ +int mz_inflateEnd(mz_streamp pStream); + +/* Single-call decompression. */ +/* Returns MZ_OK on success, or one of the error codes from mz_inflate() on failure. */ +int mz_uncompress(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char *pSource, mz_ulong source_len); + +/* Returns a string description of the specified error code, or NULL if the error code is invalid. */ +const char *mz_error(int err); + +/* Redefine zlib-compatible names to miniz equivalents, so miniz.c can be used as a drop-in replacement for the subset of zlib that miniz.c supports. */ +/* Define MINIZ_NO_ZLIB_COMPATIBLE_NAMES to disable zlib-compatibility if you use zlib in the same project. */ +#ifndef MINIZ_NO_ZLIB_COMPATIBLE_NAMES +typedef unsigned char Byte; +typedef unsigned int uInt; +typedef mz_ulong uLong; +typedef Byte Bytef; +typedef uInt uIntf; +typedef char charf; +typedef int intf; +typedef void *voidpf; +typedef uLong uLongf; +typedef void *voidp; +typedef void *const voidpc; +#define Z_NULL 0 +#define Z_NO_FLUSH MZ_NO_FLUSH +#define Z_PARTIAL_FLUSH MZ_PARTIAL_FLUSH +#define Z_SYNC_FLUSH MZ_SYNC_FLUSH +#define Z_FULL_FLUSH MZ_FULL_FLUSH +#define Z_FINISH MZ_FINISH +#define Z_BLOCK MZ_BLOCK +#define Z_OK MZ_OK +#define Z_STREAM_END MZ_STREAM_END +#define Z_NEED_DICT MZ_NEED_DICT +#define Z_ERRNO MZ_ERRNO +#define Z_STREAM_ERROR MZ_STREAM_ERROR +#define Z_DATA_ERROR MZ_DATA_ERROR +#define Z_MEM_ERROR MZ_MEM_ERROR +#define Z_BUF_ERROR MZ_BUF_ERROR +#define Z_VERSION_ERROR MZ_VERSION_ERROR +#define Z_PARAM_ERROR MZ_PARAM_ERROR +#define Z_NO_COMPRESSION MZ_NO_COMPRESSION +#define Z_BEST_SPEED MZ_BEST_SPEED +#define Z_BEST_COMPRESSION MZ_BEST_COMPRESSION +#define Z_DEFAULT_COMPRESSION MZ_DEFAULT_COMPRESSION +#define Z_DEFAULT_STRATEGY MZ_DEFAULT_STRATEGY +#define Z_FILTERED MZ_FILTERED +#define Z_HUFFMAN_ONLY MZ_HUFFMAN_ONLY +#define Z_RLE MZ_RLE +#define Z_FIXED MZ_FIXED +#define Z_DEFLATED MZ_DEFLATED +#define Z_DEFAULT_WINDOW_BITS MZ_DEFAULT_WINDOW_BITS +#define alloc_func mz_alloc_func +#define free_func mz_free_func +#define internal_state mz_internal_state +#define z_stream mz_stream +#define deflateInit mz_deflateInit +#define deflateInit2 mz_deflateInit2 +#define deflateReset mz_deflateReset +#define deflate mz_deflate +#define deflateEnd mz_deflateEnd +#define deflateBound mz_deflateBound +#define compress mz_compress +#define compress2 mz_compress2 +#define compressBound mz_compressBound +#define inflateInit mz_inflateInit +#define inflateInit2 mz_inflateInit2 +#define inflateReset mz_inflateReset +#define inflate mz_inflate +#define inflateEnd mz_inflateEnd +#define uncompress mz_uncompress +#define crc32 mz_crc32 +#define adler32 mz_adler32 +#define MAX_WBITS 15 +#define MAX_MEM_LEVEL 9 +#define zError mz_error +#define ZLIB_VERSION MZ_VERSION +#define ZLIB_VERNUM MZ_VERNUM +#define ZLIB_VER_MAJOR MZ_VER_MAJOR +#define ZLIB_VER_MINOR MZ_VER_MINOR +#define ZLIB_VER_REVISION MZ_VER_REVISION +#define ZLIB_VER_SUBREVISION MZ_VER_SUBREVISION +#define zlibVersion mz_version +#define zlib_version mz_version() +#endif /* #ifndef MINIZ_NO_ZLIB_COMPATIBLE_NAMES */ + +#endif /* MINIZ_NO_ZLIB_APIS */ + +#ifdef __cplusplus +} +#endif diff --git a/r5dev/thirdparty/cppnet/cppkore_incl/ZLib/miniz_common.h b/r5dev/thirdparty/cppnet/cppkore_incl/ZLib/miniz_common.h new file mode 100644 index 00000000..a10dae8a --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore_incl/ZLib/miniz_common.h @@ -0,0 +1,91 @@ +#pragma once +#include +#include +#include +#include + +/* ------------------- Types and macros */ +typedef unsigned char mz_uint8; +typedef signed short mz_int16; +typedef unsigned short mz_uint16; +typedef unsigned int mz_uint32; +typedef unsigned int mz_uint; +typedef int64_t mz_int64; +typedef uint64_t mz_uint64; +typedef int mz_bool; + +#define MZ_FALSE (0) +#define MZ_TRUE (1) + +/* Works around MSVC's spammy "warning C4127: conditional expression is constant" message. */ +#ifdef _MSC_VER +#define MZ_MACRO_END while (0, 0) +#else +#define MZ_MACRO_END while (0) +#endif + +#ifdef MINIZ_NO_STDIO +#define MZ_FILE void * +#else +#include +#define MZ_FILE FILE +#endif /* #ifdef MINIZ_NO_STDIO */ + +#ifdef MINIZ_NO_TIME +typedef struct mz_dummy_time_t_tag +{ + int m_dummy; +} mz_dummy_time_t; +#define MZ_TIME_T mz_dummy_time_t +#else +#define MZ_TIME_T time_t +#endif + +#define MZ_ASSERT(x) assert(x) + +#ifdef MINIZ_NO_MALLOC +#define MZ_MALLOC(x) NULL +#define MZ_FREE(x) (void)x, ((void)0) +#define MZ_REALLOC(p, x) NULL +#else +#define MZ_MALLOC(x) malloc(x) +#define MZ_FREE(x) free(x) +#define MZ_REALLOC(p, x) realloc(p, x) +#endif + +#define MZ_MAX(a, b) (((a) > (b)) ? (a) : (b)) +#define MZ_MIN(a, b) (((a) < (b)) ? (a) : (b)) +#define MZ_CLEAR_OBJ(obj) memset(&(obj), 0, sizeof(obj)) + +#if MINIZ_USE_UNALIGNED_LOADS_AND_STORES && MINIZ_LITTLE_ENDIAN +#define MZ_READ_LE16(p) *((const mz_uint16 *)(p)) +#define MZ_READ_LE32(p) *((const mz_uint32 *)(p)) +#else +#define MZ_READ_LE16(p) ((mz_uint32)(((const mz_uint8 *)(p))[0]) | ((mz_uint32)(((const mz_uint8 *)(p))[1]) << 8U)) +#define MZ_READ_LE32(p) ((mz_uint32)(((const mz_uint8 *)(p))[0]) | ((mz_uint32)(((const mz_uint8 *)(p))[1]) << 8U) | ((mz_uint32)(((const mz_uint8 *)(p))[2]) << 16U) | ((mz_uint32)(((const mz_uint8 *)(p))[3]) << 24U)) +#endif + +#define MZ_READ_LE64(p) (((mz_uint64)MZ_READ_LE32(p)) | (((mz_uint64)MZ_READ_LE32((const mz_uint8 *)(p) + sizeof(mz_uint32))) << 32U)) + +#ifdef _MSC_VER +#define MZ_FORCEINLINE __forceinline +#elif defined(__GNUC__) +#define MZ_FORCEINLINE __inline__ __attribute__((__always_inline__)) +#else +#define MZ_FORCEINLINE inline +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +extern void *miniz_def_alloc_func(void *opaque, size_t items, size_t size); +extern void miniz_def_free_func(void *opaque, void *address); +extern void *miniz_def_realloc_func(void *opaque, void *address, size_t items, size_t size); + +#define MZ_UINT16_MAX (0xFFFFU) +#define MZ_UINT32_MAX (0xFFFFFFFFU) + +#ifdef __cplusplus +} +#endif diff --git a/r5dev/thirdparty/cppnet/cppkore_incl/ZLib/miniz_tdef.h b/r5dev/thirdparty/cppnet/cppkore_incl/ZLib/miniz_tdef.h new file mode 100644 index 00000000..afa535ce --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore_incl/ZLib/miniz_tdef.h @@ -0,0 +1,190 @@ +#pragma once +#include "miniz_common.h" + +#ifdef __cplusplus +extern "C" { +#endif +/* ------------------- Low-level Compression API Definitions */ + +/* Set TDEFL_LESS_MEMORY to 1 to use less memory (compression will be slightly slower, and raw/dynamic blocks will be output more frequently). */ +#define TDEFL_LESS_MEMORY 0 + +/* tdefl_init() compression flags logically OR'd together (low 12 bits contain the max. number of probes per dictionary search): */ +/* TDEFL_DEFAULT_MAX_PROBES: The compressor defaults to 128 dictionary probes per dictionary search. 0=Huffman only, 1=Huffman+LZ (fastest/crap compression), 4095=Huffman+LZ (slowest/best compression). */ +enum +{ + TDEFL_HUFFMAN_ONLY = 0, + TDEFL_DEFAULT_MAX_PROBES = 128, + TDEFL_MAX_PROBES_MASK = 0xFFF +}; + +/* TDEFL_WRITE_ZLIB_HEADER: If set, the compressor outputs a zlib header before the deflate data, and the Adler-32 of the source data at the end. Otherwise, you'll get raw deflate data. */ +/* TDEFL_COMPUTE_ADLER32: Always compute the adler-32 of the input data (even when not writing zlib headers). */ +/* TDEFL_GREEDY_PARSING_FLAG: Set to use faster greedy parsing, instead of more efficient lazy parsing. */ +/* TDEFL_NONDETERMINISTIC_PARSING_FLAG: Enable to decrease the compressor's initialization time to the minimum, but the output may vary from run to run given the same input (depending on the contents of memory). */ +/* TDEFL_RLE_MATCHES: Only look for RLE matches (matches with a distance of 1) */ +/* TDEFL_FILTER_MATCHES: Discards matches <= 5 chars if enabled. */ +/* TDEFL_FORCE_ALL_STATIC_BLOCKS: Disable usage of optimized Huffman tables. */ +/* TDEFL_FORCE_ALL_RAW_BLOCKS: Only use raw (uncompressed) deflate blocks. */ +/* The low 12 bits are reserved to control the max # of hash probes per dictionary lookup (see TDEFL_MAX_PROBES_MASK). */ +enum +{ + TDEFL_WRITE_ZLIB_HEADER = 0x01000, + TDEFL_COMPUTE_ADLER32 = 0x02000, + TDEFL_GREEDY_PARSING_FLAG = 0x04000, + TDEFL_NONDETERMINISTIC_PARSING_FLAG = 0x08000, + TDEFL_RLE_MATCHES = 0x10000, + TDEFL_FILTER_MATCHES = 0x20000, + TDEFL_FORCE_ALL_STATIC_BLOCKS = 0x40000, + TDEFL_FORCE_ALL_RAW_BLOCKS = 0x80000 +}; + +/* High level compression functions: */ +/* tdefl_compress_mem_to_heap() compresses a block in memory to a heap block allocated via malloc(). */ +/* On entry: */ +/* pSrc_buf, src_buf_len: Pointer and size of source block to compress. */ +/* flags: The max match finder probes (default is 128) logically OR'd against the above flags. Higher probes are slower but improve compression. */ +/* On return: */ +/* Function returns a pointer to the compressed data, or NULL on failure. */ +/* *pOut_len will be set to the compressed data's size, which could be larger than src_buf_len on uncompressible data. */ +/* The caller must free() the returned block when it's no longer needed. */ +void *tdefl_compress_mem_to_heap(const void *pSrc_buf, size_t src_buf_len, size_t *pOut_len, int flags); + +/* tdefl_compress_mem_to_mem() compresses a block in memory to another block in memory. */ +/* Returns 0 on failure. */ +size_t tdefl_compress_mem_to_mem(void *pOut_buf, size_t out_buf_len, const void *pSrc_buf, size_t src_buf_len, int flags); + +/* Compresses an image to a compressed PNG file in memory. */ +/* On entry: */ +/* pImage, w, h, and num_chans describe the image to compress. num_chans may be 1, 2, 3, or 4. */ +/* The image pitch in bytes per scanline will be w*num_chans. The leftmost pixel on the top scanline is stored first in memory. */ +/* level may range from [0,10], use MZ_NO_COMPRESSION, MZ_BEST_SPEED, MZ_BEST_COMPRESSION, etc. or a decent default is MZ_DEFAULT_LEVEL */ +/* If flip is true, the image will be flipped on the Y axis (useful for OpenGL apps). */ +/* On return: */ +/* Function returns a pointer to the compressed data, or NULL on failure. */ +/* *pLen_out will be set to the size of the PNG image file. */ +/* The caller must mz_free() the returned heap block (which will typically be larger than *pLen_out) when it's no longer needed. */ +void *tdefl_write_image_to_png_file_in_memory_ex(const void *pImage, int w, int h, int num_chans, size_t *pLen_out, mz_uint level, mz_bool flip); +void *tdefl_write_image_to_png_file_in_memory(const void *pImage, int w, int h, int num_chans, size_t *pLen_out); + +/* Output stream interface. The compressor uses this interface to write compressed data. It'll typically be called TDEFL_OUT_BUF_SIZE at a time. */ +typedef mz_bool (*tdefl_put_buf_func_ptr)(const void *pBuf, int len, void *pUser); + +/* tdefl_compress_mem_to_output() compresses a block to an output stream. The above helpers use this function internally. */ +mz_bool tdefl_compress_mem_to_output(const void *pBuf, size_t buf_len, tdefl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags); + +enum +{ + TDEFL_MAX_HUFF_TABLES = 3, + TDEFL_MAX_HUFF_SYMBOLS_0 = 288, + TDEFL_MAX_HUFF_SYMBOLS_1 = 32, + TDEFL_MAX_HUFF_SYMBOLS_2 = 19, + TDEFL_LZ_DICT_SIZE = 32768, + TDEFL_LZ_DICT_SIZE_MASK = TDEFL_LZ_DICT_SIZE - 1, + TDEFL_MIN_MATCH_LEN = 3, + TDEFL_MAX_MATCH_LEN = 258 +}; + +/* TDEFL_OUT_BUF_SIZE MUST be large enough to hold a single entire compressed output block (using static/fixed Huffman codes). */ +#if TDEFL_LESS_MEMORY +enum +{ + TDEFL_LZ_CODE_BUF_SIZE = 24 * 1024, + TDEFL_OUT_BUF_SIZE = (TDEFL_LZ_CODE_BUF_SIZE * 13) / 10, + TDEFL_MAX_HUFF_SYMBOLS = 288, + TDEFL_LZ_HASH_BITS = 12, + TDEFL_LEVEL1_HASH_SIZE_MASK = 4095, + TDEFL_LZ_HASH_SHIFT = (TDEFL_LZ_HASH_BITS + 2) / 3, + TDEFL_LZ_HASH_SIZE = 1 << TDEFL_LZ_HASH_BITS +}; +#else +enum +{ + TDEFL_LZ_CODE_BUF_SIZE = 64 * 1024, + TDEFL_OUT_BUF_SIZE = (TDEFL_LZ_CODE_BUF_SIZE * 13) / 10, + TDEFL_MAX_HUFF_SYMBOLS = 288, + TDEFL_LZ_HASH_BITS = 15, + TDEFL_LEVEL1_HASH_SIZE_MASK = 4095, + TDEFL_LZ_HASH_SHIFT = (TDEFL_LZ_HASH_BITS + 2) / 3, + TDEFL_LZ_HASH_SIZE = 1 << TDEFL_LZ_HASH_BITS +}; +#endif + +/* The low-level tdefl functions below may be used directly if the above helper functions aren't flexible enough. The low-level functions don't make any heap allocations, unlike the above helper functions. */ +typedef enum { + TDEFL_STATUS_BAD_PARAM = -2, + TDEFL_STATUS_PUT_BUF_FAILED = -1, + TDEFL_STATUS_OKAY = 0, + TDEFL_STATUS_DONE = 1 +} tdefl_status; + +/* Must map to MZ_NO_FLUSH, MZ_SYNC_FLUSH, etc. enums */ +typedef enum { + TDEFL_NO_FLUSH = 0, + TDEFL_SYNC_FLUSH = 2, + TDEFL_FULL_FLUSH = 3, + TDEFL_FINISH = 4 +} tdefl_flush; + +/* tdefl's compression state structure. */ +typedef struct +{ + tdefl_put_buf_func_ptr m_pPut_buf_func; + void *m_pPut_buf_user; + mz_uint m_flags, m_max_probes[2]; + int m_greedy_parsing; + mz_uint m_adler32, m_lookahead_pos, m_lookahead_size, m_dict_size; + mz_uint8 *m_pLZ_code_buf, *m_pLZ_flags, *m_pOutput_buf, *m_pOutput_buf_end; + mz_uint m_num_flags_left, m_total_lz_bytes, m_lz_code_buf_dict_pos, m_bits_in, m_bit_buffer; + mz_uint m_saved_match_dist, m_saved_match_len, m_saved_lit, m_output_flush_ofs, m_output_flush_remaining, m_finished, m_block_index, m_wants_to_finish; + tdefl_status m_prev_return_status; + const void *m_pIn_buf; + void *m_pOut_buf; + size_t *m_pIn_buf_size, *m_pOut_buf_size; + tdefl_flush m_flush; + const mz_uint8 *m_pSrc; + size_t m_src_buf_left, m_out_buf_ofs; + mz_uint8 m_dict[TDEFL_LZ_DICT_SIZE + TDEFL_MAX_MATCH_LEN - 1]; + mz_uint16 m_huff_count[TDEFL_MAX_HUFF_TABLES][TDEFL_MAX_HUFF_SYMBOLS]; + mz_uint16 m_huff_codes[TDEFL_MAX_HUFF_TABLES][TDEFL_MAX_HUFF_SYMBOLS]; + mz_uint8 m_huff_code_sizes[TDEFL_MAX_HUFF_TABLES][TDEFL_MAX_HUFF_SYMBOLS]; + mz_uint8 m_lz_code_buf[TDEFL_LZ_CODE_BUF_SIZE]; + mz_uint16 m_next[TDEFL_LZ_DICT_SIZE]; + mz_uint16 m_hash[TDEFL_LZ_HASH_SIZE]; + mz_uint8 m_output_buf[TDEFL_OUT_BUF_SIZE]; +} tdefl_compressor; + +/* Initializes the compressor. */ +/* There is no corresponding deinit() function because the tdefl API's do not dynamically allocate memory. */ +/* pBut_buf_func: If NULL, output data will be supplied to the specified callback. In this case, the user should call the tdefl_compress_buffer() API for compression. */ +/* If pBut_buf_func is NULL the user should always call the tdefl_compress() API. */ +/* flags: See the above enums (TDEFL_HUFFMAN_ONLY, TDEFL_WRITE_ZLIB_HEADER, etc.) */ +tdefl_status tdefl_init(tdefl_compressor *d, tdefl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags); + +/* Compresses a block of data, consuming as much of the specified input buffer as possible, and writing as much compressed data to the specified output buffer as possible. */ +tdefl_status tdefl_compress(tdefl_compressor *d, const void *pIn_buf, size_t *pIn_buf_size, void *pOut_buf, size_t *pOut_buf_size, tdefl_flush flush); + +/* tdefl_compress_buffer() is only usable when the tdefl_init() is called with a non-NULL tdefl_put_buf_func_ptr. */ +/* tdefl_compress_buffer() always consumes the entire input buffer. */ +tdefl_status tdefl_compress_buffer(tdefl_compressor *d, const void *pIn_buf, size_t in_buf_size, tdefl_flush flush); + +tdefl_status tdefl_get_prev_return_status(tdefl_compressor *d); +mz_uint32 tdefl_get_adler32(tdefl_compressor *d); + +/* Create tdefl_compress() flags given zlib-style compression parameters. */ +/* level may range from [0,10] (where 10 is absolute max compression, but may be much slower on some files) */ +/* window_bits may be -15 (raw deflate) or 15 (zlib) */ +/* strategy may be either MZ_DEFAULT_STRATEGY, MZ_FILTERED, MZ_HUFFMAN_ONLY, MZ_RLE, or MZ_FIXED */ +mz_uint tdefl_create_comp_flags_from_zip_params(int level, int window_bits, int strategy); + +#ifndef MINIZ_NO_MALLOC +/* Allocate the tdefl_compressor structure in C so that */ +/* non-C language bindings to tdefl_ API don't need to worry about */ +/* structure size and allocation mechanism. */ +tdefl_compressor *tdefl_compressor_alloc(void); +void tdefl_compressor_free(tdefl_compressor *pComp); +#endif + +#ifdef __cplusplus +} +#endif diff --git a/r5dev/thirdparty/cppnet/cppkore_incl/ZLib/miniz_tinfl.h b/r5dev/thirdparty/cppnet/cppkore_incl/ZLib/miniz_tinfl.h new file mode 100644 index 00000000..be4ec9c7 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore_incl/ZLib/miniz_tinfl.h @@ -0,0 +1,144 @@ +#pragma once +#include "miniz_common.h" +/* ------------------- Low-level Decompression API Definitions */ + +#ifdef __cplusplus +extern "C" { +#endif +/* Decompression flags used by tinfl_decompress(). */ +/* TINFL_FLAG_PARSE_ZLIB_HEADER: If set, the input has a valid zlib header and ends with an adler32 checksum (it's a valid zlib stream). Otherwise, the input is a raw deflate stream. */ +/* TINFL_FLAG_HAS_MORE_INPUT: If set, there are more input bytes available beyond the end of the supplied input buffer. If clear, the input buffer contains all remaining input. */ +/* TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF: If set, the output buffer is large enough to hold the entire decompressed stream. If clear, the output buffer is at least the size of the dictionary (typically 32KB). */ +/* TINFL_FLAG_COMPUTE_ADLER32: Force adler-32 checksum computation of the decompressed bytes. */ +enum +{ + TINFL_FLAG_PARSE_ZLIB_HEADER = 1, + TINFL_FLAG_HAS_MORE_INPUT = 2, + TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF = 4, + TINFL_FLAG_COMPUTE_ADLER32 = 8 +}; + +/* High level decompression functions: */ +/* tinfl_decompress_mem_to_heap() decompresses a block in memory to a heap block allocated via malloc(). */ +/* On entry: */ +/* pSrc_buf, src_buf_len: Pointer and size of the Deflate or zlib source data to decompress. */ +/* On return: */ +/* Function returns a pointer to the decompressed data, or NULL on failure. */ +/* *pOut_len will be set to the decompressed data's size, which could be larger than src_buf_len on uncompressible data. */ +/* The caller must call mz_free() on the returned block when it's no longer needed. */ +void *tinfl_decompress_mem_to_heap(const void *pSrc_buf, size_t src_buf_len, size_t *pOut_len, int flags); + +/* tinfl_decompress_mem_to_mem() decompresses a block in memory to another block in memory. */ +/* Returns TINFL_DECOMPRESS_MEM_TO_MEM_FAILED on failure, or the number of bytes written on success. */ +#define TINFL_DECOMPRESS_MEM_TO_MEM_FAILED ((size_t)(-1)) +size_t tinfl_decompress_mem_to_mem(void *pOut_buf, size_t out_buf_len, const void *pSrc_buf, size_t src_buf_len, int flags); + +/* tinfl_decompress_mem_to_callback() decompresses a block in memory to an internal 32KB buffer, and a user provided callback function will be called to flush the buffer. */ +/* Returns 1 on success or 0 on failure. */ +typedef int (*tinfl_put_buf_func_ptr)(const void *pBuf, int len, void *pUser); +int tinfl_decompress_mem_to_callback(const void *pIn_buf, size_t *pIn_buf_size, tinfl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags); + +struct tinfl_decompressor_tag; +typedef struct tinfl_decompressor_tag tinfl_decompressor; + +#ifndef MINIZ_NO_MALLOC +/* Allocate the tinfl_decompressor structure in C so that */ +/* non-C language bindings to tinfl_ API don't need to worry about */ +/* structure size and allocation mechanism. */ +tinfl_decompressor *tinfl_decompressor_alloc(void); +void tinfl_decompressor_free(tinfl_decompressor *pDecomp); +#endif + +/* Max size of LZ dictionary. */ +#define TINFL_LZ_DICT_SIZE 32768 + +/* Return status. */ +typedef enum { + /* This flags indicates the inflator needs 1 or more input bytes to make forward progress, but the caller is indicating that no more are available. The compressed data */ + /* is probably corrupted. If you call the inflator again with more bytes it'll try to continue processing the input but this is a BAD sign (either the data is corrupted or you called it incorrectly). */ + /* If you call it again with no input you'll just get TINFL_STATUS_FAILED_CANNOT_MAKE_PROGRESS again. */ + TINFL_STATUS_FAILED_CANNOT_MAKE_PROGRESS = -4, + + /* This flag indicates that one or more of the input parameters was obviously bogus. (You can try calling it again, but if you get this error the calling code is wrong.) */ + TINFL_STATUS_BAD_PARAM = -3, + + /* This flags indicate the inflator is finished but the adler32 check of the uncompressed data didn't match. If you call it again it'll return TINFL_STATUS_DONE. */ + TINFL_STATUS_ADLER32_MISMATCH = -2, + + /* This flags indicate the inflator has somehow failed (bad code, corrupted input, etc.). If you call it again without resetting via tinfl_init() it it'll just keep on returning the same status failure code. */ + TINFL_STATUS_FAILED = -1, + + /* Any status code less than TINFL_STATUS_DONE must indicate a failure. */ + + /* This flag indicates the inflator has returned every byte of uncompressed data that it can, has consumed every byte that it needed, has successfully reached the end of the deflate stream, and */ + /* if zlib headers and adler32 checking enabled that it has successfully checked the uncompressed data's adler32. If you call it again you'll just get TINFL_STATUS_DONE over and over again. */ + TINFL_STATUS_DONE = 0, + + /* This flag indicates the inflator MUST have more input data (even 1 byte) before it can make any more forward progress, or you need to clear the TINFL_FLAG_HAS_MORE_INPUT */ + /* flag on the next call if you don't have any more source data. If the source data was somehow corrupted it's also possible (but unlikely) for the inflator to keep on demanding input to */ + /* proceed, so be sure to properly set the TINFL_FLAG_HAS_MORE_INPUT flag. */ + TINFL_STATUS_NEEDS_MORE_INPUT = 1, + + /* This flag indicates the inflator definitely has 1 or more bytes of uncompressed data available, but it cannot write this data into the output buffer. */ + /* Note if the source compressed data was corrupted it's possible for the inflator to return a lot of uncompressed data to the caller. I've been assuming you know how much uncompressed data to expect */ + /* (either exact or worst case) and will stop calling the inflator and fail after receiving too much. In pure streaming scenarios where you have no idea how many bytes to expect this may not be possible */ + /* so I may need to add some code to address this. */ + TINFL_STATUS_HAS_MORE_OUTPUT = 2 +} tinfl_status; + +/* Initializes the decompressor to its initial state. */ +#define tinfl_init(r) \ + do \ + { \ + (r)->m_state = 0; \ + } \ + MZ_MACRO_END +#define tinfl_get_adler32(r) (r)->m_check_adler32 + +/* Main low-level decompressor coroutine function. This is the only function actually needed for decompression. All the other functions are just high-level helpers for improved usability. */ +/* This is a universal API, i.e. it can be used as a building block to build any desired higher level decompression API. In the limit case, it can be called once per every byte input or output. */ +tinfl_status tinfl_decompress(tinfl_decompressor *r, const mz_uint8 *pIn_buf_next, size_t *pIn_buf_size, mz_uint8 *pOut_buf_start, mz_uint8 *pOut_buf_next, size_t *pOut_buf_size, const mz_uint32 decomp_flags); + +/* Internal/private bits follow. */ +enum +{ + TINFL_MAX_HUFF_TABLES = 3, + TINFL_MAX_HUFF_SYMBOLS_0 = 288, + TINFL_MAX_HUFF_SYMBOLS_1 = 32, + TINFL_MAX_HUFF_SYMBOLS_2 = 19, + TINFL_FAST_LOOKUP_BITS = 10, + TINFL_FAST_LOOKUP_SIZE = 1 << TINFL_FAST_LOOKUP_BITS +}; + +typedef struct +{ + mz_uint8 m_code_size[TINFL_MAX_HUFF_SYMBOLS_0]; + mz_int16 m_look_up[TINFL_FAST_LOOKUP_SIZE], m_tree[TINFL_MAX_HUFF_SYMBOLS_0 * 2]; +} tinfl_huff_table; + +#if MINIZ_HAS_64BIT_REGISTERS +#define TINFL_USE_64BIT_BITBUF 1 +#else +#define TINFL_USE_64BIT_BITBUF 0 +#endif + +#if TINFL_USE_64BIT_BITBUF +typedef mz_uint64 tinfl_bit_buf_t; +#define TINFL_BITBUF_SIZE (64) +#else +typedef mz_uint32 tinfl_bit_buf_t; +#define TINFL_BITBUF_SIZE (32) +#endif + +struct tinfl_decompressor_tag +{ + mz_uint32 m_state, m_num_bits, m_zhdr0, m_zhdr1, m_z_adler32, m_final, m_type, m_check_adler32, m_dist, m_counter, m_num_extra, m_table_sizes[TINFL_MAX_HUFF_TABLES]; + tinfl_bit_buf_t m_bit_buf; + size_t m_dist_from_out_buf_start; + tinfl_huff_table m_tables[TINFL_MAX_HUFF_TABLES]; + mz_uint8 m_raw_header[4], m_len_codes[TINFL_MAX_HUFF_SYMBOLS_0 + TINFL_MAX_HUFF_SYMBOLS_1 + 137]; +}; + +#ifdef __cplusplus +} +#endif diff --git a/r5dev/thirdparty/cppnet/cppkore_incl/ZLib/miniz_zip.h b/r5dev/thirdparty/cppnet/cppkore_incl/ZLib/miniz_zip.h new file mode 100644 index 00000000..9314361e --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore_incl/ZLib/miniz_zip.h @@ -0,0 +1,436 @@ + +#pragma once +#include "miniz.h" + +/* ------------------- ZIP archive reading/writing */ + +#ifndef MINIZ_NO_ARCHIVE_APIS + +#ifdef __cplusplus +extern "C" { +#endif + +enum +{ + /* Note: These enums can be reduced as needed to save memory or stack space - they are pretty conservative. */ + MZ_ZIP_MAX_IO_BUF_SIZE = 64 * 1024, + MZ_ZIP_MAX_ARCHIVE_FILENAME_SIZE = 512, + MZ_ZIP_MAX_ARCHIVE_FILE_COMMENT_SIZE = 512 +}; + +typedef struct +{ + /* Central directory file index. */ + mz_uint32 m_file_index; + + /* Byte offset of this entry in the archive's central directory. Note we currently only support up to UINT_MAX or less bytes in the central dir. */ + mz_uint64 m_central_dir_ofs; + + /* These fields are copied directly from the zip's central dir. */ + mz_uint16 m_version_made_by; + mz_uint16 m_version_needed; + mz_uint16 m_bit_flag; + mz_uint16 m_method; + +#ifndef MINIZ_NO_TIME + MZ_TIME_T m_time; +#endif + + /* CRC-32 of uncompressed data. */ + mz_uint32 m_crc32; + + /* File's compressed size. */ + mz_uint64 m_comp_size; + + /* File's uncompressed size. Note, I've seen some old archives where directory entries had 512 bytes for their uncompressed sizes, but when you try to unpack them you actually get 0 bytes. */ + mz_uint64 m_uncomp_size; + + /* Zip internal and external file attributes. */ + mz_uint16 m_internal_attr; + mz_uint32 m_external_attr; + + /* Entry's local header file offset in bytes. */ + mz_uint64 m_local_header_ofs; + + /* Size of comment in bytes. */ + mz_uint32 m_comment_size; + + /* MZ_TRUE if the entry appears to be a directory. */ + mz_bool m_is_directory; + + /* MZ_TRUE if the entry uses encryption/strong encryption (which miniz_zip doesn't support) */ + mz_bool m_is_encrypted; + + /* MZ_TRUE if the file is not encrypted, a patch file, and if it uses a compression method we support. */ + mz_bool m_is_supported; + + /* Filename. If string ends in '/' it's a subdirectory entry. */ + /* Guaranteed to be zero terminated, may be truncated to fit. */ + char m_filename[MZ_ZIP_MAX_ARCHIVE_FILENAME_SIZE]; + + /* Comment field. */ + /* Guaranteed to be zero terminated, may be truncated to fit. */ + char m_comment[MZ_ZIP_MAX_ARCHIVE_FILE_COMMENT_SIZE]; + +} mz_zip_archive_file_stat; + +typedef size_t (*mz_file_read_func)(void *pOpaque, mz_uint64 file_ofs, void *pBuf, size_t n); +typedef size_t (*mz_file_write_func)(void *pOpaque, mz_uint64 file_ofs, const void *pBuf, size_t n); +typedef mz_bool (*mz_file_needs_keepalive)(void *pOpaque); + +struct mz_zip_internal_state_tag; +typedef struct mz_zip_internal_state_tag mz_zip_internal_state; + +typedef enum { + MZ_ZIP_MODE_INVALID = 0, + MZ_ZIP_MODE_READING = 1, + MZ_ZIP_MODE_WRITING = 2, + MZ_ZIP_MODE_WRITING_HAS_BEEN_FINALIZED = 3 +} mz_zip_mode; + +typedef enum { + MZ_ZIP_FLAG_CASE_SENSITIVE = 0x0100, + MZ_ZIP_FLAG_IGNORE_PATH = 0x0200, + MZ_ZIP_FLAG_COMPRESSED_DATA = 0x0400, + MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY = 0x0800, + MZ_ZIP_FLAG_VALIDATE_LOCATE_FILE_FLAG = 0x1000, /* if enabled, mz_zip_reader_locate_file() will be called on each file as its validated to ensure the func finds the file in the central dir (intended for testing) */ + MZ_ZIP_FLAG_VALIDATE_HEADERS_ONLY = 0x2000, /* validate the local headers, but don't decompress the entire file and check the crc32 */ + MZ_ZIP_FLAG_WRITE_ZIP64 = 0x4000, /* always use the zip64 file format, instead of the original zip file format with automatic switch to zip64. Use as flags parameter with mz_zip_writer_init*_v2 */ + MZ_ZIP_FLAG_WRITE_ALLOW_READING = 0x8000, + MZ_ZIP_FLAG_ASCII_FILENAME = 0x10000 +} mz_zip_flags; + +typedef enum { + MZ_ZIP_TYPE_INVALID = 0, + MZ_ZIP_TYPE_USER, + MZ_ZIP_TYPE_MEMORY, + MZ_ZIP_TYPE_HEAP, + MZ_ZIP_TYPE_FILE, + MZ_ZIP_TYPE_CFILE, + MZ_ZIP_TOTAL_TYPES +} mz_zip_type; + +/* miniz error codes. Be sure to update mz_zip_get_error_string() if you add or modify this enum. */ +typedef enum { + MZ_ZIP_NO_ERROR = 0, + MZ_ZIP_UNDEFINED_ERROR, + MZ_ZIP_TOO_MANY_FILES, + MZ_ZIP_FILE_TOO_LARGE, + MZ_ZIP_UNSUPPORTED_METHOD, + MZ_ZIP_UNSUPPORTED_ENCRYPTION, + MZ_ZIP_UNSUPPORTED_FEATURE, + MZ_ZIP_FAILED_FINDING_CENTRAL_DIR, + MZ_ZIP_NOT_AN_ARCHIVE, + MZ_ZIP_INVALID_HEADER_OR_CORRUPTED, + MZ_ZIP_UNSUPPORTED_MULTIDISK, + MZ_ZIP_DECOMPRESSION_FAILED, + MZ_ZIP_COMPRESSION_FAILED, + MZ_ZIP_UNEXPECTED_DECOMPRESSED_SIZE, + MZ_ZIP_CRC_CHECK_FAILED, + MZ_ZIP_UNSUPPORTED_CDIR_SIZE, + MZ_ZIP_ALLOC_FAILED, + MZ_ZIP_FILE_OPEN_FAILED, + MZ_ZIP_FILE_CREATE_FAILED, + MZ_ZIP_FILE_WRITE_FAILED, + MZ_ZIP_FILE_READ_FAILED, + MZ_ZIP_FILE_CLOSE_FAILED, + MZ_ZIP_FILE_SEEK_FAILED, + MZ_ZIP_FILE_STAT_FAILED, + MZ_ZIP_INVALID_PARAMETER, + MZ_ZIP_INVALID_FILENAME, + MZ_ZIP_BUF_TOO_SMALL, + MZ_ZIP_INTERNAL_ERROR, + MZ_ZIP_FILE_NOT_FOUND, + MZ_ZIP_ARCHIVE_TOO_LARGE, + MZ_ZIP_VALIDATION_FAILED, + MZ_ZIP_WRITE_CALLBACK_FAILED, + MZ_ZIP_TOTAL_ERRORS +} mz_zip_error; + +typedef struct +{ + mz_uint64 m_archive_size; + mz_uint64 m_central_directory_file_ofs; + + /* We only support up to UINT32_MAX files in zip64 mode. */ + mz_uint32 m_total_files; + mz_zip_mode m_zip_mode; + mz_zip_type m_zip_type; + mz_zip_error m_last_error; + + mz_uint64 m_file_offset_alignment; + + mz_alloc_func m_pAlloc; + mz_free_func m_pFree; + mz_realloc_func m_pRealloc; + void *m_pAlloc_opaque; + + mz_file_read_func m_pRead; + mz_file_write_func m_pWrite; + mz_file_needs_keepalive m_pNeeds_keepalive; + void *m_pIO_opaque; + + mz_zip_internal_state *m_pState; + +} mz_zip_archive; + +typedef struct +{ + mz_zip_archive *pZip; + mz_uint flags; + + int status; +#ifndef MINIZ_DISABLE_ZIP_READER_CRC32_CHECKS + mz_uint file_crc32; +#endif + mz_uint64 read_buf_size, read_buf_ofs, read_buf_avail, comp_remaining, out_buf_ofs, cur_file_ofs; + mz_zip_archive_file_stat file_stat; + void *pRead_buf; + void *pWrite_buf; + + size_t out_blk_remain; + + tinfl_decompressor inflator; + +} mz_zip_reader_extract_iter_state; + +/* -------- ZIP reading */ + +/* Inits a ZIP archive reader. */ +/* These functions read and validate the archive's central directory. */ +mz_bool mz_zip_reader_init(mz_zip_archive *pZip, mz_uint64 size, mz_uint flags); + +mz_bool mz_zip_reader_init_mem(mz_zip_archive *pZip, const void *pMem, size_t size, mz_uint flags); + +#ifndef MINIZ_NO_STDIO +/* Read a archive from a disk file. */ +/* file_start_ofs is the file offset where the archive actually begins, or 0. */ +/* actual_archive_size is the true total size of the archive, which may be smaller than the file's actual size on disk. If zero the entire file is treated as the archive. */ +mz_bool mz_zip_reader_init_file(mz_zip_archive *pZip, const char *pFilename, mz_uint32 flags); +mz_bool mz_zip_reader_init_file_v2(mz_zip_archive *pZip, const char *pFilename, mz_uint flags, mz_uint64 file_start_ofs, mz_uint64 archive_size); + +/* Read an archive from an already opened FILE, beginning at the current file position. */ +/* The archive is assumed to be archive_size bytes long. If archive_size is < 0, then the entire rest of the file is assumed to contain the archive. */ +/* The FILE will NOT be closed when mz_zip_reader_end() is called. */ +mz_bool mz_zip_reader_init_cfile(mz_zip_archive *pZip, MZ_FILE *pFile, mz_uint64 archive_size, mz_uint flags); +#endif + +/* Ends archive reading, freeing all allocations, and closing the input archive file if mz_zip_reader_init_file() was used. */ +mz_bool mz_zip_reader_end(mz_zip_archive *pZip); + +/* -------- ZIP reading or writing */ + +/* Clears a mz_zip_archive struct to all zeros. */ +/* Important: This must be done before passing the struct to any mz_zip functions. */ +void mz_zip_zero_struct(mz_zip_archive *pZip); + +mz_zip_mode mz_zip_get_mode(mz_zip_archive *pZip); +mz_zip_type mz_zip_get_type(mz_zip_archive *pZip); + +/* Returns the total number of files in the archive. */ +mz_uint mz_zip_reader_get_num_files(mz_zip_archive *pZip); + +mz_uint64 mz_zip_get_archive_size(mz_zip_archive *pZip); +mz_uint64 mz_zip_get_archive_file_start_offset(mz_zip_archive *pZip); +MZ_FILE *mz_zip_get_cfile(mz_zip_archive *pZip); + +/* Reads n bytes of raw archive data, starting at file offset file_ofs, to pBuf. */ +size_t mz_zip_read_archive_data(mz_zip_archive *pZip, mz_uint64 file_ofs, void *pBuf, size_t n); + +/* All mz_zip funcs set the m_last_error field in the mz_zip_archive struct. These functions retrieve/manipulate this field. */ +/* Note that the m_last_error functionality is not thread safe. */ +mz_zip_error mz_zip_set_last_error(mz_zip_archive *pZip, mz_zip_error err_num); +mz_zip_error mz_zip_peek_last_error(mz_zip_archive *pZip); +mz_zip_error mz_zip_clear_last_error(mz_zip_archive *pZip); +mz_zip_error mz_zip_get_last_error(mz_zip_archive *pZip); +const char *mz_zip_get_error_string(mz_zip_error mz_err); + +/* MZ_TRUE if the archive file entry is a directory entry. */ +mz_bool mz_zip_reader_is_file_a_directory(mz_zip_archive *pZip, mz_uint file_index); + +/* MZ_TRUE if the file is encrypted/strong encrypted. */ +mz_bool mz_zip_reader_is_file_encrypted(mz_zip_archive *pZip, mz_uint file_index); + +/* MZ_TRUE if the compression method is supported, and the file is not encrypted, and the file is not a compressed patch file. */ +mz_bool mz_zip_reader_is_file_supported(mz_zip_archive *pZip, mz_uint file_index); + +/* Retrieves the filename of an archive file entry. */ +/* Returns the number of bytes written to pFilename, or if filename_buf_size is 0 this function returns the number of bytes needed to fully store the filename. */ +mz_uint mz_zip_reader_get_filename(mz_zip_archive *pZip, mz_uint file_index, char *pFilename, mz_uint filename_buf_size); + +/* Attempts to locates a file in the archive's central directory. */ +/* Valid flags: MZ_ZIP_FLAG_CASE_SENSITIVE, MZ_ZIP_FLAG_IGNORE_PATH */ +/* Returns -1 if the file cannot be found. */ +int mz_zip_reader_locate_file(mz_zip_archive *pZip, const char *pName, const char *pComment, mz_uint flags); +int mz_zip_reader_locate_file_v2(mz_zip_archive *pZip, const char *pName, const char *pComment, mz_uint flags, mz_uint32 *file_index); + +/* Returns detailed information about an archive file entry. */ +mz_bool mz_zip_reader_file_stat(mz_zip_archive *pZip, mz_uint file_index, mz_zip_archive_file_stat *pStat); + +/* MZ_TRUE if the file is in zip64 format. */ +/* A file is considered zip64 if it contained a zip64 end of central directory marker, or if it contained any zip64 extended file information fields in the central directory. */ +mz_bool mz_zip_is_zip64(mz_zip_archive *pZip); + +/* Returns the total central directory size in bytes. */ +/* The current max supported size is <= MZ_UINT32_MAX. */ +size_t mz_zip_get_central_dir_size(mz_zip_archive *pZip); + +/* Extracts a archive file to a memory buffer using no memory allocation. */ +/* There must be at least enough room on the stack to store the inflator's state (~34KB or so). */ +mz_bool mz_zip_reader_extract_to_mem_no_alloc(mz_zip_archive *pZip, mz_uint file_index, void *pBuf, size_t buf_size, mz_uint flags, void *pUser_read_buf, size_t user_read_buf_size); +mz_bool mz_zip_reader_extract_file_to_mem_no_alloc(mz_zip_archive *pZip, const char *pFilename, void *pBuf, size_t buf_size, mz_uint flags, void *pUser_read_buf, size_t user_read_buf_size); + +/* Extracts a archive file to a memory buffer. */ +mz_bool mz_zip_reader_extract_to_mem(mz_zip_archive *pZip, mz_uint file_index, void *pBuf, size_t buf_size, mz_uint flags); +mz_bool mz_zip_reader_extract_file_to_mem(mz_zip_archive *pZip, const char *pFilename, void *pBuf, size_t buf_size, mz_uint flags); + +/* Extracts a archive file to a dynamically allocated heap buffer. */ +/* The memory will be allocated via the mz_zip_archive's alloc/realloc functions. */ +/* Returns NULL and sets the last error on failure. */ +void *mz_zip_reader_extract_to_heap(mz_zip_archive *pZip, mz_uint file_index, size_t *pSize, mz_uint flags); +void *mz_zip_reader_extract_file_to_heap(mz_zip_archive *pZip, const char *pFilename, size_t *pSize, mz_uint flags); + +/* Extracts a archive file using a callback function to output the file's data. */ +mz_bool mz_zip_reader_extract_to_callback(mz_zip_archive *pZip, mz_uint file_index, mz_file_write_func pCallback, void *pOpaque, mz_uint flags); +mz_bool mz_zip_reader_extract_file_to_callback(mz_zip_archive *pZip, const char *pFilename, mz_file_write_func pCallback, void *pOpaque, mz_uint flags); + +/* Extract a file iteratively */ +mz_zip_reader_extract_iter_state* mz_zip_reader_extract_iter_new(mz_zip_archive *pZip, mz_uint file_index, mz_uint flags); +mz_zip_reader_extract_iter_state* mz_zip_reader_extract_file_iter_new(mz_zip_archive *pZip, const char *pFilename, mz_uint flags); +size_t mz_zip_reader_extract_iter_read(mz_zip_reader_extract_iter_state* pState, void* pvBuf, size_t buf_size); +mz_bool mz_zip_reader_extract_iter_free(mz_zip_reader_extract_iter_state* pState); + +#ifndef MINIZ_NO_STDIO +/* Extracts a archive file to a disk file and sets its last accessed and modified times. */ +/* This function only extracts files, not archive directory records. */ +mz_bool mz_zip_reader_extract_to_file(mz_zip_archive *pZip, mz_uint file_index, const char *pDst_filename, mz_uint flags); +mz_bool mz_zip_reader_extract_file_to_file(mz_zip_archive *pZip, const char *pArchive_filename, const char *pDst_filename, mz_uint flags); + +/* Extracts a archive file starting at the current position in the destination FILE stream. */ +mz_bool mz_zip_reader_extract_to_cfile(mz_zip_archive *pZip, mz_uint file_index, MZ_FILE *File, mz_uint flags); +mz_bool mz_zip_reader_extract_file_to_cfile(mz_zip_archive *pZip, const char *pArchive_filename, MZ_FILE *pFile, mz_uint flags); +#endif + +#if 0 +/* TODO */ + typedef void *mz_zip_streaming_extract_state_ptr; + mz_zip_streaming_extract_state_ptr mz_zip_streaming_extract_begin(mz_zip_archive *pZip, mz_uint file_index, mz_uint flags); + uint64_t mz_zip_streaming_extract_get_size(mz_zip_archive *pZip, mz_zip_streaming_extract_state_ptr pState); + uint64_t mz_zip_streaming_extract_get_cur_ofs(mz_zip_archive *pZip, mz_zip_streaming_extract_state_ptr pState); + mz_bool mz_zip_streaming_extract_seek(mz_zip_archive *pZip, mz_zip_streaming_extract_state_ptr pState, uint64_t new_ofs); + size_t mz_zip_streaming_extract_read(mz_zip_archive *pZip, mz_zip_streaming_extract_state_ptr pState, void *pBuf, size_t buf_size); + mz_bool mz_zip_streaming_extract_end(mz_zip_archive *pZip, mz_zip_streaming_extract_state_ptr pState); +#endif + +/* This function compares the archive's local headers, the optional local zip64 extended information block, and the optional descriptor following the compressed data vs. the data in the central directory. */ +/* It also validates that each file can be successfully uncompressed unless the MZ_ZIP_FLAG_VALIDATE_HEADERS_ONLY is specified. */ +mz_bool mz_zip_validate_file(mz_zip_archive *pZip, mz_uint file_index, mz_uint flags); + +/* Validates an entire archive by calling mz_zip_validate_file() on each file. */ +mz_bool mz_zip_validate_archive(mz_zip_archive *pZip, mz_uint flags); + +/* Misc utils/helpers, valid for ZIP reading or writing */ +mz_bool mz_zip_validate_mem_archive(const void *pMem, size_t size, mz_uint flags, mz_zip_error *pErr); +mz_bool mz_zip_validate_file_archive(const char *pFilename, mz_uint flags, mz_zip_error *pErr); + +/* Universal end function - calls either mz_zip_reader_end() or mz_zip_writer_end(). */ +mz_bool mz_zip_end(mz_zip_archive *pZip); + +/* -------- ZIP writing */ + +#ifndef MINIZ_NO_ARCHIVE_WRITING_APIS + +/* Inits a ZIP archive writer. */ +/*Set pZip->m_pWrite (and pZip->m_pIO_opaque) before calling mz_zip_writer_init or mz_zip_writer_init_v2*/ +/*The output is streamable, i.e. file_ofs in mz_file_write_func always increases only by n*/ +mz_bool mz_zip_writer_init(mz_zip_archive *pZip, mz_uint64 existing_size); +mz_bool mz_zip_writer_init_v2(mz_zip_archive *pZip, mz_uint64 existing_size, mz_uint flags); + +mz_bool mz_zip_writer_init_heap(mz_zip_archive *pZip, size_t size_to_reserve_at_beginning, size_t initial_allocation_size); +mz_bool mz_zip_writer_init_heap_v2(mz_zip_archive *pZip, size_t size_to_reserve_at_beginning, size_t initial_allocation_size, mz_uint flags); + +#ifndef MINIZ_NO_STDIO +mz_bool mz_zip_writer_init_file(mz_zip_archive *pZip, const char *pFilename, mz_uint64 size_to_reserve_at_beginning); +mz_bool mz_zip_writer_init_file_v2(mz_zip_archive *pZip, const char *pFilename, mz_uint64 size_to_reserve_at_beginning, mz_uint flags); +mz_bool mz_zip_writer_init_cfile(mz_zip_archive *pZip, MZ_FILE *pFile, mz_uint flags); +#endif + +/* Converts a ZIP archive reader object into a writer object, to allow efficient in-place file appends to occur on an existing archive. */ +/* For archives opened using mz_zip_reader_init_file, pFilename must be the archive's filename so it can be reopened for writing. If the file can't be reopened, mz_zip_reader_end() will be called. */ +/* For archives opened using mz_zip_reader_init_mem, the memory block must be growable using the realloc callback (which defaults to realloc unless you've overridden it). */ +/* Finally, for archives opened using mz_zip_reader_init, the mz_zip_archive's user provided m_pWrite function cannot be NULL. */ +/* Note: In-place archive modification is not recommended unless you know what you're doing, because if execution stops or something goes wrong before */ +/* the archive is finalized the file's central directory will be hosed. */ +mz_bool mz_zip_writer_init_from_reader(mz_zip_archive *pZip, const char *pFilename); +mz_bool mz_zip_writer_init_from_reader_v2(mz_zip_archive *pZip, const char *pFilename, mz_uint flags); + +/* Adds the contents of a memory buffer to an archive. These functions record the current local time into the archive. */ +/* To add a directory entry, call this method with an archive name ending in a forwardslash with an empty buffer. */ +/* level_and_flags - compression level (0-10, see MZ_BEST_SPEED, MZ_BEST_COMPRESSION, etc.) logically OR'd with zero or more mz_zip_flags, or just set to MZ_DEFAULT_COMPRESSION. */ +mz_bool mz_zip_writer_add_mem(mz_zip_archive *pZip, const char *pArchive_name, const void *pBuf, size_t buf_size, mz_uint level_and_flags); + +/* Like mz_zip_writer_add_mem(), except you can specify a file comment field, and optionally supply the function with already compressed data. */ +/* uncomp_size/uncomp_crc32 are only used if the MZ_ZIP_FLAG_COMPRESSED_DATA flag is specified. */ +mz_bool mz_zip_writer_add_mem_ex(mz_zip_archive *pZip, const char *pArchive_name, const void *pBuf, size_t buf_size, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags, + mz_uint64 uncomp_size, mz_uint32 uncomp_crc32); + +mz_bool mz_zip_writer_add_mem_ex_v2(mz_zip_archive *pZip, const char *pArchive_name, const void *pBuf, size_t buf_size, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags, + mz_uint64 uncomp_size, mz_uint32 uncomp_crc32, MZ_TIME_T *last_modified, const char *user_extra_data_local, mz_uint user_extra_data_local_len, + const char *user_extra_data_central, mz_uint user_extra_data_central_len); + +/* Adds the contents of a file to an archive. This function also records the disk file's modified time into the archive. */ +/* File data is supplied via a read callback function. User mz_zip_writer_add_(c)file to add a file directly.*/ +mz_bool mz_zip_writer_add_read_buf_callback(mz_zip_archive *pZip, const char *pArchive_name, mz_file_read_func read_callback, void* callback_opaque, mz_uint64 size_to_add, + const MZ_TIME_T *pFile_time, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags, const char *user_extra_data_local, mz_uint user_extra_data_local_len, + const char *user_extra_data_central, mz_uint user_extra_data_central_len); + +#ifndef MINIZ_NO_STDIO +/* Adds the contents of a disk file to an archive. This function also records the disk file's modified time into the archive. */ +/* level_and_flags - compression level (0-10, see MZ_BEST_SPEED, MZ_BEST_COMPRESSION, etc.) logically OR'd with zero or more mz_zip_flags, or just set to MZ_DEFAULT_COMPRESSION. */ +mz_bool mz_zip_writer_add_file(mz_zip_archive *pZip, const char *pArchive_name, const char *pSrc_filename, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags); + +/* Like mz_zip_writer_add_file(), except the file data is read from the specified FILE stream. */ +mz_bool mz_zip_writer_add_cfile(mz_zip_archive *pZip, const char *pArchive_name, MZ_FILE *pSrc_file, mz_uint64 size_to_add, + const MZ_TIME_T *pFile_time, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags, const char *user_extra_data_local, mz_uint user_extra_data_local_len, + const char *user_extra_data_central, mz_uint user_extra_data_central_len); +#endif + +/* Adds a file to an archive by fully cloning the data from another archive. */ +/* This function fully clones the source file's compressed data (no recompression), along with its full filename, extra data (it may add or modify the zip64 local header extra data field), and the optional descriptor following the compressed data. */ +mz_bool mz_zip_writer_add_from_zip_reader(mz_zip_archive *pZip, mz_zip_archive *pSource_zip, mz_uint src_file_index); + +/* Finalizes the archive by writing the central directory records followed by the end of central directory record. */ +/* After an archive is finalized, the only valid call on the mz_zip_archive struct is mz_zip_writer_end(). */ +/* An archive must be manually finalized by calling this function for it to be valid. */ +mz_bool mz_zip_writer_finalize_archive(mz_zip_archive *pZip); + +/* Finalizes a heap archive, returning a poiner to the heap block and its size. */ +/* The heap block will be allocated using the mz_zip_archive's alloc/realloc callbacks. */ +mz_bool mz_zip_writer_finalize_heap_archive(mz_zip_archive *pZip, void **ppBuf, size_t *pSize); + +/* Ends archive writing, freeing all allocations, and closing the output file if mz_zip_writer_init_file() was used. */ +/* Note for the archive to be valid, it *must* have been finalized before ending (this function will not do it for you). */ +mz_bool mz_zip_writer_end(mz_zip_archive *pZip); + +/* -------- Misc. high-level helper functions: */ + +/* mz_zip_add_mem_to_archive_file_in_place() efficiently (but not atomically) appends a memory blob to a ZIP archive. */ +/* Note this is NOT a fully safe operation. If it crashes or dies in some way your archive can be left in a screwed up state (without a central directory). */ +/* level_and_flags - compression level (0-10, see MZ_BEST_SPEED, MZ_BEST_COMPRESSION, etc.) logically OR'd with zero or more mz_zip_flags, or just set to MZ_DEFAULT_COMPRESSION. */ +/* TODO: Perhaps add an option to leave the existing central dir in place in case the add dies? We could then truncate the file (so the old central dir would be at the end) if something goes wrong. */ +mz_bool mz_zip_add_mem_to_archive_file_in_place(const char *pZip_filename, const char *pArchive_name, const void *pBuf, size_t buf_size, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags); +mz_bool mz_zip_add_mem_to_archive_file_in_place_v2(const char *pZip_filename, const char *pArchive_name, const void *pBuf, size_t buf_size, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags, mz_zip_error *pErr); + +/* Reads a single file from an archive into a heap block. */ +/* If pComment is not NULL, only the file with the specified comment will be extracted. */ +/* Returns NULL on failure. */ +void *mz_zip_extract_archive_file_to_heap(const char *pZip_filename, const char *pArchive_name, size_t *pSize, mz_uint flags); +void *mz_zip_extract_archive_file_to_heap_v2(const char *pZip_filename, const char *pArchive_name, const char *pComment, size_t *pSize, mz_uint flags, mz_zip_error *pErr); + +#endif /* #ifndef MINIZ_NO_ARCHIVE_WRITING_APIS */ + +#ifdef __cplusplus +} +#endif + +#endif /* MINIZ_NO_ARCHIVE_APIS */ diff --git a/r5dev/thirdparty/cppnet/cppkore_shaders/preview.frag b/r5dev/thirdparty/cppnet/cppkore_shaders/preview.frag new file mode 100644 index 00000000..1ca63cf9 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore_shaders/preview.frag @@ -0,0 +1,55 @@ +#version 430 core +layout(location = 0) out vec3 color; + +in vec3 vertColorFrag; +in vec3 vertFragPos; +in vec3 vertNormal; +in vec2 vertUVLayer; + +uniform mat4 view; +uniform mat4 projection; + +uniform int diffuseLoaded; +uniform sampler2D diffuseTexture; +uniform sampler2D normalTexture; +uniform sampler2D glossTexture; +uniform sampler2D specularTexture; + +void main() +{ + // Ambient + float ambientStrength = 0.1; + vec3 ambient = ambientStrength * vec3(1, 1, 1); // Amb color + + // Diffuse + vec3 norm = normalize(vertNormal); + vec3 normMap = normalize((texture(normalTexture,vertUVLayer).rgb * -2) + 1); + float glossMap = texture(glossTexture,vertUVLayer).rgb.r; + + normMap.z = 1; + normMap = normalize(normMap); + + + vec3 lightDir = normalize(inverse(view)[3].xyz - vertFragPos); + float diff = max(dot(norm, lightDir), 0.0); + vec3 diffuse = diff * texture(diffuseTexture, vertUVLayer).rgb; // Light color + + // Specular + float specularStrength = 1; + + vec3 viewPos = inverse(view)[3].xyz; + + vec3 viewDir = normalize(viewPos - vertFragPos); + vec3 reflectDir = reflect(-lightDir, norm); + + + float spec = pow(max(dot(viewDir, reflectDir), 0.0), 2); + vec3 specular = texture(specularTexture, vertUVLayer).rgb * spec * specularStrength; + + // Result + if (diffuseLoaded == 1) { + color = (ambient + diffuse + specular); + } else { + color = (ambient) * 0.6; + } +} \ No newline at end of file diff --git a/r5dev/thirdparty/cppnet/cppkore_shaders/preview.vert b/r5dev/thirdparty/cppnet/cppkore_shaders/preview.vert new file mode 100644 index 00000000..4440b126 --- /dev/null +++ b/r5dev/thirdparty/cppnet/cppkore_shaders/preview.vert @@ -0,0 +1,29 @@ +#version 430 core +layout(location = 0) in vec3 vertPos; +layout(location = 1) in vec3 vertNorm; +layout(location = 2) in uvec4 vertColor; +layout(location = 3) in vec2 vertUV; + +uniform mat4 model; +uniform mat4 view; +uniform mat4 projection; + +out vec3 vertColorFrag; +out vec3 vertNormal; +out vec3 vertFragPos; +out vec2 vertUVLayer; + +void main() +{ + // Calculate the model/view/projection matrix + mat4 MVP = projection * view * model; + + // Set the vertex postion + gl_Position = MVP * vec4(vertPos, 1.0); + + // Pass normal, color, and position to frag shader + vertNormal = mat3(transpose(inverse(model))) * vertNorm; + vertColorFrag = vec3(float(vertColor.x) / 255.0, float(vertColor.y) / 255.0, float(vertColor.z) / 255.0); + vertFragPos = vec3(model * vec4(vertPos, 1.0)); + vertUVLayer = vertUV; +} \ No newline at end of file diff --git a/r5dev/vproj/libcppkore.vcxproj b/r5dev/vproj/libcppkore.vcxproj new file mode 100644 index 00000000..d6e73055 --- /dev/null +++ b/r5dev/vproj/libcppkore.vcxproj @@ -0,0 +1,590 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 15.0 + {88BC2D60-A093-4E61-B194-59AB8BE4E33E} + Win32Proj + cppkore + 10.0 + libcppkore + + + + StaticLibrary + true + v143 + Unicode + Static + + + StaticLibrary + false + v143 + true + Unicode + Static + + + StaticLibrary + true + v143 + Unicode + Static + + + StaticLibrary + false + v143 + true + Unicode + Static + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)build\$(ProjectName)\$(Configuration)\ + $(SolutionDir)lib\$(Configuration)\ + libcppkore_x86 + + + true + $(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64) + $(SolutionDir)build\$(ProjectName)\$(Configuration)\ + $(SolutionDir)lib\$(Configuration)\ + libcppkore_x64 + + + false + $(SolutionDir)build\$(ProjectName)\$(Configuration)\ + $(SolutionDir)lib\$(Configuration)\ + libcppkore_x86 + + + false + $(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64) + $(SolutionDir)build\$(ProjectName)\$(Configuration)\ + $(SolutionDir)lib\$(Configuration)\ + libcppkore_x64 + + + + Use + Level3 + Disabled + true + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + true + /std:c++17 %(AdditionalOptions) + false + %(AdditionalIncludeDirectories) + stdcpp17 + + + Windows + true + + + + + Use + Level3 + Disabled + true + _DEBUG;_LIB;_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS;%(PreprocessorDefinitions) + true + /std:c++17 %(AdditionalOptions) + false + %(AdditionalIncludeDirectories) + stdcpp17 + MultiThreadedDebugDLL + + + Windows + true + + + + + + + + + Use + Level3 + MaxSpeed + true + true + true + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + true + /std:c++17 %(AdditionalOptions) + false + %(AdditionalIncludeDirectories) + stdcpp17 + + + Windows + true + true + true + + + + + Use + Level3 + MaxSpeed + true + true + true + NDEBUG;_LIB;_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS;%(PreprocessorDefinitions) + true + /std:c++17 %(AdditionalOptions) + false + %(AdditionalIncludeDirectories) + stdcpp17 + + + Windows + true + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ../stdafx.h + ../stdafx.h + + + ../stdafx.h + ../stdafx.h + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Create + Create + Create + Create + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/r5dev/vproj/libcppkore.vcxproj.filters b/r5dev/vproj/libcppkore.vcxproj.filters new file mode 100644 index 00000000..da34b86b --- /dev/null +++ b/r5dev/vproj/libcppkore.vcxproj.filters @@ -0,0 +1,1280 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;ipp;xsd + + + {d96abbd0-aa31-4b1c-ba39-aeb04f6c443d} + + + {eabba284-5560-4089-9f57-37bf6c7d451f} + + + {b84aef37-f23a-485e-ae6d-3b197fe20e3c} + + + {164a360e-4c3f-403d-8580-dd9b0f81a232} + + + {bde97faa-f1dd-4c3b-acc6-55fe7bdb1ce4} + + + {35c8b5d5-d9b7-4827-8d20-4b5754ea8070} + + + {fc8281e8-ddf3-45e1-8aaa-e20c621f1db3} + + + {7ed7c84e-47c3-41f8-885a-13344e98b713} + + + {9c5f7aac-affd-4512-97a4-0a5d048a02e9} + + + {aa5da805-ec43-4f92-8b5f-4b00b8e7bd2b} + + + {ce07f034-8d05-4bfe-ab76-95e14b672c5f} + + + {d7f0ece7-f3fc-468f-8b9c-8949f8ee495f} + + + {816f9384-501c-4174-add5-a914d6aa66e6} + + + {a13074c4-3469-4489-b9d1-21348f5b3e88} + + + {374ef221-c5aa-48c9-b7e9-5fa7e662c8db} + + + {4781918a-7243-4750-a76b-394d3bca0267} + + + {b3f9ae8f-54a1-433b-850d-2dace70a1439} + + + {27a79727-7e95-46f7-af7d-00203d1b2467} + + + {1302f91e-8460-4751-a1c4-66a234d77be9} + + + {f5c7a2b0-b080-4416-b23c-6a97296e07f6} + + + {7749b0ed-b23c-45de-99fb-85ca33d00793} + + + {55e4197d-9b85-4410-bdac-e27fd91d46be} + + + {4afecb02-c985-41b4-adb2-26f3d5c90552} + + + {c1bdba66-5788-4c22-99d8-fab0836cbff6} + + + {3d66bc92-7d2e-47ed-a18d-1af3fec5d2e3} + + + {b1907ef1-dedc-4ec2-916a-aec6de1d2715} + + + {bcfb9225-7966-41c7-bf52-4c817c907953} + + + {d5a3e68c-fac0-4c43-a9a3-4cffd224132f} + + + {48d0df58-f9c7-4c3e-af45-b5a44ba780d2} + + + {af4d46a3-fb46-4bab-8140-bb0b3f06ac04} + + + {a7d14d19-0af3-48cb-82a4-84471f5b5971} + + + {4b826953-8d4d-486a-bae9-cb7bfa06d1f8} + + + {8d414705-c0f8-4918-b24f-dfd5d4e6d5e7} + + + {bc22a61f-cd16-4ef6-9305-94ecd0c67e21} + + + {5df6e022-9307-438b-88ed-81433c6fe778} + + + {a07c1a9f-1774-4279-8e76-fd5843e18df5} + + + {61ad359c-9f84-4e6a-8515-7214a11d6cb1} + + + {aa21e46f-59af-4f5e-908b-63d84d67bc55} + + + {0d459ee9-9191-44d0-bfc6-b2ebf3e87d20} + + + {96d3895a-4359-4887-8baa-3b11259c392f} + + + {483322b8-289e-49e6-8674-c5fc249d76a6} + + + {6a6efd51-9e66-4743-9230-ca30f9e8f648} + + + {397d58cc-16d7-4d29-98f1-9fd4d17b1ed1} + + + {27d34575-ed65-4358-abfe-15a2b3247727} + + + + + Header Files + + + Header Files\IO + + + Header Files\IO + + + Header Files\IO + + + Header Files\IO + + + Header Files\IO + + + Header Files\IO + + + Header Files\IO + + + Header Files\IO + + + Header Files\IO + + + Header Files\IO + + + Header Files\IO + + + Header Files\IO + + + Header Files\Data + + + Header Files\IO + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files\IO + + + Header Files\IO + + + Header Files\IO + + + Header Files\IO + + + Header Files\IO + + + Header Files\Threading + + + Header Files\Threading + + + Header Files\Threading + + + Header Files\IO + + + Header Files\Diagnostics + + + Header Files\Diagnostics + + + Header Files\System + + + Header Files\System + + + Header Files\Diagnostics + + + Header Files\Diagnostics + + + Header Files\Diagnostics + + + Header Files\Math + + + Header Files\Math + + + Header Files\Data + + + Header Files\Math + + + Header Files\Math + + + Header Files\Win32 + + + Header Files\Win32 + + + Header Files\Win32 + + + Header Files\Win32 + + + Header Files\Win32 + + + Header Files\Win32 + + + Header Files\System + + + Header Files\System + + + Header Files\System + + + Header Files\IO + + + Header Files\System + + + Header Files\System + + + Header Files\Compression + + + Header Files\Compression + + + Header Files\Compression + + + Header Files\Forms + + + Header Files\Forms + + + Header Files\Forms + + + Header Files\Forms + + + Header Files\Forms + + + Header Files\Forms + + + Header Files\Forms + + + Header Files\Forms + + + Header Files\Drawing + + + Header Files\Forms\EventArgs + + + Header Files\Drawing + + + Header Files\Forms + + + Header Files + + + Header Files\Forms\EventArgs + + + Header Files\Forms\EventArgs + + + Header Files\Forms\EventArgs + + + Header Files\Forms + + + Header Files\Forms + + + Header Files\Forms + + + Header Files\Forms + + + Header Files\Drawing + + + Header Files\Forms + + + Header Files\Forms + + + Header Files\Forms + + + Header Files\Forms + + + Header Files\Forms\EventArgs + + + Header Files\Forms\EventArgs + + + Header Files\Forms + + + Header Files\Forms + + + Header Files\Drawing + + + Header Files\Forms + + + Header Files\Forms + + + Header Files\Threading + + + Header Files\Forms + + + Header Files\Forms + + + Header Files\Forms + + + Header Files\Forms + + + Header Files\Forms + + + Header Files\Forms + + + Header Files\Forms + + + Header Files\Forms + + + Header Files\Forms + + + Header Files\Forms + + + Header Files\Forms + + + Header Files\Forms + + + Header Files\Assets + + + Header Files\Assets + + + Header Files\Assets + + + Header Files\Assets + + + Header Files\Assets + + + Header Files\Assets + + + Header Files\Assets + + + Header Files\Assets + + + Header Files\Assets\Exporters + + + Header Files + + + Header Files\Assets\Exporters + + + Header Files\Hashing + + + Header Files\Assets\Exporters + + + Header Files\Assets\Exporters + + + Header Files\Assets\Exporters + + + Header Files\Math + + + Header Files\Assets\Exporters + + + Header Files\Assets\Exporters + + + Header Files\Hashing + + + Header Files\Forms + + + Header Files\Assets + + + Header Files\Math + + + Header Files\Assets + + + Header Files\MGL + + + Header Files\MGL + + + Header Files\Forms + + + Header Files\Forms + + + Header Files\Forms + + + Header Files\Forms + + + Header Files\Forms + + + Header Files\Forms + + + Header Files\Forms + + + Header Files\Forms + + + Header Files\Forms\EventArgs + + + Header Files\Forms\EventArgs + + + Header Files\Forms\EventArgs + + + Header Files\Forms + + + Header Files\Forms\EventArgs + + + Header Files\Drawing + + + Header Files\Forms + + + Header Files\Forms + + + Header Files\Forms\EventArgs + + + Header Files\System + + + Header Files\Forms + + + Header Files\Forms + + + Header Files\Forms + + + Header Files\Forms + + + Header Files\Forms + + + Header Files\Forms + + + Header Files\Forms + + + Header Files\Forms + + + Header Files\Forms + + + Header Files\Forms + + + Header Files\Forms + + + Header Files\Forms + + + Header Files\Forms\EventArgs + + + Header Files\Forms\EventArgs + + + Header Files\Forms\EventArgs + + + Header Files\Compression + + + Header Files\Forms\EventArgs + + + Header Files\Forms + + + Header Files\Forms\EventArgs + + + Header Files\Forms\EventArgs + + + Header Files\Forms\EventArgs + + + Header Files\Forms\EventArgs + + + Header Files\Forms + + + Header Files\Forms + + + Header Files\Assets + + + Header Files + + + Header Files\Hashing + + + Header Files\Hashing + + + Header Files\Assets\Exporters + + + Header Files\Assets + + + Header Files\UIX + + + Header Files\Assets\Exporters + + + Header Files\Compression + + + Header Files\Compression + + + Header Files\Compression + + + Header Files\Assets + + + Header Files\Assets + + + Header Files\Forms + + + Header Files\Forms\EventArgs + + + Header Files\Forms\EventArgs + + + Header Files\MGL\Fonts + + + Header Files\Assets + + + Header Files\MGL\Shaders + + + Header Files\MGL\Shaders + + + Header Files\UIX + + + Header Files\UIX + + + Header Files\UIX + + + Header Files\Assets\Exporters + + + Header Files\Assets\Exporters + + + Header Files\UIX + + + Header Files\UIX\Images + + + Header Files\UIX + + + Header Files\UIX + + + Header Files\UIX + + + Header Files\Compression + + + Header Files\Compression + + + Header Files\Compression + + + Header Files\Net + + + Header Files\Net + + + Header Files\UIX + + + Header Files\UIX + + + Header Files\UIX\Themes + + + Header Files\UIX + + + Header Files\UIX + + + Header Files\UIX\Themes + + + Header Files\UIX + + + Header Files\Forms + + + Header Files\Forms + + + Header Files\Assets + + + Header Files\Drawing + + + Header Files\Drawing + + + Header Files\Threading + + + Header Files\Assets + + + Header Files\Assets\Exporters + + + Header Files\Assets\Exporters + + + Header Files\Assets + + + Header Files\Assets + + + Header Files + + + Header Files\Jobs + + + Header Files\Jobs + + + Header Files\Jobs + + + Header Files + + + Header Files\Forms + + + Header Files\Forms + + + Header Files\UIX + + + Header Files + + + Header Files\Hashing + + + Header Files\Clipboard + + + Header Files\Clipboard + + + + + Source Files + + + Source Files\IO + + + Source Files\IO + + + Source Files\IO + + + Source Files\IO + + + Source Files\IO + + + Source Files\IO + + + Source Files\IO + + + Source Files\Data + + + Source Files\IO + + + Source Files\IO + + + Source Files\IO + + + Source Files\IO + + + Source Files\IO + + + Source Files\Threading + + + Source Files\IO + + + Source Files\IO + + + Source Files\Diagnostics + + + Source Files\System + + + Source Files\Math + + + Source Files\Math + + + Source Files\Math + + + Source Files\Math + + + Source Files\Win32 + + + Source Files\Win32 + + + Source Files\Win32 + + + Source Files\System + + + Source Files\IO + + + Source Files\System + + + Source Files\System + + + Source Files\Compression + + + Source Files\Compression + + + Source Files\Forms + + + Source Files\Forms + + + Source Files\Forms + + + Source Files\Forms + + + Source Files\Forms\EventArgs + + + Source Files\Forms\EventArgs + + + Source Files\Forms\EventArgs + + + Source Files\Forms\EventArgs + + + Source Files\Forms + + + Source Files\Drawing + + + Source Files\Forms + + + Source Files\Forms\EventArgs + + + Source Files\Forms\EventArgs + + + Source Files\Forms + + + Source Files\Drawing + + + Source Files\Forms + + + Source Files\Forms + + + Source Files\Forms + + + Source Files\Forms + + + Source Files\Forms + + + Source Files\Forms + + + Source Files\Assets + + + Source Files\Assets + + + Source Files\Assets + + + Source Files\Assets + + + Source Files\Assets + + + Source Files\Assets + + + Source Files\Assets + + + Source Files\Assets\Exporters + + + Source Files\Hashing + + + Source Files\Assets\Exporters + + + Source Files\Assets\Exporters + + + Source Files\Assets\Exporters + + + Source Files\Math + + + Source Files\Assets\Exporters + + + Source Files\Assets\Exporters + + + Source Files\Hashing + + + Source Files\Forms + + + Source Files\Assets + + + Source Files\MGL + + + Source Files\MGL + + + Source Files\Assets + + + Source Files\Forms + + + Source Files\Forms\EventArgs + + + Source Files\Forms\EventArgs + + + Source Files\Forms\EventArgs + + + Source Files\Forms\EventArgs + + + Source Files\Drawing + + + Source Files\Forms + + + Source Files\Forms\EventArgs + + + Source Files\System + + + Source Files\Forms + + + Source Files\Forms + + + Source Files\Forms + + + Source Files\Forms + + + Source Files\Forms + + + Source Files\Forms\EventArgs + + + Source Files\Forms\EventArgs + + + Source Files\Forms\EventArgs + + + Source Files\Compression + + + Source Files\Forms\EventArgs + + + Source Files\Forms\EventArgs + + + Source Files\Forms\EventArgs + + + Source Files\Forms\EventArgs + + + Source Files\Forms\EventArgs + + + Source Files\Forms + + + Source Files\Assets + + + Source Files\Assets\Exporters + + + Source Files\Assets + + + Source Files\Assets\Exporters + + + Source Files\UIX + + + Source Files\Compression + + + Source Files\Compression + + + Source Files\Compression + + + Source Files\Assets + + + Source Files\Assets + + + Source Files\Forms + + + Source Files\Forms\EventArgs + + + Source Files\Drawing + + + Source Files\Assets + + + Source Files\UIX + + + Source Files\UIX + + + Source Files\UIX + + + Source Files\Assets\Exporters + + + Source Files\Assets\Exporters + + + Source Files\UIX + + + Source Files\UIX + + + Source Files\UIX + + + Source Files\UIX + + + Source Files\Compression + + + Source Files\Compression + + + Source Files\Net + + + Source Files\UIX + + + Source Files\UIX\Themes + + + Source Files\UIX + + + Source Files\UIX + + + Source Files\UIX\Themes + + + Source Files\UIX + + + Source Files\Forms + + + Source Files\Forms + + + Source Files\Assets + + + Source Files\Drawing + + + Source Files\Assets + + + Source Files\Assets\Exporters + + + Source Files\Assets\Exporters + + + Source Files\Assets + + + Source Files\Jobs + + + Source Files\Jobs + + + Source Files\Jobs + + + Source Files\Hashing + + + Source Files\Clipboard + + + Source Files\Clipboard + + + + + + \ No newline at end of file diff --git a/r5sdk.sln b/r5sdk.sln index 1281d144..47a86b5a 100644 --- a/r5sdk.sln +++ b/r5sdk.sln @@ -77,6 +77,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "clientsdk", "r5dev\vproj\cl EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{3363D141-5FD1-4569-B1B0-EC59ABBA5FAC}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcppkore", "r5dev\vproj\libcppkore.vcxproj", "{88BC2D60-A093-4E61-B194-59AB8BE4E33E}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 @@ -213,6 +215,14 @@ Global {8FC77C68-CE93-45CE-B753-68ABE36BCDDB}.Release|x64.Build.0 = Release|x64 {8FC77C68-CE93-45CE-B753-68ABE36BCDDB}.Release|x86.ActiveCfg = Release|x64 {8FC77C68-CE93-45CE-B753-68ABE36BCDDB}.Release|x86.Build.0 = Release|x64 + {88BC2D60-A093-4E61-B194-59AB8BE4E33E}.Debug|x64.ActiveCfg = Debug|x64 + {88BC2D60-A093-4E61-B194-59AB8BE4E33E}.Debug|x64.Build.0 = Debug|x64 + {88BC2D60-A093-4E61-B194-59AB8BE4E33E}.Debug|x86.ActiveCfg = Debug|Win32 + {88BC2D60-A093-4E61-B194-59AB8BE4E33E}.Debug|x86.Build.0 = Debug|Win32 + {88BC2D60-A093-4E61-B194-59AB8BE4E33E}.Release|x64.ActiveCfg = Release|x64 + {88BC2D60-A093-4E61-B194-59AB8BE4E33E}.Release|x64.Build.0 = Release|x64 + {88BC2D60-A093-4E61-B194-59AB8BE4E33E}.Release|x86.ActiveCfg = Release|Win32 + {88BC2D60-A093-4E61-B194-59AB8BE4E33E}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -234,6 +244,7 @@ Global {0E701104-CD9A-45C0-8E32-3284DBDEAF5E} = {EB0E2713-EB72-4F68-B6CF-F076D68ECA40} {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {9D2825F8-4BEC-4D0A-B125-6390B554D519} {1942083A-03D9-4D76-B644-A3FA2A118A35} = {3363D141-5FD1-4569-B1B0-EC59ABBA5FAC} + {88BC2D60-A093-4E61-B194-59AB8BE4E33E} = {9D2825F8-4BEC-4D0A-B125-6390B554D519} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {5E5FE02E-6BCE-4BAF-9948-C56476039C3C}