├── .github └── FUNDING.yml ├── .gitignore ├── LICENSE ├── README.md ├── build.bat ├── build.hxml ├── hxformat.json ├── src ├── Main.hx ├── engine │ └── Endor.hx ├── graphics │ ├── Sound.hx │ └── Texture.hx ├── lib │ ├── glad │ │ ├── GLAD.hx │ │ └── glad.xml │ ├── glfw │ │ ├── GLFW.hx │ │ └── glfw.xml │ ├── openal │ │ ├── AL.hx │ │ ├── ALC.hx │ │ └── al.xml │ ├── stb │ │ ├── Image.hx │ │ ├── endor_stb_image.cpp │ │ ├── endor_stb_image.h │ │ └── stb.xml │ └── vorbis │ │ ├── Vorbis.hx │ │ ├── endor_vorbis.cpp │ │ ├── endor_vorbis.h │ │ └── libvorbis.xml └── render │ ├── Model.hx │ └── Shader.hx └── vendor ├── GLAD ├── include │ ├── KHR │ │ └── khrplatform.h │ └── glad │ │ └── glad.h └── src │ └── glad.c ├── GLFW ├── glfw3.h ├── glfw3native.h └── lib │ └── x86 │ ├── glfw3.dll │ ├── glfw3.lib │ ├── glfw3_mt.lib │ └── glfw3dll.lib ├── glfw └── lib │ └── x64 │ ├── glfw3.dll │ ├── glfw3.lib │ ├── glfw3_mt.lib │ └── glfw3dll.lib ├── libvorbis ├── include │ ├── ogg │ │ ├── ogg.h │ │ └── os_types.h │ └── vorbis │ │ ├── codec.h │ │ ├── vorbisenc.h │ │ └── vorbisfile.h └── lib │ ├── x64 │ ├── ogg.lib │ ├── vorbis.lib │ ├── vorbisenc.lib │ └── vorbisfile.lib │ └── x86 │ ├── ogg.lib │ ├── vorbis.lib │ ├── vorbisenc.lib │ └── vorbisfile.lib ├── openal ├── include │ └── AL │ │ ├── al.h │ │ ├── alc.h │ │ ├── alext.h │ │ ├── efx-creative.h │ │ ├── efx-presets.h │ │ └── efx.h └── lib │ ├── x64 │ ├── OpenAL32.lib │ └── soft_oal.dll │ └── x86 │ ├── OpenAL32.lib │ └── soft_oal.dll └── stb └── include └── stb_image.h /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | ko_fi: polyproxy 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries 2 | bin/ 3 | 4 | # VSCode settings 5 | .vscode/ 6 | 7 | # DS Store files are annoying 8 | 9 | .DS_Store 10 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Mozilla Public License Version 2.0 2 | ================================== 3 | 4 | 1. Definitions 5 | -------------- 6 | 7 | 1.1. "Contributor" 8 | means each individual or legal entity that creates, contributes to 9 | the creation of, or owns Covered Software. 10 | 11 | 1.2. "Contributor Version" 12 | means the combination of the Contributions of others (if any) used 13 | by a Contributor and that particular Contributor's Contribution. 14 | 15 | 1.3. "Contribution" 16 | means Covered Software of a particular Contributor. 17 | 18 | 1.4. "Covered Software" 19 | means Source Code Form to which the initial Contributor has attached 20 | the notice in Exhibit A, the Executable Form of such Source Code 21 | Form, and Modifications of such Source Code Form, in each case 22 | including portions thereof. 23 | 24 | 1.5. "Incompatible With Secondary Licenses" 25 | means 26 | 27 | (a) that the initial Contributor has attached the notice described 28 | in Exhibit B to the Covered Software; or 29 | 30 | (b) that the Covered Software was made available under the terms of 31 | version 1.1 or earlier of the License, but not also under the 32 | terms of a Secondary License. 33 | 34 | 1.6. "Executable Form" 35 | means any form of the work other than Source Code Form. 36 | 37 | 1.7. "Larger Work" 38 | means a work that combines Covered Software with other material, in 39 | a separate file or files, that is not Covered Software. 40 | 41 | 1.8. "License" 42 | means this document. 43 | 44 | 1.9. "Licensable" 45 | means having the right to grant, to the maximum extent possible, 46 | whether at the time of the initial grant or subsequently, any and 47 | all of the rights conveyed by this License. 48 | 49 | 1.10. "Modifications" 50 | means any of the following: 51 | 52 | (a) any file in Source Code Form that results from an addition to, 53 | deletion from, or modification of the contents of Covered 54 | Software; or 55 | 56 | (b) any new file in Source Code Form that contains any Covered 57 | Software. 58 | 59 | 1.11. "Patent Claims" of a Contributor 60 | means any patent claim(s), including without limitation, method, 61 | process, and apparatus claims, in any patent Licensable by such 62 | Contributor that would be infringed, but for the grant of the 63 | License, by the making, using, selling, offering for sale, having 64 | made, import, or transfer of either its Contributions or its 65 | Contributor Version. 66 | 67 | 1.12. "Secondary License" 68 | means either the GNU General Public License, Version 2.0, the GNU 69 | Lesser General Public License, Version 2.1, the GNU Affero General 70 | Public License, Version 3.0, or any later versions of those 71 | licenses. 72 | 73 | 1.13. "Source Code Form" 74 | means the form of the work preferred for making modifications. 75 | 76 | 1.14. "You" (or "Your") 77 | means an individual or a legal entity exercising rights under this 78 | License. For legal entities, "You" includes any entity that 79 | controls, is controlled by, or is under common control with You. For 80 | purposes of this definition, "control" means (a) the power, direct 81 | or indirect, to cause the direction or management of such entity, 82 | whether by contract or otherwise, or (b) ownership of more than 83 | fifty percent (50%) of the outstanding shares or beneficial 84 | ownership of such entity. 85 | 86 | 2. License Grants and Conditions 87 | -------------------------------- 88 | 89 | 2.1. Grants 90 | 91 | Each Contributor hereby grants You a world-wide, royalty-free, 92 | non-exclusive license: 93 | 94 | (a) under intellectual property rights (other than patent or trademark) 95 | Licensable by such Contributor to use, reproduce, make available, 96 | modify, display, perform, distribute, and otherwise exploit its 97 | Contributions, either on an unmodified basis, with Modifications, or 98 | as part of a Larger Work; and 99 | 100 | (b) under Patent Claims of such Contributor to make, use, sell, offer 101 | for sale, have made, import, and otherwise transfer either its 102 | Contributions or its Contributor Version. 103 | 104 | 2.2. Effective Date 105 | 106 | The licenses granted in Section 2.1 with respect to any Contribution 107 | become effective for each Contribution on the date the Contributor first 108 | distributes such Contribution. 109 | 110 | 2.3. Limitations on Grant Scope 111 | 112 | The licenses granted in this Section 2 are the only rights granted under 113 | this License. No additional rights or licenses will be implied from the 114 | distribution or licensing of Covered Software under this License. 115 | Notwithstanding Section 2.1(b) above, no patent license is granted by a 116 | Contributor: 117 | 118 | (a) for any code that a Contributor has removed from Covered Software; 119 | or 120 | 121 | (b) for infringements caused by: (i) Your and any other third party's 122 | modifications of Covered Software, or (ii) the combination of its 123 | Contributions with other software (except as part of its Contributor 124 | Version); or 125 | 126 | (c) under Patent Claims infringed by Covered Software in the absence of 127 | its Contributions. 128 | 129 | This License does not grant any rights in the trademarks, service marks, 130 | or logos of any Contributor (except as may be necessary to comply with 131 | the notice requirements in Section 3.4). 132 | 133 | 2.4. Subsequent Licenses 134 | 135 | No Contributor makes additional grants as a result of Your choice to 136 | distribute the Covered Software under a subsequent version of this 137 | License (see Section 10.2) or under the terms of a Secondary License (if 138 | permitted under the terms of Section 3.3). 139 | 140 | 2.5. Representation 141 | 142 | Each Contributor represents that the Contributor believes its 143 | Contributions are its original creation(s) or it has sufficient rights 144 | to grant the rights to its Contributions conveyed by this License. 145 | 146 | 2.6. Fair Use 147 | 148 | This License is not intended to limit any rights You have under 149 | applicable copyright doctrines of fair use, fair dealing, or other 150 | equivalents. 151 | 152 | 2.7. Conditions 153 | 154 | Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted 155 | in Section 2.1. 156 | 157 | 3. Responsibilities 158 | ------------------- 159 | 160 | 3.1. Distribution of Source Form 161 | 162 | All distribution of Covered Software in Source Code Form, including any 163 | Modifications that You create or to which You contribute, must be under 164 | the terms of this License. You must inform recipients that the Source 165 | Code Form of the Covered Software is governed by the terms of this 166 | License, and how they can obtain a copy of this License. You may not 167 | attempt to alter or restrict the recipients' rights in the Source Code 168 | Form. 169 | 170 | 3.2. Distribution of Executable Form 171 | 172 | If You distribute Covered Software in Executable Form then: 173 | 174 | (a) such Covered Software must also be made available in Source Code 175 | Form, as described in Section 3.1, and You must inform recipients of 176 | the Executable Form how they can obtain a copy of such Source Code 177 | Form by reasonable means in a timely manner, at a charge no more 178 | than the cost of distribution to the recipient; and 179 | 180 | (b) You may distribute such Executable Form under the terms of this 181 | License, or sublicense it under different terms, provided that the 182 | license for the Executable Form does not attempt to limit or alter 183 | the recipients' rights in the Source Code Form under this License. 184 | 185 | 3.3. Distribution of a Larger Work 186 | 187 | You may create and distribute a Larger Work under terms of Your choice, 188 | provided that You also comply with the requirements of this License for 189 | the Covered Software. If the Larger Work is a combination of Covered 190 | Software with a work governed by one or more Secondary Licenses, and the 191 | Covered Software is not Incompatible With Secondary Licenses, this 192 | License permits You to additionally distribute such Covered Software 193 | under the terms of such Secondary License(s), so that the recipient of 194 | the Larger Work may, at their option, further distribute the Covered 195 | Software under the terms of either this License or such Secondary 196 | License(s). 197 | 198 | 3.4. Notices 199 | 200 | You may not remove or alter the substance of any license notices 201 | (including copyright notices, patent notices, disclaimers of warranty, 202 | or limitations of liability) contained within the Source Code Form of 203 | the Covered Software, except that You may alter any license notices to 204 | the extent required to remedy known factual inaccuracies. 205 | 206 | 3.5. Application of Additional Terms 207 | 208 | You may choose to offer, and to charge a fee for, warranty, support, 209 | indemnity or liability obligations to one or more recipients of Covered 210 | Software. However, You may do so only on Your own behalf, and not on 211 | behalf of any Contributor. You must make it absolutely clear that any 212 | such warranty, support, indemnity, or liability obligation is offered by 213 | You alone, and You hereby agree to indemnify every Contributor for any 214 | liability incurred by such Contributor as a result of warranty, support, 215 | indemnity or liability terms You offer. You may include additional 216 | disclaimers of warranty and limitations of liability specific to any 217 | jurisdiction. 218 | 219 | 4. Inability to Comply Due to Statute or Regulation 220 | --------------------------------------------------- 221 | 222 | If it is impossible for You to comply with any of the terms of this 223 | License with respect to some or all of the Covered Software due to 224 | statute, judicial order, or regulation then You must: (a) comply with 225 | the terms of this License to the maximum extent possible; and (b) 226 | describe the limitations and the code they affect. Such description must 227 | be placed in a text file included with all distributions of the Covered 228 | Software under this License. Except to the extent prohibited by statute 229 | or regulation, such description must be sufficiently detailed for a 230 | recipient of ordinary skill to be able to understand it. 231 | 232 | 5. Termination 233 | -------------- 234 | 235 | 5.1. The rights granted under this License will terminate automatically 236 | if You fail to comply with any of its terms. However, if You become 237 | compliant, then the rights granted under this License from a particular 238 | Contributor are reinstated (a) provisionally, unless and until such 239 | Contributor explicitly and finally terminates Your grants, and (b) on an 240 | ongoing basis, if such Contributor fails to notify You of the 241 | non-compliance by some reasonable means prior to 60 days after You have 242 | come back into compliance. Moreover, Your grants from a particular 243 | Contributor are reinstated on an ongoing basis if such Contributor 244 | notifies You of the non-compliance by some reasonable means, this is the 245 | first time You have received notice of non-compliance with this License 246 | from such Contributor, and You become compliant prior to 30 days after 247 | Your receipt of the notice. 248 | 249 | 5.2. If You initiate litigation against any entity by asserting a patent 250 | infringement claim (excluding declaratory judgment actions, 251 | counter-claims, and cross-claims) alleging that a Contributor Version 252 | directly or indirectly infringes any patent, then the rights granted to 253 | You by any and all Contributors for the Covered Software under Section 254 | 2.1 of this License shall terminate. 255 | 256 | 5.3. In the event of termination under Sections 5.1 or 5.2 above, all 257 | end user license agreements (excluding distributors and resellers) which 258 | have been validly granted by You or Your distributors under this License 259 | prior to termination shall survive termination. 260 | 261 | ************************************************************************ 262 | * * 263 | * 6. Disclaimer of Warranty * 264 | * ------------------------- * 265 | * * 266 | * Covered Software is provided under this License on an "as is" * 267 | * basis, without warranty of any kind, either expressed, implied, or * 268 | * statutory, including, without limitation, warranties that the * 269 | * Covered Software is free of defects, merchantable, fit for a * 270 | * particular purpose or non-infringing. The entire risk as to the * 271 | * quality and performance of the Covered Software is with You. * 272 | * Should any Covered Software prove defective in any respect, You * 273 | * (not any Contributor) assume the cost of any necessary servicing, * 274 | * repair, or correction. This disclaimer of warranty constitutes an * 275 | * essential part of this License. No use of any Covered Software is * 276 | * authorized under this License except under this disclaimer. * 277 | * * 278 | ************************************************************************ 279 | 280 | ************************************************************************ 281 | * * 282 | * 7. Limitation of Liability * 283 | * -------------------------- * 284 | * * 285 | * Under no circumstances and under no legal theory, whether tort * 286 | * (including negligence), contract, or otherwise, shall any * 287 | * Contributor, or anyone who distributes Covered Software as * 288 | * permitted above, be liable to You for any direct, indirect, * 289 | * special, incidental, or consequential damages of any character * 290 | * including, without limitation, damages for lost profits, loss of * 291 | * goodwill, work stoppage, computer failure or malfunction, or any * 292 | * and all other commercial damages or losses, even if such party * 293 | * shall have been informed of the possibility of such damages. This * 294 | * limitation of liability shall not apply to liability for death or * 295 | * personal injury resulting from such party's negligence to the * 296 | * extent applicable law prohibits such limitation. Some * 297 | * jurisdictions do not allow the exclusion or limitation of * 298 | * incidental or consequential damages, so this exclusion and * 299 | * limitation may not apply to You. * 300 | * * 301 | ************************************************************************ 302 | 303 | 8. Litigation 304 | ------------- 305 | 306 | Any litigation relating to this License may be brought only in the 307 | courts of a jurisdiction where the defendant maintains its principal 308 | place of business and such litigation shall be governed by laws of that 309 | jurisdiction, without reference to its conflict-of-law provisions. 310 | Nothing in this Section shall prevent a party's ability to bring 311 | cross-claims or counter-claims. 312 | 313 | 9. Miscellaneous 314 | ---------------- 315 | 316 | This License represents the complete agreement concerning the subject 317 | matter hereof. If any provision of this License is held to be 318 | unenforceable, such provision shall be reformed only to the extent 319 | necessary to make it enforceable. Any law or regulation which provides 320 | that the language of a contract shall be construed against the drafter 321 | shall not be used to construe this License against a Contributor. 322 | 323 | 10. Versions of the License 324 | --------------------------- 325 | 326 | 10.1. New Versions 327 | 328 | Mozilla Foundation is the license steward. Except as provided in Section 329 | 10.3, no one other than the license steward has the right to modify or 330 | publish new versions of this License. Each version will be given a 331 | distinguishing version number. 332 | 333 | 10.2. Effect of New Versions 334 | 335 | You may distribute the Covered Software under the terms of the version 336 | of the License under which You originally received the Covered Software, 337 | or under the terms of any subsequent version published by the license 338 | steward. 339 | 340 | 10.3. Modified Versions 341 | 342 | If you create software not governed by this License, and you want to 343 | create a new license for such software, you may create and use a 344 | modified version of this License if you rename the license and remove 345 | any references to the name of the license steward (except to note that 346 | such modified license differs from this License). 347 | 348 | 10.4. Distributing Source Code Form that is Incompatible With Secondary 349 | Licenses 350 | 351 | If You choose to distribute Source Code Form that is Incompatible With 352 | Secondary Licenses under the terms of this version of the License, the 353 | notice described in Exhibit B of this License must be attached. 354 | 355 | Exhibit A - Source Code Form License Notice 356 | ------------------------------------------- 357 | 358 | This Source Code Form is subject to the terms of the Mozilla Public 359 | License, v. 2.0. If a copy of the MPL was not distributed with this 360 | file, You can obtain one at http://mozilla.org/MPL/2.0/. 361 | 362 | If it is not possible or desirable to put the notice in a particular 363 | file, then You may include the notice in a location (such as a LICENSE 364 | file in a relevant directory) where a recipient would be likely to look 365 | for such a notice. 366 | 367 | You may add additional accurate notices of copyright ownership. 368 | 369 | Exhibit B - "Incompatible With Secondary Licenses" Notice 370 | --------------------------------------------------------- 371 | 372 | This Source Code Form is "Incompatible With Secondary Licenses", as 373 | defined by the Mozilla Public License, v. 2.0. 374 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Endor 2 | 3 | A 3D game engine made with Haxe and C++. 4 | 5 | Currently the engine is possible of loading/compiling shaders, loading textures, playing sound, and rendering basic vertices. 6 | ![image](https://github.com/polybiusproxy/Endor/assets/47796739/cb7e59e9-069c-4b21-84b3-b72dc4ad5639) 7 | 8 | ## Requirements 9 | * format 10 | * haxe-glm 11 | > Use the git repository, the haxelib version is outdated. 12 | * hxtelemetry 13 | > Use the git repository, the haxelib version is outdated. 14 | -------------------------------------------------------------------------------- /build.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | cls 3 | set VSLANG=1033 4 | haxe.exe build.hxml -D ENDOR_GLFW_STATIC 5 | haxe.exe build.hxml -debug -D ENDOR_GLFW_STATIC -D HXCPP_STACK_TRACE -D HXCPP_TELEMETRY -------------------------------------------------------------------------------- /build.hxml: -------------------------------------------------------------------------------- 1 | -cp src 2 | -D analyzer-optimize 3 | -main Main 4 | --library hxcpp-debug-server 5 | --library haxe-glm 6 | --library format 7 | --library hxtelemetry 8 | --cpp bin 9 | -D HXCPP_M64 -------------------------------------------------------------------------------- /hxformat.json: -------------------------------------------------------------------------------- 1 | { 2 | "lineEnds": { 3 | "leftCurly": "both", 4 | "rightCurly": "both", 5 | "objectLiteralCurly": { 6 | "leftCurly": "after" 7 | } 8 | }, 9 | "sameLine": { 10 | "ifElse": "next", 11 | "doWhile": "next", 12 | "tryBody": "next", 13 | "tryCatch": "next" 14 | } 15 | } -------------------------------------------------------------------------------- /src/Main.hx: -------------------------------------------------------------------------------- 1 | import graphics.Texture; 2 | import render.Model; 3 | import graphics.Sound; 4 | import engine.Endor; 5 | import render.Shader; 6 | import lib.glad.GLAD.*; 7 | import lib.glfw.GLFW.*; 8 | 9 | class Main 10 | { 11 | static function main() 12 | { 13 | Endor.init([1280, 720], "Endor"); 14 | 15 | var vertices:Array = [ 16 | 0.5, 0.5, 0.0, 17 | 0.5, -0.5, 0.0, 18 | -0.5, -0.5, 0.0, 19 | -0.5, 0.5, 0.0 20 | ]; 21 | 22 | var indices:Array = [ 23 | 0, 1, 3, 24 | 1, 2, 3 25 | ]; 26 | 27 | var colors:Array = [ 28 | 1.0, 0.0, 0.0, 29 | 0.0, 1.0, 0.0, 30 | 0.0, 0.0, 1.0, 31 | 1.0, 1.0, 1.0, 32 | ]; 33 | 34 | var texCoords:Array = [ 35 | 1.0, 1.0, 36 | 1.0, 0.0, 37 | 0.0, 0.0, 38 | 0.0, 1.0 39 | ]; 40 | 41 | var rectangleShader:Shader = new Shader(); 42 | 43 | var rectangle = new Model(vertices, indices, colors, texCoords, rectangleShader); 44 | var rectangleTexture:Texture = new Texture(rectangle, "tro.png"); 45 | 46 | var music:Sound = new Sound("09.ogg"); 47 | music.play(); 48 | 49 | while (glfwWindowShouldClose(Endor.window) != GLFW_TRUE) 50 | { 51 | glClearColor(0.07, 0.13, 0.17, 1); 52 | glClear(GL_COLOR_BUFFER_BIT); 53 | 54 | for (shader in Endor.shaders) 55 | { 56 | shader.use(); 57 | } 58 | 59 | for (model in Endor.models) 60 | { 61 | model.render(); 62 | } 63 | 64 | glfwSwapBuffers(Endor.window); 65 | glfwPollEvents(); 66 | 67 | #if HXCPP_TELEMETRY 68 | Endor.advanceFrame(); 69 | #end 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/engine/Endor.hx: -------------------------------------------------------------------------------- 1 | package engine; 2 | 3 | #if HXCPP_TELEMETRY 4 | import hxtelemetry.HxTelemetry; 5 | #end 6 | 7 | import render.Shader; 8 | import render.Model; 9 | import lib.openal.ALC.ALCcontext; 10 | import lib.openal.ALC.ALCdevice; 11 | import lib.openal.ALC.*; 12 | import haxe.PosInfos; 13 | import haxe.Log; 14 | import lib.glfw.GLFW.GLFWwindow; 15 | import lib.glfw.GLFW.*; 16 | import lib.glad.GLAD.*; 17 | import cpp.Pointer; 18 | 19 | class Endor 20 | { 21 | public static var models:Array = []; 22 | public static var shaders:Array = []; 23 | 24 | public static var window:Pointer; 25 | 26 | static var device:Pointer; 27 | static var context:Pointer; 28 | 29 | #if HXCPP_TELEMETRY 30 | static var hxtConfig:Config; 31 | static var hxt:hxtelemetry.HxTelemetry; 32 | #end 33 | 34 | public static function init(resolution:Array, title:String) 35 | { 36 | #if HXCPP_TELEMETRY 37 | /* init telemetry */ 38 | hxtConfig = new Config(); 39 | hxtConfig.app_name = "Endor"; 40 | 41 | hxt = new hxtelemetry.HxTelemetry(hxtConfig); 42 | #end 43 | 44 | Log.trace = function(data:Dynamic, ?info:PosInfos) 45 | { 46 | Sys.println("[endor] " + data); 47 | } 48 | 49 | trace("[engine] Initializing..."); 50 | 51 | if (glfwInit() != GLFW_TRUE) 52 | { 53 | trace("[glfw] Initialization failed!"); 54 | Sys.exit(-1); 55 | } 56 | 57 | trace("[glfw] Initialized!"); 58 | 59 | glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4); 60 | glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 6); 61 | glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); 62 | 63 | window = glfwCreateWindow(resolution[0], resolution[1], title, null, null); 64 | 65 | glfwMakeContextCurrent(window); 66 | glfwSetFramebufferSizeCallback(window, framebufferSizeCallback); 67 | 68 | device = alcOpenDevice(null); 69 | if (device == null) 70 | { 71 | trace("[openal] Unable to open default device!"); 72 | Sys.exit(-1); 73 | } 74 | 75 | trace("[openal] Device: " + alcGetString(device, ALC_DEFAULT_ALL_DEVICES_SPECIFIER)); 76 | 77 | context = alcCreateContext(device, 0); 78 | alcMakeContextCurrent(context); 79 | 80 | if (gladLoadGL() != GLFW_TRUE) 81 | { 82 | trace("[opengl] Initialization failed!"); 83 | Sys.exit(-1); 84 | } 85 | 86 | trace("[opengl] Initialized!"); 87 | 88 | trace("[opengl] --------------- INFO ---------------"); 89 | trace("[opengl] Vendor: " + glGetString(GL_VENDOR)); 90 | trace("[opengl] Rendering Device: " + glGetString(GL_RENDERER)); 91 | trace("[opengl] Version: " + glGetString(GL_VERSION)); 92 | trace("[opengl] GLSL Version: " + glGetString(GL_SHADING_LANGUAGE_VERSION)); 93 | trace("[opengl] ------------------------------------"); 94 | } 95 | 96 | static function framebufferSizeCallback(window:Pointer, width:Int, height:Int) 97 | { 98 | glViewport(0, 0, width, height); 99 | } 100 | 101 | #if HXCPP_TELEMETRY 102 | public static function advanceFrame() 103 | { 104 | hxt.advance_frame(); 105 | } 106 | #end 107 | } 108 | -------------------------------------------------------------------------------- /src/graphics/Sound.hx: -------------------------------------------------------------------------------- 1 | package graphics; 2 | 3 | import haxe.io.Path; 4 | import haxe.io.Bytes; 5 | import lib.openal.AL.*; 6 | import lib.vorbis.Vorbis.*; 7 | import sys.io.File; 8 | 9 | class Sound 10 | { 11 | static var sources:Array = []; 12 | static var buffers:Array = []; 13 | 14 | public function new(filename:String) 15 | { 16 | alListener3f(AL_POSITION, 0, 0, 1); 17 | alListener3f(AL_VELOCITY, 0, 0, 0); 18 | alListenerfv(AL_ORIENTATION, [0, 0, 1, 0, 1, 0]); 19 | 20 | alGenSources(1, sources); 21 | 22 | alSourcef(sources[0], AL_PITCH, 1); 23 | alSourcef(sources[0], AL_GAIN, 1); 24 | alSource3f(sources[0], AL_POSITION, 0, 0, 0); 25 | alSource3f(sources[0], AL_VELOCITY, 0, 0, 0); 26 | alSourcei(sources[0], AL_LOOPING, AL_TRUE); 27 | 28 | alGenBuffers(1, buffers); 29 | 30 | switch (Path.extension(filename)) 31 | { 32 | case "wav": 33 | loadWAV(filename); 34 | case "ogg": 35 | loadOGG(filename); 36 | } 37 | } 38 | 39 | public function play() 40 | { 41 | alSourcei(sources[0], AL_BUFFER, buffers[0]); 42 | alSourcePlay(sources[0]); 43 | } 44 | 45 | function loadWAV(filename:String) 46 | { 47 | var file = File.read("res/audio/" + filename, true); 48 | var wav = new format.wav.Reader(file).read(); 49 | 50 | var format:Int = switch (wav.header.channels) 51 | { 52 | case 1: 53 | switch (wav.header.bitsPerSample) 54 | { 55 | case 8: 56 | AL_FORMAT_MONO8; 57 | case 16: 58 | AL_FORMAT_MONO16; 59 | default: 60 | -1; 61 | } 62 | case 2: 63 | switch (wav.header.bitsPerSample) 64 | { 65 | case 8: 66 | AL_FORMAT_STEREO8; 67 | case 16: 68 | AL_FORMAT_STEREO16; 69 | default: 70 | -1; 71 | } 72 | default: 73 | -1; 74 | } 75 | 76 | trace('[sound] Filename: ${filename} | Channels: ${wav.header.channels} | Sampling rate: ${wav.header.samplingRate} Hz'); 77 | 78 | alBufferData(buffers[0], format, wav.data.getData(), wav.data.length, wav.header.samplingRate); 79 | } 80 | 81 | function loadOGG(filename:String) 82 | { 83 | var vf = vb_open("res/audio/" + filename); 84 | 85 | var ogg = vb_info(vf); 86 | var oggData = vb_read(vf); 87 | 88 | var format:Int = ogg.channels == 1 ? AL_FORMAT_MONO16 : AL_FORMAT_STEREO16; 89 | trace('[sound] Filename: ${filename} | Channels: ${ogg.channels} | Sampling rate: ${ogg.samplingRate} Hz'); 90 | 91 | var tmp = Bytes.ofData(oggData.data); // Use this, OpenAL doesn't like cpp::VirtualArray 92 | alBufferData(buffers[0], format, tmp.getData(), oggData.dataLen, ogg.samplingRate); 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /src/graphics/Texture.hx: -------------------------------------------------------------------------------- 1 | package graphics; 2 | 3 | import render.Model; 4 | import render.Shader; 5 | import lib.glad.GLAD.*; 6 | import lib.stb.Image; 7 | 8 | class Texture 9 | { 10 | public var ID:Int = 0; 11 | 12 | public function new(model:Model, filename:String, req_comp:Int = 0) 13 | { 14 | var image = Image.load("res/images/" + filename, req_comp); 15 | 16 | glGenTextures(1, ID); 17 | glBindTexture(GL_TEXTURE_2D, ID); 18 | 19 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); 20 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); 21 | 22 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); 23 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); 24 | 25 | glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, image.width, image.height, 0, GL_RGBA, GL_UNSIGNED_BYTE, image.data); 26 | glGenerateMipmap(GL_TEXTURE_2D); 27 | 28 | model.setTexture(this); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/lib/glad/GLAD.hx: -------------------------------------------------------------------------------- 1 | package lib.glad; 2 | 3 | import glm.Mat4; 4 | import haxe.io.BytesData; 5 | import cpp.ConstCharStar; 6 | import cpp.Star; 7 | import cpp.NativeArray; 8 | 9 | @:keep 10 | @:include("glad/glad.h") 11 | @:buildXml("") 12 | extern class GLAD 13 | { 14 | static inline var GL_FALSE = 0; 15 | static inline var GL_TRUE = 1; 16 | static inline var GL_TRIANGLES = 0x0004; 17 | inline static var GL_SRC_ALPHA = 0x0302; 18 | inline static var GL_ONE_MINUS_SRC_ALPHA = 0x0303; 19 | inline static var GL_BLEND = 0x0BE2; 20 | static inline var GL_UNPACK_ALIGNMENT = 0x0CF5; 21 | static inline var GL_TEXTURE_2D = 0x0DE1; 22 | static inline var GL_UNSIGNED_BYTE = 0x1401; 23 | static inline var GL_UNSIGNED_INT = 0x1405; 24 | static inline var GL_FLOAT = 0x1406; 25 | static inline var GL_RED = 0x1903; 26 | static inline var GL_RGB = 0x1907; 27 | static inline var GL_RGBA = 0x1908; 28 | static inline var GL_VENDOR = 0x1F00; 29 | static inline var GL_RENDERER = 0x1F01; 30 | static inline var GL_VERSION = 0x1F02; 31 | static inline var GL_LINEAR = 0x2601; 32 | static inline var GL_LINEAR_MIPMAP_LINEAR = 0x2703; 33 | static inline var GL_TEXTURE_MAG_FILTER = 0x2800; 34 | static inline var GL_TEXTURE_MIN_FILTER = 0x2801; 35 | static inline var GL_TEXTURE_WRAP_S = 0x2802; 36 | static inline var GL_TEXTURE_WRAP_T = 0x2803; 37 | static inline var GL_REPEAT = 0x2901; 38 | static inline var GL_CLAMP_TO_EDGE = 0x812F; 39 | static inline var GL_DEBUG_OUTPUT_SYNCHRONOUS = 0x8242; 40 | static inline var GL_ARRAY_BUFFER = 0x8892; 41 | static inline var GL_ELEMENT_ARRAY_BUFFER = 0x8893; 42 | static inline var GL_STATIC_DRAW = 0x88E4; 43 | static inline var GL_FRAGMENT_SHADER = 0x8B30; 44 | static inline var GL_VERTEX_SHADER = 0x8B31; 45 | static inline var GL_SHADING_LANGUAGE_VERSION = 0x8B8C; 46 | static inline var GL_DEBUG_OUTPUT = 0x92E0; 47 | static inline var GL_COLOR_BUFFER_BIT = 0x00004000; 48 | 49 | @:native("gladLoadGL") 50 | static function gladLoadGL():Int; 51 | 52 | @:native("glViewport") 53 | static function glViewport(x:Int, y:Int, width:Int, height:Int):Void; 54 | 55 | @:native("glEnable") 56 | static function glEnable(cap:Int):Void; 57 | 58 | @:native("glPixelStorei") 59 | static function glPixelStorei(pname:Int, param:Int):Void; 60 | 61 | @:native('glBlendFunc') 62 | static function glBlendFunc(sfactor:Int, dfactor:Int):Void; 63 | 64 | @:native("glGetString") 65 | inline static function glGetString(name:Int):String 66 | { 67 | return untyped __cpp__("::String((const char*)glGetString({0}))", name); 68 | } 69 | 70 | @:native("glAttachShader") 71 | static function glAttachShader(program:Int, shader:Int):Void; 72 | 73 | @:native("glCreateProgram") 74 | static function glCreateProgram():Int; 75 | 76 | @:native("glCreateShader") 77 | static function glCreateShader(type:Int):Int; 78 | 79 | @:native("glLinkProgram") 80 | static function glLinkProgram(program:Int):Void; 81 | 82 | @:native("glUseProgram") 83 | static function glUseProgram(program:Int):Void; 84 | 85 | @:native("glGetUniformLocation") 86 | static function glGetUniformLocation(program:Int, name:String):Int; 87 | 88 | @:native("glUniform1i") 89 | static function glUniform1i(location:Int, v0:Int):Void; 90 | 91 | @:native("glUniform1f") 92 | static function glUniform1f(location:Int, v0:Float):Void; 93 | 94 | @:native('glUniform3f') 95 | static function glUniform3f(location:Int, v0:cpp.Float32, v1:cpp.Float32, v2:cpp.Float32):Void; 96 | 97 | inline static function glUniformMatrix4fv(location:Int, count:Int, transpose:Bool, value:Mat4):Void 98 | { 99 | untyped __cpp__("glUniformMatrix4fv({0}, {1}, {2}, (const GLfloat*)&({3}[0]))", location, count, transpose, value.toFloatArray()); 100 | } 101 | 102 | static inline function glShaderSource(shader:Int, count:Int, string:ConstCharStar):Void 103 | { 104 | untyped __cpp__("glShaderSource({0}, {1}, &({2}), NULL)", shader, count, string); 105 | } 106 | 107 | @:native("glCompileShader") 108 | static function glCompileShader(shader:Int):Void; 109 | 110 | @:native("glDeleteShader") 111 | static function glDeleteShader(shader:Int):Void; 112 | 113 | static inline function glGenVertexArrays(n:Int, arrays:Int):Void 114 | { 115 | untyped __cpp__("glGenVertexArrays({0}, (GLuint*)&({1}))", n, arrays); 116 | } 117 | 118 | @:native("glBindVertexArray") 119 | static function glBindVertexArray(array:Int):Void; 120 | 121 | @:native("glVertexAttribPointer") 122 | static inline function glVertexAttribPointer(index:Int, size:Int, type:Int, normalized:Bool, stride:Int, 123 | pointer:Int /** Using the integer type because I don't see a proper translation of "const void*" **/):Void 124 | { 125 | untyped __cpp__("glVertexAttribPointer({0}, {1}, {2}, {3}, ({4} * sizeof(float)), (void*)(({5} == 0) ? {5} : {5} * sizeof(float)))", index, size, 126 | type, normalized, stride, pointer); 127 | } 128 | 129 | @:native("glEnableVertexAttribArray") 130 | static function glEnableVertexAttribArray(index:Int):Void; 131 | 132 | @:native("glDrawArrays") 133 | static function glDrawArrays(mode:Int, first:Int, count:Int):Void; 134 | 135 | @:native("glDrawElements") 136 | static function glDrawElements(mode:Int, count:Int, type:Int, indices:Int /** No pointers here, this isn't used anyways **/):Void; 137 | 138 | static inline function glGenTextures(n:Int, textures:Int):Void 139 | { 140 | untyped __cpp__("glGenTextures({0}, (GLuint*)&({1}))", n, textures); 141 | } 142 | 143 | @:native("glBindTexture") 144 | static function glBindTexture(target:Int, texture:Int):Void; 145 | 146 | @:native("glActiveTexture") 147 | static function glActiveTexture(texture:Int):Void; 148 | 149 | static inline function glTexImage2D(target:Int, level:Int, internalFormat:Int, width:Int, height:Int, border:Int, format:Int, type:Int, 150 | data:BytesData):Void 151 | { 152 | untyped __cpp__("glTexImage2D({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, (const void*)&({8}[0]))", target, level, internalFormat, width, height, border, 153 | format, type, data); 154 | } 155 | 156 | @:native("glGenerateMipmap") 157 | static function glGenerateMipmap(target:Int):Void; 158 | 159 | @:native("glTexParameteri") 160 | static function glTexParameteri(target:Int, pname:Int, param:Int):Void; 161 | 162 | static inline function glGenBuffers(n:Int, buffers:Int):Void 163 | { 164 | untyped __cpp__("glGenBuffers({0}, (GLuint*)&({1}))", n, buffers); 165 | } 166 | 167 | @:native("glBindBuffer") 168 | static function glBindBuffer(target:Int, buffer:Int):Void; 169 | 170 | @:native("glBufferData") 171 | @:noCompletion 172 | static function _bufferData(target:Int, size:Int, data:Star, usage:Int):Void; 173 | 174 | // i love undocumented haxe features, dont you love using features that are barely documented and pray for them to work 175 | static inline function glBufferData(target:Int, data:Array, usage:Int):Void 176 | { 177 | var tmp:Array = cast data; 178 | _bufferData(target, tmp.length * untyped __cpp__("sizeof(float)"), cast NativeArray.address(tmp, 0), usage); 179 | } 180 | 181 | static inline function glBufferData_int(target:Int, data:Array, usage:Int):Void 182 | { 183 | _bufferData(target, data.length * untyped __cpp__("sizeof(float)"), cast NativeArray.address(data, 0), usage); 184 | } 185 | 186 | @:native("glClear") 187 | static function glClear(mask:Int):Void; 188 | 189 | @:native("glClearColor") 190 | static function glClearColor(red:Float, green:Float, blue:Float, alpha:Float):Void; 191 | } 192 | -------------------------------------------------------------------------------- /src/lib/glad/glad.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 |
17 |
18 |
-------------------------------------------------------------------------------- /src/lib/glfw/GLFW.hx: -------------------------------------------------------------------------------- 1 | package lib.glfw; 2 | 3 | import cpp.ConstCharStar; 4 | import cpp.Star; 5 | import cpp.Function; 6 | import cpp.Pointer; 7 | 8 | @:keep 9 | @:native("GLFWwindow") 10 | @:include("glfw3.h") 11 | extern class GLFWwindow {} 12 | 13 | @:keep 14 | @:native("GLFWmonitor") 15 | @:include("glfw3.h") 16 | extern class GLFWmonitor {} 17 | 18 | typedef GLFWframebuffersizefun = Pointer->Int->Int->Void; 19 | 20 | @:keep 21 | class GLFWFramebufferSizeHandler 22 | { 23 | static var listeners = new Map(); 24 | 25 | static public function nativeCallback(win:Star, width:Int, height:Int) 26 | { 27 | var cb = listeners.get('win' + win); 28 | 29 | if (cb != null) 30 | cb(cast win, width, height); 31 | } 32 | 33 | public static function setCallback(win:Star, func:GLFWframebuffersizefun) 34 | { 35 | listeners.set('win' + win, func); 36 | } 37 | } 38 | 39 | /** 40 | * Some of this code was taken from linc_glfw (ex. callbacks). 41 | */ 42 | @:keep 43 | @:include("glfw3.h") 44 | @:buildXml("") 45 | extern class GLFW 46 | { 47 | static inline var GLFW_TRUE = 1; 48 | static inline var GLFW_FALSE = 0; 49 | static inline var GLFW_CONTEXT_VERSION_MAJOR = 0x00022002; 50 | static inline var GLFW_CONTEXT_VERSION_MINOR = 0x00022003; 51 | static inline var GLFW_OPENGL_DEBUG_CONTEXT = 0x00022007; 52 | static inline var GLFW_OPENGL_PROFILE = 0x00022008; 53 | static inline var GLFW_OPENGL_CORE_PROFILE = 0x00032001; 54 | 55 | @:native("glfwInit") 56 | static inline function glfwInit():Int 57 | { 58 | forceInclude(); 59 | return untyped __cpp__("glfwInit()"); 60 | } 61 | 62 | static inline function glfwSetFramebufferSizeCallback(window:Pointer, callback:GLFWframebuffersizefun):Void 63 | { 64 | GLFWFramebufferSizeHandler.setCallback(window.ptr, callback); 65 | untyped __global__.glfwSetFramebufferSizeCallback(window, Function.fromStaticFunction(GLFWFramebufferSizeHandler.nativeCallback)); 66 | } 67 | 68 | @:native("glfwTerminate") 69 | static function glfwTerminate():Void; 70 | 71 | @:native("glfwWindowHint") 72 | static function glfwWindowHint(hint:Int, value:Int):Void; 73 | 74 | @:native("glfwCreateWindow") 75 | static function glfwCreateWindow(width:Int, height:Int, title:String, monitor:Pointer, share:Pointer):Pointer; 76 | 77 | @:native("glfwMakeContextCurrent") 78 | static function glfwMakeContextCurrent(window:Pointer):Void; 79 | 80 | @:native("glfwSwapBuffers") 81 | static function glfwSwapBuffers(window:Pointer):Void; 82 | 83 | @:native("glfwWindowShouldClose") 84 | static function glfwWindowShouldClose(window:Pointer):Int; 85 | 86 | @:native("glfwSetWindowTitle") 87 | static function glfwSetWindowTitle(window:Pointer, title:ConstCharStar):Void; 88 | 89 | @:native("glfwPollEvents") 90 | static function glfwPollEvents():Void; 91 | 92 | @:native("void") 93 | public static function forceInclude():Void; 94 | } 95 | -------------------------------------------------------------------------------- /src/lib/glfw/glfw.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 |
28 |
29 |
30 | 31 | 32 | 33 |
-------------------------------------------------------------------------------- /src/lib/openal/AL.hx: -------------------------------------------------------------------------------- 1 | package lib.openal; 2 | 3 | import cpp.Pointer; 4 | import cpp.UInt8; 5 | import cpp.NativeArray; 6 | import cpp.Star; 7 | import haxe.io.BytesData; 8 | 9 | @:keep 10 | @:include("AL/al.h") 11 | @:buildXml("") 12 | extern class AL 13 | { 14 | static inline var AL_FALSE = 0; 15 | static inline var AL_TRUE = 1; 16 | static inline var AL_PITCH = 0x1003; 17 | static inline var AL_POSITION = 0x1004; 18 | static inline var AL_VELOCITY = 0x1006; 19 | static inline var AL_LOOPING = 0x1007; 20 | static inline var AL_BUFFER = 0x1009; 21 | static inline var AL_GAIN = 0x100A; 22 | static inline var AL_ORIENTATION = 0x100F; 23 | static inline var AL_FORMAT_MONO8 = 0x1100; 24 | static inline var AL_FORMAT_MONO16 = 0x1101; 25 | static inline var AL_FORMAT_STEREO8 = 0x1102; 26 | static inline var AL_FORMAT_STEREO16 = 0x1103; 27 | 28 | @:native("alGetError") 29 | static function alGetError():Void; 30 | 31 | @:native("alSourcePlay") 32 | static function alSourcePlay(source:Int):Void; 33 | 34 | @:native("alBufferData") 35 | static function _alBufferData(buffer:Int, format:Int, data:Pointer, size:Int, freq:Int):Void; 36 | 37 | static inline function alBufferData(buffer:Int, format:Int, data:BytesData, size:Int, freq:Int):Void 38 | { 39 | _alBufferData(buffer, format, Pointer.arrayElem(data, 0), size, freq); 40 | } 41 | 42 | @:native("alGenSources") 43 | static inline function alGenSources(n:Int, sources:Array):Void 44 | { 45 | untyped __cpp__("alGenSources({0}, (ALuint*)&({1}[0]))", n, sources); 46 | } 47 | 48 | @:native("alGenBuffers") 49 | static inline function alGenBuffers(n:Int, buffers:Array):Void 50 | { 51 | untyped __cpp__("alGenBuffers({0}, (ALuint*)&({1}[0]))", n, buffers); 52 | } 53 | 54 | @:native("alListener3f") 55 | static function alListener3f(param:Int, value1:Float, value2:Float, value3:Float):Void; 56 | 57 | @:native("alListenerfv") 58 | static function _alListenerfv(param:Int, values:Star):Void; 59 | 60 | static inline function alListenerfv(param:Int, values:Array):Void 61 | { 62 | _alListenerfv(param, cast NativeArray.address(values, 0)); 63 | } 64 | 65 | @:native("alSourcef") 66 | static function alSourcef(source:Int, param:Int, value:Float):Void; 67 | @:native("alSource3f") 68 | static function alSource3f(param:Int, param:Int, value1:Float, value2:Float, value3:Float):Void; 69 | @:native("alSourcei") 70 | static function alSourcei(source:Int, param:Int, value:Int):Void; 71 | } 72 | -------------------------------------------------------------------------------- /src/lib/openal/ALC.hx: -------------------------------------------------------------------------------- 1 | package lib.openal; 2 | 3 | import cpp.ConstCharStar; 4 | import cpp.Pointer; 5 | 6 | @:keep 7 | @:native("ALCdevice") 8 | @:include("AL/alc.h") 9 | extern class ALCdevice {} 10 | 11 | @:keep 12 | @:native("ALCcontext") 13 | @:include("AL/alc.h") 14 | extern class ALCcontext {} 15 | 16 | @:keep 17 | @:include("AL/alc.h") 18 | @:buildXml("") 19 | extern class ALC 20 | { 21 | static inline var ALC_DEVICE_SPECIFIER = 0x1005; 22 | static inline var ALC_DEFAULT_ALL_DEVICES_SPECIFIER = 0x1012; 23 | 24 | @:native("alcOpenDevice") 25 | static function alcOpenDevice(devicename:ConstCharStar):Pointer; 26 | 27 | @:native("alcCreateContext") 28 | static function alcCreateContext(device:Pointer, attrlist:Int):Pointer; 29 | 30 | @:native("alcMakeContextCurrent") 31 | static function alcMakeContextCurrent(context:Pointer):Int; 32 | 33 | @:native("alcIsExtensionPresent") 34 | static function alcIsExtensionPresent(device:Pointer, extname:ConstCharStar):Int; 35 | 36 | @:native("alcGetString") 37 | static function alcGetString(device:Pointer, param:Int):ConstCharStar; 38 | } 39 | -------------------------------------------------------------------------------- /src/lib/openal/al.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 |
22 | 23 |
24 |
25 |
26 | 27 | 28 | 29 |
-------------------------------------------------------------------------------- /src/lib/stb/Image.hx: -------------------------------------------------------------------------------- 1 | package lib.stb; 2 | 3 | import haxe.io.BytesData; 4 | 5 | typedef ImageData = 6 | { 7 | var width:Int; 8 | var height:Int; 9 | var channels:Int; 10 | var data:BytesData; 11 | } 12 | 13 | @:keep 14 | @:include("endor_stb_image.h") 15 | @:buildXml("") 16 | extern class Image 17 | { 18 | @:native("endor::stb_image::load") 19 | static function load(filename:String, req_comp:Int):ImageData; 20 | } 21 | -------------------------------------------------------------------------------- /src/lib/stb/endor_stb_image.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define STB_IMAGE_IMPLEMENTATION 4 | #include "stb_image.h" 5 | 6 | namespace endor 7 | { 8 | namespace stb_image 9 | { 10 | Array toHaxeBytes(unsigned char *bytes, int length); 11 | Dynamic toImageData(int width, int height, int channels, Array data); 12 | 13 | Dynamic load(::String filename, int req_comp) 14 | { 15 | stbi_set_flip_vertically_on_load(true); 16 | 17 | int width, height, channels; 18 | unsigned char *data = stbi_load(filename, &width, &height, &channels, req_comp); 19 | 20 | if (!data) 21 | return null(); 22 | 23 | if (req_comp == 0) 24 | req_comp = channels; 25 | 26 | Array bytes = toHaxeBytes(data, width * height * channels); 27 | stbi_image_free(data); 28 | 29 | return toImageData(width, height, channels, bytes); 30 | } 31 | 32 | Dynamic toImageData(int width, int height, int channels, Array data) 33 | { 34 | hx::Anon result = hx::Anon_obj::Create(); 35 | 36 | result->Add(HX_CSTRING("width"), width); 37 | result->Add(HX_CSTRING("height"), height); 38 | result->Add(HX_CSTRING("channels"), channels); 39 | result->Add(HX_CSTRING("data"), data); 40 | 41 | return result; 42 | } 43 | 44 | Array toHaxeBytes(unsigned char *bytes, int length) 45 | { 46 | Array haxeBytes = new Array_obj(length, length); 47 | memcpy(haxeBytes->GetBase(), bytes, length); 48 | 49 | return haxeBytes; 50 | } 51 | } 52 | } -------------------------------------------------------------------------------- /src/lib/stb/endor_stb_image.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef HXCPP_H 4 | #include 5 | #endif 6 | 7 | #include "stb_image.h" 8 | 9 | namespace endor 10 | { 11 | namespace stb_image 12 | { 13 | extern Dynamic load(::String filename, int req_comp); 14 | } 15 | } -------------------------------------------------------------------------------- /src/lib/stb/stb.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/lib/vorbis/Vorbis.hx: -------------------------------------------------------------------------------- 1 | package lib.vorbis; 2 | 3 | import haxe.io.BytesData; 4 | 5 | typedef Vorbis_Info = 6 | { 7 | var channels:Int; 8 | var samplingRate:Int; 9 | } 10 | 11 | typedef Vorbis_File = 12 | { 13 | var data:BytesData; 14 | var dataLen:Int; 15 | } 16 | 17 | @:keep 18 | @:native("OggVorbis_File") 19 | @:unreflective 20 | @:include("vorbis/vorbisfile.h") 21 | extern class OggVorbis_File {} 22 | 23 | @:keep 24 | @:include("endor_vorbis.h") 25 | @:buildXml("") 26 | extern class Vorbis 27 | { 28 | @:native("endor::vorbis::vb_open") 29 | static function vb_open(filename:String):OggVorbis_File; 30 | 31 | @:native("endor::vorbis::vb_info") 32 | static function vb_info(vf:OggVorbis_File):Vorbis_Info; 33 | 34 | @:native("endor::vorbis::vb_read") 35 | static function vb_read(vf:OggVorbis_File):Vorbis_File; 36 | } 37 | -------------------------------------------------------------------------------- /src/lib/vorbis/endor_vorbis.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #define __STDC_FORMAT_MACROS 1 6 | #include 7 | 8 | namespace endor 9 | { 10 | namespace vorbis 11 | { 12 | Array toHaxeBytes(unsigned char *bytes, int length); 13 | 14 | OggVorbis_File vb_open(::String filename) 15 | { 16 | OggVorbis_File vf; 17 | FILE *fp = fopen(filename, "rb"); 18 | 19 | if (ov_open_callbacks(fp, &vf, NULL, 0, OV_CALLBACKS_NOCLOSE) < 0) 20 | { 21 | printf("[endor] [libvorbis] Invalid OggVorbis stream!\n"); 22 | exit(-1); 23 | } 24 | 25 | return vf; 26 | } 27 | 28 | Dynamic vb_info(OggVorbis_File vf) 29 | { 30 | vorbis_info *vi = ov_info(&vf, -1); 31 | 32 | hx::Anon result = hx::Anon_obj::Create(); 33 | result->Add(HX_CSTRING("channels"), vi->channels); 34 | result->Add(HX_CSTRING("samplingRate"), (int)vi->rate); 35 | 36 | return result; 37 | } 38 | 39 | Dynamic vb_read(OggVorbis_File vf) 40 | { 41 | vorbis_info *vi = ov_info(&vf, -1); 42 | ogg_int64_t dataLen = ov_pcm_total(&vf, -1) * vi->channels * 2; 43 | 44 | printf("[endor] [libvorbis] Allocating %" PRIu64 " bytes...\n", dataLen); 45 | 46 | unsigned char *rawData = new unsigned char[dataLen]; 47 | 48 | long size = 0; 49 | int sel = 0; 50 | while (size < dataLen) 51 | { 52 | long result = ov_read(&vf, (char *)rawData + size, dataLen - size, 0, 2, 1, &sel); 53 | 54 | if (result < 0) 55 | { 56 | printf("[endor] [libvorbis] Faulty Vorbis file!"); 57 | exit(-1); 58 | } 59 | else 60 | { 61 | size += result; 62 | } 63 | } 64 | 65 | hx::Anon result = hx::Anon_obj::Create(); 66 | result->Add(HX_CSTRING("data"), toHaxeBytes(rawData, size)); 67 | result->Add(HX_CSTRING("dataLen"), (int)size); 68 | 69 | ov_clear(&vf); 70 | free(rawData); 71 | 72 | return result; 73 | } 74 | 75 | Array toHaxeBytes(unsigned char *bytes, int length) 76 | { 77 | Array haxeBytes = new Array_obj(length, length); 78 | memcpy(haxeBytes->GetBase(), bytes, length); 79 | 80 | return haxeBytes; 81 | } 82 | } 83 | } -------------------------------------------------------------------------------- /src/lib/vorbis/endor_vorbis.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef HXCPP_H 4 | #include 5 | #endif 6 | 7 | #include 8 | 9 | namespace endor 10 | { 11 | namespace vorbis 12 | { 13 | extern OggVorbis_File vb_open(::String filename); 14 | extern Dynamic vb_info(OggVorbis_File vf); 15 | extern Dynamic vb_read(OggVorbis_File vf); 16 | } 17 | } -------------------------------------------------------------------------------- /src/lib/vorbis/libvorbis.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 |
31 |
-------------------------------------------------------------------------------- /src/render/Model.hx: -------------------------------------------------------------------------------- 1 | package render; 2 | 3 | import graphics.Texture; 4 | import engine.Endor; 5 | import render.Shader; 6 | import lib.glad.GLAD.*; 7 | 8 | class Model 9 | { 10 | public var vaoID:Int; 11 | public var vertexCount:Int; 12 | 13 | public var hasIndices:Bool; 14 | 15 | public var VBOs:Array = []; 16 | public var VAOs:Array = []; 17 | public var EBOs:Array = []; 18 | 19 | public var textures:Array = []; 20 | 21 | public var shader:Shader; 22 | 23 | public function new(vertices:Array, ?indices:Array, ?colors:Array, ?texCoords:Array, shader:Shader) 24 | { 25 | if (indices != null) 26 | hasIndices = true; 27 | 28 | if (hasIndices) 29 | vertexCount = indices.length; 30 | else 31 | vertexCount = Std.int(vertices.length / 3); 32 | 33 | this.shader = shader; 34 | 35 | var VAO:Int = 0; 36 | glGenVertexArrays(1, VAO); 37 | glBindVertexArray(VAO); 38 | VAOs.push(VAO); 39 | 40 | var vertexVBO:Int = 0; 41 | glGenBuffers(1, vertexVBO); 42 | VBOs.push(vertexVBO); 43 | 44 | glBindBuffer(GL_ARRAY_BUFFER, vertexVBO); 45 | glBufferData(GL_ARRAY_BUFFER, vertices, GL_STATIC_DRAW); 46 | 47 | // position attribute 48 | glVertexAttribPointer(0, 3, GL_FLOAT, false, 3, 0); 49 | glEnableVertexAttribArray(0); 50 | glBindBuffer(GL_ARRAY_BUFFER, 0); 51 | 52 | var indexEBO:Int = 0; 53 | 54 | if (hasIndices) 55 | { 56 | // Indices EBO 57 | glGenBuffers(1, indexEBO); 58 | EBOs.push(indexEBO); 59 | 60 | glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indexEBO); 61 | glBufferData_int(GL_ELEMENT_ARRAY_BUFFER, indices, GL_STATIC_DRAW); 62 | } 63 | 64 | var colorVBO:Int = 0; 65 | glGenBuffers(1, colorVBO); 66 | VBOs.push(colorVBO); 67 | 68 | if (colors != null) 69 | { 70 | glBindBuffer(GL_ARRAY_BUFFER, colorVBO); 71 | glBufferData(GL_ARRAY_BUFFER, colors, GL_STATIC_DRAW); 72 | 73 | glVertexAttribPointer(1, 3, GL_FLOAT, false, 3, 0); 74 | glEnableVertexAttribArray(1); 75 | glBindBuffer(GL_ARRAY_BUFFER, 0); 76 | } 77 | 78 | var texCoordVBO:Int = 0; 79 | glGenBuffers(1, texCoordVBO); 80 | VBOs.push(texCoordVBO); 81 | 82 | if (texCoords != null) 83 | { 84 | glBindBuffer(GL_ARRAY_BUFFER, texCoordVBO); 85 | glBufferData(GL_ARRAY_BUFFER, texCoords, GL_STATIC_DRAW); 86 | 87 | glVertexAttribPointer(2, 2, GL_FLOAT, false, 2, 0); 88 | glEnableVertexAttribArray(2); 89 | glBindBuffer(GL_ARRAY_BUFFER, 0); 90 | } 91 | 92 | glBindVertexArray(0); 93 | 94 | Endor.models.push(this); 95 | } 96 | 97 | public function setTexture(texture:Texture) 98 | { 99 | shader.setInt("tex", texture.ID); 100 | textures.push(texture); 101 | } 102 | 103 | public function render() 104 | { 105 | for (VAO in VAOs) 106 | { 107 | glBindVertexArray(VAO); 108 | } 109 | 110 | for (texture in textures) 111 | { 112 | glBindTexture(GL_TEXTURE_2D, texture.ID); 113 | } 114 | 115 | if (hasIndices) 116 | { 117 | glDrawElements(GL_TRIANGLES, vertexCount, GL_UNSIGNED_INT, 0); 118 | } 119 | else 120 | glDrawArrays(GL_TRIANGLES, 0, vertexCount); 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /src/render/Shader.hx: -------------------------------------------------------------------------------- 1 | package render; 2 | 3 | import glm.Vec3; 4 | import glm.Mat4; 5 | import engine.Endor; 6 | import cpp.ConstCharStar; 7 | import lib.glad.GLAD.*; 8 | import sys.io.File; 9 | 10 | @:headerInclude("iostream") 11 | class Shader 12 | { 13 | public var ID:Int; 14 | 15 | var vertex:Int; 16 | var fragment:Int; 17 | 18 | var defaultVert = "#version 460 core 19 | layout (location = 0) in vec3 aPos; 20 | layout (location = 1) in vec3 aColor; 21 | layout (location = 2) in vec2 aTexCoord; 22 | 23 | out vec3 color; 24 | out vec2 texCoord; 25 | 26 | void main() 27 | { 28 | color = aColor; 29 | texCoord = aTexCoord; 30 | gl_Position = vec4(aPos, 1.0); 31 | }"; 32 | 33 | var defaultFrag = "#version 460 core 34 | out vec4 fragColor; 35 | 36 | in vec3 color; 37 | in vec2 texCoord; 38 | 39 | uniform sampler2D tex; 40 | 41 | void main() 42 | { 43 | fragColor = texture(tex, texCoord) * vec4(color, 1.0); 44 | }"; 45 | 46 | public function new(?vertexPath:String, ?fragmentPath:String, ?file:Bool = true) 47 | { 48 | var vertexShader:String = ""; 49 | var fragmentShader:String = ""; 50 | 51 | if (vertexPath != null && fragmentPath != null) 52 | { 53 | if (file) 54 | { 55 | try 56 | { 57 | vertexShader = File.getContent(vertexPath + '.vs'); 58 | fragmentShader = File.getContent(fragmentPath + '.fs'); 59 | } 60 | catch (err) 61 | { 62 | trace("[endor] [shader] Couldn't load shader files!"); 63 | } 64 | } 65 | else 66 | { 67 | vertexShader = vertexPath; 68 | fragmentShader = fragmentPath; 69 | } 70 | } 71 | else 72 | { 73 | vertexShader = defaultVert; 74 | fragmentShader = defaultFrag; 75 | } 76 | 77 | trace("[shader] Compiling shaders..."); 78 | 79 | vertex = glCreateShader(GL_VERTEX_SHADER); 80 | glShaderSource(vertex, 1, vertexShader); 81 | glCompileShader(vertex); 82 | checkErrors(vertex, "VERTEX"); 83 | 84 | fragment = glCreateShader(GL_FRAGMENT_SHADER); 85 | glShaderSource(fragment, 1, fragmentShader); 86 | glCompileShader(fragment); 87 | checkErrors(fragment, "FRAGMENT"); 88 | 89 | trace("[shader] Compiling programs..."); 90 | 91 | ID = glCreateProgram(); 92 | glAttachShader(ID, vertex); 93 | glAttachShader(ID, fragment); 94 | glLinkProgram(ID); 95 | checkErrors(ID, "PROGRAM"); 96 | 97 | Endor.shaders.push(this); 98 | 99 | glDeleteShader(vertex); 100 | glDeleteShader(fragment); 101 | } 102 | 103 | public function use() 104 | { 105 | glUseProgram(ID); 106 | } 107 | 108 | public function setBool(name:String, value:Bool) 109 | { 110 | glUseProgram(ID); 111 | glUniform1i(glGetUniformLocation(ID, name), cast value); 112 | } 113 | 114 | public function setInt(name:String, value:Int) 115 | { 116 | glUseProgram(ID); 117 | glUniform1i(glGetUniformLocation(ID, name), value); 118 | } 119 | 120 | public function setFloat(name:String, value:Float) 121 | { 122 | glUseProgram(ID); 123 | glUniform1f(glGetUniformLocation(ID, name), value); 124 | } 125 | 126 | public function setVec3(name:String, value:Vec3) 127 | { 128 | glUseProgram(ID); 129 | glUniform3f(glGetUniformLocation(ID, name), value.x, value.y, value.z); 130 | } 131 | 132 | public function setMat4(name:String, value:Mat4) 133 | { 134 | glUseProgram(ID); 135 | glUniformMatrix4fv(glGetUniformLocation(ID, name), 1, false, value); 136 | } 137 | 138 | @:functionCode(' 139 | int success; 140 | char infoLog[1024]; 141 | 142 | if (type != "PROGRAM") 143 | { 144 | glGetShaderiv(shader, GL_COMPILE_STATUS, &success); 145 | 146 | if (!success) 147 | { 148 | glGetShaderInfoLog(shader, 1024, NULL, infoLog); 149 | std::cout << "[opengl] [shader] Compile error of type: " << type << std::endl << infoLog << std::endl << " -- --------------------------------------------------- -- " << std::endl; 150 | } 151 | } 152 | else 153 | { 154 | glGetProgramiv(shader, GL_LINK_STATUS, &success); 155 | 156 | if (!success) 157 | { 158 | glGetProgramInfoLog(shader, 1024, NULL, infoLog); 159 | std::cout << "[endor] [shader] Link error of type: " << type << std::endl << infoLog << std::endl << " -- --------------------------------------------------- -- " << std::endl; 160 | } 161 | } 162 | ') 163 | private function checkErrors(shader:Int, type:ConstCharStar) {} 164 | } 165 | -------------------------------------------------------------------------------- /vendor/GLAD/include/KHR/khrplatform.h: -------------------------------------------------------------------------------- 1 | #ifndef __khrplatform_h_ 2 | #define __khrplatform_h_ 3 | 4 | /* 5 | ** Copyright (c) 2008-2018 The Khronos Group Inc. 6 | ** 7 | ** Permission is hereby granted, free of charge, to any person obtaining a 8 | ** copy of this software and/or associated documentation files (the 9 | ** "Materials"), to deal in the Materials without restriction, including 10 | ** without limitation the rights to use, copy, modify, merge, publish, 11 | ** distribute, sublicense, and/or sell copies of the Materials, and to 12 | ** permit persons to whom the Materials are furnished to do so, subject to 13 | ** the following conditions: 14 | ** 15 | ** The above copyright notice and this permission notice shall be included 16 | ** in all copies or substantial portions of the Materials. 17 | ** 18 | ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 21 | ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 23 | ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 24 | ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. 25 | */ 26 | 27 | /* Khronos platform-specific types and definitions. 28 | * 29 | * The master copy of khrplatform.h is maintained in the Khronos EGL 30 | * Registry repository at https://github.com/KhronosGroup/EGL-Registry 31 | * The last semantic modification to khrplatform.h was at commit ID: 32 | * 67a3e0864c2d75ea5287b9f3d2eb74a745936692 33 | * 34 | * Adopters may modify this file to suit their platform. Adopters are 35 | * encouraged to submit platform specific modifications to the Khronos 36 | * group so that they can be included in future versions of this file. 37 | * Please submit changes by filing pull requests or issues on 38 | * the EGL Registry repository linked above. 39 | * 40 | * 41 | * See the Implementer's Guidelines for information about where this file 42 | * should be located on your system and for more details of its use: 43 | * http://www.khronos.org/registry/implementers_guide.pdf 44 | * 45 | * This file should be included as 46 | * #include 47 | * by Khronos client API header files that use its types and defines. 48 | * 49 | * The types in khrplatform.h should only be used to define API-specific types. 50 | * 51 | * Types defined in khrplatform.h: 52 | * khronos_int8_t signed 8 bit 53 | * khronos_uint8_t unsigned 8 bit 54 | * khronos_int16_t signed 16 bit 55 | * khronos_uint16_t unsigned 16 bit 56 | * khronos_int32_t signed 32 bit 57 | * khronos_uint32_t unsigned 32 bit 58 | * khronos_int64_t signed 64 bit 59 | * khronos_uint64_t unsigned 64 bit 60 | * khronos_intptr_t signed same number of bits as a pointer 61 | * khronos_uintptr_t unsigned same number of bits as a pointer 62 | * khronos_ssize_t signed size 63 | * khronos_usize_t unsigned size 64 | * khronos_float_t signed 32 bit floating point 65 | * khronos_time_ns_t unsigned 64 bit time in nanoseconds 66 | * khronos_utime_nanoseconds_t unsigned time interval or absolute time in 67 | * nanoseconds 68 | * khronos_stime_nanoseconds_t signed time interval in nanoseconds 69 | * khronos_boolean_enum_t enumerated boolean type. This should 70 | * only be used as a base type when a client API's boolean type is 71 | * an enum. Client APIs which use an integer or other type for 72 | * booleans cannot use this as the base type for their boolean. 73 | * 74 | * Tokens defined in khrplatform.h: 75 | * 76 | * KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values. 77 | * 78 | * KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0. 79 | * KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0. 80 | * 81 | * Calling convention macros defined in this file: 82 | * KHRONOS_APICALL 83 | * KHRONOS_APIENTRY 84 | * KHRONOS_APIATTRIBUTES 85 | * 86 | * These may be used in function prototypes as: 87 | * 88 | * KHRONOS_APICALL void KHRONOS_APIENTRY funcname( 89 | * int arg1, 90 | * int arg2) KHRONOS_APIATTRIBUTES; 91 | */ 92 | 93 | #if defined(__SCITECH_SNAP__) && !defined(KHRONOS_STATIC) 94 | # define KHRONOS_STATIC 1 95 | #endif 96 | 97 | /*------------------------------------------------------------------------- 98 | * Definition of KHRONOS_APICALL 99 | *------------------------------------------------------------------------- 100 | * This precedes the return type of the function in the function prototype. 101 | */ 102 | #if defined(KHRONOS_STATIC) 103 | /* If the preprocessor constant KHRONOS_STATIC is defined, make the 104 | * header compatible with static linking. */ 105 | # define KHRONOS_APICALL 106 | #elif defined(_WIN32) 107 | # define KHRONOS_APICALL __declspec(dllimport) 108 | #elif defined (__SYMBIAN32__) 109 | # define KHRONOS_APICALL IMPORT_C 110 | #elif defined(__ANDROID__) 111 | # define KHRONOS_APICALL __attribute__((visibility("default"))) 112 | #else 113 | # define KHRONOS_APICALL 114 | #endif 115 | 116 | /*------------------------------------------------------------------------- 117 | * Definition of KHRONOS_APIENTRY 118 | *------------------------------------------------------------------------- 119 | * This follows the return type of the function and precedes the function 120 | * name in the function prototype. 121 | */ 122 | #if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__) 123 | /* Win32 but not WinCE */ 124 | # define KHRONOS_APIENTRY __stdcall 125 | #else 126 | # define KHRONOS_APIENTRY 127 | #endif 128 | 129 | /*------------------------------------------------------------------------- 130 | * Definition of KHRONOS_APIATTRIBUTES 131 | *------------------------------------------------------------------------- 132 | * This follows the closing parenthesis of the function prototype arguments. 133 | */ 134 | #if defined (__ARMCC_2__) 135 | #define KHRONOS_APIATTRIBUTES __softfp 136 | #else 137 | #define KHRONOS_APIATTRIBUTES 138 | #endif 139 | 140 | /*------------------------------------------------------------------------- 141 | * basic type definitions 142 | *-----------------------------------------------------------------------*/ 143 | #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__) 144 | 145 | 146 | /* 147 | * Using 148 | */ 149 | #include 150 | typedef int32_t khronos_int32_t; 151 | typedef uint32_t khronos_uint32_t; 152 | typedef int64_t khronos_int64_t; 153 | typedef uint64_t khronos_uint64_t; 154 | #define KHRONOS_SUPPORT_INT64 1 155 | #define KHRONOS_SUPPORT_FLOAT 1 156 | /* 157 | * To support platform where unsigned long cannot be used interchangeably with 158 | * inptr_t (e.g. CHERI-extended ISAs), we can use the stdint.h intptr_t. 159 | * Ideally, we could just use (u)intptr_t everywhere, but this could result in 160 | * ABI breakage if khronos_uintptr_t is changed from unsigned long to 161 | * unsigned long long or similar (this results in different C++ name mangling). 162 | * To avoid changes for existing platforms, we restrict usage of intptr_t to 163 | * platforms where the size of a pointer is larger than the size of long. 164 | */ 165 | #if defined(__SIZEOF_LONG__) && defined(__SIZEOF_POINTER__) 166 | #if __SIZEOF_POINTER__ > __SIZEOF_LONG__ 167 | #define KHRONOS_USE_INTPTR_T 168 | #endif 169 | #endif 170 | 171 | #elif defined(__VMS ) || defined(__sgi) 172 | 173 | /* 174 | * Using 175 | */ 176 | #include 177 | typedef int32_t khronos_int32_t; 178 | typedef uint32_t khronos_uint32_t; 179 | typedef int64_t khronos_int64_t; 180 | typedef uint64_t khronos_uint64_t; 181 | #define KHRONOS_SUPPORT_INT64 1 182 | #define KHRONOS_SUPPORT_FLOAT 1 183 | 184 | #elif defined(_WIN32) && !defined(__SCITECH_SNAP__) 185 | 186 | /* 187 | * Win32 188 | */ 189 | typedef __int32 khronos_int32_t; 190 | typedef unsigned __int32 khronos_uint32_t; 191 | typedef __int64 khronos_int64_t; 192 | typedef unsigned __int64 khronos_uint64_t; 193 | #define KHRONOS_SUPPORT_INT64 1 194 | #define KHRONOS_SUPPORT_FLOAT 1 195 | 196 | #elif defined(__sun__) || defined(__digital__) 197 | 198 | /* 199 | * Sun or Digital 200 | */ 201 | typedef int khronos_int32_t; 202 | typedef unsigned int khronos_uint32_t; 203 | #if defined(__arch64__) || defined(_LP64) 204 | typedef long int khronos_int64_t; 205 | typedef unsigned long int khronos_uint64_t; 206 | #else 207 | typedef long long int khronos_int64_t; 208 | typedef unsigned long long int khronos_uint64_t; 209 | #endif /* __arch64__ */ 210 | #define KHRONOS_SUPPORT_INT64 1 211 | #define KHRONOS_SUPPORT_FLOAT 1 212 | 213 | #elif 0 214 | 215 | /* 216 | * Hypothetical platform with no float or int64 support 217 | */ 218 | typedef int khronos_int32_t; 219 | typedef unsigned int khronos_uint32_t; 220 | #define KHRONOS_SUPPORT_INT64 0 221 | #define KHRONOS_SUPPORT_FLOAT 0 222 | 223 | #else 224 | 225 | /* 226 | * Generic fallback 227 | */ 228 | #include 229 | typedef int32_t khronos_int32_t; 230 | typedef uint32_t khronos_uint32_t; 231 | typedef int64_t khronos_int64_t; 232 | typedef uint64_t khronos_uint64_t; 233 | #define KHRONOS_SUPPORT_INT64 1 234 | #define KHRONOS_SUPPORT_FLOAT 1 235 | 236 | #endif 237 | 238 | 239 | /* 240 | * Types that are (so far) the same on all platforms 241 | */ 242 | typedef signed char khronos_int8_t; 243 | typedef unsigned char khronos_uint8_t; 244 | typedef signed short int khronos_int16_t; 245 | typedef unsigned short int khronos_uint16_t; 246 | 247 | /* 248 | * Types that differ between LLP64 and LP64 architectures - in LLP64, 249 | * pointers are 64 bits, but 'long' is still 32 bits. Win64 appears 250 | * to be the only LLP64 architecture in current use. 251 | */ 252 | #ifdef KHRONOS_USE_INTPTR_T 253 | typedef intptr_t khronos_intptr_t; 254 | typedef uintptr_t khronos_uintptr_t; 255 | #elif defined(_WIN64) 256 | typedef signed long long int khronos_intptr_t; 257 | typedef unsigned long long int khronos_uintptr_t; 258 | #else 259 | typedef signed long int khronos_intptr_t; 260 | typedef unsigned long int khronos_uintptr_t; 261 | #endif 262 | 263 | #if defined(_WIN64) 264 | typedef signed long long int khronos_ssize_t; 265 | typedef unsigned long long int khronos_usize_t; 266 | #else 267 | typedef signed long int khronos_ssize_t; 268 | typedef unsigned long int khronos_usize_t; 269 | #endif 270 | 271 | #if KHRONOS_SUPPORT_FLOAT 272 | /* 273 | * Float type 274 | */ 275 | typedef float khronos_float_t; 276 | #endif 277 | 278 | #if KHRONOS_SUPPORT_INT64 279 | /* Time types 280 | * 281 | * These types can be used to represent a time interval in nanoseconds or 282 | * an absolute Unadjusted System Time. Unadjusted System Time is the number 283 | * of nanoseconds since some arbitrary system event (e.g. since the last 284 | * time the system booted). The Unadjusted System Time is an unsigned 285 | * 64 bit value that wraps back to 0 every 584 years. Time intervals 286 | * may be either signed or unsigned. 287 | */ 288 | typedef khronos_uint64_t khronos_utime_nanoseconds_t; 289 | typedef khronos_int64_t khronos_stime_nanoseconds_t; 290 | #endif 291 | 292 | /* 293 | * Dummy value used to pad enum types to 32 bits. 294 | */ 295 | #ifndef KHRONOS_MAX_ENUM 296 | #define KHRONOS_MAX_ENUM 0x7FFFFFFF 297 | #endif 298 | 299 | /* 300 | * Enumerated boolean type 301 | * 302 | * Values other than zero should be considered to be true. Therefore 303 | * comparisons should not be made against KHRONOS_TRUE. 304 | */ 305 | typedef enum { 306 | KHRONOS_FALSE = 0, 307 | KHRONOS_TRUE = 1, 308 | KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM 309 | } khronos_boolean_enum_t; 310 | 311 | #endif /* __khrplatform_h_ */ 312 | -------------------------------------------------------------------------------- /vendor/GLFW/glfw3native.h: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * GLFW 3.3 - www.glfw.org 3 | * A library for OpenGL, window and input 4 | *------------------------------------------------------------------------ 5 | * Copyright (c) 2002-2006 Marcus Geelnard 6 | * Copyright (c) 2006-2018 Camilla Löwy 7 | * 8 | * This software is provided 'as-is', without any express or implied 9 | * warranty. In no event will the authors be held liable for any damages 10 | * arising from the use of this software. 11 | * 12 | * Permission is granted to anyone to use this software for any purpose, 13 | * including commercial applications, and to alter it and redistribute it 14 | * freely, subject to the following restrictions: 15 | * 16 | * 1. The origin of this software must not be misrepresented; you must not 17 | * claim that you wrote the original software. If you use this software 18 | * in a product, an acknowledgment in the product documentation would 19 | * be appreciated but is not required. 20 | * 21 | * 2. Altered source versions must be plainly marked as such, and must not 22 | * be misrepresented as being the original software. 23 | * 24 | * 3. This notice may not be removed or altered from any source 25 | * distribution. 26 | * 27 | *************************************************************************/ 28 | 29 | #ifndef _glfw3_native_h_ 30 | #define _glfw3_native_h_ 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | 36 | 37 | /************************************************************************* 38 | * Doxygen documentation 39 | *************************************************************************/ 40 | 41 | /*! @file glfw3native.h 42 | * @brief The header of the native access functions. 43 | * 44 | * This is the header file of the native access functions. See @ref native for 45 | * more information. 46 | */ 47 | /*! @defgroup native Native access 48 | * @brief Functions related to accessing native handles. 49 | * 50 | * **By using the native access functions you assert that you know what you're 51 | * doing and how to fix problems caused by using them. If you don't, you 52 | * shouldn't be using them.** 53 | * 54 | * Before the inclusion of @ref glfw3native.h, you may define zero or more 55 | * window system API macro and zero or more context creation API macros. 56 | * 57 | * The chosen backends must match those the library was compiled for. Failure 58 | * to do this will cause a link-time error. 59 | * 60 | * The available window API macros are: 61 | * * `GLFW_EXPOSE_NATIVE_WIN32` 62 | * * `GLFW_EXPOSE_NATIVE_COCOA` 63 | * * `GLFW_EXPOSE_NATIVE_X11` 64 | * * `GLFW_EXPOSE_NATIVE_WAYLAND` 65 | * 66 | * The available context API macros are: 67 | * * `GLFW_EXPOSE_NATIVE_WGL` 68 | * * `GLFW_EXPOSE_NATIVE_NSGL` 69 | * * `GLFW_EXPOSE_NATIVE_GLX` 70 | * * `GLFW_EXPOSE_NATIVE_EGL` 71 | * * `GLFW_EXPOSE_NATIVE_OSMESA` 72 | * 73 | * These macros select which of the native access functions that are declared 74 | * and which platform-specific headers to include. It is then up your (by 75 | * definition platform-specific) code to handle which of these should be 76 | * defined. 77 | * 78 | * If you do not want the platform-specific headers to be included, define 79 | * `GLFW_NATIVE_INCLUDE_NONE` before including the @ref glfw3native.h header. 80 | * 81 | * @code 82 | * #define GLFW_EXPOSE_NATIVE_WIN32 83 | * #define GLFW_EXPOSE_NATIVE_WGL 84 | * #define GLFW_NATIVE_INCLUDE_NONE 85 | * #include 86 | * @endcode 87 | */ 88 | 89 | 90 | /************************************************************************* 91 | * System headers and types 92 | *************************************************************************/ 93 | 94 | #if !defined(GLFW_NATIVE_INCLUDE_NONE) 95 | 96 | #if defined(GLFW_EXPOSE_NATIVE_WIN32) || defined(GLFW_EXPOSE_NATIVE_WGL) 97 | /* This is a workaround for the fact that glfw3.h needs to export APIENTRY (for 98 | * example to allow applications to correctly declare a GL_KHR_debug callback) 99 | * but windows.h assumes no one will define APIENTRY before it does 100 | */ 101 | #if defined(GLFW_APIENTRY_DEFINED) 102 | #undef APIENTRY 103 | #undef GLFW_APIENTRY_DEFINED 104 | #endif 105 | #include 106 | #elif defined(GLFW_EXPOSE_NATIVE_COCOA) || defined(GLFW_EXPOSE_NATIVE_NSGL) 107 | #if defined(__OBJC__) 108 | #import 109 | #else 110 | #include 111 | #include 112 | #endif 113 | #elif defined(GLFW_EXPOSE_NATIVE_X11) || defined(GLFW_EXPOSE_NATIVE_GLX) 114 | #include 115 | #include 116 | #elif defined(GLFW_EXPOSE_NATIVE_WAYLAND) 117 | #include 118 | #endif 119 | 120 | #if defined(GLFW_EXPOSE_NATIVE_WGL) 121 | /* WGL is declared by windows.h */ 122 | #endif 123 | #if defined(GLFW_EXPOSE_NATIVE_NSGL) 124 | /* NSGL is declared by Cocoa.h */ 125 | #endif 126 | #if defined(GLFW_EXPOSE_NATIVE_GLX) 127 | /* This is a workaround for the fact that glfw3.h defines GLAPIENTRY because by 128 | * default it also acts as an OpenGL header 129 | * However, glx.h will include gl.h, which will define it unconditionally 130 | */ 131 | #if defined(GLFW_GLAPIENTRY_DEFINED) 132 | #undef GLAPIENTRY 133 | #undef GLFW_GLAPIENTRY_DEFINED 134 | #endif 135 | #include 136 | #endif 137 | #if defined(GLFW_EXPOSE_NATIVE_EGL) 138 | #include 139 | #endif 140 | #if defined(GLFW_EXPOSE_NATIVE_OSMESA) 141 | /* This is a workaround for the fact that glfw3.h defines GLAPIENTRY because by 142 | * default it also acts as an OpenGL header 143 | * However, osmesa.h will include gl.h, which will define it unconditionally 144 | */ 145 | #if defined(GLFW_GLAPIENTRY_DEFINED) 146 | #undef GLAPIENTRY 147 | #undef GLFW_GLAPIENTRY_DEFINED 148 | #endif 149 | #include 150 | #endif 151 | 152 | #endif /*GLFW_NATIVE_INCLUDE_NONE*/ 153 | 154 | 155 | /************************************************************************* 156 | * Functions 157 | *************************************************************************/ 158 | 159 | #if defined(GLFW_EXPOSE_NATIVE_WIN32) 160 | /*! @brief Returns the adapter device name of the specified monitor. 161 | * 162 | * @return The UTF-8 encoded adapter device name (for example `\\.\DISPLAY1`) 163 | * of the specified monitor, or `NULL` if an [error](@ref error_handling) 164 | * occurred. 165 | * 166 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. 167 | * 168 | * @thread_safety This function may be called from any thread. Access is not 169 | * synchronized. 170 | * 171 | * @since Added in version 3.1. 172 | * 173 | * @ingroup native 174 | */ 175 | GLFWAPI const char* glfwGetWin32Adapter(GLFWmonitor* monitor); 176 | 177 | /*! @brief Returns the display device name of the specified monitor. 178 | * 179 | * @return The UTF-8 encoded display device name (for example 180 | * `\\.\DISPLAY1\Monitor0`) of the specified monitor, or `NULL` if an 181 | * [error](@ref error_handling) occurred. 182 | * 183 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. 184 | * 185 | * @thread_safety This function may be called from any thread. Access is not 186 | * synchronized. 187 | * 188 | * @since Added in version 3.1. 189 | * 190 | * @ingroup native 191 | */ 192 | GLFWAPI const char* glfwGetWin32Monitor(GLFWmonitor* monitor); 193 | 194 | /*! @brief Returns the `HWND` of the specified window. 195 | * 196 | * @return The `HWND` of the specified window, or `NULL` if an 197 | * [error](@ref error_handling) occurred. 198 | * 199 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. 200 | * 201 | * @remark The `HDC` associated with the window can be queried with the 202 | * [GetDC](https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getdc) 203 | * function. 204 | * @code 205 | * HDC dc = GetDC(glfwGetWin32Window(window)); 206 | * @endcode 207 | * This DC is private and does not need to be released. 208 | * 209 | * @thread_safety This function may be called from any thread. Access is not 210 | * synchronized. 211 | * 212 | * @since Added in version 3.0. 213 | * 214 | * @ingroup native 215 | */ 216 | GLFWAPI HWND glfwGetWin32Window(GLFWwindow* window); 217 | #endif 218 | 219 | #if defined(GLFW_EXPOSE_NATIVE_WGL) 220 | /*! @brief Returns the `HGLRC` of the specified window. 221 | * 222 | * @return The `HGLRC` of the specified window, or `NULL` if an 223 | * [error](@ref error_handling) occurred. 224 | * 225 | * @errors Possible errors include @ref GLFW_NO_WINDOW_CONTEXT and @ref 226 | * GLFW_NOT_INITIALIZED. 227 | * 228 | * @remark The `HDC` associated with the window can be queried with the 229 | * [GetDC](https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getdc) 230 | * function. 231 | * @code 232 | * HDC dc = GetDC(glfwGetWin32Window(window)); 233 | * @endcode 234 | * This DC is private and does not need to be released. 235 | * 236 | * @thread_safety This function may be called from any thread. Access is not 237 | * synchronized. 238 | * 239 | * @since Added in version 3.0. 240 | * 241 | * @ingroup native 242 | */ 243 | GLFWAPI HGLRC glfwGetWGLContext(GLFWwindow* window); 244 | #endif 245 | 246 | #if defined(GLFW_EXPOSE_NATIVE_COCOA) 247 | /*! @brief Returns the `CGDirectDisplayID` of the specified monitor. 248 | * 249 | * @return The `CGDirectDisplayID` of the specified monitor, or 250 | * `kCGNullDirectDisplay` if an [error](@ref error_handling) occurred. 251 | * 252 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. 253 | * 254 | * @thread_safety This function may be called from any thread. Access is not 255 | * synchronized. 256 | * 257 | * @since Added in version 3.1. 258 | * 259 | * @ingroup native 260 | */ 261 | GLFWAPI CGDirectDisplayID glfwGetCocoaMonitor(GLFWmonitor* monitor); 262 | 263 | /*! @brief Returns the `NSWindow` of the specified window. 264 | * 265 | * @return The `NSWindow` of the specified window, or `nil` if an 266 | * [error](@ref error_handling) occurred. 267 | * 268 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. 269 | * 270 | * @thread_safety This function may be called from any thread. Access is not 271 | * synchronized. 272 | * 273 | * @since Added in version 3.0. 274 | * 275 | * @ingroup native 276 | */ 277 | GLFWAPI id glfwGetCocoaWindow(GLFWwindow* window); 278 | #endif 279 | 280 | #if defined(GLFW_EXPOSE_NATIVE_NSGL) 281 | /*! @brief Returns the `NSOpenGLContext` of the specified window. 282 | * 283 | * @return The `NSOpenGLContext` of the specified window, or `nil` if an 284 | * [error](@ref error_handling) occurred. 285 | * 286 | * @errors Possible errors include @ref GLFW_NO_WINDOW_CONTEXT and @ref 287 | * GLFW_NOT_INITIALIZED. 288 | * 289 | * @thread_safety This function may be called from any thread. Access is not 290 | * synchronized. 291 | * 292 | * @since Added in version 3.0. 293 | * 294 | * @ingroup native 295 | */ 296 | GLFWAPI id glfwGetNSGLContext(GLFWwindow* window); 297 | #endif 298 | 299 | #if defined(GLFW_EXPOSE_NATIVE_X11) 300 | /*! @brief Returns the `Display` used by GLFW. 301 | * 302 | * @return The `Display` used by GLFW, or `NULL` if an 303 | * [error](@ref error_handling) occurred. 304 | * 305 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. 306 | * 307 | * @thread_safety This function may be called from any thread. Access is not 308 | * synchronized. 309 | * 310 | * @since Added in version 3.0. 311 | * 312 | * @ingroup native 313 | */ 314 | GLFWAPI Display* glfwGetX11Display(void); 315 | 316 | /*! @brief Returns the `RRCrtc` of the specified monitor. 317 | * 318 | * @return The `RRCrtc` of the specified monitor, or `None` if an 319 | * [error](@ref error_handling) occurred. 320 | * 321 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. 322 | * 323 | * @thread_safety This function may be called from any thread. Access is not 324 | * synchronized. 325 | * 326 | * @since Added in version 3.1. 327 | * 328 | * @ingroup native 329 | */ 330 | GLFWAPI RRCrtc glfwGetX11Adapter(GLFWmonitor* monitor); 331 | 332 | /*! @brief Returns the `RROutput` of the specified monitor. 333 | * 334 | * @return The `RROutput` of the specified monitor, or `None` if an 335 | * [error](@ref error_handling) occurred. 336 | * 337 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. 338 | * 339 | * @thread_safety This function may be called from any thread. Access is not 340 | * synchronized. 341 | * 342 | * @since Added in version 3.1. 343 | * 344 | * @ingroup native 345 | */ 346 | GLFWAPI RROutput glfwGetX11Monitor(GLFWmonitor* monitor); 347 | 348 | /*! @brief Returns the `Window` of the specified window. 349 | * 350 | * @return The `Window` of the specified window, or `None` if an 351 | * [error](@ref error_handling) occurred. 352 | * 353 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. 354 | * 355 | * @thread_safety This function may be called from any thread. Access is not 356 | * synchronized. 357 | * 358 | * @since Added in version 3.0. 359 | * 360 | * @ingroup native 361 | */ 362 | GLFWAPI Window glfwGetX11Window(GLFWwindow* window); 363 | 364 | /*! @brief Sets the current primary selection to the specified string. 365 | * 366 | * @param[in] string A UTF-8 encoded string. 367 | * 368 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref 369 | * GLFW_PLATFORM_ERROR. 370 | * 371 | * @pointer_lifetime The specified string is copied before this function 372 | * returns. 373 | * 374 | * @thread_safety This function must only be called from the main thread. 375 | * 376 | * @sa @ref clipboard 377 | * @sa glfwGetX11SelectionString 378 | * @sa glfwSetClipboardString 379 | * 380 | * @since Added in version 3.3. 381 | * 382 | * @ingroup native 383 | */ 384 | GLFWAPI void glfwSetX11SelectionString(const char* string); 385 | 386 | /*! @brief Returns the contents of the current primary selection as a string. 387 | * 388 | * If the selection is empty or if its contents cannot be converted, `NULL` 389 | * is returned and a @ref GLFW_FORMAT_UNAVAILABLE error is generated. 390 | * 391 | * @return The contents of the selection as a UTF-8 encoded string, or `NULL` 392 | * if an [error](@ref error_handling) occurred. 393 | * 394 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref 395 | * GLFW_PLATFORM_ERROR. 396 | * 397 | * @pointer_lifetime The returned string is allocated and freed by GLFW. You 398 | * should not free it yourself. It is valid until the next call to @ref 399 | * glfwGetX11SelectionString or @ref glfwSetX11SelectionString, or until the 400 | * library is terminated. 401 | * 402 | * @thread_safety This function must only be called from the main thread. 403 | * 404 | * @sa @ref clipboard 405 | * @sa glfwSetX11SelectionString 406 | * @sa glfwGetClipboardString 407 | * 408 | * @since Added in version 3.3. 409 | * 410 | * @ingroup native 411 | */ 412 | GLFWAPI const char* glfwGetX11SelectionString(void); 413 | #endif 414 | 415 | #if defined(GLFW_EXPOSE_NATIVE_GLX) 416 | /*! @brief Returns the `GLXContext` of the specified window. 417 | * 418 | * @return The `GLXContext` of the specified window, or `NULL` if an 419 | * [error](@ref error_handling) occurred. 420 | * 421 | * @errors Possible errors include @ref GLFW_NO_WINDOW_CONTEXT and @ref 422 | * GLFW_NOT_INITIALIZED. 423 | * 424 | * @thread_safety This function may be called from any thread. Access is not 425 | * synchronized. 426 | * 427 | * @since Added in version 3.0. 428 | * 429 | * @ingroup native 430 | */ 431 | GLFWAPI GLXContext glfwGetGLXContext(GLFWwindow* window); 432 | 433 | /*! @brief Returns the `GLXWindow` of the specified window. 434 | * 435 | * @return The `GLXWindow` of the specified window, or `None` if an 436 | * [error](@ref error_handling) occurred. 437 | * 438 | * @errors Possible errors include @ref GLFW_NO_WINDOW_CONTEXT and @ref 439 | * GLFW_NOT_INITIALIZED. 440 | * 441 | * @thread_safety This function may be called from any thread. Access is not 442 | * synchronized. 443 | * 444 | * @since Added in version 3.2. 445 | * 446 | * @ingroup native 447 | */ 448 | GLFWAPI GLXWindow glfwGetGLXWindow(GLFWwindow* window); 449 | #endif 450 | 451 | #if defined(GLFW_EXPOSE_NATIVE_WAYLAND) 452 | /*! @brief Returns the `struct wl_display*` used by GLFW. 453 | * 454 | * @return The `struct wl_display*` used by GLFW, or `NULL` if an 455 | * [error](@ref error_handling) occurred. 456 | * 457 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. 458 | * 459 | * @thread_safety This function may be called from any thread. Access is not 460 | * synchronized. 461 | * 462 | * @since Added in version 3.2. 463 | * 464 | * @ingroup native 465 | */ 466 | GLFWAPI struct wl_display* glfwGetWaylandDisplay(void); 467 | 468 | /*! @brief Returns the `struct wl_output*` of the specified monitor. 469 | * 470 | * @return The `struct wl_output*` of the specified monitor, or `NULL` if an 471 | * [error](@ref error_handling) occurred. 472 | * 473 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. 474 | * 475 | * @thread_safety This function may be called from any thread. Access is not 476 | * synchronized. 477 | * 478 | * @since Added in version 3.2. 479 | * 480 | * @ingroup native 481 | */ 482 | GLFWAPI struct wl_output* glfwGetWaylandMonitor(GLFWmonitor* monitor); 483 | 484 | /*! @brief Returns the main `struct wl_surface*` of the specified window. 485 | * 486 | * @return The main `struct wl_surface*` of the specified window, or `NULL` if 487 | * an [error](@ref error_handling) occurred. 488 | * 489 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. 490 | * 491 | * @thread_safety This function may be called from any thread. Access is not 492 | * synchronized. 493 | * 494 | * @since Added in version 3.2. 495 | * 496 | * @ingroup native 497 | */ 498 | GLFWAPI struct wl_surface* glfwGetWaylandWindow(GLFWwindow* window); 499 | #endif 500 | 501 | #if defined(GLFW_EXPOSE_NATIVE_EGL) 502 | /*! @brief Returns the `EGLDisplay` used by GLFW. 503 | * 504 | * @return The `EGLDisplay` used by GLFW, or `EGL_NO_DISPLAY` if an 505 | * [error](@ref error_handling) occurred. 506 | * 507 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. 508 | * 509 | * @remark Because EGL is initialized on demand, this function will return 510 | * `EGL_NO_DISPLAY` until the first context has been created via EGL. 511 | * 512 | * @thread_safety This function may be called from any thread. Access is not 513 | * synchronized. 514 | * 515 | * @since Added in version 3.0. 516 | * 517 | * @ingroup native 518 | */ 519 | GLFWAPI EGLDisplay glfwGetEGLDisplay(void); 520 | 521 | /*! @brief Returns the `EGLContext` of the specified window. 522 | * 523 | * @return The `EGLContext` of the specified window, or `EGL_NO_CONTEXT` if an 524 | * [error](@ref error_handling) occurred. 525 | * 526 | * @errors Possible errors include @ref GLFW_NO_WINDOW_CONTEXT and @ref 527 | * GLFW_NOT_INITIALIZED. 528 | * 529 | * @thread_safety This function may be called from any thread. Access is not 530 | * synchronized. 531 | * 532 | * @since Added in version 3.0. 533 | * 534 | * @ingroup native 535 | */ 536 | GLFWAPI EGLContext glfwGetEGLContext(GLFWwindow* window); 537 | 538 | /*! @brief Returns the `EGLSurface` of the specified window. 539 | * 540 | * @return The `EGLSurface` of the specified window, or `EGL_NO_SURFACE` if an 541 | * [error](@ref error_handling) occurred. 542 | * 543 | * @errors Possible errors include @ref GLFW_NO_WINDOW_CONTEXT and @ref 544 | * GLFW_NOT_INITIALIZED. 545 | * 546 | * @thread_safety This function may be called from any thread. Access is not 547 | * synchronized. 548 | * 549 | * @since Added in version 3.0. 550 | * 551 | * @ingroup native 552 | */ 553 | GLFWAPI EGLSurface glfwGetEGLSurface(GLFWwindow* window); 554 | #endif 555 | 556 | #if defined(GLFW_EXPOSE_NATIVE_OSMESA) 557 | /*! @brief Retrieves the color buffer associated with the specified window. 558 | * 559 | * @param[in] window The window whose color buffer to retrieve. 560 | * @param[out] width Where to store the width of the color buffer, or `NULL`. 561 | * @param[out] height Where to store the height of the color buffer, or `NULL`. 562 | * @param[out] format Where to store the OSMesa pixel format of the color 563 | * buffer, or `NULL`. 564 | * @param[out] buffer Where to store the address of the color buffer, or 565 | * `NULL`. 566 | * @return `GLFW_TRUE` if successful, or `GLFW_FALSE` if an 567 | * [error](@ref error_handling) occurred. 568 | * 569 | * @errors Possible errors include @ref GLFW_NO_WINDOW_CONTEXT and @ref 570 | * GLFW_NOT_INITIALIZED. 571 | * 572 | * @thread_safety This function may be called from any thread. Access is not 573 | * synchronized. 574 | * 575 | * @since Added in version 3.3. 576 | * 577 | * @ingroup native 578 | */ 579 | GLFWAPI int glfwGetOSMesaColorBuffer(GLFWwindow* window, int* width, int* height, int* format, void** buffer); 580 | 581 | /*! @brief Retrieves the depth buffer associated with the specified window. 582 | * 583 | * @param[in] window The window whose depth buffer to retrieve. 584 | * @param[out] width Where to store the width of the depth buffer, or `NULL`. 585 | * @param[out] height Where to store the height of the depth buffer, or `NULL`. 586 | * @param[out] bytesPerValue Where to store the number of bytes per depth 587 | * buffer element, or `NULL`. 588 | * @param[out] buffer Where to store the address of the depth buffer, or 589 | * `NULL`. 590 | * @return `GLFW_TRUE` if successful, or `GLFW_FALSE` if an 591 | * [error](@ref error_handling) occurred. 592 | * 593 | * @errors Possible errors include @ref GLFW_NO_WINDOW_CONTEXT and @ref 594 | * GLFW_NOT_INITIALIZED. 595 | * 596 | * @thread_safety This function may be called from any thread. Access is not 597 | * synchronized. 598 | * 599 | * @since Added in version 3.3. 600 | * 601 | * @ingroup native 602 | */ 603 | GLFWAPI int glfwGetOSMesaDepthBuffer(GLFWwindow* window, int* width, int* height, int* bytesPerValue, void** buffer); 604 | 605 | /*! @brief Returns the `OSMesaContext` of the specified window. 606 | * 607 | * @return The `OSMesaContext` of the specified window, or `NULL` if an 608 | * [error](@ref error_handling) occurred. 609 | * 610 | * @errors Possible errors include @ref GLFW_NO_WINDOW_CONTEXT and @ref 611 | * GLFW_NOT_INITIALIZED. 612 | * 613 | * @thread_safety This function may be called from any thread. Access is not 614 | * synchronized. 615 | * 616 | * @since Added in version 3.3. 617 | * 618 | * @ingroup native 619 | */ 620 | GLFWAPI OSMesaContext glfwGetOSMesaContext(GLFWwindow* window); 621 | #endif 622 | 623 | #ifdef __cplusplus 624 | } 625 | #endif 626 | 627 | #endif /* _glfw3_native_h_ */ 628 | 629 | -------------------------------------------------------------------------------- /vendor/GLFW/lib/x86/glfw3.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polybiusproxy/Endor/9612e857852d35652c8b2035b7bfa7c07b57fe38/vendor/GLFW/lib/x86/glfw3.dll -------------------------------------------------------------------------------- /vendor/GLFW/lib/x86/glfw3.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polybiusproxy/Endor/9612e857852d35652c8b2035b7bfa7c07b57fe38/vendor/GLFW/lib/x86/glfw3.lib -------------------------------------------------------------------------------- /vendor/GLFW/lib/x86/glfw3_mt.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polybiusproxy/Endor/9612e857852d35652c8b2035b7bfa7c07b57fe38/vendor/GLFW/lib/x86/glfw3_mt.lib -------------------------------------------------------------------------------- /vendor/GLFW/lib/x86/glfw3dll.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polybiusproxy/Endor/9612e857852d35652c8b2035b7bfa7c07b57fe38/vendor/GLFW/lib/x86/glfw3dll.lib -------------------------------------------------------------------------------- /vendor/glfw/lib/x64/glfw3.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polybiusproxy/Endor/9612e857852d35652c8b2035b7bfa7c07b57fe38/vendor/glfw/lib/x64/glfw3.dll -------------------------------------------------------------------------------- /vendor/glfw/lib/x64/glfw3.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polybiusproxy/Endor/9612e857852d35652c8b2035b7bfa7c07b57fe38/vendor/glfw/lib/x64/glfw3.lib -------------------------------------------------------------------------------- /vendor/glfw/lib/x64/glfw3_mt.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polybiusproxy/Endor/9612e857852d35652c8b2035b7bfa7c07b57fe38/vendor/glfw/lib/x64/glfw3_mt.lib -------------------------------------------------------------------------------- /vendor/glfw/lib/x64/glfw3dll.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polybiusproxy/Endor/9612e857852d35652c8b2035b7bfa7c07b57fe38/vendor/glfw/lib/x64/glfw3dll.lib -------------------------------------------------------------------------------- /vendor/libvorbis/include/ogg/ogg.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 * 9 | * by the Xiph.Org Foundation http://www.xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | function: toplevel libogg include 14 | 15 | ********************************************************************/ 16 | #ifndef _OGG_H 17 | #define _OGG_H 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | #include 24 | #include 25 | 26 | typedef struct { 27 | void *iov_base; 28 | size_t iov_len; 29 | } ogg_iovec_t; 30 | 31 | typedef struct { 32 | long endbyte; 33 | int endbit; 34 | 35 | unsigned char *buffer; 36 | unsigned char *ptr; 37 | long storage; 38 | } oggpack_buffer; 39 | 40 | /* ogg_page is used to encapsulate the data in one Ogg bitstream page *****/ 41 | 42 | typedef struct { 43 | unsigned char *header; 44 | long header_len; 45 | unsigned char *body; 46 | long body_len; 47 | } ogg_page; 48 | 49 | /* ogg_stream_state contains the current encode/decode state of a logical 50 | Ogg bitstream **********************************************************/ 51 | 52 | typedef struct { 53 | unsigned char *body_data; /* bytes from packet bodies */ 54 | long body_storage; /* storage elements allocated */ 55 | long body_fill; /* elements stored; fill mark */ 56 | long body_returned; /* elements of fill returned */ 57 | 58 | 59 | int *lacing_vals; /* The values that will go to the segment table */ 60 | ogg_int64_t *granule_vals; /* granulepos values for headers. Not compact 61 | this way, but it is simple coupled to the 62 | lacing fifo */ 63 | long lacing_storage; 64 | long lacing_fill; 65 | long lacing_packet; 66 | long lacing_returned; 67 | 68 | unsigned char header[282]; /* working space for header encode */ 69 | int header_fill; 70 | 71 | int e_o_s; /* set when we have buffered the last packet in the 72 | logical bitstream */ 73 | int b_o_s; /* set after we've written the initial page 74 | of a logical bitstream */ 75 | long serialno; 76 | long pageno; 77 | ogg_int64_t packetno; /* sequence number for decode; the framing 78 | knows where there's a hole in the data, 79 | but we need coupling so that the codec 80 | (which is in a separate abstraction 81 | layer) also knows about the gap */ 82 | ogg_int64_t granulepos; 83 | 84 | } ogg_stream_state; 85 | 86 | /* ogg_packet is used to encapsulate the data and metadata belonging 87 | to a single raw Ogg/Vorbis packet *************************************/ 88 | 89 | typedef struct { 90 | unsigned char *packet; 91 | long bytes; 92 | long b_o_s; 93 | long e_o_s; 94 | 95 | ogg_int64_t granulepos; 96 | 97 | ogg_int64_t packetno; /* sequence number for decode; the framing 98 | knows where there's a hole in the data, 99 | but we need coupling so that the codec 100 | (which is in a separate abstraction 101 | layer) also knows about the gap */ 102 | } ogg_packet; 103 | 104 | typedef struct { 105 | unsigned char *data; 106 | int storage; 107 | int fill; 108 | int returned; 109 | 110 | int unsynced; 111 | int headerbytes; 112 | int bodybytes; 113 | } ogg_sync_state; 114 | 115 | /* Ogg BITSTREAM PRIMITIVES: bitstream ************************/ 116 | 117 | extern void oggpack_writeinit(oggpack_buffer *b); 118 | extern int oggpack_writecheck(oggpack_buffer *b); 119 | extern void oggpack_writetrunc(oggpack_buffer *b,long bits); 120 | extern void oggpack_writealign(oggpack_buffer *b); 121 | extern void oggpack_writecopy(oggpack_buffer *b,void *source,long bits); 122 | extern void oggpack_reset(oggpack_buffer *b); 123 | extern void oggpack_writeclear(oggpack_buffer *b); 124 | extern void oggpack_readinit(oggpack_buffer *b,unsigned char *buf,int bytes); 125 | extern void oggpack_write(oggpack_buffer *b,unsigned long value,int bits); 126 | extern long oggpack_look(oggpack_buffer *b,int bits); 127 | extern long oggpack_look1(oggpack_buffer *b); 128 | extern void oggpack_adv(oggpack_buffer *b,int bits); 129 | extern void oggpack_adv1(oggpack_buffer *b); 130 | extern long oggpack_read(oggpack_buffer *b,int bits); 131 | extern long oggpack_read1(oggpack_buffer *b); 132 | extern long oggpack_bytes(oggpack_buffer *b); 133 | extern long oggpack_bits(oggpack_buffer *b); 134 | extern unsigned char *oggpack_get_buffer(oggpack_buffer *b); 135 | 136 | extern void oggpackB_writeinit(oggpack_buffer *b); 137 | extern int oggpackB_writecheck(oggpack_buffer *b); 138 | extern void oggpackB_writetrunc(oggpack_buffer *b,long bits); 139 | extern void oggpackB_writealign(oggpack_buffer *b); 140 | extern void oggpackB_writecopy(oggpack_buffer *b,void *source,long bits); 141 | extern void oggpackB_reset(oggpack_buffer *b); 142 | extern void oggpackB_writeclear(oggpack_buffer *b); 143 | extern void oggpackB_readinit(oggpack_buffer *b,unsigned char *buf,int bytes); 144 | extern void oggpackB_write(oggpack_buffer *b,unsigned long value,int bits); 145 | extern long oggpackB_look(oggpack_buffer *b,int bits); 146 | extern long oggpackB_look1(oggpack_buffer *b); 147 | extern void oggpackB_adv(oggpack_buffer *b,int bits); 148 | extern void oggpackB_adv1(oggpack_buffer *b); 149 | extern long oggpackB_read(oggpack_buffer *b,int bits); 150 | extern long oggpackB_read1(oggpack_buffer *b); 151 | extern long oggpackB_bytes(oggpack_buffer *b); 152 | extern long oggpackB_bits(oggpack_buffer *b); 153 | extern unsigned char *oggpackB_get_buffer(oggpack_buffer *b); 154 | 155 | /* Ogg BITSTREAM PRIMITIVES: encoding **************************/ 156 | 157 | extern int ogg_stream_packetin(ogg_stream_state *os, ogg_packet *op); 158 | extern int ogg_stream_iovecin(ogg_stream_state *os, ogg_iovec_t *iov, 159 | int count, long e_o_s, ogg_int64_t granulepos); 160 | extern int ogg_stream_pageout(ogg_stream_state *os, ogg_page *og); 161 | extern int ogg_stream_pageout_fill(ogg_stream_state *os, ogg_page *og, int nfill); 162 | extern int ogg_stream_flush(ogg_stream_state *os, ogg_page *og); 163 | extern int ogg_stream_flush_fill(ogg_stream_state *os, ogg_page *og, int nfill); 164 | 165 | /* Ogg BITSTREAM PRIMITIVES: decoding **************************/ 166 | 167 | extern int ogg_sync_init(ogg_sync_state *oy); 168 | extern int ogg_sync_clear(ogg_sync_state *oy); 169 | extern int ogg_sync_reset(ogg_sync_state *oy); 170 | extern int ogg_sync_destroy(ogg_sync_state *oy); 171 | extern int ogg_sync_check(ogg_sync_state *oy); 172 | 173 | extern char *ogg_sync_buffer(ogg_sync_state *oy, long size); 174 | extern int ogg_sync_wrote(ogg_sync_state *oy, long bytes); 175 | extern long ogg_sync_pageseek(ogg_sync_state *oy,ogg_page *og); 176 | extern int ogg_sync_pageout(ogg_sync_state *oy, ogg_page *og); 177 | extern int ogg_stream_pagein(ogg_stream_state *os, ogg_page *og); 178 | extern int ogg_stream_packetout(ogg_stream_state *os,ogg_packet *op); 179 | extern int ogg_stream_packetpeek(ogg_stream_state *os,ogg_packet *op); 180 | 181 | /* Ogg BITSTREAM PRIMITIVES: general ***************************/ 182 | 183 | extern int ogg_stream_init(ogg_stream_state *os,int serialno); 184 | extern int ogg_stream_clear(ogg_stream_state *os); 185 | extern int ogg_stream_reset(ogg_stream_state *os); 186 | extern int ogg_stream_reset_serialno(ogg_stream_state *os,int serialno); 187 | extern int ogg_stream_destroy(ogg_stream_state *os); 188 | extern int ogg_stream_check(ogg_stream_state *os); 189 | extern int ogg_stream_eos(ogg_stream_state *os); 190 | 191 | extern void ogg_page_checksum_set(ogg_page *og); 192 | 193 | extern int ogg_page_version(const ogg_page *og); 194 | extern int ogg_page_continued(const ogg_page *og); 195 | extern int ogg_page_bos(const ogg_page *og); 196 | extern int ogg_page_eos(const ogg_page *og); 197 | extern ogg_int64_t ogg_page_granulepos(const ogg_page *og); 198 | extern int ogg_page_serialno(const ogg_page *og); 199 | extern long ogg_page_pageno(const ogg_page *og); 200 | extern int ogg_page_packets(const ogg_page *og); 201 | 202 | extern void ogg_packet_clear(ogg_packet *op); 203 | 204 | 205 | #ifdef __cplusplus 206 | } 207 | #endif 208 | 209 | #endif /* _OGG_H */ 210 | -------------------------------------------------------------------------------- /vendor/libvorbis/include/ogg/os_types.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2002 * 9 | * by the Xiph.Org Foundation http://www.xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | function: Define a consistent set of types on each platform. 14 | 15 | ********************************************************************/ 16 | #ifndef _OS_TYPES_H 17 | #define _OS_TYPES_H 18 | 19 | /* make it easy on the folks that want to compile the libs with a 20 | different malloc than stdlib */ 21 | #define _ogg_malloc malloc 22 | #define _ogg_calloc calloc 23 | #define _ogg_realloc realloc 24 | #define _ogg_free free 25 | 26 | #if defined(_WIN32) 27 | 28 | # if defined(__CYGWIN__) 29 | # include 30 | typedef int16_t ogg_int16_t; 31 | typedef uint16_t ogg_uint16_t; 32 | typedef int32_t ogg_int32_t; 33 | typedef uint32_t ogg_uint32_t; 34 | typedef int64_t ogg_int64_t; 35 | typedef uint64_t ogg_uint64_t; 36 | # elif defined(__MINGW32__) 37 | # include 38 | typedef short ogg_int16_t; 39 | typedef unsigned short ogg_uint16_t; 40 | typedef int ogg_int32_t; 41 | typedef unsigned int ogg_uint32_t; 42 | typedef long long ogg_int64_t; 43 | typedef unsigned long long ogg_uint64_t; 44 | # elif defined(__MWERKS__) 45 | typedef long long ogg_int64_t; 46 | typedef unsigned long long ogg_uint64_t; 47 | typedef int ogg_int32_t; 48 | typedef unsigned int ogg_uint32_t; 49 | typedef short ogg_int16_t; 50 | typedef unsigned short ogg_uint16_t; 51 | # else 52 | # if defined(_MSC_VER) && (_MSC_VER >= 1800) /* MSVC 2013 and newer */ 53 | # include 54 | typedef int16_t ogg_int16_t; 55 | typedef uint16_t ogg_uint16_t; 56 | typedef int32_t ogg_int32_t; 57 | typedef uint32_t ogg_uint32_t; 58 | typedef int64_t ogg_int64_t; 59 | typedef uint64_t ogg_uint64_t; 60 | # else 61 | /* MSVC/Borland */ 62 | typedef __int64 ogg_int64_t; 63 | typedef __int32 ogg_int32_t; 64 | typedef unsigned __int32 ogg_uint32_t; 65 | typedef unsigned __int64 ogg_uint64_t; 66 | typedef __int16 ogg_int16_t; 67 | typedef unsigned __int16 ogg_uint16_t; 68 | # endif 69 | # endif 70 | 71 | #elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */ 72 | 73 | # include 74 | typedef int16_t ogg_int16_t; 75 | typedef u_int16_t ogg_uint16_t; 76 | typedef int32_t ogg_int32_t; 77 | typedef u_int32_t ogg_uint32_t; 78 | typedef int64_t ogg_int64_t; 79 | typedef u_int64_t ogg_uint64_t; 80 | 81 | #elif defined(__HAIKU__) 82 | 83 | /* Haiku */ 84 | # include 85 | typedef short ogg_int16_t; 86 | typedef unsigned short ogg_uint16_t; 87 | typedef int ogg_int32_t; 88 | typedef unsigned int ogg_uint32_t; 89 | typedef long long ogg_int64_t; 90 | typedef unsigned long long ogg_uint64_t; 91 | 92 | #elif defined(__BEOS__) 93 | 94 | /* Be */ 95 | # include 96 | typedef int16_t ogg_int16_t; 97 | typedef uint16_t ogg_uint16_t; 98 | typedef int32_t ogg_int32_t; 99 | typedef uint32_t ogg_uint32_t; 100 | typedef int64_t ogg_int64_t; 101 | typedef uint64_t ogg_uint64_t; 102 | 103 | #elif defined (__EMX__) 104 | 105 | /* OS/2 GCC */ 106 | typedef short ogg_int16_t; 107 | typedef unsigned short ogg_uint16_t; 108 | typedef int ogg_int32_t; 109 | typedef unsigned int ogg_uint32_t; 110 | typedef long long ogg_int64_t; 111 | typedef unsigned long long ogg_uint64_t; 112 | 113 | 114 | #elif defined (DJGPP) 115 | 116 | /* DJGPP */ 117 | typedef short ogg_int16_t; 118 | typedef int ogg_int32_t; 119 | typedef unsigned int ogg_uint32_t; 120 | typedef long long ogg_int64_t; 121 | typedef unsigned long long ogg_uint64_t; 122 | 123 | #elif defined(R5900) 124 | 125 | /* PS2 EE */ 126 | typedef long ogg_int64_t; 127 | typedef unsigned long ogg_uint64_t; 128 | typedef int ogg_int32_t; 129 | typedef unsigned ogg_uint32_t; 130 | typedef short ogg_int16_t; 131 | 132 | #elif defined(__SYMBIAN32__) 133 | 134 | /* Symbian GCC */ 135 | typedef signed short ogg_int16_t; 136 | typedef unsigned short ogg_uint16_t; 137 | typedef signed int ogg_int32_t; 138 | typedef unsigned int ogg_uint32_t; 139 | typedef long long int ogg_int64_t; 140 | typedef unsigned long long int ogg_uint64_t; 141 | 142 | #elif defined(__TMS320C6X__) 143 | 144 | /* TI C64x compiler */ 145 | typedef signed short ogg_int16_t; 146 | typedef unsigned short ogg_uint16_t; 147 | typedef signed int ogg_int32_t; 148 | typedef unsigned int ogg_uint32_t; 149 | typedef long long int ogg_int64_t; 150 | typedef unsigned long long int ogg_uint64_t; 151 | 152 | #else 153 | 154 | # include 155 | 156 | #endif 157 | 158 | #endif /* _OS_TYPES_H */ 159 | -------------------------------------------------------------------------------- /vendor/libvorbis/include/vorbis/codec.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 * 9 | * by the Xiph.Org Foundation https://xiph.org/ * 10 | 11 | ******************************************************************** 12 | 13 | function: libvorbis codec headers 14 | 15 | ********************************************************************/ 16 | 17 | #ifndef _vorbis_codec_h_ 18 | #define _vorbis_codec_h_ 19 | 20 | #ifdef __cplusplus 21 | extern "C" 22 | { 23 | #endif /* __cplusplus */ 24 | 25 | #include 26 | 27 | typedef struct vorbis_info{ 28 | int version; 29 | int channels; 30 | long rate; 31 | 32 | /* The below bitrate declarations are *hints*. 33 | Combinations of the three values carry the following implications: 34 | 35 | all three set to the same value: 36 | implies a fixed rate bitstream 37 | only nominal set: 38 | implies a VBR stream that averages the nominal bitrate. No hard 39 | upper/lower limit 40 | upper and or lower set: 41 | implies a VBR bitstream that obeys the bitrate limits. nominal 42 | may also be set to give a nominal rate. 43 | none set: 44 | the coder does not care to speculate. 45 | */ 46 | 47 | long bitrate_upper; 48 | long bitrate_nominal; 49 | long bitrate_lower; 50 | long bitrate_window; 51 | 52 | void *codec_setup; 53 | } vorbis_info; 54 | 55 | /* vorbis_dsp_state buffers the current vorbis audio 56 | analysis/synthesis state. The DSP state belongs to a specific 57 | logical bitstream ****************************************************/ 58 | typedef struct vorbis_dsp_state{ 59 | int analysisp; 60 | vorbis_info *vi; 61 | 62 | float **pcm; 63 | float **pcmret; 64 | int pcm_storage; 65 | int pcm_current; 66 | int pcm_returned; 67 | 68 | int preextrapolate; 69 | int eofflag; 70 | 71 | long lW; 72 | long W; 73 | long nW; 74 | long centerW; 75 | 76 | ogg_int64_t granulepos; 77 | ogg_int64_t sequence; 78 | 79 | ogg_int64_t glue_bits; 80 | ogg_int64_t time_bits; 81 | ogg_int64_t floor_bits; 82 | ogg_int64_t res_bits; 83 | 84 | void *backend_state; 85 | } vorbis_dsp_state; 86 | 87 | typedef struct vorbis_block{ 88 | /* necessary stream state for linking to the framing abstraction */ 89 | float **pcm; /* this is a pointer into local storage */ 90 | oggpack_buffer opb; 91 | 92 | long lW; 93 | long W; 94 | long nW; 95 | int pcmend; 96 | int mode; 97 | 98 | int eofflag; 99 | ogg_int64_t granulepos; 100 | ogg_int64_t sequence; 101 | vorbis_dsp_state *vd; /* For read-only access of configuration */ 102 | 103 | /* local storage to avoid remallocing; it's up to the mapping to 104 | structure it */ 105 | void *localstore; 106 | long localtop; 107 | long localalloc; 108 | long totaluse; 109 | struct alloc_chain *reap; 110 | 111 | /* bitmetrics for the frame */ 112 | long glue_bits; 113 | long time_bits; 114 | long floor_bits; 115 | long res_bits; 116 | 117 | void *internal; 118 | 119 | } vorbis_block; 120 | 121 | /* vorbis_block is a single block of data to be processed as part of 122 | the analysis/synthesis stream; it belongs to a specific logical 123 | bitstream, but is independent from other vorbis_blocks belonging to 124 | that logical bitstream. *************************************************/ 125 | 126 | struct alloc_chain{ 127 | void *ptr; 128 | struct alloc_chain *next; 129 | }; 130 | 131 | /* vorbis_info contains all the setup information specific to the 132 | specific compression/decompression mode in progress (eg, 133 | psychoacoustic settings, channel setup, options, codebook 134 | etc). vorbis_info and substructures are in backends.h. 135 | *********************************************************************/ 136 | 137 | /* the comments are not part of vorbis_info so that vorbis_info can be 138 | static storage */ 139 | typedef struct vorbis_comment{ 140 | /* unlimited user comment fields. libvorbis writes 'libvorbis' 141 | whatever vendor is set to in encode */ 142 | char **user_comments; 143 | int *comment_lengths; 144 | int comments; 145 | char *vendor; 146 | 147 | } vorbis_comment; 148 | 149 | 150 | /* libvorbis encodes in two abstraction layers; first we perform DSP 151 | and produce a packet (see docs/analysis.txt). The packet is then 152 | coded into a framed OggSquish bitstream by the second layer (see 153 | docs/framing.txt). Decode is the reverse process; we sync/frame 154 | the bitstream and extract individual packets, then decode the 155 | packet back into PCM audio. 156 | 157 | The extra framing/packetizing is used in streaming formats, such as 158 | files. Over the net (such as with UDP), the framing and 159 | packetization aren't necessary as they're provided by the transport 160 | and the streaming layer is not used */ 161 | 162 | /* Vorbis PRIMITIVES: general ***************************************/ 163 | 164 | extern void vorbis_info_init(vorbis_info *vi); 165 | extern void vorbis_info_clear(vorbis_info *vi); 166 | extern int vorbis_info_blocksize(vorbis_info *vi,int zo); 167 | extern void vorbis_comment_init(vorbis_comment *vc); 168 | extern void vorbis_comment_add(vorbis_comment *vc, const char *comment); 169 | extern void vorbis_comment_add_tag(vorbis_comment *vc, 170 | const char *tag, const char *contents); 171 | extern char *vorbis_comment_query(vorbis_comment *vc, const char *tag, int count); 172 | extern int vorbis_comment_query_count(vorbis_comment *vc, const char *tag); 173 | extern void vorbis_comment_clear(vorbis_comment *vc); 174 | 175 | extern int vorbis_block_init(vorbis_dsp_state *v, vorbis_block *vb); 176 | extern int vorbis_block_clear(vorbis_block *vb); 177 | extern void vorbis_dsp_clear(vorbis_dsp_state *v); 178 | extern double vorbis_granule_time(vorbis_dsp_state *v, 179 | ogg_int64_t granulepos); 180 | 181 | extern const char *vorbis_version_string(void); 182 | 183 | /* Vorbis PRIMITIVES: analysis/DSP layer ****************************/ 184 | 185 | extern int vorbis_analysis_init(vorbis_dsp_state *v,vorbis_info *vi); 186 | extern int vorbis_commentheader_out(vorbis_comment *vc, ogg_packet *op); 187 | extern int vorbis_analysis_headerout(vorbis_dsp_state *v, 188 | vorbis_comment *vc, 189 | ogg_packet *op, 190 | ogg_packet *op_comm, 191 | ogg_packet *op_code); 192 | extern float **vorbis_analysis_buffer(vorbis_dsp_state *v,int vals); 193 | extern int vorbis_analysis_wrote(vorbis_dsp_state *v,int vals); 194 | extern int vorbis_analysis_blockout(vorbis_dsp_state *v,vorbis_block *vb); 195 | extern int vorbis_analysis(vorbis_block *vb,ogg_packet *op); 196 | 197 | extern int vorbis_bitrate_addblock(vorbis_block *vb); 198 | extern int vorbis_bitrate_flushpacket(vorbis_dsp_state *vd, 199 | ogg_packet *op); 200 | 201 | /* Vorbis PRIMITIVES: synthesis layer *******************************/ 202 | extern int vorbis_synthesis_idheader(ogg_packet *op); 203 | extern int vorbis_synthesis_headerin(vorbis_info *vi,vorbis_comment *vc, 204 | ogg_packet *op); 205 | 206 | extern int vorbis_synthesis_init(vorbis_dsp_state *v,vorbis_info *vi); 207 | extern int vorbis_synthesis_restart(vorbis_dsp_state *v); 208 | extern int vorbis_synthesis(vorbis_block *vb,ogg_packet *op); 209 | extern int vorbis_synthesis_trackonly(vorbis_block *vb,ogg_packet *op); 210 | extern int vorbis_synthesis_blockin(vorbis_dsp_state *v,vorbis_block *vb); 211 | extern int vorbis_synthesis_pcmout(vorbis_dsp_state *v,float ***pcm); 212 | extern int vorbis_synthesis_lapout(vorbis_dsp_state *v,float ***pcm); 213 | extern int vorbis_synthesis_read(vorbis_dsp_state *v,int samples); 214 | extern long vorbis_packet_blocksize(vorbis_info *vi,ogg_packet *op); 215 | 216 | extern int vorbis_synthesis_halfrate(vorbis_info *v,int flag); 217 | extern int vorbis_synthesis_halfrate_p(vorbis_info *v); 218 | 219 | /* Vorbis ERRORS and return codes ***********************************/ 220 | 221 | #define OV_FALSE -1 222 | #define OV_EOF -2 223 | #define OV_HOLE -3 224 | 225 | #define OV_EREAD -128 226 | #define OV_EFAULT -129 227 | #define OV_EIMPL -130 228 | #define OV_EINVAL -131 229 | #define OV_ENOTVORBIS -132 230 | #define OV_EBADHEADER -133 231 | #define OV_EVERSION -134 232 | #define OV_ENOTAUDIO -135 233 | #define OV_EBADPACKET -136 234 | #define OV_EBADLINK -137 235 | #define OV_ENOSEEK -138 236 | 237 | #ifdef __cplusplus 238 | } 239 | #endif /* __cplusplus */ 240 | 241 | #endif 242 | 243 | -------------------------------------------------------------------------------- /vendor/libvorbis/include/vorbis/vorbisenc.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 * 9 | * by the Xiph.Org Foundation https://xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | function: vorbis encode-engine setup 14 | 15 | ********************************************************************/ 16 | 17 | /** \file 18 | * Libvorbisenc is a convenient API for setting up an encoding 19 | * environment using libvorbis. Libvorbisenc encapsulates the 20 | * actions needed to set up the encoder properly. 21 | */ 22 | 23 | #ifndef _OV_ENC_H_ 24 | #define _OV_ENC_H_ 25 | 26 | #ifdef __cplusplus 27 | extern "C" 28 | { 29 | #endif /* __cplusplus */ 30 | 31 | #include "codec.h" 32 | 33 | /** 34 | * This is the primary function within libvorbisenc for setting up managed 35 | * bitrate modes. 36 | * 37 | * Before this function is called, the \ref vorbis_info 38 | * struct should be initialized by using vorbis_info_init() from the libvorbis 39 | * API. After encoding, vorbis_info_clear() should be called. 40 | * 41 | * The max_bitrate, nominal_bitrate, and min_bitrate settings are used to set 42 | * constraints for the encoded file. This function uses these settings to 43 | * select the appropriate encoding mode and set it up. 44 | * 45 | * \param vi Pointer to an initialized \ref vorbis_info struct. 46 | * \param channels The number of channels to be encoded. 47 | * \param rate The sampling rate of the source audio. 48 | * \param max_bitrate Desired maximum bitrate (limit). -1 indicates unset. 49 | * \param nominal_bitrate Desired average, or central, bitrate. -1 indicates unset. 50 | * \param min_bitrate Desired minimum bitrate. -1 indicates unset. 51 | * 52 | * \return Zero for success, and negative values for failure. 53 | * 54 | * \retval 0 Success. 55 | * \retval OV_EFAULT Internal logic fault; indicates a bug or heap/stack corruption. 56 | * \retval OV_EINVAL Invalid setup request, eg, out of range argument. 57 | * \retval OV_EIMPL Unimplemented mode; unable to comply with bitrate request. 58 | */ 59 | extern int vorbis_encode_init(vorbis_info *vi, 60 | long channels, 61 | long rate, 62 | 63 | long max_bitrate, 64 | long nominal_bitrate, 65 | long min_bitrate); 66 | 67 | /** 68 | * This function performs step-one of a three-step bitrate-managed encode 69 | * setup. It functions similarly to the one-step setup performed by \ref 70 | * vorbis_encode_init but allows an application to make further encode setup 71 | * tweaks using \ref vorbis_encode_ctl before finally calling \ref 72 | * vorbis_encode_setup_init to complete the setup process. 73 | * 74 | * Before this function is called, the \ref vorbis_info struct should be 75 | * initialized by using vorbis_info_init() from the libvorbis API. After 76 | * encoding, vorbis_info_clear() should be called. 77 | * 78 | * The max_bitrate, nominal_bitrate, and min_bitrate settings are used to set 79 | * constraints for the encoded file. This function uses these settings to 80 | * select the appropriate encoding mode and set it up. 81 | * 82 | * \param vi Pointer to an initialized vorbis_info struct. 83 | * \param channels The number of channels to be encoded. 84 | * \param rate The sampling rate of the source audio. 85 | * \param max_bitrate Desired maximum bitrate (limit). -1 indicates unset. 86 | * \param nominal_bitrate Desired average, or central, bitrate. -1 indicates unset. 87 | * \param min_bitrate Desired minimum bitrate. -1 indicates unset. 88 | * 89 | * \return Zero for success, and negative for failure. 90 | * 91 | * \retval 0 Success 92 | * \retval OV_EFAULT Internal logic fault; indicates a bug or heap/stack corruption. 93 | * \retval OV_EINVAL Invalid setup request, eg, out of range argument. 94 | * \retval OV_EIMPL Unimplemented mode; unable to comply with bitrate request. 95 | */ 96 | extern int vorbis_encode_setup_managed(vorbis_info *vi, 97 | long channels, 98 | long rate, 99 | 100 | long max_bitrate, 101 | long nominal_bitrate, 102 | long min_bitrate); 103 | 104 | /** 105 | * This function performs step-one of a three-step variable bitrate 106 | * (quality-based) encode setup. It functions similarly to the one-step setup 107 | * performed by \ref vorbis_encode_init_vbr() but allows an application to 108 | * make further encode setup tweaks using \ref vorbis_encode_ctl() before 109 | * finally calling \ref vorbis_encode_setup_init to complete the setup 110 | * process. 111 | * 112 | * Before this function is called, the \ref vorbis_info struct should be 113 | * initialized by using \ref vorbis_info_init() from the libvorbis API. After 114 | * encoding, vorbis_info_clear() should be called. 115 | * 116 | * \param vi Pointer to an initialized vorbis_info struct. 117 | * \param channels The number of channels to be encoded. 118 | * \param rate The sampling rate of the source audio. 119 | * \param quality Desired quality level, currently from -0.1 to 1.0 (lo to hi). 120 | * 121 | * \return Zero for success, and negative values for failure. 122 | * 123 | * \retval 0 Success 124 | * \retval OV_EFAULT Internal logic fault; indicates a bug or heap/stack corruption. 125 | * \retval OV_EINVAL Invalid setup request, eg, out of range argument. 126 | * \retval OV_EIMPL Unimplemented mode; unable to comply with quality level request. 127 | */ 128 | extern int vorbis_encode_setup_vbr(vorbis_info *vi, 129 | long channels, 130 | long rate, 131 | 132 | float quality 133 | ); 134 | 135 | /** 136 | * This is the primary function within libvorbisenc for setting up variable 137 | * bitrate ("quality" based) modes. 138 | * 139 | * 140 | * Before this function is called, the vorbis_info struct should be 141 | * initialized by using vorbis_info_init() from the libvorbis API. After 142 | * encoding, vorbis_info_clear() should be called. 143 | * 144 | * \param vi Pointer to an initialized vorbis_info struct. 145 | * \param channels The number of channels to be encoded. 146 | * \param rate The sampling rate of the source audio. 147 | * \param base_quality Desired quality level, currently from -0.1 to 1.0 (lo to hi). 148 | * 149 | * 150 | * \return Zero for success, or a negative number for failure. 151 | * 152 | * \retval 0 Success 153 | * \retval OV_EFAULT Internal logic fault; indicates a bug or heap/stack corruption. 154 | * \retval OV_EINVAL Invalid setup request, eg, out of range argument. 155 | * \retval OV_EIMPL Unimplemented mode; unable to comply with quality level request. 156 | */ 157 | extern int vorbis_encode_init_vbr(vorbis_info *vi, 158 | long channels, 159 | long rate, 160 | 161 | float base_quality 162 | ); 163 | 164 | /** 165 | * This function performs the last stage of three-step encoding setup, as 166 | * described in the API overview under managed bitrate modes. 167 | * 168 | * Before this function is called, the \ref vorbis_info struct should be 169 | * initialized by using vorbis_info_init() from the libvorbis API, one of 170 | * \ref vorbis_encode_setup_managed() or \ref vorbis_encode_setup_vbr() called to 171 | * initialize the high-level encoding setup, and \ref vorbis_encode_ctl() 172 | * called if necessary to make encoding setup changes. 173 | * vorbis_encode_setup_init() finalizes the highlevel encoding structure into 174 | * a complete encoding setup after which the application may make no further 175 | * setup changes. 176 | * 177 | * After encoding, vorbis_info_clear() should be called. 178 | * 179 | * \param vi Pointer to an initialized \ref vorbis_info struct. 180 | * 181 | * \return Zero for success, and negative values for failure. 182 | * 183 | * \retval 0 Success. 184 | * \retval OV_EFAULT Internal logic fault; indicates a bug or heap/stack corruption. 185 | * 186 | * \retval OV_EINVAL Attempt to use vorbis_encode_setup_init() without first 187 | * calling one of vorbis_encode_setup_managed() or vorbis_encode_setup_vbr() to 188 | * initialize the high-level encoding setup 189 | * 190 | */ 191 | extern int vorbis_encode_setup_init(vorbis_info *vi); 192 | 193 | /** 194 | * This function implements a generic interface to miscellaneous encoder 195 | * settings similar to the classic UNIX 'ioctl()' system call. Applications 196 | * may use vorbis_encode_ctl() to query or set bitrate management or quality 197 | * mode details by using one of several \e request arguments detailed below. 198 | * vorbis_encode_ctl() must be called after one of 199 | * vorbis_encode_setup_managed() or vorbis_encode_setup_vbr(). When used 200 | * to modify settings, \ref vorbis_encode_ctl() must be called before \ref 201 | * vorbis_encode_setup_init(). 202 | * 203 | * \param vi Pointer to an initialized vorbis_info struct. 204 | * 205 | * \param number Specifies the desired action; See \ref encctlcodes "the list 206 | * of available requests". 207 | * 208 | * \param arg void * pointing to a data structure matching the request 209 | * argument. 210 | * 211 | * \retval 0 Success. Any further return information (such as the result of a 212 | * query) is placed into the storage pointed to by *arg. 213 | * 214 | * \retval OV_EINVAL Invalid argument, or an attempt to modify a setting after 215 | * calling vorbis_encode_setup_init(). 216 | * 217 | * \retval OV_EIMPL Unimplemented or unknown request 218 | */ 219 | extern int vorbis_encode_ctl(vorbis_info *vi,int number,void *arg); 220 | 221 | /** 222 | * \deprecated This is a deprecated interface. Please use vorbis_encode_ctl() 223 | * with the \ref ovectl_ratemanage2_arg struct and \ref 224 | * OV_ECTL_RATEMANAGE2_GET and \ref OV_ECTL_RATEMANAGE2_SET calls in new code. 225 | * 226 | * The \ref ovectl_ratemanage_arg structure is used with vorbis_encode_ctl() 227 | * and the \ref OV_ECTL_RATEMANAGE_GET, \ref OV_ECTL_RATEMANAGE_SET, \ref 228 | * OV_ECTL_RATEMANAGE_AVG, \ref OV_ECTL_RATEMANAGE_HARD calls in order to 229 | * query and modify specifics of the encoder's bitrate management 230 | * configuration. 231 | */ 232 | struct ovectl_ratemanage_arg { 233 | int management_active; /**< nonzero if bitrate management is active*/ 234 | /** hard lower limit (in kilobits per second) below which the stream bitrate 235 | will never be allowed for any given bitrate_hard_window seconds of time.*/ 236 | long bitrate_hard_min; 237 | /** hard upper limit (in kilobits per second) above which the stream bitrate 238 | will never be allowed for any given bitrate_hard_window seconds of time.*/ 239 | long bitrate_hard_max; 240 | /** the window period (in seconds) used to regulate the hard bitrate minimum 241 | and maximum*/ 242 | double bitrate_hard_window; 243 | /** soft lower limit (in kilobits per second) below which the average bitrate 244 | tracker will start nudging the bitrate higher.*/ 245 | long bitrate_av_lo; 246 | /** soft upper limit (in kilobits per second) above which the average bitrate 247 | tracker will start nudging the bitrate lower.*/ 248 | long bitrate_av_hi; 249 | /** the window period (in seconds) used to regulate the average bitrate 250 | minimum and maximum.*/ 251 | double bitrate_av_window; 252 | /** Regulates the relative centering of the average and hard windows; in 253 | libvorbis 1.0 and 1.0.1, the hard window regulation overlapped but 254 | followed the average window regulation. In libvorbis 1.1 a bit-reservoir 255 | interface replaces the old windowing interface; the older windowing 256 | interface is simulated and this field has no effect.*/ 257 | double bitrate_av_window_center; 258 | }; 259 | 260 | /** 261 | * \name struct ovectl_ratemanage2_arg 262 | * 263 | * The ovectl_ratemanage2_arg structure is used with vorbis_encode_ctl() and 264 | * the OV_ECTL_RATEMANAGE2_GET and OV_ECTL_RATEMANAGE2_SET calls in order to 265 | * query and modify specifics of the encoder's bitrate management 266 | * configuration. 267 | * 268 | */ 269 | struct ovectl_ratemanage2_arg { 270 | int management_active; /**< nonzero if bitrate management is active */ 271 | /** Lower allowed bitrate limit in kilobits per second */ 272 | long bitrate_limit_min_kbps; 273 | /** Upper allowed bitrate limit in kilobits per second */ 274 | long bitrate_limit_max_kbps; 275 | long bitrate_limit_reservoir_bits; /**struct ovectl_ratemanage2_arg * 307 | * 308 | * Used to query the current encoder bitrate management setting. Also used to 309 | * initialize fields of an ovectl_ratemanage2_arg structure for use with 310 | * \ref OV_ECTL_RATEMANAGE2_SET. 311 | */ 312 | #define OV_ECTL_RATEMANAGE2_GET 0x14 313 | 314 | /** 315 | * Set the current encoder bitrate management settings. 316 | * 317 | * Argument: struct ovectl_ratemanage2_arg * 318 | * 319 | * Used to set the current encoder bitrate management settings to the values 320 | * listed in the ovectl_ratemanage2_arg. Passing a NULL pointer will disable 321 | * bitrate management. 322 | */ 323 | #define OV_ECTL_RATEMANAGE2_SET 0x15 324 | 325 | /** 326 | * Returns the current encoder hard-lowpass setting (kHz) in the double 327 | * pointed to by arg. 328 | * 329 | * Argument: double * 330 | */ 331 | #define OV_ECTL_LOWPASS_GET 0x20 332 | 333 | /** 334 | * Sets the encoder hard-lowpass to the value (kHz) pointed to by arg. Valid 335 | * lowpass settings range from 2 to 99. 336 | * 337 | * Argument: double * 338 | */ 339 | #define OV_ECTL_LOWPASS_SET 0x21 340 | 341 | /** 342 | * Returns the current encoder impulse block setting in the double pointed 343 | * to by arg. 344 | * 345 | * Argument: double * 346 | */ 347 | #define OV_ECTL_IBLOCK_GET 0x30 348 | 349 | /** 350 | * Sets the impulse block bias to the the value pointed to by arg. 351 | * 352 | * Argument: double * 353 | * 354 | * Valid range is -15.0 to 0.0 [default]. A negative impulse block bias will 355 | * direct to encoder to use more bits when incoding short blocks that contain 356 | * strong impulses, thus improving the accuracy of impulse encoding. 357 | */ 358 | #define OV_ECTL_IBLOCK_SET 0x31 359 | 360 | /** 361 | * Returns the current encoder coupling setting in the int pointed 362 | * to by arg. 363 | * 364 | * Argument: int * 365 | */ 366 | #define OV_ECTL_COUPLING_GET 0x40 367 | 368 | /** 369 | * Enables/disables channel coupling in multichannel encoding according to arg. 370 | * 371 | * Argument: int * 372 | * 373 | * Zero disables channel coupling for multichannel inputs, nonzer enables 374 | * channel coupling. Setting has no effect on monophonic encoding or 375 | * multichannel counts that do not offer coupling. At present, coupling is 376 | * available for stereo and 5.1 encoding. 377 | */ 378 | #define OV_ECTL_COUPLING_SET 0x41 379 | 380 | /* deprecated rate management supported only for compatibility */ 381 | 382 | /** 383 | * Old interface to querying bitrate management settings. 384 | * 385 | * Deprecated after move to bit-reservoir style management in 1.1 rendered 386 | * this interface partially obsolete. 387 | 388 | * \deprecated Please use \ref OV_ECTL_RATEMANAGE2_GET instead. 389 | * 390 | * Argument: struct ovectl_ratemanage_arg * 391 | */ 392 | #define OV_ECTL_RATEMANAGE_GET 0x10 393 | /** 394 | * Old interface to modifying bitrate management settings. 395 | * 396 | * deprecated after move to bit-reservoir style management in 1.1 rendered 397 | * this interface partially obsolete. 398 | * 399 | * \deprecated Please use \ref OV_ECTL_RATEMANAGE2_SET instead. 400 | * 401 | * Argument: struct ovectl_ratemanage_arg * 402 | */ 403 | #define OV_ECTL_RATEMANAGE_SET 0x11 404 | /** 405 | * Old interface to setting average-bitrate encoding mode. 406 | * 407 | * Deprecated after move to bit-reservoir style management in 1.1 rendered 408 | * this interface partially obsolete. 409 | * 410 | * \deprecated Please use \ref OV_ECTL_RATEMANAGE2_SET instead. 411 | * 412 | * Argument: struct ovectl_ratemanage_arg * 413 | */ 414 | #define OV_ECTL_RATEMANAGE_AVG 0x12 415 | /** 416 | * Old interface to setting bounded-bitrate encoding modes. 417 | * 418 | * deprecated after move to bit-reservoir style management in 1.1 rendered 419 | * this interface partially obsolete. 420 | * 421 | * \deprecated Please use \ref OV_ECTL_RATEMANAGE2_SET instead. 422 | * 423 | * Argument: struct ovectl_ratemanage_arg * 424 | */ 425 | #define OV_ECTL_RATEMANAGE_HARD 0x13 426 | 427 | /*@}*/ 428 | 429 | 430 | 431 | #ifdef __cplusplus 432 | } 433 | #endif /* __cplusplus */ 434 | 435 | #endif 436 | -------------------------------------------------------------------------------- /vendor/libvorbis/include/vorbis/vorbisfile.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 * 9 | * by the Xiph.Org Foundation https://xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | function: stdio-based convenience library for opening/seeking/decoding 14 | 15 | ********************************************************************/ 16 | 17 | #ifndef _OV_FILE_H_ 18 | #define _OV_FILE_H_ 19 | 20 | #ifdef __cplusplus 21 | extern "C" 22 | { 23 | #endif /* __cplusplus */ 24 | 25 | #include 26 | #include "codec.h" 27 | 28 | /* The function prototypes for the callbacks are basically the same as for 29 | * the stdio functions fread, fseek, fclose, ftell. 30 | * The one difference is that the FILE * arguments have been replaced with 31 | * a void * - this is to be used as a pointer to whatever internal data these 32 | * functions might need. In the stdio case, it's just a FILE * cast to a void * 33 | * 34 | * If you use other functions, check the docs for these functions and return 35 | * the right values. For seek_func(), you *MUST* return -1 if the stream is 36 | * unseekable 37 | */ 38 | typedef struct { 39 | size_t (*read_func) (void *ptr, size_t size, size_t nmemb, void *datasource); 40 | int (*seek_func) (void *datasource, ogg_int64_t offset, int whence); 41 | int (*close_func) (void *datasource); 42 | long (*tell_func) (void *datasource); 43 | } ov_callbacks; 44 | 45 | #ifndef OV_EXCLUDE_STATIC_CALLBACKS 46 | 47 | /* a few sets of convenient callbacks, especially for use under 48 | * Windows where ov_open_callbacks() should always be used instead of 49 | * ov_open() to avoid problems with incompatible crt.o version linking 50 | * issues. */ 51 | 52 | static int _ov_header_fseek_wrap(FILE *f,ogg_int64_t off,int whence){ 53 | if(f==NULL)return(-1); 54 | 55 | #ifdef __MINGW32__ 56 | return fseeko64(f,off,whence); 57 | #elif defined (_WIN32) 58 | return _fseeki64(f,off,whence); 59 | #else 60 | return fseek(f,off,whence); 61 | #endif 62 | } 63 | 64 | /* These structs below (OV_CALLBACKS_DEFAULT etc) are defined here as 65 | * static data. That means that every file which includes this header 66 | * will get its own copy of these structs whether it uses them or 67 | * not unless it #defines OV_EXCLUDE_STATIC_CALLBACKS. 68 | * These static symbols are essential on platforms such as Windows on 69 | * which several different versions of stdio support may be linked to 70 | * by different DLLs, and we need to be certain we know which one 71 | * we're using (the same one as the main application). 72 | */ 73 | 74 | static ov_callbacks OV_CALLBACKS_DEFAULT = { 75 | (size_t (*)(void *, size_t, size_t, void *)) fread, 76 | (int (*)(void *, ogg_int64_t, int)) _ov_header_fseek_wrap, 77 | (int (*)(void *)) fclose, 78 | (long (*)(void *)) ftell 79 | }; 80 | 81 | static ov_callbacks OV_CALLBACKS_NOCLOSE = { 82 | (size_t (*)(void *, size_t, size_t, void *)) fread, 83 | (int (*)(void *, ogg_int64_t, int)) _ov_header_fseek_wrap, 84 | (int (*)(void *)) NULL, 85 | (long (*)(void *)) ftell 86 | }; 87 | 88 | static ov_callbacks OV_CALLBACKS_STREAMONLY = { 89 | (size_t (*)(void *, size_t, size_t, void *)) fread, 90 | (int (*)(void *, ogg_int64_t, int)) NULL, 91 | (int (*)(void *)) fclose, 92 | (long (*)(void *)) NULL 93 | }; 94 | 95 | static ov_callbacks OV_CALLBACKS_STREAMONLY_NOCLOSE = { 96 | (size_t (*)(void *, size_t, size_t, void *)) fread, 97 | (int (*)(void *, ogg_int64_t, int)) NULL, 98 | (int (*)(void *)) NULL, 99 | (long (*)(void *)) NULL 100 | }; 101 | 102 | #endif 103 | 104 | #define NOTOPEN 0 105 | #define PARTOPEN 1 106 | #define OPENED 2 107 | #define STREAMSET 3 108 | #define INITSET 4 109 | 110 | typedef struct OggVorbis_File { 111 | void *datasource; /* Pointer to a FILE *, etc. */ 112 | int seekable; 113 | ogg_int64_t offset; 114 | ogg_int64_t end; 115 | ogg_sync_state oy; 116 | 117 | /* If the FILE handle isn't seekable (eg, a pipe), only the current 118 | stream appears */ 119 | int links; 120 | ogg_int64_t *offsets; 121 | ogg_int64_t *dataoffsets; 122 | long *serialnos; 123 | ogg_int64_t *pcmlengths; /* overloaded to maintain binary 124 | compatibility; x2 size, stores both 125 | beginning and end values */ 126 | vorbis_info *vi; 127 | vorbis_comment *vc; 128 | 129 | /* Decoding working state local storage */ 130 | ogg_int64_t pcm_offset; 131 | int ready_state; 132 | long current_serialno; 133 | int current_link; 134 | 135 | double bittrack; 136 | double samptrack; 137 | 138 | ogg_stream_state os; /* take physical pages, weld into a logical 139 | stream of packets */ 140 | vorbis_dsp_state vd; /* central working state for the packet->PCM decoder */ 141 | vorbis_block vb; /* local working space for packet->PCM decode */ 142 | 143 | ov_callbacks callbacks; 144 | 145 | } OggVorbis_File; 146 | 147 | 148 | extern int ov_clear(OggVorbis_File *vf); 149 | extern int ov_fopen(const char *path,OggVorbis_File *vf); 150 | extern int ov_open(FILE *f,OggVorbis_File *vf,const char *initial,long ibytes); 151 | extern int ov_open_callbacks(void *datasource, OggVorbis_File *vf, 152 | const char *initial, long ibytes, ov_callbacks callbacks); 153 | 154 | extern int ov_test(FILE *f,OggVorbis_File *vf,const char *initial,long ibytes); 155 | extern int ov_test_callbacks(void *datasource, OggVorbis_File *vf, 156 | const char *initial, long ibytes, ov_callbacks callbacks); 157 | extern int ov_test_open(OggVorbis_File *vf); 158 | 159 | extern long ov_bitrate(OggVorbis_File *vf,int i); 160 | extern long ov_bitrate_instant(OggVorbis_File *vf); 161 | extern long ov_streams(OggVorbis_File *vf); 162 | extern long ov_seekable(OggVorbis_File *vf); 163 | extern long ov_serialnumber(OggVorbis_File *vf,int i); 164 | 165 | extern ogg_int64_t ov_raw_total(OggVorbis_File *vf,int i); 166 | extern ogg_int64_t ov_pcm_total(OggVorbis_File *vf,int i); 167 | extern double ov_time_total(OggVorbis_File *vf,int i); 168 | 169 | extern int ov_raw_seek(OggVorbis_File *vf,ogg_int64_t pos); 170 | extern int ov_pcm_seek(OggVorbis_File *vf,ogg_int64_t pos); 171 | extern int ov_pcm_seek_page(OggVorbis_File *vf,ogg_int64_t pos); 172 | extern int ov_time_seek(OggVorbis_File *vf,double pos); 173 | extern int ov_time_seek_page(OggVorbis_File *vf,double pos); 174 | 175 | extern int ov_raw_seek_lap(OggVorbis_File *vf,ogg_int64_t pos); 176 | extern int ov_pcm_seek_lap(OggVorbis_File *vf,ogg_int64_t pos); 177 | extern int ov_pcm_seek_page_lap(OggVorbis_File *vf,ogg_int64_t pos); 178 | extern int ov_time_seek_lap(OggVorbis_File *vf,double pos); 179 | extern int ov_time_seek_page_lap(OggVorbis_File *vf,double pos); 180 | 181 | extern ogg_int64_t ov_raw_tell(OggVorbis_File *vf); 182 | extern ogg_int64_t ov_pcm_tell(OggVorbis_File *vf); 183 | extern double ov_time_tell(OggVorbis_File *vf); 184 | 185 | extern vorbis_info *ov_info(OggVorbis_File *vf,int link); 186 | extern vorbis_comment *ov_comment(OggVorbis_File *vf,int link); 187 | 188 | extern long ov_read_float(OggVorbis_File *vf,float ***pcm_channels,int samples, 189 | int *bitstream); 190 | extern long ov_read_filter(OggVorbis_File *vf,char *buffer,int length, 191 | int bigendianp,int word,int sgned,int *bitstream, 192 | void (*filter)(float **pcm,long channels,long samples,void *filter_param),void *filter_param); 193 | extern long ov_read(OggVorbis_File *vf,char *buffer,int length, 194 | int bigendianp,int word,int sgned,int *bitstream); 195 | extern int ov_crosslap(OggVorbis_File *vf1,OggVorbis_File *vf2); 196 | 197 | extern int ov_halfrate(OggVorbis_File *vf,int flag); 198 | extern int ov_halfrate_p(OggVorbis_File *vf); 199 | 200 | #ifdef __cplusplus 201 | } 202 | #endif /* __cplusplus */ 203 | 204 | #endif 205 | 206 | -------------------------------------------------------------------------------- /vendor/libvorbis/lib/x64/ogg.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polybiusproxy/Endor/9612e857852d35652c8b2035b7bfa7c07b57fe38/vendor/libvorbis/lib/x64/ogg.lib -------------------------------------------------------------------------------- /vendor/libvorbis/lib/x64/vorbis.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polybiusproxy/Endor/9612e857852d35652c8b2035b7bfa7c07b57fe38/vendor/libvorbis/lib/x64/vorbis.lib -------------------------------------------------------------------------------- /vendor/libvorbis/lib/x64/vorbisenc.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polybiusproxy/Endor/9612e857852d35652c8b2035b7bfa7c07b57fe38/vendor/libvorbis/lib/x64/vorbisenc.lib -------------------------------------------------------------------------------- /vendor/libvorbis/lib/x64/vorbisfile.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polybiusproxy/Endor/9612e857852d35652c8b2035b7bfa7c07b57fe38/vendor/libvorbis/lib/x64/vorbisfile.lib -------------------------------------------------------------------------------- /vendor/libvorbis/lib/x86/ogg.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polybiusproxy/Endor/9612e857852d35652c8b2035b7bfa7c07b57fe38/vendor/libvorbis/lib/x86/ogg.lib -------------------------------------------------------------------------------- /vendor/libvorbis/lib/x86/vorbis.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polybiusproxy/Endor/9612e857852d35652c8b2035b7bfa7c07b57fe38/vendor/libvorbis/lib/x86/vorbis.lib -------------------------------------------------------------------------------- /vendor/libvorbis/lib/x86/vorbisenc.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polybiusproxy/Endor/9612e857852d35652c8b2035b7bfa7c07b57fe38/vendor/libvorbis/lib/x86/vorbisenc.lib -------------------------------------------------------------------------------- /vendor/libvorbis/lib/x86/vorbisfile.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polybiusproxy/Endor/9612e857852d35652c8b2035b7bfa7c07b57fe38/vendor/libvorbis/lib/x86/vorbisfile.lib -------------------------------------------------------------------------------- /vendor/openal/include/AL/al.h: -------------------------------------------------------------------------------- 1 | #ifndef AL_AL_H 2 | #define AL_AL_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #ifndef AL_API 9 | #if defined(AL_LIBTYPE_STATIC) 10 | #define AL_API 11 | #elif defined(_WIN32) 12 | #define AL_API __declspec(dllimport) 13 | #else 14 | #define AL_API extern 15 | #endif 16 | #endif 17 | 18 | #ifdef _WIN32 19 | #define AL_APIENTRY __cdecl 20 | #else 21 | #define AL_APIENTRY 22 | #endif 23 | 24 | 25 | /* Deprecated macros. */ 26 | #define OPENAL 27 | #define ALAPI AL_API 28 | #define ALAPIENTRY AL_APIENTRY 29 | #define AL_INVALID (-1) 30 | #define AL_ILLEGAL_ENUM AL_INVALID_ENUM 31 | #define AL_ILLEGAL_COMMAND AL_INVALID_OPERATION 32 | 33 | /* Supported AL versions. */ 34 | #define AL_VERSION_1_0 35 | #define AL_VERSION_1_1 36 | 37 | /** 8-bit boolean */ 38 | typedef char ALboolean; 39 | 40 | /** character */ 41 | typedef char ALchar; 42 | 43 | /** signed 8-bit integer */ 44 | typedef signed char ALbyte; 45 | 46 | /** unsigned 8-bit integer */ 47 | typedef unsigned char ALubyte; 48 | 49 | /** signed 16-bit integer */ 50 | typedef short ALshort; 51 | 52 | /** unsigned 16-bit integer */ 53 | typedef unsigned short ALushort; 54 | 55 | /** signed 32-bit integer */ 56 | typedef int ALint; 57 | 58 | /** unsigned 32-bit integer */ 59 | typedef unsigned int ALuint; 60 | 61 | /** non-negative 32-bit integer size */ 62 | typedef int ALsizei; 63 | 64 | /** 32-bit enumeration value */ 65 | typedef int ALenum; 66 | 67 | /** 32-bit IEEE-754 floating-point */ 68 | typedef float ALfloat; 69 | 70 | /** 64-bit IEEE-754 floating-point */ 71 | typedef double ALdouble; 72 | 73 | /** void type (opaque pointers only) */ 74 | typedef void ALvoid; 75 | 76 | 77 | /* Enumeration values begin at column 50. Do not use tabs. */ 78 | 79 | /** No distance model or no buffer */ 80 | #define AL_NONE 0 81 | 82 | /** Boolean False. */ 83 | #define AL_FALSE 0 84 | 85 | /** Boolean True. */ 86 | #define AL_TRUE 1 87 | 88 | 89 | /** 90 | * Relative source. 91 | * Type: ALboolean 92 | * Range: [AL_FALSE, AL_TRUE] 93 | * Default: AL_FALSE 94 | * 95 | * Specifies if the source uses relative coordinates. 96 | */ 97 | #define AL_SOURCE_RELATIVE 0x202 98 | 99 | 100 | /** 101 | * Inner cone angle, in degrees. 102 | * Type: ALint, ALfloat 103 | * Range: [0 - 360] 104 | * Default: 360 105 | * 106 | * The angle covered by the inner cone, the area within which the source will 107 | * not be attenuated by direction. 108 | */ 109 | #define AL_CONE_INNER_ANGLE 0x1001 110 | 111 | /** 112 | * Outer cone angle, in degrees. 113 | * Range: [0 - 360] 114 | * Default: 360 115 | * 116 | * The angle covered by the outer cone, the area outside of which the source 117 | * will be fully attenuated by direction. 118 | */ 119 | #define AL_CONE_OUTER_ANGLE 0x1002 120 | 121 | /** 122 | * Source pitch. 123 | * Type: ALfloat 124 | * Range: [0.5 - 2.0] 125 | * Default: 1.0 126 | * 127 | * A multiplier for the sample rate of the source's buffer. 128 | */ 129 | #define AL_PITCH 0x1003 130 | 131 | /** 132 | * Source or listener position. 133 | * Type: ALfloat[3], ALint[3] 134 | * Default: {0, 0, 0} 135 | * 136 | * The source or listener location in three dimensional space. 137 | * 138 | * OpenAL uses a right handed coordinate system, like OpenGL, where with a 139 | * default view, X points right (thumb), Y points up (index finger), and Z 140 | * points towards the viewer/camera (middle finger). 141 | * 142 | * To change from or to a left handed coordinate system, negate the Z 143 | * component. 144 | */ 145 | #define AL_POSITION 0x1004 146 | 147 | /** 148 | * Source direction. 149 | * Type: ALfloat[3], ALint[3] 150 | * Default: {0, 0, 0} 151 | * 152 | * Specifies the current direction in local space. A zero-length vector 153 | * specifies an omni-directional source (cone is ignored). 154 | * 155 | * To change from or to a left handed coordinate system, negate the Z 156 | * component. 157 | */ 158 | #define AL_DIRECTION 0x1005 159 | 160 | /** 161 | * Source or listener velocity. 162 | * Type: ALfloat[3], ALint[3] 163 | * Default: {0, 0, 0} 164 | * 165 | * Specifies the current velocity, relative to the position. 166 | * 167 | * To change from or to a left handed coordinate system, negate the Z 168 | * component. 169 | */ 170 | #define AL_VELOCITY 0x1006 171 | 172 | /** 173 | * Source looping. 174 | * Type: ALboolean 175 | * Range: [AL_FALSE, AL_TRUE] 176 | * Default: AL_FALSE 177 | * 178 | * Specifies whether source playback loops. 179 | */ 180 | #define AL_LOOPING 0x1007 181 | 182 | /** 183 | * Source buffer. 184 | * Type: ALuint 185 | * Range: any valid Buffer ID 186 | * Default: AL_NONE 187 | * 188 | * Specifies the buffer to provide sound samples for a source. 189 | */ 190 | #define AL_BUFFER 0x1009 191 | 192 | /** 193 | * Source or listener gain. 194 | * Type: ALfloat 195 | * Range: [0.0 - ] 196 | * 197 | * For sources, an initial linear gain value (before attenuation is applied). 198 | * For the listener, an output linear gain adjustment. 199 | * 200 | * A value of 1.0 means unattenuated. Each division by 2 equals an attenuation 201 | * of about -6dB. Each multiplication by 2 equals an amplification of about 202 | * +6dB. 203 | */ 204 | #define AL_GAIN 0x100A 205 | 206 | /** 207 | * Minimum source gain. 208 | * Type: ALfloat 209 | * Range: [0.0 - 1.0] 210 | * 211 | * The minimum gain allowed for a source, after distance and cone attenuation 212 | * are applied (if applicable). 213 | */ 214 | #define AL_MIN_GAIN 0x100D 215 | 216 | /** 217 | * Maximum source gain. 218 | * Type: ALfloat 219 | * Range: [0.0 - 1.0] 220 | * 221 | * The maximum gain allowed for a source, after distance and cone attenuation 222 | * are applied (if applicable). 223 | */ 224 | #define AL_MAX_GAIN 0x100E 225 | 226 | /** 227 | * Listener orientation. 228 | * Type: ALfloat[6] 229 | * Default: {0.0, 0.0, -1.0, 0.0, 1.0, 0.0} 230 | * 231 | * Effectively two three dimensional vectors. The first vector is the front (or 232 | * "at") and the second is the top (or "up"). Both vectors are relative to the 233 | * listener position. 234 | * 235 | * To change from or to a left handed coordinate system, negate the Z 236 | * component of both vectors. 237 | */ 238 | #define AL_ORIENTATION 0x100F 239 | 240 | /** 241 | * Source state (query only). 242 | * Type: ALenum 243 | * Range: [AL_INITIAL, AL_PLAYING, AL_PAUSED, AL_STOPPED] 244 | */ 245 | #define AL_SOURCE_STATE 0x1010 246 | 247 | /* Source state values. */ 248 | #define AL_INITIAL 0x1011 249 | #define AL_PLAYING 0x1012 250 | #define AL_PAUSED 0x1013 251 | #define AL_STOPPED 0x1014 252 | 253 | /** 254 | * Source Buffer Queue size (query only). 255 | * Type: ALint 256 | * 257 | * The number of buffers queued using alSourceQueueBuffers, minus the buffers 258 | * removed with alSourceUnqueueBuffers. 259 | */ 260 | #define AL_BUFFERS_QUEUED 0x1015 261 | 262 | /** 263 | * Source Buffer Queue processed count (query only). 264 | * Type: ALint 265 | * 266 | * The number of queued buffers that have been fully processed, and can be 267 | * removed with alSourceUnqueueBuffers. 268 | * 269 | * Looping sources will never fully process buffers because they will be set to 270 | * play again for when the source loops. 271 | */ 272 | #define AL_BUFFERS_PROCESSED 0x1016 273 | 274 | /** 275 | * Source reference distance. 276 | * Type: ALfloat 277 | * Range: [0.0 - ] 278 | * Default: 1.0 279 | * 280 | * The distance in units that no distance attenuation occurs. 281 | * 282 | * At 0.0, no distance attenuation occurs with non-linear attenuation models. 283 | */ 284 | #define AL_REFERENCE_DISTANCE 0x1020 285 | 286 | /** 287 | * Source rolloff factor. 288 | * Type: ALfloat 289 | * Range: [0.0 - ] 290 | * Default: 1.0 291 | * 292 | * Multiplier to exaggerate or diminish distance attenuation. 293 | * 294 | * At 0.0, no distance attenuation ever occurs. 295 | */ 296 | #define AL_ROLLOFF_FACTOR 0x1021 297 | 298 | /** 299 | * Outer cone gain. 300 | * Type: ALfloat 301 | * Range: [0.0 - 1.0] 302 | * Default: 0.0 303 | * 304 | * The gain attenuation applied when the listener is outside of the source's 305 | * outer cone angle. 306 | */ 307 | #define AL_CONE_OUTER_GAIN 0x1022 308 | 309 | /** 310 | * Source maximum distance. 311 | * Type: ALfloat 312 | * Range: [0.0 - ] 313 | * Default: FLT_MAX 314 | * 315 | * The distance above which the source is not attenuated any further with a 316 | * clamped distance model, or where attenuation reaches 0.0 gain for linear 317 | * distance models with a default rolloff factor. 318 | */ 319 | #define AL_MAX_DISTANCE 0x1023 320 | 321 | /** Source buffer offset, in seconds */ 322 | #define AL_SEC_OFFSET 0x1024 323 | /** Source buffer offset, in sample frames */ 324 | #define AL_SAMPLE_OFFSET 0x1025 325 | /** Source buffer offset, in bytes */ 326 | #define AL_BYTE_OFFSET 0x1026 327 | 328 | /** 329 | * Source type (query only). 330 | * Type: ALenum 331 | * Range: [AL_STATIC, AL_STREAMING, AL_UNDETERMINED] 332 | * 333 | * A Source is Static if a Buffer has been attached using AL_BUFFER. 334 | * 335 | * A Source is Streaming if one or more Buffers have been attached using 336 | * alSourceQueueBuffers. 337 | * 338 | * A Source is Undetermined when it has the NULL buffer attached using 339 | * AL_BUFFER. 340 | */ 341 | #define AL_SOURCE_TYPE 0x1027 342 | 343 | /* Source type values. */ 344 | #define AL_STATIC 0x1028 345 | #define AL_STREAMING 0x1029 346 | #define AL_UNDETERMINED 0x1030 347 | 348 | /** Unsigned 8-bit mono buffer format. */ 349 | #define AL_FORMAT_MONO8 0x1100 350 | /** Signed 16-bit mono buffer format. */ 351 | #define AL_FORMAT_MONO16 0x1101 352 | /** Unsigned 8-bit stereo buffer format. */ 353 | #define AL_FORMAT_STEREO8 0x1102 354 | /** Signed 16-bit stereo buffer format. */ 355 | #define AL_FORMAT_STEREO16 0x1103 356 | 357 | /** Buffer frequency/sample rate (query only). */ 358 | #define AL_FREQUENCY 0x2001 359 | /** Buffer bits per sample (query only). */ 360 | #define AL_BITS 0x2002 361 | /** Buffer channel count (query only). */ 362 | #define AL_CHANNELS 0x2003 363 | /** Buffer data size in bytes (query only). */ 364 | #define AL_SIZE 0x2004 365 | 366 | /* Buffer state. Not for public use. */ 367 | #define AL_UNUSED 0x2010 368 | #define AL_PENDING 0x2011 369 | #define AL_PROCESSED 0x2012 370 | 371 | 372 | /** No error. */ 373 | #define AL_NO_ERROR 0 374 | 375 | /** Invalid name (ID) passed to an AL call. */ 376 | #define AL_INVALID_NAME 0xA001 377 | 378 | /** Invalid enumeration passed to AL call. */ 379 | #define AL_INVALID_ENUM 0xA002 380 | 381 | /** Invalid value passed to AL call. */ 382 | #define AL_INVALID_VALUE 0xA003 383 | 384 | /** Illegal AL call. */ 385 | #define AL_INVALID_OPERATION 0xA004 386 | 387 | /** Not enough memory to execute the AL call. */ 388 | #define AL_OUT_OF_MEMORY 0xA005 389 | 390 | 391 | /** Context string: Vendor name. */ 392 | #define AL_VENDOR 0xB001 393 | /** Context string: Version. */ 394 | #define AL_VERSION 0xB002 395 | /** Context string: Renderer name. */ 396 | #define AL_RENDERER 0xB003 397 | /** Context string: Space-separated extension list. */ 398 | #define AL_EXTENSIONS 0xB004 399 | 400 | /** 401 | * Doppler scale. 402 | * Type: ALfloat 403 | * Range: [0.0 - ] 404 | * Default: 1.0 405 | * 406 | * Scale for source and listener velocities. 407 | */ 408 | #define AL_DOPPLER_FACTOR 0xC000 409 | 410 | /** 411 | * Doppler velocity (deprecated). 412 | * 413 | * A multiplier applied to the Speed of Sound. 414 | */ 415 | #define AL_DOPPLER_VELOCITY 0xC001 416 | 417 | /** 418 | * Speed of Sound, in units per second. 419 | * Type: ALfloat 420 | * Range: [0.0001 - ] 421 | * Default: 343.3 422 | * 423 | * The speed at which sound waves are assumed to travel, when calculating the 424 | * doppler effect from source and listener velocities. 425 | */ 426 | #define AL_SPEED_OF_SOUND 0xC003 427 | 428 | /** 429 | * Distance attenuation model. 430 | * Type: ALenum 431 | * Range: [AL_NONE, AL_INVERSE_DISTANCE, AL_INVERSE_DISTANCE_CLAMPED, 432 | * AL_LINEAR_DISTANCE, AL_LINEAR_DISTANCE_CLAMPED, 433 | * AL_EXPONENT_DISTANCE, AL_EXPONENT_DISTANCE_CLAMPED] 434 | * Default: AL_INVERSE_DISTANCE_CLAMPED 435 | * 436 | * The model by which sources attenuate with distance. 437 | * 438 | * None - No distance attenuation. 439 | * Inverse - Doubling the distance halves the source gain. 440 | * Linear - Linear gain scaling between the reference and max distances. 441 | * Exponent - Exponential gain dropoff. 442 | * 443 | * Clamped variations work like the non-clamped counterparts, except the 444 | * distance calculated is clamped between the reference and max distances. 445 | */ 446 | #define AL_DISTANCE_MODEL 0xD000 447 | 448 | /* Distance model values. */ 449 | #define AL_INVERSE_DISTANCE 0xD001 450 | #define AL_INVERSE_DISTANCE_CLAMPED 0xD002 451 | #define AL_LINEAR_DISTANCE 0xD003 452 | #define AL_LINEAR_DISTANCE_CLAMPED 0xD004 453 | #define AL_EXPONENT_DISTANCE 0xD005 454 | #define AL_EXPONENT_DISTANCE_CLAMPED 0xD006 455 | 456 | #ifndef AL_NO_PROTOTYPES 457 | /* Renderer State management. */ 458 | AL_API void AL_APIENTRY alEnable(ALenum capability); 459 | AL_API void AL_APIENTRY alDisable(ALenum capability); 460 | AL_API ALboolean AL_APIENTRY alIsEnabled(ALenum capability); 461 | 462 | /* Context state setting. */ 463 | AL_API void AL_APIENTRY alDopplerFactor(ALfloat value); 464 | AL_API void AL_APIENTRY alDopplerVelocity(ALfloat value); 465 | AL_API void AL_APIENTRY alSpeedOfSound(ALfloat value); 466 | AL_API void AL_APIENTRY alDistanceModel(ALenum distanceModel); 467 | 468 | /* Context state retrieval. */ 469 | AL_API const ALchar* AL_APIENTRY alGetString(ALenum param); 470 | AL_API void AL_APIENTRY alGetBooleanv(ALenum param, ALboolean *values); 471 | AL_API void AL_APIENTRY alGetIntegerv(ALenum param, ALint *values); 472 | AL_API void AL_APIENTRY alGetFloatv(ALenum param, ALfloat *values); 473 | AL_API void AL_APIENTRY alGetDoublev(ALenum param, ALdouble *values); 474 | AL_API ALboolean AL_APIENTRY alGetBoolean(ALenum param); 475 | AL_API ALint AL_APIENTRY alGetInteger(ALenum param); 476 | AL_API ALfloat AL_APIENTRY alGetFloat(ALenum param); 477 | AL_API ALdouble AL_APIENTRY alGetDouble(ALenum param); 478 | 479 | /** 480 | * Obtain the first error generated in the AL context since the last call to 481 | * this function. 482 | */ 483 | AL_API ALenum AL_APIENTRY alGetError(void); 484 | 485 | /** Query for the presence of an extension on the AL context. */ 486 | AL_API ALboolean AL_APIENTRY alIsExtensionPresent(const ALchar *extname); 487 | /** 488 | * Retrieve the address of a function. The returned function may be context- 489 | * specific. 490 | */ 491 | AL_API void* AL_APIENTRY alGetProcAddress(const ALchar *fname); 492 | /** 493 | * Retrieve the value of an enum. The returned value may be context-specific. 494 | */ 495 | AL_API ALenum AL_APIENTRY alGetEnumValue(const ALchar *ename); 496 | 497 | 498 | /* Set listener parameters. */ 499 | AL_API void AL_APIENTRY alListenerf(ALenum param, ALfloat value); 500 | AL_API void AL_APIENTRY alListener3f(ALenum param, ALfloat value1, ALfloat value2, ALfloat value3); 501 | AL_API void AL_APIENTRY alListenerfv(ALenum param, const ALfloat *values); 502 | AL_API void AL_APIENTRY alListeneri(ALenum param, ALint value); 503 | AL_API void AL_APIENTRY alListener3i(ALenum param, ALint value1, ALint value2, ALint value3); 504 | AL_API void AL_APIENTRY alListeneriv(ALenum param, const ALint *values); 505 | 506 | /* Get listener parameters. */ 507 | AL_API void AL_APIENTRY alGetListenerf(ALenum param, ALfloat *value); 508 | AL_API void AL_APIENTRY alGetListener3f(ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3); 509 | AL_API void AL_APIENTRY alGetListenerfv(ALenum param, ALfloat *values); 510 | AL_API void AL_APIENTRY alGetListeneri(ALenum param, ALint *value); 511 | AL_API void AL_APIENTRY alGetListener3i(ALenum param, ALint *value1, ALint *value2, ALint *value3); 512 | AL_API void AL_APIENTRY alGetListeneriv(ALenum param, ALint *values); 513 | 514 | 515 | /** Create source objects. */ 516 | AL_API void AL_APIENTRY alGenSources(ALsizei n, ALuint *sources); 517 | /** Delete source objects. */ 518 | AL_API void AL_APIENTRY alDeleteSources(ALsizei n, const ALuint *sources); 519 | /** Verify an ID is for a valid source. */ 520 | AL_API ALboolean AL_APIENTRY alIsSource(ALuint source); 521 | 522 | /* Set source parameters. */ 523 | AL_API void AL_APIENTRY alSourcef(ALuint source, ALenum param, ALfloat value); 524 | AL_API void AL_APIENTRY alSource3f(ALuint source, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3); 525 | AL_API void AL_APIENTRY alSourcefv(ALuint source, ALenum param, const ALfloat *values); 526 | AL_API void AL_APIENTRY alSourcei(ALuint source, ALenum param, ALint value); 527 | AL_API void AL_APIENTRY alSource3i(ALuint source, ALenum param, ALint value1, ALint value2, ALint value3); 528 | AL_API void AL_APIENTRY alSourceiv(ALuint source, ALenum param, const ALint *values); 529 | 530 | /* Get source parameters. */ 531 | AL_API void AL_APIENTRY alGetSourcef(ALuint source, ALenum param, ALfloat *value); 532 | AL_API void AL_APIENTRY alGetSource3f(ALuint source, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3); 533 | AL_API void AL_APIENTRY alGetSourcefv(ALuint source, ALenum param, ALfloat *values); 534 | AL_API void AL_APIENTRY alGetSourcei(ALuint source, ALenum param, ALint *value); 535 | AL_API void AL_APIENTRY alGetSource3i(ALuint source, ALenum param, ALint *value1, ALint *value2, ALint *value3); 536 | AL_API void AL_APIENTRY alGetSourceiv(ALuint source, ALenum param, ALint *values); 537 | 538 | 539 | /** Play, restart, or resume a source, setting its state to AL_PLAYING. */ 540 | AL_API void AL_APIENTRY alSourcePlay(ALuint source); 541 | /** Stop a source, setting its state to AL_STOPPED if playing or paused. */ 542 | AL_API void AL_APIENTRY alSourceStop(ALuint source); 543 | /** Rewind a source, setting its state to AL_INITIAL. */ 544 | AL_API void AL_APIENTRY alSourceRewind(ALuint source); 545 | /** Pause a source, setting its state to AL_PAUSED if playing. */ 546 | AL_API void AL_APIENTRY alSourcePause(ALuint source); 547 | 548 | /** Play, restart, or resume a list of sources atomically. */ 549 | AL_API void AL_APIENTRY alSourcePlayv(ALsizei n, const ALuint *sources); 550 | /** Stop a list of sources atomically. */ 551 | AL_API void AL_APIENTRY alSourceStopv(ALsizei n, const ALuint *sources); 552 | /** Rewind a list of sources atomically. */ 553 | AL_API void AL_APIENTRY alSourceRewindv(ALsizei n, const ALuint *sources); 554 | /** Pause a list of sources atomically. */ 555 | AL_API void AL_APIENTRY alSourcePausev(ALsizei n, const ALuint *sources); 556 | 557 | /** Queue buffers onto a source */ 558 | AL_API void AL_APIENTRY alSourceQueueBuffers(ALuint source, ALsizei nb, const ALuint *buffers); 559 | /** Unqueue processed buffers from a source */ 560 | AL_API void AL_APIENTRY alSourceUnqueueBuffers(ALuint source, ALsizei nb, ALuint *buffers); 561 | 562 | 563 | /** Create buffer objects */ 564 | AL_API void AL_APIENTRY alGenBuffers(ALsizei n, ALuint *buffers); 565 | /** Delete buffer objects */ 566 | AL_API void AL_APIENTRY alDeleteBuffers(ALsizei n, const ALuint *buffers); 567 | /** Verify an ID is a valid buffer (including the NULL buffer) */ 568 | AL_API ALboolean AL_APIENTRY alIsBuffer(ALuint buffer); 569 | 570 | /** 571 | * Copies data into the buffer, interpreting it using the specified format and 572 | * samplerate. 573 | */ 574 | AL_API void AL_APIENTRY alBufferData(ALuint buffer, ALenum format, const ALvoid *data, ALsizei size, ALsizei samplerate); 575 | 576 | /* Set buffer parameters. */ 577 | AL_API void AL_APIENTRY alBufferf(ALuint buffer, ALenum param, ALfloat value); 578 | AL_API void AL_APIENTRY alBuffer3f(ALuint buffer, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3); 579 | AL_API void AL_APIENTRY alBufferfv(ALuint buffer, ALenum param, const ALfloat *values); 580 | AL_API void AL_APIENTRY alBufferi(ALuint buffer, ALenum param, ALint value); 581 | AL_API void AL_APIENTRY alBuffer3i(ALuint buffer, ALenum param, ALint value1, ALint value2, ALint value3); 582 | AL_API void AL_APIENTRY alBufferiv(ALuint buffer, ALenum param, const ALint *values); 583 | 584 | /* Get buffer parameters. */ 585 | AL_API void AL_APIENTRY alGetBufferf(ALuint buffer, ALenum param, ALfloat *value); 586 | AL_API void AL_APIENTRY alGetBuffer3f(ALuint buffer, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3); 587 | AL_API void AL_APIENTRY alGetBufferfv(ALuint buffer, ALenum param, ALfloat *values); 588 | AL_API void AL_APIENTRY alGetBufferi(ALuint buffer, ALenum param, ALint *value); 589 | AL_API void AL_APIENTRY alGetBuffer3i(ALuint buffer, ALenum param, ALint *value1, ALint *value2, ALint *value3); 590 | AL_API void AL_APIENTRY alGetBufferiv(ALuint buffer, ALenum param, ALint *values); 591 | #endif /* AL_NO_PROTOTYPES */ 592 | 593 | /* Pointer-to-function types, useful for storing dynamically loaded AL entry 594 | * points. 595 | */ 596 | typedef void (AL_APIENTRY *LPALENABLE)(ALenum capability); 597 | typedef void (AL_APIENTRY *LPALDISABLE)(ALenum capability); 598 | typedef ALboolean (AL_APIENTRY *LPALISENABLED)(ALenum capability); 599 | typedef const ALchar* (AL_APIENTRY *LPALGETSTRING)(ALenum param); 600 | typedef void (AL_APIENTRY *LPALGETBOOLEANV)(ALenum param, ALboolean *values); 601 | typedef void (AL_APIENTRY *LPALGETINTEGERV)(ALenum param, ALint *values); 602 | typedef void (AL_APIENTRY *LPALGETFLOATV)(ALenum param, ALfloat *values); 603 | typedef void (AL_APIENTRY *LPALGETDOUBLEV)(ALenum param, ALdouble *values); 604 | typedef ALboolean (AL_APIENTRY *LPALGETBOOLEAN)(ALenum param); 605 | typedef ALint (AL_APIENTRY *LPALGETINTEGER)(ALenum param); 606 | typedef ALfloat (AL_APIENTRY *LPALGETFLOAT)(ALenum param); 607 | typedef ALdouble (AL_APIENTRY *LPALGETDOUBLE)(ALenum param); 608 | typedef ALenum (AL_APIENTRY *LPALGETERROR)(void); 609 | typedef ALboolean (AL_APIENTRY *LPALISEXTENSIONPRESENT)(const ALchar *extname); 610 | typedef void* (AL_APIENTRY *LPALGETPROCADDRESS)(const ALchar *fname); 611 | typedef ALenum (AL_APIENTRY *LPALGETENUMVALUE)(const ALchar *ename); 612 | typedef void (AL_APIENTRY *LPALLISTENERF)(ALenum param, ALfloat value); 613 | typedef void (AL_APIENTRY *LPALLISTENER3F)(ALenum param, ALfloat value1, ALfloat value2, ALfloat value3); 614 | typedef void (AL_APIENTRY *LPALLISTENERFV)(ALenum param, const ALfloat *values); 615 | typedef void (AL_APIENTRY *LPALLISTENERI)(ALenum param, ALint value); 616 | typedef void (AL_APIENTRY *LPALLISTENER3I)(ALenum param, ALint value1, ALint value2, ALint value3); 617 | typedef void (AL_APIENTRY *LPALLISTENERIV)(ALenum param, const ALint *values); 618 | typedef void (AL_APIENTRY *LPALGETLISTENERF)(ALenum param, ALfloat *value); 619 | typedef void (AL_APIENTRY *LPALGETLISTENER3F)(ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3); 620 | typedef void (AL_APIENTRY *LPALGETLISTENERFV)(ALenum param, ALfloat *values); 621 | typedef void (AL_APIENTRY *LPALGETLISTENERI)(ALenum param, ALint *value); 622 | typedef void (AL_APIENTRY *LPALGETLISTENER3I)(ALenum param, ALint *value1, ALint *value2, ALint *value3); 623 | typedef void (AL_APIENTRY *LPALGETLISTENERIV)(ALenum param, ALint *values); 624 | typedef void (AL_APIENTRY *LPALGENSOURCES)(ALsizei n, ALuint *sources); 625 | typedef void (AL_APIENTRY *LPALDELETESOURCES)(ALsizei n, const ALuint *sources); 626 | typedef ALboolean (AL_APIENTRY *LPALISSOURCE)(ALuint source); 627 | typedef void (AL_APIENTRY *LPALSOURCEF)(ALuint source, ALenum param, ALfloat value); 628 | typedef void (AL_APIENTRY *LPALSOURCE3F)(ALuint source, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3); 629 | typedef void (AL_APIENTRY *LPALSOURCEFV)(ALuint source, ALenum param, const ALfloat *values); 630 | typedef void (AL_APIENTRY *LPALSOURCEI)(ALuint source, ALenum param, ALint value); 631 | typedef void (AL_APIENTRY *LPALSOURCE3I)(ALuint source, ALenum param, ALint value1, ALint value2, ALint value3); 632 | typedef void (AL_APIENTRY *LPALSOURCEIV)(ALuint source, ALenum param, const ALint *values); 633 | typedef void (AL_APIENTRY *LPALGETSOURCEF)(ALuint source, ALenum param, ALfloat *value); 634 | typedef void (AL_APIENTRY *LPALGETSOURCE3F)(ALuint source, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3); 635 | typedef void (AL_APIENTRY *LPALGETSOURCEFV)(ALuint source, ALenum param, ALfloat *values); 636 | typedef void (AL_APIENTRY *LPALGETSOURCEI)(ALuint source, ALenum param, ALint *value); 637 | typedef void (AL_APIENTRY *LPALGETSOURCE3I)(ALuint source, ALenum param, ALint *value1, ALint *value2, ALint *value3); 638 | typedef void (AL_APIENTRY *LPALGETSOURCEIV)(ALuint source, ALenum param, ALint *values); 639 | typedef void (AL_APIENTRY *LPALSOURCEPLAYV)(ALsizei n, const ALuint *sources); 640 | typedef void (AL_APIENTRY *LPALSOURCESTOPV)(ALsizei n, const ALuint *sources); 641 | typedef void (AL_APIENTRY *LPALSOURCEREWINDV)(ALsizei n, const ALuint *sources); 642 | typedef void (AL_APIENTRY *LPALSOURCEPAUSEV)(ALsizei n, const ALuint *sources); 643 | typedef void (AL_APIENTRY *LPALSOURCEPLAY)(ALuint source); 644 | typedef void (AL_APIENTRY *LPALSOURCESTOP)(ALuint source); 645 | typedef void (AL_APIENTRY *LPALSOURCEREWIND)(ALuint source); 646 | typedef void (AL_APIENTRY *LPALSOURCEPAUSE)(ALuint source); 647 | typedef void (AL_APIENTRY *LPALSOURCEQUEUEBUFFERS)(ALuint source, ALsizei nb, const ALuint *buffers); 648 | typedef void (AL_APIENTRY *LPALSOURCEUNQUEUEBUFFERS)(ALuint source, ALsizei nb, ALuint *buffers); 649 | typedef void (AL_APIENTRY *LPALGENBUFFERS)(ALsizei n, ALuint *buffers); 650 | typedef void (AL_APIENTRY *LPALDELETEBUFFERS)(ALsizei n, const ALuint *buffers); 651 | typedef ALboolean (AL_APIENTRY *LPALISBUFFER)(ALuint buffer); 652 | typedef void (AL_APIENTRY *LPALBUFFERDATA)(ALuint buffer, ALenum format, const ALvoid *data, ALsizei size, ALsizei samplerate); 653 | typedef void (AL_APIENTRY *LPALBUFFERF)(ALuint buffer, ALenum param, ALfloat value); 654 | typedef void (AL_APIENTRY *LPALBUFFER3F)(ALuint buffer, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3); 655 | typedef void (AL_APIENTRY *LPALBUFFERFV)(ALuint buffer, ALenum param, const ALfloat *values); 656 | typedef void (AL_APIENTRY *LPALBUFFERI)(ALuint buffer, ALenum param, ALint value); 657 | typedef void (AL_APIENTRY *LPALBUFFER3I)(ALuint buffer, ALenum param, ALint value1, ALint value2, ALint value3); 658 | typedef void (AL_APIENTRY *LPALBUFFERIV)(ALuint buffer, ALenum param, const ALint *values); 659 | typedef void (AL_APIENTRY *LPALGETBUFFERF)(ALuint buffer, ALenum param, ALfloat *value); 660 | typedef void (AL_APIENTRY *LPALGETBUFFER3F)(ALuint buffer, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3); 661 | typedef void (AL_APIENTRY *LPALGETBUFFERFV)(ALuint buffer, ALenum param, ALfloat *values); 662 | typedef void (AL_APIENTRY *LPALGETBUFFERI)(ALuint buffer, ALenum param, ALint *value); 663 | typedef void (AL_APIENTRY *LPALGETBUFFER3I)(ALuint buffer, ALenum param, ALint *value1, ALint *value2, ALint *value3); 664 | typedef void (AL_APIENTRY *LPALGETBUFFERIV)(ALuint buffer, ALenum param, ALint *values); 665 | typedef void (AL_APIENTRY *LPALDOPPLERFACTOR)(ALfloat value); 666 | typedef void (AL_APIENTRY *LPALDOPPLERVELOCITY)(ALfloat value); 667 | typedef void (AL_APIENTRY *LPALSPEEDOFSOUND)(ALfloat value); 668 | typedef void (AL_APIENTRY *LPALDISTANCEMODEL)(ALenum distanceModel); 669 | 670 | #ifdef __cplusplus 671 | } /* extern "C" */ 672 | #endif 673 | 674 | #endif /* AL_AL_H */ 675 | -------------------------------------------------------------------------------- /vendor/openal/include/AL/alc.h: -------------------------------------------------------------------------------- 1 | #ifndef AL_ALC_H 2 | #define AL_ALC_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #ifndef ALC_API 9 | #if defined(AL_LIBTYPE_STATIC) 10 | #define ALC_API 11 | #elif defined(_WIN32) 12 | #define ALC_API __declspec(dllimport) 13 | #else 14 | #define ALC_API extern 15 | #endif 16 | #endif 17 | 18 | #ifdef _WIN32 19 | #define ALC_APIENTRY __cdecl 20 | #else 21 | #define ALC_APIENTRY 22 | #endif 23 | 24 | 25 | /* Deprecated macros. */ 26 | #define ALCAPI ALC_API 27 | #define ALCAPIENTRY ALC_APIENTRY 28 | #define ALC_INVALID 0 29 | 30 | /** Supported ALC version? */ 31 | #define ALC_VERSION_0_1 1 32 | 33 | /** Opaque device handle */ 34 | typedef struct ALCdevice ALCdevice; 35 | /** Opaque context handle */ 36 | typedef struct ALCcontext ALCcontext; 37 | 38 | /** 8-bit boolean */ 39 | typedef char ALCboolean; 40 | 41 | /** character */ 42 | typedef char ALCchar; 43 | 44 | /** signed 8-bit integer */ 45 | typedef signed char ALCbyte; 46 | 47 | /** unsigned 8-bit integer */ 48 | typedef unsigned char ALCubyte; 49 | 50 | /** signed 16-bit integer */ 51 | typedef short ALCshort; 52 | 53 | /** unsigned 16-bit integer */ 54 | typedef unsigned short ALCushort; 55 | 56 | /** signed 32-bit integer */ 57 | typedef int ALCint; 58 | 59 | /** unsigned 32-bit integer */ 60 | typedef unsigned int ALCuint; 61 | 62 | /** non-negative 32-bit integer size */ 63 | typedef int ALCsizei; 64 | 65 | /** 32-bit enumeration value */ 66 | typedef int ALCenum; 67 | 68 | /** 32-bit IEEE-754 floating-point */ 69 | typedef float ALCfloat; 70 | 71 | /** 64-bit IEEE-754 floating-point */ 72 | typedef double ALCdouble; 73 | 74 | /** void type (for opaque pointers only) */ 75 | typedef void ALCvoid; 76 | 77 | 78 | /* Enumeration values begin at column 50. Do not use tabs. */ 79 | 80 | /** Boolean False. */ 81 | #define ALC_FALSE 0 82 | 83 | /** Boolean True. */ 84 | #define ALC_TRUE 1 85 | 86 | /** Context attribute: Hz. */ 87 | #define ALC_FREQUENCY 0x1007 88 | 89 | /** Context attribute: Hz. */ 90 | #define ALC_REFRESH 0x1008 91 | 92 | /** Context attribute: AL_TRUE or AL_FALSE synchronous context? */ 93 | #define ALC_SYNC 0x1009 94 | 95 | /** Context attribute: requested Mono (3D) Sources. */ 96 | #define ALC_MONO_SOURCES 0x1010 97 | 98 | /** Context attribute: requested Stereo Sources. */ 99 | #define ALC_STEREO_SOURCES 0x1011 100 | 101 | /** No error. */ 102 | #define ALC_NO_ERROR 0 103 | 104 | /** Invalid device handle. */ 105 | #define ALC_INVALID_DEVICE 0xA001 106 | 107 | /** Invalid context handle. */ 108 | #define ALC_INVALID_CONTEXT 0xA002 109 | 110 | /** Invalid enumeration passed to an ALC call. */ 111 | #define ALC_INVALID_ENUM 0xA003 112 | 113 | /** Invalid value passed to an ALC call. */ 114 | #define ALC_INVALID_VALUE 0xA004 115 | 116 | /** Out of memory. */ 117 | #define ALC_OUT_OF_MEMORY 0xA005 118 | 119 | 120 | /** Runtime ALC major version. */ 121 | #define ALC_MAJOR_VERSION 0x1000 122 | /** Runtime ALC minor version. */ 123 | #define ALC_MINOR_VERSION 0x1001 124 | 125 | /** Context attribute list size. */ 126 | #define ALC_ATTRIBUTES_SIZE 0x1002 127 | /** Context attribute list properties. */ 128 | #define ALC_ALL_ATTRIBUTES 0x1003 129 | 130 | /** String for the default device specifier. */ 131 | #define ALC_DEFAULT_DEVICE_SPECIFIER 0x1004 132 | /** 133 | * Device specifier string. 134 | * 135 | * If device handle is NULL, it is instead a null-character separated list of 136 | * strings of known device specifiers (list ends with an empty string). 137 | */ 138 | #define ALC_DEVICE_SPECIFIER 0x1005 139 | /** String for space-separated list of ALC extensions. */ 140 | #define ALC_EXTENSIONS 0x1006 141 | 142 | 143 | /** Capture extension */ 144 | #define ALC_EXT_CAPTURE 1 145 | /** 146 | * Capture device specifier string. 147 | * 148 | * If device handle is NULL, it is instead a null-character separated list of 149 | * strings of known capture device specifiers (list ends with an empty string). 150 | */ 151 | #define ALC_CAPTURE_DEVICE_SPECIFIER 0x310 152 | /** String for the default capture device specifier. */ 153 | #define ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER 0x311 154 | /** Number of sample frames available for capture. */ 155 | #define ALC_CAPTURE_SAMPLES 0x312 156 | 157 | 158 | /** Enumerate All extension */ 159 | #define ALC_ENUMERATE_ALL_EXT 1 160 | /** String for the default extended device specifier. */ 161 | #define ALC_DEFAULT_ALL_DEVICES_SPECIFIER 0x1012 162 | /** 163 | * Device's extended specifier string. 164 | * 165 | * If device handle is NULL, it is instead a null-character separated list of 166 | * strings of known extended device specifiers (list ends with an empty string). 167 | */ 168 | #define ALC_ALL_DEVICES_SPECIFIER 0x1013 169 | 170 | 171 | #ifndef ALC_NO_PROTOTYPES 172 | /* Context management. */ 173 | 174 | /** Create and attach a context to the given device. */ 175 | ALC_API ALCcontext* ALC_APIENTRY alcCreateContext(ALCdevice *device, const ALCint *attrlist); 176 | /** 177 | * Makes the given context the active process-wide context. Passing NULL clears 178 | * the active context. 179 | */ 180 | ALC_API ALCboolean ALC_APIENTRY alcMakeContextCurrent(ALCcontext *context); 181 | /** Resumes processing updates for the given context. */ 182 | ALC_API void ALC_APIENTRY alcProcessContext(ALCcontext *context); 183 | /** Suspends updates for the given context. */ 184 | ALC_API void ALC_APIENTRY alcSuspendContext(ALCcontext *context); 185 | /** Remove a context from its device and destroys it. */ 186 | ALC_API void ALC_APIENTRY alcDestroyContext(ALCcontext *context); 187 | /** Returns the currently active context. */ 188 | ALC_API ALCcontext* ALC_APIENTRY alcGetCurrentContext(void); 189 | /** Returns the device that a particular context is attached to. */ 190 | ALC_API ALCdevice* ALC_APIENTRY alcGetContextsDevice(ALCcontext *context); 191 | 192 | /* Device management. */ 193 | 194 | /** Opens the named playback device. */ 195 | ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *devicename); 196 | /** Closes the given playback device. */ 197 | ALC_API ALCboolean ALC_APIENTRY alcCloseDevice(ALCdevice *device); 198 | 199 | /* Error support. */ 200 | 201 | /** Obtain the most recent Device error. */ 202 | ALC_API ALCenum ALC_APIENTRY alcGetError(ALCdevice *device); 203 | 204 | /* Extension support. */ 205 | 206 | /** 207 | * Query for the presence of an extension on the device. Pass a NULL device to 208 | * query a device-inspecific extension. 209 | */ 210 | ALC_API ALCboolean ALC_APIENTRY alcIsExtensionPresent(ALCdevice *device, const ALCchar *extname); 211 | /** 212 | * Retrieve the address of a function. Given a non-NULL device, the returned 213 | * function may be device-specific. 214 | */ 215 | ALC_API ALCvoid* ALC_APIENTRY alcGetProcAddress(ALCdevice *device, const ALCchar *funcname); 216 | /** 217 | * Retrieve the value of an enum. Given a non-NULL device, the returned value 218 | * may be device-specific. 219 | */ 220 | ALC_API ALCenum ALC_APIENTRY alcGetEnumValue(ALCdevice *device, const ALCchar *enumname); 221 | 222 | /* Query functions. */ 223 | 224 | /** Returns information about the device, and error strings. */ 225 | ALC_API const ALCchar* ALC_APIENTRY alcGetString(ALCdevice *device, ALCenum param); 226 | /** Returns information about the device and the version of OpenAL. */ 227 | ALC_API void ALC_APIENTRY alcGetIntegerv(ALCdevice *device, ALCenum param, ALCsizei size, ALCint *values); 228 | 229 | /* Capture functions. */ 230 | 231 | /** 232 | * Opens the named capture device with the given frequency, format, and buffer 233 | * size. 234 | */ 235 | ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice(const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize); 236 | /** Closes the given capture device. */ 237 | ALC_API ALCboolean ALC_APIENTRY alcCaptureCloseDevice(ALCdevice *device); 238 | /** Starts capturing samples into the device buffer. */ 239 | ALC_API void ALC_APIENTRY alcCaptureStart(ALCdevice *device); 240 | /** Stops capturing samples. Samples in the device buffer remain available. */ 241 | ALC_API void ALC_APIENTRY alcCaptureStop(ALCdevice *device); 242 | /** Reads samples from the device buffer. */ 243 | ALC_API void ALC_APIENTRY alcCaptureSamples(ALCdevice *device, ALCvoid *buffer, ALCsizei samples); 244 | #endif /* ALC_NO_PROTOTYPES */ 245 | 246 | /* Pointer-to-function types, useful for storing dynamically loaded ALC entry 247 | * points. 248 | */ 249 | typedef ALCcontext* (ALC_APIENTRY *LPALCCREATECONTEXT)(ALCdevice *device, const ALCint *attrlist); 250 | typedef ALCboolean (ALC_APIENTRY *LPALCMAKECONTEXTCURRENT)(ALCcontext *context); 251 | typedef void (ALC_APIENTRY *LPALCPROCESSCONTEXT)(ALCcontext *context); 252 | typedef void (ALC_APIENTRY *LPALCSUSPENDCONTEXT)(ALCcontext *context); 253 | typedef void (ALC_APIENTRY *LPALCDESTROYCONTEXT)(ALCcontext *context); 254 | typedef ALCcontext* (ALC_APIENTRY *LPALCGETCURRENTCONTEXT)(void); 255 | typedef ALCdevice* (ALC_APIENTRY *LPALCGETCONTEXTSDEVICE)(ALCcontext *context); 256 | typedef ALCdevice* (ALC_APIENTRY *LPALCOPENDEVICE)(const ALCchar *devicename); 257 | typedef ALCboolean (ALC_APIENTRY *LPALCCLOSEDEVICE)(ALCdevice *device); 258 | typedef ALCenum (ALC_APIENTRY *LPALCGETERROR)(ALCdevice *device); 259 | typedef ALCboolean (ALC_APIENTRY *LPALCISEXTENSIONPRESENT)(ALCdevice *device, const ALCchar *extname); 260 | typedef ALCvoid* (ALC_APIENTRY *LPALCGETPROCADDRESS)(ALCdevice *device, const ALCchar *funcname); 261 | typedef ALCenum (ALC_APIENTRY *LPALCGETENUMVALUE)(ALCdevice *device, const ALCchar *enumname); 262 | typedef const ALCchar* (ALC_APIENTRY *LPALCGETSTRING)(ALCdevice *device, ALCenum param); 263 | typedef void (ALC_APIENTRY *LPALCGETINTEGERV)(ALCdevice *device, ALCenum param, ALCsizei size, ALCint *values); 264 | typedef ALCdevice* (ALC_APIENTRY *LPALCCAPTUREOPENDEVICE)(const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize); 265 | typedef ALCboolean (ALC_APIENTRY *LPALCCAPTURECLOSEDEVICE)(ALCdevice *device); 266 | typedef void (ALC_APIENTRY *LPALCCAPTURESTART)(ALCdevice *device); 267 | typedef void (ALC_APIENTRY *LPALCCAPTURESTOP)(ALCdevice *device); 268 | typedef void (ALC_APIENTRY *LPALCCAPTURESAMPLES)(ALCdevice *device, ALCvoid *buffer, ALCsizei samples); 269 | 270 | #ifdef __cplusplus 271 | } /* extern "C" */ 272 | #endif 273 | 274 | #endif /* AL_ALC_H */ 275 | -------------------------------------------------------------------------------- /vendor/openal/include/AL/alext.h: -------------------------------------------------------------------------------- 1 | #ifndef AL_ALEXT_H 2 | #define AL_ALEXT_H 3 | 4 | #include 5 | /* Define int64 and uint64 types */ 6 | #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \ 7 | (defined(__cplusplus) && __cplusplus >= 201103L) 8 | #include 9 | typedef int64_t _alsoft_int64_t; 10 | typedef uint64_t _alsoft_uint64_t; 11 | #elif defined(_WIN32) 12 | typedef __int64 _alsoft_int64_t; 13 | typedef unsigned __int64 _alsoft_uint64_t; 14 | #else 15 | /* Fallback if nothing above works */ 16 | #include 17 | typedef int64_t _alsoft_int64_t; 18 | typedef uint64_t _alsoft_uint64_t; 19 | #endif 20 | 21 | #include "alc.h" 22 | #include "al.h" 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | #ifndef AL_LOKI_IMA_ADPCM_format 29 | #define AL_LOKI_IMA_ADPCM_format 1 30 | #define AL_FORMAT_IMA_ADPCM_MONO16_EXT 0x10000 31 | #define AL_FORMAT_IMA_ADPCM_STEREO16_EXT 0x10001 32 | #endif 33 | 34 | #ifndef AL_LOKI_WAVE_format 35 | #define AL_LOKI_WAVE_format 1 36 | #define AL_FORMAT_WAVE_EXT 0x10002 37 | #endif 38 | 39 | #ifndef AL_EXT_vorbis 40 | #define AL_EXT_vorbis 1 41 | #define AL_FORMAT_VORBIS_EXT 0x10003 42 | #endif 43 | 44 | #ifndef AL_LOKI_quadriphonic 45 | #define AL_LOKI_quadriphonic 1 46 | #define AL_FORMAT_QUAD8_LOKI 0x10004 47 | #define AL_FORMAT_QUAD16_LOKI 0x10005 48 | #endif 49 | 50 | #ifndef AL_EXT_float32 51 | #define AL_EXT_float32 1 52 | #define AL_FORMAT_MONO_FLOAT32 0x10010 53 | #define AL_FORMAT_STEREO_FLOAT32 0x10011 54 | #endif 55 | 56 | #ifndef AL_EXT_double 57 | #define AL_EXT_double 1 58 | #define AL_FORMAT_MONO_DOUBLE_EXT 0x10012 59 | #define AL_FORMAT_STEREO_DOUBLE_EXT 0x10013 60 | #endif 61 | 62 | #ifndef AL_EXT_MULAW 63 | #define AL_EXT_MULAW 1 64 | #define AL_FORMAT_MONO_MULAW_EXT 0x10014 65 | #define AL_FORMAT_STEREO_MULAW_EXT 0x10015 66 | #endif 67 | 68 | #ifndef AL_EXT_ALAW 69 | #define AL_EXT_ALAW 1 70 | #define AL_FORMAT_MONO_ALAW_EXT 0x10016 71 | #define AL_FORMAT_STEREO_ALAW_EXT 0x10017 72 | #endif 73 | 74 | #ifndef ALC_LOKI_audio_channel 75 | #define ALC_LOKI_audio_channel 1 76 | #define ALC_CHAN_MAIN_LOKI 0x500001 77 | #define ALC_CHAN_PCM_LOKI 0x500002 78 | #define ALC_CHAN_CD_LOKI 0x500003 79 | #endif 80 | 81 | #ifndef AL_EXT_MCFORMATS 82 | #define AL_EXT_MCFORMATS 1 83 | /* Provides support for surround sound buffer formats with 8, 16, and 32-bit 84 | * samples. 85 | * 86 | * QUAD8: Unsigned 8-bit, Quadraphonic (Front Left, Front Right, Rear Left, 87 | * Rear Right). 88 | * QUAD16: Signed 16-bit, Quadraphonic. 89 | * QUAD32: 32-bit float, Quadraphonic. 90 | * REAR8: Unsigned 8-bit, Rear Stereo (Rear Left, Rear Right). 91 | * REAR16: Signed 16-bit, Rear Stereo. 92 | * REAR32: 32-bit float, Rear Stereo. 93 | * 51CHN8: Unsigned 8-bit, 5.1 Surround (Front Left, Front Right, Front Center, 94 | * LFE, Side Left, Side Right). Note that some audio systems may label 95 | * 5.1's Side channels as Rear or Surround; they are equivalent for the 96 | * purposes of this extension. 97 | * 51CHN16: Signed 16-bit, 5.1 Surround. 98 | * 51CHN32: 32-bit float, 5.1 Surround. 99 | * 61CHN8: Unsigned 8-bit, 6.1 Surround (Front Left, Front Right, Front Center, 100 | * LFE, Rear Center, Side Left, Side Right). 101 | * 61CHN16: Signed 16-bit, 6.1 Surround. 102 | * 61CHN32: 32-bit float, 6.1 Surround. 103 | * 71CHN8: Unsigned 8-bit, 7.1 Surround (Front Left, Front Right, Front Center, 104 | * LFE, Rear Left, Rear Right, Side Left, Side Right). 105 | * 71CHN16: Signed 16-bit, 7.1 Surround. 106 | * 71CHN32: 32-bit float, 7.1 Surround. 107 | */ 108 | #define AL_FORMAT_QUAD8 0x1204 109 | #define AL_FORMAT_QUAD16 0x1205 110 | #define AL_FORMAT_QUAD32 0x1206 111 | #define AL_FORMAT_REAR8 0x1207 112 | #define AL_FORMAT_REAR16 0x1208 113 | #define AL_FORMAT_REAR32 0x1209 114 | #define AL_FORMAT_51CHN8 0x120A 115 | #define AL_FORMAT_51CHN16 0x120B 116 | #define AL_FORMAT_51CHN32 0x120C 117 | #define AL_FORMAT_61CHN8 0x120D 118 | #define AL_FORMAT_61CHN16 0x120E 119 | #define AL_FORMAT_61CHN32 0x120F 120 | #define AL_FORMAT_71CHN8 0x1210 121 | #define AL_FORMAT_71CHN16 0x1211 122 | #define AL_FORMAT_71CHN32 0x1212 123 | #endif 124 | 125 | #ifndef AL_EXT_MULAW_MCFORMATS 126 | #define AL_EXT_MULAW_MCFORMATS 1 127 | #define AL_FORMAT_MONO_MULAW 0x10014 128 | #define AL_FORMAT_STEREO_MULAW 0x10015 129 | #define AL_FORMAT_QUAD_MULAW 0x10021 130 | #define AL_FORMAT_REAR_MULAW 0x10022 131 | #define AL_FORMAT_51CHN_MULAW 0x10023 132 | #define AL_FORMAT_61CHN_MULAW 0x10024 133 | #define AL_FORMAT_71CHN_MULAW 0x10025 134 | #endif 135 | 136 | #ifndef AL_EXT_IMA4 137 | #define AL_EXT_IMA4 1 138 | #define AL_FORMAT_MONO_IMA4 0x1300 139 | #define AL_FORMAT_STEREO_IMA4 0x1301 140 | #endif 141 | 142 | #ifndef AL_EXT_STATIC_BUFFER 143 | #define AL_EXT_STATIC_BUFFER 1 144 | typedef void (AL_APIENTRY*PFNALBUFFERDATASTATICPROC)(const ALuint,ALenum,ALvoid*,ALsizei,ALsizei); 145 | #ifdef AL_ALEXT_PROTOTYPES 146 | void AL_APIENTRY alBufferDataStatic(const ALuint buffer, ALenum format, ALvoid *data, ALsizei size, ALsizei freq); 147 | #endif 148 | #endif 149 | 150 | #ifndef ALC_EXT_EFX 151 | #define ALC_EXT_EFX 1 152 | #include "efx.h" 153 | #endif 154 | 155 | #ifndef ALC_EXT_disconnect 156 | #define ALC_EXT_disconnect 1 157 | #define ALC_CONNECTED 0x313 158 | #endif 159 | 160 | #ifndef ALC_EXT_thread_local_context 161 | #define ALC_EXT_thread_local_context 1 162 | typedef ALCboolean (ALC_APIENTRY*PFNALCSETTHREADCONTEXTPROC)(ALCcontext *context); 163 | typedef ALCcontext* (ALC_APIENTRY*PFNALCGETTHREADCONTEXTPROC)(void); 164 | #ifdef AL_ALEXT_PROTOTYPES 165 | ALC_API ALCboolean ALC_APIENTRY alcSetThreadContext(ALCcontext *context); 166 | ALC_API ALCcontext* ALC_APIENTRY alcGetThreadContext(void); 167 | #endif 168 | #endif 169 | 170 | #ifndef AL_EXT_source_distance_model 171 | #define AL_EXT_source_distance_model 1 172 | #define AL_SOURCE_DISTANCE_MODEL 0x200 173 | #endif 174 | 175 | #ifndef AL_SOFT_buffer_sub_data 176 | #define AL_SOFT_buffer_sub_data 1 177 | #define AL_BYTE_RW_OFFSETS_SOFT 0x1031 178 | #define AL_SAMPLE_RW_OFFSETS_SOFT 0x1032 179 | typedef void (AL_APIENTRY*PFNALBUFFERSUBDATASOFTPROC)(ALuint,ALenum,const ALvoid*,ALsizei,ALsizei); 180 | #ifdef AL_ALEXT_PROTOTYPES 181 | AL_API void AL_APIENTRY alBufferSubDataSOFT(ALuint buffer,ALenum format,const ALvoid *data,ALsizei offset,ALsizei length); 182 | #endif 183 | #endif 184 | 185 | #ifndef AL_SOFT_loop_points 186 | #define AL_SOFT_loop_points 1 187 | #define AL_LOOP_POINTS_SOFT 0x2015 188 | #endif 189 | 190 | #ifndef AL_EXT_FOLDBACK 191 | #define AL_EXT_FOLDBACK 1 192 | #define AL_EXT_FOLDBACK_NAME "AL_EXT_FOLDBACK" 193 | #define AL_FOLDBACK_EVENT_BLOCK 0x4112 194 | #define AL_FOLDBACK_EVENT_START 0x4111 195 | #define AL_FOLDBACK_EVENT_STOP 0x4113 196 | #define AL_FOLDBACK_MODE_MONO 0x4101 197 | #define AL_FOLDBACK_MODE_STEREO 0x4102 198 | typedef void (AL_APIENTRY*LPALFOLDBACKCALLBACK)(ALenum,ALsizei); 199 | typedef void (AL_APIENTRY*LPALREQUESTFOLDBACKSTART)(ALenum,ALsizei,ALsizei,ALfloat*,LPALFOLDBACKCALLBACK); 200 | typedef void (AL_APIENTRY*LPALREQUESTFOLDBACKSTOP)(void); 201 | #ifdef AL_ALEXT_PROTOTYPES 202 | AL_API void AL_APIENTRY alRequestFoldbackStart(ALenum mode,ALsizei count,ALsizei length,ALfloat *mem,LPALFOLDBACKCALLBACK callback); 203 | AL_API void AL_APIENTRY alRequestFoldbackStop(void); 204 | #endif 205 | #endif 206 | 207 | #ifndef ALC_EXT_DEDICATED 208 | #define ALC_EXT_DEDICATED 1 209 | #define AL_DEDICATED_GAIN 0x0001 210 | #define AL_EFFECT_DEDICATED_DIALOGUE 0x9001 211 | #define AL_EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT 0x9000 212 | #endif 213 | 214 | #ifndef AL_SOFT_buffer_samples 215 | #define AL_SOFT_buffer_samples 1 216 | /* Channel configurations */ 217 | #define AL_MONO_SOFT 0x1500 218 | #define AL_STEREO_SOFT 0x1501 219 | #define AL_REAR_SOFT 0x1502 220 | #define AL_QUAD_SOFT 0x1503 221 | #define AL_5POINT1_SOFT 0x1504 222 | #define AL_6POINT1_SOFT 0x1505 223 | #define AL_7POINT1_SOFT 0x1506 224 | 225 | /* Sample types */ 226 | #define AL_BYTE_SOFT 0x1400 227 | #define AL_UNSIGNED_BYTE_SOFT 0x1401 228 | #define AL_SHORT_SOFT 0x1402 229 | #define AL_UNSIGNED_SHORT_SOFT 0x1403 230 | #define AL_INT_SOFT 0x1404 231 | #define AL_UNSIGNED_INT_SOFT 0x1405 232 | #define AL_FLOAT_SOFT 0x1406 233 | #define AL_DOUBLE_SOFT 0x1407 234 | #define AL_BYTE3_SOFT 0x1408 235 | #define AL_UNSIGNED_BYTE3_SOFT 0x1409 236 | 237 | /* Storage formats */ 238 | #define AL_MONO8_SOFT 0x1100 239 | #define AL_MONO16_SOFT 0x1101 240 | #define AL_MONO32F_SOFT 0x10010 241 | #define AL_STEREO8_SOFT 0x1102 242 | #define AL_STEREO16_SOFT 0x1103 243 | #define AL_STEREO32F_SOFT 0x10011 244 | #define AL_QUAD8_SOFT 0x1204 245 | #define AL_QUAD16_SOFT 0x1205 246 | #define AL_QUAD32F_SOFT 0x1206 247 | #define AL_REAR8_SOFT 0x1207 248 | #define AL_REAR16_SOFT 0x1208 249 | #define AL_REAR32F_SOFT 0x1209 250 | #define AL_5POINT1_8_SOFT 0x120A 251 | #define AL_5POINT1_16_SOFT 0x120B 252 | #define AL_5POINT1_32F_SOFT 0x120C 253 | #define AL_6POINT1_8_SOFT 0x120D 254 | #define AL_6POINT1_16_SOFT 0x120E 255 | #define AL_6POINT1_32F_SOFT 0x120F 256 | #define AL_7POINT1_8_SOFT 0x1210 257 | #define AL_7POINT1_16_SOFT 0x1211 258 | #define AL_7POINT1_32F_SOFT 0x1212 259 | 260 | /* Buffer attributes */ 261 | #define AL_INTERNAL_FORMAT_SOFT 0x2008 262 | #define AL_BYTE_LENGTH_SOFT 0x2009 263 | #define AL_SAMPLE_LENGTH_SOFT 0x200A 264 | #define AL_SEC_LENGTH_SOFT 0x200B 265 | 266 | typedef void (AL_APIENTRY*LPALBUFFERSAMPLESSOFT)(ALuint,ALuint,ALenum,ALsizei,ALenum,ALenum,const ALvoid*); 267 | typedef void (AL_APIENTRY*LPALBUFFERSUBSAMPLESSOFT)(ALuint,ALsizei,ALsizei,ALenum,ALenum,const ALvoid*); 268 | typedef void (AL_APIENTRY*LPALGETBUFFERSAMPLESSOFT)(ALuint,ALsizei,ALsizei,ALenum,ALenum,ALvoid*); 269 | typedef ALboolean (AL_APIENTRY*LPALISBUFFERFORMATSUPPORTEDSOFT)(ALenum); 270 | #ifdef AL_ALEXT_PROTOTYPES 271 | AL_API void AL_APIENTRY alBufferSamplesSOFT(ALuint buffer, ALuint samplerate, ALenum internalformat, ALsizei samples, ALenum channels, ALenum type, const ALvoid *data); 272 | AL_API void AL_APIENTRY alBufferSubSamplesSOFT(ALuint buffer, ALsizei offset, ALsizei samples, ALenum channels, ALenum type, const ALvoid *data); 273 | AL_API void AL_APIENTRY alGetBufferSamplesSOFT(ALuint buffer, ALsizei offset, ALsizei samples, ALenum channels, ALenum type, ALvoid *data); 274 | AL_API ALboolean AL_APIENTRY alIsBufferFormatSupportedSOFT(ALenum format); 275 | #endif 276 | #endif 277 | 278 | #ifndef AL_SOFT_direct_channels 279 | #define AL_SOFT_direct_channels 1 280 | #define AL_DIRECT_CHANNELS_SOFT 0x1033 281 | #endif 282 | 283 | #ifndef ALC_SOFT_loopback 284 | #define ALC_SOFT_loopback 1 285 | #define ALC_FORMAT_CHANNELS_SOFT 0x1990 286 | #define ALC_FORMAT_TYPE_SOFT 0x1991 287 | 288 | /* Sample types */ 289 | #define ALC_BYTE_SOFT 0x1400 290 | #define ALC_UNSIGNED_BYTE_SOFT 0x1401 291 | #define ALC_SHORT_SOFT 0x1402 292 | #define ALC_UNSIGNED_SHORT_SOFT 0x1403 293 | #define ALC_INT_SOFT 0x1404 294 | #define ALC_UNSIGNED_INT_SOFT 0x1405 295 | #define ALC_FLOAT_SOFT 0x1406 296 | 297 | /* Channel configurations */ 298 | #define ALC_MONO_SOFT 0x1500 299 | #define ALC_STEREO_SOFT 0x1501 300 | #define ALC_QUAD_SOFT 0x1503 301 | #define ALC_5POINT1_SOFT 0x1504 302 | #define ALC_6POINT1_SOFT 0x1505 303 | #define ALC_7POINT1_SOFT 0x1506 304 | 305 | typedef ALCdevice* (ALC_APIENTRY*LPALCLOOPBACKOPENDEVICESOFT)(const ALCchar*); 306 | typedef ALCboolean (ALC_APIENTRY*LPALCISRENDERFORMATSUPPORTEDSOFT)(ALCdevice*,ALCsizei,ALCenum,ALCenum); 307 | typedef void (ALC_APIENTRY*LPALCRENDERSAMPLESSOFT)(ALCdevice*,ALCvoid*,ALCsizei); 308 | #ifdef AL_ALEXT_PROTOTYPES 309 | ALC_API ALCdevice* ALC_APIENTRY alcLoopbackOpenDeviceSOFT(const ALCchar *deviceName); 310 | ALC_API ALCboolean ALC_APIENTRY alcIsRenderFormatSupportedSOFT(ALCdevice *device, ALCsizei freq, ALCenum channels, ALCenum type); 311 | ALC_API void ALC_APIENTRY alcRenderSamplesSOFT(ALCdevice *device, ALCvoid *buffer, ALCsizei samples); 312 | #endif 313 | #endif 314 | 315 | #ifndef AL_EXT_STEREO_ANGLES 316 | #define AL_EXT_STEREO_ANGLES 1 317 | #define AL_STEREO_ANGLES 0x1030 318 | #endif 319 | 320 | #ifndef AL_EXT_SOURCE_RADIUS 321 | #define AL_EXT_SOURCE_RADIUS 1 322 | #define AL_SOURCE_RADIUS 0x1031 323 | #endif 324 | 325 | #ifndef AL_SOFT_source_latency 326 | #define AL_SOFT_source_latency 1 327 | #define AL_SAMPLE_OFFSET_LATENCY_SOFT 0x1200 328 | #define AL_SEC_OFFSET_LATENCY_SOFT 0x1201 329 | typedef _alsoft_int64_t ALint64SOFT; 330 | typedef _alsoft_uint64_t ALuint64SOFT; 331 | typedef void (AL_APIENTRY*LPALSOURCEDSOFT)(ALuint,ALenum,ALdouble); 332 | typedef void (AL_APIENTRY*LPALSOURCE3DSOFT)(ALuint,ALenum,ALdouble,ALdouble,ALdouble); 333 | typedef void (AL_APIENTRY*LPALSOURCEDVSOFT)(ALuint,ALenum,const ALdouble*); 334 | typedef void (AL_APIENTRY*LPALGETSOURCEDSOFT)(ALuint,ALenum,ALdouble*); 335 | typedef void (AL_APIENTRY*LPALGETSOURCE3DSOFT)(ALuint,ALenum,ALdouble*,ALdouble*,ALdouble*); 336 | typedef void (AL_APIENTRY*LPALGETSOURCEDVSOFT)(ALuint,ALenum,ALdouble*); 337 | typedef void (AL_APIENTRY*LPALSOURCEI64SOFT)(ALuint,ALenum,ALint64SOFT); 338 | typedef void (AL_APIENTRY*LPALSOURCE3I64SOFT)(ALuint,ALenum,ALint64SOFT,ALint64SOFT,ALint64SOFT); 339 | typedef void (AL_APIENTRY*LPALSOURCEI64VSOFT)(ALuint,ALenum,const ALint64SOFT*); 340 | typedef void (AL_APIENTRY*LPALGETSOURCEI64SOFT)(ALuint,ALenum,ALint64SOFT*); 341 | typedef void (AL_APIENTRY*LPALGETSOURCE3I64SOFT)(ALuint,ALenum,ALint64SOFT*,ALint64SOFT*,ALint64SOFT*); 342 | typedef void (AL_APIENTRY*LPALGETSOURCEI64VSOFT)(ALuint,ALenum,ALint64SOFT*); 343 | #ifdef AL_ALEXT_PROTOTYPES 344 | AL_API void AL_APIENTRY alSourcedSOFT(ALuint source, ALenum param, ALdouble value); 345 | AL_API void AL_APIENTRY alSource3dSOFT(ALuint source, ALenum param, ALdouble value1, ALdouble value2, ALdouble value3); 346 | AL_API void AL_APIENTRY alSourcedvSOFT(ALuint source, ALenum param, const ALdouble *values); 347 | AL_API void AL_APIENTRY alGetSourcedSOFT(ALuint source, ALenum param, ALdouble *value); 348 | AL_API void AL_APIENTRY alGetSource3dSOFT(ALuint source, ALenum param, ALdouble *value1, ALdouble *value2, ALdouble *value3); 349 | AL_API void AL_APIENTRY alGetSourcedvSOFT(ALuint source, ALenum param, ALdouble *values); 350 | AL_API void AL_APIENTRY alSourcei64SOFT(ALuint source, ALenum param, ALint64SOFT value); 351 | AL_API void AL_APIENTRY alSource3i64SOFT(ALuint source, ALenum param, ALint64SOFT value1, ALint64SOFT value2, ALint64SOFT value3); 352 | AL_API void AL_APIENTRY alSourcei64vSOFT(ALuint source, ALenum param, const ALint64SOFT *values); 353 | AL_API void AL_APIENTRY alGetSourcei64SOFT(ALuint source, ALenum param, ALint64SOFT *value); 354 | AL_API void AL_APIENTRY alGetSource3i64SOFT(ALuint source, ALenum param, ALint64SOFT *value1, ALint64SOFT *value2, ALint64SOFT *value3); 355 | AL_API void AL_APIENTRY alGetSourcei64vSOFT(ALuint source, ALenum param, ALint64SOFT *values); 356 | #endif 357 | #endif 358 | 359 | #ifndef ALC_EXT_DEFAULT_FILTER_ORDER 360 | #define ALC_EXT_DEFAULT_FILTER_ORDER 1 361 | #define ALC_DEFAULT_FILTER_ORDER 0x1100 362 | #endif 363 | 364 | #ifndef AL_SOFT_deferred_updates 365 | #define AL_SOFT_deferred_updates 1 366 | #define AL_DEFERRED_UPDATES_SOFT 0xC002 367 | typedef void (AL_APIENTRY*LPALDEFERUPDATESSOFT)(void); 368 | typedef void (AL_APIENTRY*LPALPROCESSUPDATESSOFT)(void); 369 | #ifdef AL_ALEXT_PROTOTYPES 370 | AL_API void AL_APIENTRY alDeferUpdatesSOFT(void); 371 | AL_API void AL_APIENTRY alProcessUpdatesSOFT(void); 372 | #endif 373 | #endif 374 | 375 | #ifndef AL_SOFT_block_alignment 376 | #define AL_SOFT_block_alignment 1 377 | #define AL_UNPACK_BLOCK_ALIGNMENT_SOFT 0x200C 378 | #define AL_PACK_BLOCK_ALIGNMENT_SOFT 0x200D 379 | #endif 380 | 381 | #ifndef AL_SOFT_MSADPCM 382 | #define AL_SOFT_MSADPCM 1 383 | #define AL_FORMAT_MONO_MSADPCM_SOFT 0x1302 384 | #define AL_FORMAT_STEREO_MSADPCM_SOFT 0x1303 385 | #endif 386 | 387 | #ifndef AL_SOFT_source_length 388 | #define AL_SOFT_source_length 1 389 | /*#define AL_BYTE_LENGTH_SOFT 0x2009*/ 390 | /*#define AL_SAMPLE_LENGTH_SOFT 0x200A*/ 391 | /*#define AL_SEC_LENGTH_SOFT 0x200B*/ 392 | #endif 393 | 394 | #ifndef AL_SOFT_buffer_length_query 395 | #define AL_SOFT_buffer_length_query 1 396 | /*#define AL_BYTE_LENGTH_SOFT 0x2009*/ 397 | /*#define AL_SAMPLE_LENGTH_SOFT 0x200A*/ 398 | /*#define AL_SEC_LENGTH_SOFT 0x200B*/ 399 | #endif 400 | 401 | #ifndef ALC_SOFT_pause_device 402 | #define ALC_SOFT_pause_device 1 403 | typedef void (ALC_APIENTRY*LPALCDEVICEPAUSESOFT)(ALCdevice *device); 404 | typedef void (ALC_APIENTRY*LPALCDEVICERESUMESOFT)(ALCdevice *device); 405 | #ifdef AL_ALEXT_PROTOTYPES 406 | ALC_API void ALC_APIENTRY alcDevicePauseSOFT(ALCdevice *device); 407 | ALC_API void ALC_APIENTRY alcDeviceResumeSOFT(ALCdevice *device); 408 | #endif 409 | #endif 410 | 411 | #ifndef AL_EXT_BFORMAT 412 | #define AL_EXT_BFORMAT 1 413 | /* Provides support for B-Format ambisonic buffers (first-order, FuMa scaling 414 | * and layout). 415 | * 416 | * BFORMAT2D_8: Unsigned 8-bit, 3-channel non-periphonic (WXY). 417 | * BFORMAT2D_16: Signed 16-bit, 3-channel non-periphonic (WXY). 418 | * BFORMAT2D_FLOAT32: 32-bit float, 3-channel non-periphonic (WXY). 419 | * BFORMAT3D_8: Unsigned 8-bit, 4-channel periphonic (WXYZ). 420 | * BFORMAT3D_16: Signed 16-bit, 4-channel periphonic (WXYZ). 421 | * BFORMAT3D_FLOAT32: 32-bit float, 4-channel periphonic (WXYZ). 422 | */ 423 | #define AL_FORMAT_BFORMAT2D_8 0x20021 424 | #define AL_FORMAT_BFORMAT2D_16 0x20022 425 | #define AL_FORMAT_BFORMAT2D_FLOAT32 0x20023 426 | #define AL_FORMAT_BFORMAT3D_8 0x20031 427 | #define AL_FORMAT_BFORMAT3D_16 0x20032 428 | #define AL_FORMAT_BFORMAT3D_FLOAT32 0x20033 429 | #endif 430 | 431 | #ifndef AL_EXT_MULAW_BFORMAT 432 | #define AL_EXT_MULAW_BFORMAT 1 433 | #define AL_FORMAT_BFORMAT2D_MULAW 0x10031 434 | #define AL_FORMAT_BFORMAT3D_MULAW 0x10032 435 | #endif 436 | 437 | #ifndef ALC_SOFT_HRTF 438 | #define ALC_SOFT_HRTF 1 439 | #define ALC_HRTF_SOFT 0x1992 440 | #define ALC_DONT_CARE_SOFT 0x0002 441 | #define ALC_HRTF_STATUS_SOFT 0x1993 442 | #define ALC_HRTF_DISABLED_SOFT 0x0000 443 | #define ALC_HRTF_ENABLED_SOFT 0x0001 444 | #define ALC_HRTF_DENIED_SOFT 0x0002 445 | #define ALC_HRTF_REQUIRED_SOFT 0x0003 446 | #define ALC_HRTF_HEADPHONES_DETECTED_SOFT 0x0004 447 | #define ALC_HRTF_UNSUPPORTED_FORMAT_SOFT 0x0005 448 | #define ALC_NUM_HRTF_SPECIFIERS_SOFT 0x1994 449 | #define ALC_HRTF_SPECIFIER_SOFT 0x1995 450 | #define ALC_HRTF_ID_SOFT 0x1996 451 | typedef const ALCchar* (ALC_APIENTRY*LPALCGETSTRINGISOFT)(ALCdevice *device, ALCenum paramName, ALCsizei index); 452 | typedef ALCboolean (ALC_APIENTRY*LPALCRESETDEVICESOFT)(ALCdevice *device, const ALCint *attribs); 453 | #ifdef AL_ALEXT_PROTOTYPES 454 | ALC_API const ALCchar* ALC_APIENTRY alcGetStringiSOFT(ALCdevice *device, ALCenum paramName, ALCsizei index); 455 | ALC_API ALCboolean ALC_APIENTRY alcResetDeviceSOFT(ALCdevice *device, const ALCint *attribs); 456 | #endif 457 | #endif 458 | 459 | #ifndef AL_SOFT_gain_clamp_ex 460 | #define AL_SOFT_gain_clamp_ex 1 461 | #define AL_GAIN_LIMIT_SOFT 0x200E 462 | #endif 463 | 464 | #ifndef AL_SOFT_source_resampler 465 | #define AL_SOFT_source_resampler 466 | #define AL_NUM_RESAMPLERS_SOFT 0x1210 467 | #define AL_DEFAULT_RESAMPLER_SOFT 0x1211 468 | #define AL_SOURCE_RESAMPLER_SOFT 0x1212 469 | #define AL_RESAMPLER_NAME_SOFT 0x1213 470 | typedef const ALchar* (AL_APIENTRY*LPALGETSTRINGISOFT)(ALenum pname, ALsizei index); 471 | #ifdef AL_ALEXT_PROTOTYPES 472 | AL_API const ALchar* AL_APIENTRY alGetStringiSOFT(ALenum pname, ALsizei index); 473 | #endif 474 | #endif 475 | 476 | #ifndef AL_SOFT_source_spatialize 477 | #define AL_SOFT_source_spatialize 478 | #define AL_SOURCE_SPATIALIZE_SOFT 0x1214 479 | #define AL_AUTO_SOFT 0x0002 480 | #endif 481 | 482 | #ifndef ALC_SOFT_output_limiter 483 | #define ALC_SOFT_output_limiter 484 | #define ALC_OUTPUT_LIMITER_SOFT 0x199A 485 | #endif 486 | 487 | #ifndef ALC_SOFT_device_clock 488 | #define ALC_SOFT_device_clock 1 489 | typedef _alsoft_int64_t ALCint64SOFT; 490 | typedef _alsoft_uint64_t ALCuint64SOFT; 491 | #define ALC_DEVICE_CLOCK_SOFT 0x1600 492 | #define ALC_DEVICE_LATENCY_SOFT 0x1601 493 | #define ALC_DEVICE_CLOCK_LATENCY_SOFT 0x1602 494 | #define AL_SAMPLE_OFFSET_CLOCK_SOFT 0x1202 495 | #define AL_SEC_OFFSET_CLOCK_SOFT 0x1203 496 | typedef void (ALC_APIENTRY*LPALCGETINTEGER64VSOFT)(ALCdevice *device, ALCenum pname, ALsizei size, ALCint64SOFT *values); 497 | #ifdef AL_ALEXT_PROTOTYPES 498 | ALC_API void ALC_APIENTRY alcGetInteger64vSOFT(ALCdevice *device, ALCenum pname, ALsizei size, ALCint64SOFT *values); 499 | #endif 500 | #endif 501 | 502 | #ifndef AL_SOFT_direct_channels_remix 503 | #define AL_SOFT_direct_channels_remix 1 504 | #define AL_DROP_UNMATCHED_SOFT 0x0001 505 | #define AL_REMIX_UNMATCHED_SOFT 0x0002 506 | #endif 507 | 508 | #ifndef AL_SOFT_bformat_ex 509 | #define AL_SOFT_bformat_ex 1 510 | #define AL_AMBISONIC_LAYOUT_SOFT 0x1997 511 | #define AL_AMBISONIC_SCALING_SOFT 0x1998 512 | 513 | /* Ambisonic layouts */ 514 | #define AL_FUMA_SOFT 0x0000 515 | #define AL_ACN_SOFT 0x0001 516 | 517 | /* Ambisonic scalings (normalization) */ 518 | /*#define AL_FUMA_SOFT*/ 519 | #define AL_SN3D_SOFT 0x0001 520 | #define AL_N3D_SOFT 0x0002 521 | #endif 522 | 523 | #ifndef ALC_SOFT_loopback_bformat 524 | #define ALC_SOFT_loopback_bformat 1 525 | #define ALC_AMBISONIC_LAYOUT_SOFT 0x1997 526 | #define ALC_AMBISONIC_SCALING_SOFT 0x1998 527 | #define ALC_AMBISONIC_ORDER_SOFT 0x1999 528 | #define ALC_MAX_AMBISONIC_ORDER_SOFT 0x199B 529 | 530 | #define ALC_BFORMAT3D_SOFT 0x1507 531 | 532 | /* Ambisonic layouts */ 533 | #define ALC_FUMA_SOFT 0x0000 534 | #define ALC_ACN_SOFT 0x0001 535 | 536 | /* Ambisonic scalings (normalization) */ 537 | /*#define ALC_FUMA_SOFT*/ 538 | #define ALC_SN3D_SOFT 0x0001 539 | #define ALC_N3D_SOFT 0x0002 540 | #endif 541 | 542 | #ifndef AL_SOFT_effect_target 543 | #define AL_SOFT_effect_target 544 | #define AL_EFFECTSLOT_TARGET_SOFT 0x199C 545 | #endif 546 | 547 | #ifndef AL_SOFT_events 548 | #define AL_SOFT_events 1 549 | #define AL_EVENT_CALLBACK_FUNCTION_SOFT 0x19A2 550 | #define AL_EVENT_CALLBACK_USER_PARAM_SOFT 0x19A3 551 | #define AL_EVENT_TYPE_BUFFER_COMPLETED_SOFT 0x19A4 552 | #define AL_EVENT_TYPE_SOURCE_STATE_CHANGED_SOFT 0x19A5 553 | #define AL_EVENT_TYPE_DISCONNECTED_SOFT 0x19A6 554 | typedef void (AL_APIENTRY*ALEVENTPROCSOFT)(ALenum eventType, ALuint object, ALuint param, 555 | ALsizei length, const ALchar *message, 556 | void *userParam); 557 | typedef void (AL_APIENTRY*LPALEVENTCONTROLSOFT)(ALsizei count, const ALenum *types, ALboolean enable); 558 | typedef void (AL_APIENTRY*LPALEVENTCALLBACKSOFT)(ALEVENTPROCSOFT callback, void *userParam); 559 | typedef void* (AL_APIENTRY*LPALGETPOINTERSOFT)(ALenum pname); 560 | typedef void (AL_APIENTRY*LPALGETPOINTERVSOFT)(ALenum pname, void **values); 561 | #ifdef AL_ALEXT_PROTOTYPES 562 | AL_API void AL_APIENTRY alEventControlSOFT(ALsizei count, const ALenum *types, ALboolean enable); 563 | AL_API void AL_APIENTRY alEventCallbackSOFT(ALEVENTPROCSOFT callback, void *userParam); 564 | AL_API void* AL_APIENTRY alGetPointerSOFT(ALenum pname); 565 | AL_API void AL_APIENTRY alGetPointervSOFT(ALenum pname, void **values); 566 | #endif 567 | #endif 568 | 569 | #ifndef ALC_SOFT_reopen_device 570 | #define ALC_SOFT_reopen_device 571 | typedef ALCboolean (ALC_APIENTRY*LPALCREOPENDEVICESOFT)(ALCdevice *device, 572 | const ALCchar *deviceName, const ALCint *attribs); 573 | #ifdef AL_ALEXT_PROTOTYPES 574 | ALCboolean ALC_APIENTRY alcReopenDeviceSOFT(ALCdevice *device, const ALCchar *deviceName, 575 | const ALCint *attribs); 576 | #endif 577 | #endif 578 | 579 | #ifndef AL_SOFT_callback_buffer 580 | #define AL_SOFT_callback_buffer 581 | #define AL_BUFFER_CALLBACK_FUNCTION_SOFT 0x19A0 582 | #define AL_BUFFER_CALLBACK_USER_PARAM_SOFT 0x19A1 583 | typedef ALsizei (AL_APIENTRY*ALBUFFERCALLBACKTYPESOFT)(ALvoid *userptr, ALvoid *sampledata, ALsizei numbytes); 584 | typedef void (AL_APIENTRY*LPALBUFFERCALLBACKSOFT)(ALuint buffer, ALenum format, ALsizei freq, ALBUFFERCALLBACKTYPESOFT callback, ALvoid *userptr); 585 | typedef void (AL_APIENTRY*LPALGETBUFFERPTRSOFT)(ALuint buffer, ALenum param, ALvoid **value); 586 | typedef void (AL_APIENTRY*LPALGETBUFFER3PTRSOFT)(ALuint buffer, ALenum param, ALvoid **value1, ALvoid **value2, ALvoid **value3); 587 | typedef void (AL_APIENTRY*LPALGETBUFFERPTRVSOFT)(ALuint buffer, ALenum param, ALvoid **values); 588 | #ifdef AL_ALEXT_PROTOTYPES 589 | AL_API void AL_APIENTRY alBufferCallbackSOFT(ALuint buffer, ALenum format, ALsizei freq, ALBUFFERCALLBACKTYPESOFT callback, ALvoid *userptr); 590 | AL_API void AL_APIENTRY alGetBufferPtrSOFT(ALuint buffer, ALenum param, ALvoid **ptr); 591 | AL_API void AL_APIENTRY alGetBuffer3PtrSOFT(ALuint buffer, ALenum param, ALvoid **ptr0, ALvoid **ptr1, ALvoid **ptr2); 592 | AL_API void AL_APIENTRY alGetBufferPtrvSOFT(ALuint buffer, ALenum param, ALvoid **ptr); 593 | #endif 594 | #endif 595 | 596 | #ifndef AL_SOFT_UHJ 597 | #define AL_SOFT_UHJ 598 | #define AL_FORMAT_UHJ2CHN8_SOFT 0x19A2 599 | #define AL_FORMAT_UHJ2CHN16_SOFT 0x19A3 600 | #define AL_FORMAT_UHJ2CHN_FLOAT32_SOFT 0x19A4 601 | #define AL_FORMAT_UHJ3CHN8_SOFT 0x19A5 602 | #define AL_FORMAT_UHJ3CHN16_SOFT 0x19A6 603 | #define AL_FORMAT_UHJ3CHN_FLOAT32_SOFT 0x19A7 604 | #define AL_FORMAT_UHJ4CHN8_SOFT 0x19A8 605 | #define AL_FORMAT_UHJ4CHN16_SOFT 0x19A9 606 | #define AL_FORMAT_UHJ4CHN_FLOAT32_SOFT 0x19AA 607 | 608 | #define AL_STEREO_MODE_SOFT 0x19B0 609 | #define AL_NORMAL_SOFT 0x0000 610 | #define AL_SUPER_STEREO_SOFT 0x0001 611 | #define AL_SUPER_STEREO_WIDTH_SOFT 0x19B1 612 | #endif 613 | 614 | #ifndef AL_SOFT_UHJ_ex 615 | #define AL_SOFT_UHJ_ex 616 | #define AL_FORMAT_UHJ2CHN_MULAW_SOFT 0x19B3 617 | #define AL_FORMAT_UHJ2CHN_ALAW_SOFT 0x19B4 618 | #define AL_FORMAT_UHJ2CHN_IMA4_SOFT 0x19B5 619 | #define AL_FORMAT_UHJ2CHN_MSADPCM_SOFT 0x19B6 620 | #define AL_FORMAT_UHJ3CHN_MULAW_SOFT 0x19B7 621 | #define AL_FORMAT_UHJ3CHN_ALAW_SOFT 0x19B8 622 | #define AL_FORMAT_UHJ4CHN_MULAW_SOFT 0x19B9 623 | #define AL_FORMAT_UHJ4CHN_ALAW_SOFT 0x19BA 624 | #endif 625 | 626 | #ifndef ALC_SOFT_output_mode 627 | #define ALC_SOFT_output_mode 628 | #define ALC_OUTPUT_MODE_SOFT 0x19AC 629 | #define ALC_ANY_SOFT 0x19AD 630 | /*#define ALC_MONO_SOFT 0x1500*/ 631 | /*#define ALC_STEREO_SOFT 0x1501*/ 632 | #define ALC_STEREO_BASIC_SOFT 0x19AE 633 | #define ALC_STEREO_UHJ_SOFT 0x19AF 634 | #define ALC_STEREO_HRTF_SOFT 0x19B2 635 | /*#define ALC_QUAD_SOFT 0x1503*/ 636 | #define ALC_SURROUND_5_1_SOFT 0x1504 637 | #define ALC_SURROUND_6_1_SOFT 0x1505 638 | #define ALC_SURROUND_7_1_SOFT 0x1506 639 | #endif 640 | 641 | #ifndef AL_SOFT_source_start_delay 642 | #define AL_SOFT_source_start_delay 643 | typedef void (AL_APIENTRY*LPALSOURCEPLAYATTIMESOFT)(ALuint source, ALint64SOFT start_time); 644 | typedef void (AL_APIENTRY*LPALSOURCEPLAYATTIMEVSOFT)(ALsizei n, const ALuint *sources, ALint64SOFT start_time); 645 | #ifdef AL_ALEXT_PROTOTYPES 646 | void AL_APIENTRY alSourcePlayAtTimeSOFT(ALuint source, ALint64SOFT start_time); 647 | void AL_APIENTRY alSourcePlayAtTimevSOFT(ALsizei n, const ALuint *sources, ALint64SOFT start_time); 648 | #endif 649 | #endif 650 | 651 | #ifdef __cplusplus 652 | } 653 | #endif 654 | 655 | #endif 656 | -------------------------------------------------------------------------------- /vendor/openal/include/AL/efx-creative.h: -------------------------------------------------------------------------------- 1 | /* The tokens that would be defined here are already defined in efx.h. This 2 | * empty file is here to provide compatibility with Windows-based projects 3 | * that would include it. */ 4 | -------------------------------------------------------------------------------- /vendor/openal/lib/x64/OpenAL32.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polybiusproxy/Endor/9612e857852d35652c8b2035b7bfa7c07b57fe38/vendor/openal/lib/x64/OpenAL32.lib -------------------------------------------------------------------------------- /vendor/openal/lib/x64/soft_oal.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polybiusproxy/Endor/9612e857852d35652c8b2035b7bfa7c07b57fe38/vendor/openal/lib/x64/soft_oal.dll -------------------------------------------------------------------------------- /vendor/openal/lib/x86/OpenAL32.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polybiusproxy/Endor/9612e857852d35652c8b2035b7bfa7c07b57fe38/vendor/openal/lib/x86/OpenAL32.lib -------------------------------------------------------------------------------- /vendor/openal/lib/x86/soft_oal.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polybiusproxy/Endor/9612e857852d35652c8b2035b7bfa7c07b57fe38/vendor/openal/lib/x86/soft_oal.dll --------------------------------------------------------------------------------