├── .gitattributes
├── LICENSE
├── QuakeBspViewerVR.exe
├── QuakeBspViewerVR.sln
├── QuakeBspViewerVR.vcxproj
├── QuakeBspViewerVR.vcxproj.filters
├── README.md
├── SDL2.dll
├── contrib
├── SDL
│ ├── BUGS.txt
│ ├── COPYING.txt
│ ├── README-SDL.txt
│ ├── README.txt
│ ├── WhatsNew.txt
│ ├── include
│ │ ├── SDL.h
│ │ ├── SDL_assert.h
│ │ ├── SDL_atomic.h
│ │ ├── SDL_audio.h
│ │ ├── SDL_bits.h
│ │ ├── SDL_blendmode.h
│ │ ├── SDL_clipboard.h
│ │ ├── SDL_config.h
│ │ ├── SDL_cpuinfo.h
│ │ ├── SDL_egl.h
│ │ ├── SDL_endian.h
│ │ ├── SDL_error.h
│ │ ├── SDL_events.h
│ │ ├── SDL_filesystem.h
│ │ ├── SDL_gamecontroller.h
│ │ ├── SDL_gesture.h
│ │ ├── SDL_haptic.h
│ │ ├── SDL_hints.h
│ │ ├── SDL_joystick.h
│ │ ├── SDL_keyboard.h
│ │ ├── SDL_keycode.h
│ │ ├── SDL_loadso.h
│ │ ├── SDL_log.h
│ │ ├── SDL_main.h
│ │ ├── SDL_messagebox.h
│ │ ├── SDL_mouse.h
│ │ ├── SDL_mutex.h
│ │ ├── SDL_name.h
│ │ ├── SDL_opengl.h
│ │ ├── SDL_opengl_glext.h
│ │ ├── SDL_opengles.h
│ │ ├── SDL_opengles2.h
│ │ ├── SDL_opengles2_gl2.h
│ │ ├── SDL_opengles2_gl2ext.h
│ │ ├── SDL_opengles2_gl2platform.h
│ │ ├── SDL_opengles2_khrplatform.h
│ │ ├── SDL_pixels.h
│ │ ├── SDL_platform.h
│ │ ├── SDL_power.h
│ │ ├── SDL_quit.h
│ │ ├── SDL_rect.h
│ │ ├── SDL_render.h
│ │ ├── SDL_revision.h
│ │ ├── SDL_rwops.h
│ │ ├── SDL_scancode.h
│ │ ├── SDL_shape.h
│ │ ├── SDL_stdinc.h
│ │ ├── SDL_surface.h
│ │ ├── SDL_system.h
│ │ ├── SDL_syswm.h
│ │ ├── SDL_test.h
│ │ ├── SDL_test_assert.h
│ │ ├── SDL_test_common.h
│ │ ├── SDL_test_compare.h
│ │ ├── SDL_test_crc32.h
│ │ ├── SDL_test_font.h
│ │ ├── SDL_test_fuzzer.h
│ │ ├── SDL_test_harness.h
│ │ ├── SDL_test_images.h
│ │ ├── SDL_test_log.h
│ │ ├── SDL_test_md5.h
│ │ ├── SDL_test_random.h
│ │ ├── SDL_thread.h
│ │ ├── SDL_timer.h
│ │ ├── SDL_touch.h
│ │ ├── SDL_types.h
│ │ ├── SDL_version.h
│ │ ├── SDL_video.h
│ │ ├── begin_code.h
│ │ └── close_code.h
│ └── lib
│ │ ├── x64
│ │ ├── SDL2.dll
│ │ ├── SDL2.lib
│ │ ├── SDL2main.lib
│ │ └── SDL2test.lib
│ │ └── x86
│ │ ├── SDL2.dll
│ │ ├── SDL2.lib
│ │ ├── SDL2main.lib
│ │ └── SDL2test.lib
├── glew-1.11.0
│ ├── LICENSE.txt
│ ├── README.txt
│ ├── TODO.txt
│ ├── bin
│ │ ├── Release MX
│ │ │ ├── Win32
│ │ │ │ └── glew32mx.dll
│ │ │ └── x64
│ │ │ │ └── glew32mx.dll
│ │ └── Release
│ │ │ ├── Win32
│ │ │ ├── glew32.dll
│ │ │ ├── glewinfo.exe
│ │ │ ├── glewinfo.txt
│ │ │ └── visualinfo.exe
│ │ │ └── x64
│ │ │ ├── glew32.dll
│ │ │ ├── glewinfo.exe
│ │ │ └── visualinfo.exe
│ ├── doc
│ │ ├── advanced.html
│ │ ├── basic.html
│ │ ├── build.html
│ │ ├── credits.html
│ │ ├── glew.css
│ │ ├── glew.html
│ │ ├── glew.png
│ │ ├── glew.txt
│ │ ├── glxew.html
│ │ ├── gpl.txt
│ │ ├── index.html
│ │ ├── install.html
│ │ ├── khronos.txt
│ │ ├── log.html
│ │ ├── mesa.txt
│ │ ├── new.png
│ │ ├── ogl_sm.jpg
│ │ └── wglew.html
│ ├── include
│ │ └── GL
│ │ │ ├── glew.h
│ │ │ ├── glxew.h
│ │ │ └── wglew.h
│ └── lib
│ │ ├── Release MX
│ │ ├── Win32
│ │ │ ├── glew32mx.lib
│ │ │ └── glew32mxs.lib
│ │ └── x64
│ │ │ ├── glew32mx.lib
│ │ │ └── glew32mxs.lib
│ │ └── Release
│ │ ├── Win32
│ │ ├── glew32.lib
│ │ └── glew32s.lib
│ │ └── x64
│ │ ├── glew32.lib
│ │ └── glew32s.lib
└── stb_image
│ ├── stb_image.c
│ └── stb_image.h
├── glew32.dll
├── images
├── q3vr1.png
├── q3vr2.png
├── q3vr_youtube.png
├── qbsp1.png
└── qbsp3.png
├── maps
└── ntkjidm2.bsp
├── res
├── Basic.fsh
├── Basic.vsh
├── Font.fsh
├── Font.vsh
├── OVRFrustum.fsh
├── OVRFrustum.vsh
├── font.png
└── missing.png
├── run.bat
└── src
├── Application.cpp
├── Application.hpp
├── Frustum.cpp
├── Frustum.hpp
├── InputHandlers.cpp
├── InputHandlers.hpp
├── Math.cpp
├── Math.hpp
├── StringHelpers.cpp
├── StringHelpers.hpp
├── Utils.cpp
├── Utils.hpp
├── common
├── BspMap.hpp
└── StatsUI.hpp
├── main.cpp
├── q3bsp
├── Q3Bsp.hpp
├── Q3BspLoader.cpp
├── Q3BspLoader.hpp
├── Q3BspMap.cpp
├── Q3BspMap.hpp
├── Q3BspPatch.cpp
├── Q3BspPatch.hpp
├── Q3BspRenderHelpers.hpp
├── Q3BspStatsUI.cpp
└── Q3BspStatsUI.hpp
└── renderer
├── Camera.cpp
├── Camera.hpp
├── CameraDirector.cpp
├── CameraDirector.hpp
├── Font.cpp
├── Font.hpp
├── OVRCameraFrustum.cpp
├── OVRCameraFrustum.hpp
├── OVRTrackerChaperone.cpp
├── OVRTrackerChaperone.hpp
├── OculusVR.cpp
├── OculusVR.hpp
├── OculusVRDebug.cpp
├── OculusVRDebug.hpp
├── OpenGL.cpp
├── OpenGL.hpp
├── RenderContext.cpp
├── RenderContext.hpp
├── Shader.hpp
├── ShaderManager.cpp
├── ShaderManager.hpp
├── Texture.cpp
├── Texture.hpp
├── TextureManager.cpp
└── TextureManager.hpp
/.gitattributes:
--------------------------------------------------------------------------------
1 | contrib/* linguist-vendored
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2016 Krzysztof Kondrak
2 |
3 | Permission is hereby granted, free of charge, to any
4 | person obtaining a copy of this software and associated
5 | documentation files (the "Software"), to deal in the
6 | Software without restriction, including without
7 | limitation the rights to use, copy, modify, merge,
8 | publish, distribute, sublicense, and/or sell copies of
9 | the Software, and to permit persons to whom the Software
10 | is furnished to do so, subject to the following
11 | conditions:
12 |
13 | The above copyright notice and this permission notice
14 | shall be included in all copies or substantial portions
15 | of the Software.
16 |
17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
18 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
19 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
20 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
21 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
24 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25 | DEALINGS IN THE SOFTWARE.
26 |
--------------------------------------------------------------------------------
/QuakeBspViewerVR.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kondrak/quake_bsp_viewer_vr/d04590571f3959f40706a58a6ef21b34f82119a0/QuakeBspViewerVR.exe
--------------------------------------------------------------------------------
/QuakeBspViewerVR.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | VisualStudioVersion = 14.0.23107.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "QuakeBspViewerVR", "QuakeBspViewerVR.vcxproj", "{74D78140-348F-4C55-9D29-C41940DBC100}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Win32 = Debug|Win32
11 | Release|Win32 = Release|Win32
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {74D78140-348F-4C55-9D29-C41940DBC100}.Debug|Win32.ActiveCfg = Debug|Win32
15 | {74D78140-348F-4C55-9D29-C41940DBC100}.Debug|Win32.Build.0 = Debug|Win32
16 | {74D78140-348F-4C55-9D29-C41940DBC100}.Release|Win32.ActiveCfg = Release|Win32
17 | {74D78140-348F-4C55-9D29-C41940DBC100}.Release|Win32.Build.0 = Release|Win32
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Quake BSP map viewer with Oculus Rift support
2 | ================
3 |
4 | This is a BSP tree OpenGL renderer written in C++. It handles basic geometry and curved patch rendering but with no support for game-specific shaders, entities etc. It implement PVS and frustum culling so performance is optimal. At the moment only Quake III Arena maps are supported but an interface is provided for adding other BSP versions in the future.
5 |
6 | A separate no_vr
branch contains code without any OculusVR dependencies if you're just interested in focusing solely on OpenGL renderer.
7 |
8 | Youtube demo:
9 |
10 | [](https://www.youtube.com/watch?v=pAGLW82ryBc)
11 |
12 | Screenshots:
13 |
14 | 
15 | 
16 | 
17 | 
18 | Usage
19 | -----
20 | Running the viewer:
21 |
22 | QuakeBspViewerVR.exe <path-to-bsp-file>
23 |
24 | Running the viewer in VR:
25 |
26 | QuakeBspViewerVR.exe <path-to-bsp-file> -vr
27 |
28 | In non-VR mode, use tilde key (~) to toggle statistics menu on/off. In VR mode, toggle between statistics, VR debug data and IR tracking camera frustum rendering (if camera is available). SPACE key will recenter your tracking position. Press M to toggle between different mirror modes. Note that you must have Quake III Arena textures and models unpacked in the root directory if you want to see proper texturing. To move around use the WASD keys. RF keys lift you up/down and QE keys let you do the barrel roll (in non-VR mode only).
29 |
30 | Dependencies
31 | -------
32 | This project uses following external libraries:
33 |
34 | - GLEW extension library
35 | - [stb_image](https://github.com/nothings/stb) library for texture loading
36 | - SDL2 library for window/input
37 | - VR support requires OculusVR SDK 1.3+ and Oculus Home installed
38 |
39 | References
40 | -------
41 | This viewer was made using following resources:
42 | - http://www.mralligator.com/q3/
43 | - http://graphics.cs.brown.edu/games/quake/quake3.html
44 |
45 | Known issues
46 | -------
47 | Certain BSP leaves containing doors, moving platforms etc. may not render correctly with PVS enabled. This is because they are handled differently by the original game.
48 |
49 | Todo
50 | ----
51 | Here's a list of ideas that could be fun to implement over time:
52 |
53 | - add support for older bsp formats (ie. Quake1, Quake2)
54 | - render map entities (weapons, armor, other pickups)
55 | - support loading data from pk3/pak files
56 | - add support for rendering Quake 3 shaders
57 | - bsp patch tesselation on the fly
58 |
--------------------------------------------------------------------------------
/SDL2.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kondrak/quake_bsp_viewer_vr/d04590571f3959f40706a58a6ef21b34f82119a0/SDL2.dll
--------------------------------------------------------------------------------
/contrib/SDL/BUGS.txt:
--------------------------------------------------------------------------------
1 |
2 | Bugs are now managed in the SDL bug tracker, here:
3 |
4 | http://bugzilla.libsdl.org/
5 |
6 | You may report bugs there, and search to see if a given issue has already
7 | been reported, discussed, and maybe even fixed.
8 |
9 |
10 | You may also find help on the SDL mailing list. Subscription information:
11 |
12 | http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
13 |
14 | Bug reports are welcome here, but we really appreciate if you use Bugzilla, as
15 | bugs discussed on the mailing list may be forgotten or missed.
16 |
17 |
--------------------------------------------------------------------------------
/contrib/SDL/COPYING.txt:
--------------------------------------------------------------------------------
1 |
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2016 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 |
21 |
--------------------------------------------------------------------------------
/contrib/SDL/README-SDL.txt:
--------------------------------------------------------------------------------
1 |
2 | Please distribute this file with the SDL runtime environment:
3 |
4 | The Simple DirectMedia Layer (SDL for short) is a cross-platform library
5 | designed to make it easy to write multi-media software, such as games and
6 | emulators.
7 |
8 | The Simple DirectMedia Layer library source code is available from:
9 | http://www.libsdl.org/
10 |
11 | This library is distributed under the terms of the zlib license:
12 | http://www.zlib.net/zlib_license.html
13 |
14 |
--------------------------------------------------------------------------------
/contrib/SDL/README.txt:
--------------------------------------------------------------------------------
1 |
2 | Simple DirectMedia Layer
3 |
4 | (SDL)
5 |
6 | Version 2.0
7 |
8 | ---
9 | http://www.libsdl.org/
10 |
11 | Simple DirectMedia Layer is a cross-platform development library designed
12 | to provide low level access to audio, keyboard, mouse, joystick, and graphics
13 | hardware via OpenGL and Direct3D. It is used by video playback software,
14 | emulators, and popular games including Valve's award winning catalog
15 | and many Humble Bundle games.
16 |
17 | More extensive documentation is available in the docs directory, starting
18 | with README.md
19 |
20 | Enjoy!
21 | Sam Lantinga (slouken@libsdl.org)
22 |
--------------------------------------------------------------------------------
/contrib/SDL/include/SDL.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2016 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL.h
24 | *
25 | * Main include header for the SDL library
26 | */
27 |
28 |
29 | #ifndef _SDL_H
30 | #define _SDL_H
31 |
32 | #include "SDL_main.h"
33 | #include "SDL_stdinc.h"
34 | #include "SDL_assert.h"
35 | #include "SDL_atomic.h"
36 | #include "SDL_audio.h"
37 | #include "SDL_clipboard.h"
38 | #include "SDL_cpuinfo.h"
39 | #include "SDL_endian.h"
40 | #include "SDL_error.h"
41 | #include "SDL_events.h"
42 | #include "SDL_filesystem.h"
43 | #include "SDL_joystick.h"
44 | #include "SDL_gamecontroller.h"
45 | #include "SDL_haptic.h"
46 | #include "SDL_hints.h"
47 | #include "SDL_loadso.h"
48 | #include "SDL_log.h"
49 | #include "SDL_messagebox.h"
50 | #include "SDL_mutex.h"
51 | #include "SDL_power.h"
52 | #include "SDL_render.h"
53 | #include "SDL_rwops.h"
54 | #include "SDL_system.h"
55 | #include "SDL_thread.h"
56 | #include "SDL_timer.h"
57 | #include "SDL_version.h"
58 | #include "SDL_video.h"
59 |
60 | #include "begin_code.h"
61 | /* Set up for C function definitions, even when using C++ */
62 | #ifdef __cplusplus
63 | extern "C" {
64 | #endif
65 |
66 | /* As of version 0.5, SDL is loaded dynamically into the application */
67 |
68 | /**
69 | * \name SDL_INIT_*
70 | *
71 | * These are the flags which may be passed to SDL_Init(). You should
72 | * specify the subsystems which you will be using in your application.
73 | */
74 | /* @{ */
75 | #define SDL_INIT_TIMER 0x00000001
76 | #define SDL_INIT_AUDIO 0x00000010
77 | #define SDL_INIT_VIDEO 0x00000020 /**< SDL_INIT_VIDEO implies SDL_INIT_EVENTS */
78 | #define SDL_INIT_JOYSTICK 0x00000200 /**< SDL_INIT_JOYSTICK implies SDL_INIT_EVENTS */
79 | #define SDL_INIT_HAPTIC 0x00001000
80 | #define SDL_INIT_GAMECONTROLLER 0x00002000 /**< SDL_INIT_GAMECONTROLLER implies SDL_INIT_JOYSTICK */
81 | #define SDL_INIT_EVENTS 0x00004000
82 | #define SDL_INIT_NOPARACHUTE 0x00100000 /**< compatibility; this flag is ignored. */
83 | #define SDL_INIT_EVERYTHING ( \
84 | SDL_INIT_TIMER | SDL_INIT_AUDIO | SDL_INIT_VIDEO | SDL_INIT_EVENTS | \
85 | SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC | SDL_INIT_GAMECONTROLLER \
86 | )
87 | /* @} */
88 |
89 | /**
90 | * This function initializes the subsystems specified by \c flags
91 | */
92 | extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags);
93 |
94 | /**
95 | * This function initializes specific SDL subsystems
96 | *
97 | * Subsystem initialization is ref-counted, you must call
98 | * SDL_QuitSubSystem for each SDL_InitSubSystem to correctly
99 | * shutdown a subsystem manually (or call SDL_Quit to force shutdown).
100 | * If a subsystem is already loaded then this call will
101 | * increase the ref-count and return.
102 | */
103 | extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags);
104 |
105 | /**
106 | * This function cleans up specific SDL subsystems
107 | */
108 | extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags);
109 |
110 | /**
111 | * This function returns a mask of the specified subsystems which have
112 | * previously been initialized.
113 | *
114 | * If \c flags is 0, it returns a mask of all initialized subsystems.
115 | */
116 | extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags);
117 |
118 | /**
119 | * This function cleans up all initialized subsystems. You should
120 | * call it upon all exit conditions.
121 | */
122 | extern DECLSPEC void SDLCALL SDL_Quit(void);
123 |
124 | /* Ends C function definitions when using C++ */
125 | #ifdef __cplusplus
126 | }
127 | #endif
128 | #include "close_code.h"
129 |
130 | #endif /* _SDL_H */
131 |
132 | /* vi: set ts=4 sw=4 expandtab: */
133 |
--------------------------------------------------------------------------------
/contrib/SDL/include/SDL_bits.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2016 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_bits.h
24 | *
25 | * Functions for fiddling with bits and bitmasks.
26 | */
27 |
28 | #ifndef _SDL_bits_h
29 | #define _SDL_bits_h
30 |
31 | #include "SDL_stdinc.h"
32 |
33 | #include "begin_code.h"
34 | /* Set up for C function definitions, even when using C++ */
35 | #ifdef __cplusplus
36 | extern "C" {
37 | #endif
38 |
39 | /**
40 | * \file SDL_bits.h
41 | */
42 |
43 | /**
44 | * Get the index of the most significant bit. Result is undefined when called
45 | * with 0. This operation can also be stated as "count leading zeroes" and
46 | * "log base 2".
47 | *
48 | * \return Index of the most significant bit, or -1 if the value is 0.
49 | */
50 | SDL_FORCE_INLINE int
51 | SDL_MostSignificantBitIndex32(Uint32 x)
52 | {
53 | #if defined(__GNUC__) && __GNUC__ >= 4
54 | /* Count Leading Zeroes builtin in GCC.
55 | * http://gcc.gnu.org/onlinedocs/gcc-4.3.4/gcc/Other-Builtins.html
56 | */
57 | if (x == 0) {
58 | return -1;
59 | }
60 | return 31 - __builtin_clz(x);
61 | #else
62 | /* Based off of Bit Twiddling Hacks by Sean Eron Anderson
63 | * , released in the public domain.
64 | * http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog
65 | */
66 | const Uint32 b[] = {0x2, 0xC, 0xF0, 0xFF00, 0xFFFF0000};
67 | const int S[] = {1, 2, 4, 8, 16};
68 |
69 | int msbIndex = 0;
70 | int i;
71 |
72 | if (x == 0) {
73 | return -1;
74 | }
75 |
76 | for (i = 4; i >= 0; i--)
77 | {
78 | if (x & b[i])
79 | {
80 | x >>= S[i];
81 | msbIndex |= S[i];
82 | }
83 | }
84 |
85 | return msbIndex;
86 | #endif
87 | }
88 |
89 | /* Ends C function definitions when using C++ */
90 | #ifdef __cplusplus
91 | }
92 | #endif
93 | #include "close_code.h"
94 |
95 | #endif /* _SDL_bits_h */
96 |
97 | /* vi: set ts=4 sw=4 expandtab: */
98 |
--------------------------------------------------------------------------------
/contrib/SDL/include/SDL_blendmode.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2016 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_blendmode.h
24 | *
25 | * Header file declaring the SDL_BlendMode enumeration
26 | */
27 |
28 | #ifndef _SDL_blendmode_h
29 | #define _SDL_blendmode_h
30 |
31 | #include "begin_code.h"
32 | /* Set up for C function definitions, even when using C++ */
33 | #ifdef __cplusplus
34 | extern "C" {
35 | #endif
36 |
37 | /**
38 | * \brief The blend mode used in SDL_RenderCopy() and drawing operations.
39 | */
40 | typedef enum
41 | {
42 | SDL_BLENDMODE_NONE = 0x00000000, /**< no blending
43 | dstRGBA = srcRGBA */
44 | SDL_BLENDMODE_BLEND = 0x00000001, /**< alpha blending
45 | dstRGB = (srcRGB * srcA) + (dstRGB * (1-srcA))
46 | dstA = srcA + (dstA * (1-srcA)) */
47 | SDL_BLENDMODE_ADD = 0x00000002, /**< additive blending
48 | dstRGB = (srcRGB * srcA) + dstRGB
49 | dstA = dstA */
50 | SDL_BLENDMODE_MOD = 0x00000004 /**< color modulate
51 | dstRGB = srcRGB * dstRGB
52 | dstA = dstA */
53 | } SDL_BlendMode;
54 |
55 | /* Ends C function definitions when using C++ */
56 | #ifdef __cplusplus
57 | }
58 | #endif
59 | #include "close_code.h"
60 |
61 | #endif /* _SDL_blendmode_h */
62 |
63 | /* vi: set ts=4 sw=4 expandtab: */
64 |
--------------------------------------------------------------------------------
/contrib/SDL/include/SDL_clipboard.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2016 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_clipboard.h
24 | *
25 | * Include file for SDL clipboard handling
26 | */
27 |
28 | #ifndef _SDL_clipboard_h
29 | #define _SDL_clipboard_h
30 |
31 | #include "SDL_stdinc.h"
32 |
33 | #include "begin_code.h"
34 | /* Set up for C function definitions, even when using C++ */
35 | #ifdef __cplusplus
36 | extern "C" {
37 | #endif
38 |
39 | /* Function prototypes */
40 |
41 | /**
42 | * \brief Put UTF-8 text into the clipboard
43 | *
44 | * \sa SDL_GetClipboardText()
45 | */
46 | extern DECLSPEC int SDLCALL SDL_SetClipboardText(const char *text);
47 |
48 | /**
49 | * \brief Get UTF-8 text from the clipboard, which must be freed with SDL_free()
50 | *
51 | * \sa SDL_SetClipboardText()
52 | */
53 | extern DECLSPEC char * SDLCALL SDL_GetClipboardText(void);
54 |
55 | /**
56 | * \brief Returns a flag indicating whether the clipboard exists and contains a text string that is non-empty
57 | *
58 | * \sa SDL_GetClipboardText()
59 | */
60 | extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void);
61 |
62 |
63 | /* Ends C function definitions when using C++ */
64 | #ifdef __cplusplus
65 | }
66 | #endif
67 | #include "close_code.h"
68 |
69 | #endif /* _SDL_clipboard_h */
70 |
71 | /* vi: set ts=4 sw=4 expandtab: */
72 |
--------------------------------------------------------------------------------
/contrib/SDL/include/SDL_cpuinfo.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2016 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_cpuinfo.h
24 | *
25 | * CPU feature detection for SDL.
26 | */
27 |
28 | #ifndef _SDL_cpuinfo_h
29 | #define _SDL_cpuinfo_h
30 |
31 | #include "SDL_stdinc.h"
32 |
33 | /* Need to do this here because intrin.h has C++ code in it */
34 | /* Visual Studio 2005 has a bug where intrin.h conflicts with winnt.h */
35 | #if defined(_MSC_VER) && (_MSC_VER >= 1500) && (defined(_M_IX86) || defined(_M_X64))
36 | #include
37 | #ifndef _WIN64
38 | #define __MMX__
39 | #define __3dNOW__
40 | #endif
41 | #define __SSE__
42 | #define __SSE2__
43 | #elif defined(__MINGW64_VERSION_MAJOR)
44 | #include
45 | #else
46 | #ifdef __ALTIVEC__
47 | #if HAVE_ALTIVEC_H && !defined(__APPLE_ALTIVEC__)
48 | #include
49 | #undef pixel
50 | #endif
51 | #endif
52 | #ifdef __MMX__
53 | #include
54 | #endif
55 | #ifdef __3dNOW__
56 | #include
57 | #endif
58 | #ifdef __SSE__
59 | #include
60 | #endif
61 | #ifdef __SSE2__
62 | #include
63 | #endif
64 | #endif
65 |
66 | #include "begin_code.h"
67 | /* Set up for C function definitions, even when using C++ */
68 | #ifdef __cplusplus
69 | extern "C" {
70 | #endif
71 |
72 | /* This is a guess for the cacheline size used for padding.
73 | * Most x86 processors have a 64 byte cache line.
74 | * The 64-bit PowerPC processors have a 128 byte cache line.
75 | * We'll use the larger value to be generally safe.
76 | */
77 | #define SDL_CACHELINE_SIZE 128
78 |
79 | /**
80 | * This function returns the number of CPU cores available.
81 | */
82 | extern DECLSPEC int SDLCALL SDL_GetCPUCount(void);
83 |
84 | /**
85 | * This function returns the L1 cache line size of the CPU
86 | *
87 | * This is useful for determining multi-threaded structure padding
88 | * or SIMD prefetch sizes.
89 | */
90 | extern DECLSPEC int SDLCALL SDL_GetCPUCacheLineSize(void);
91 |
92 | /**
93 | * This function returns true if the CPU has the RDTSC instruction.
94 | */
95 | extern DECLSPEC SDL_bool SDLCALL SDL_HasRDTSC(void);
96 |
97 | /**
98 | * This function returns true if the CPU has AltiVec features.
99 | */
100 | extern DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(void);
101 |
102 | /**
103 | * This function returns true if the CPU has MMX features.
104 | */
105 | extern DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void);
106 |
107 | /**
108 | * This function returns true if the CPU has 3DNow! features.
109 | */
110 | extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNow(void);
111 |
112 | /**
113 | * This function returns true if the CPU has SSE features.
114 | */
115 | extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void);
116 |
117 | /**
118 | * This function returns true if the CPU has SSE2 features.
119 | */
120 | extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void);
121 |
122 | /**
123 | * This function returns true if the CPU has SSE3 features.
124 | */
125 | extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE3(void);
126 |
127 | /**
128 | * This function returns true if the CPU has SSE4.1 features.
129 | */
130 | extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE41(void);
131 |
132 | /**
133 | * This function returns true if the CPU has SSE4.2 features.
134 | */
135 | extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE42(void);
136 |
137 | /**
138 | * This function returns true if the CPU has AVX features.
139 | */
140 | extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX(void);
141 |
142 | /**
143 | * This function returns true if the CPU has AVX2 features.
144 | */
145 | extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX2(void);
146 |
147 | /**
148 | * This function returns the amount of RAM configured in the system, in MB.
149 | */
150 | extern DECLSPEC int SDLCALL SDL_GetSystemRAM(void);
151 |
152 |
153 | /* Ends C function definitions when using C++ */
154 | #ifdef __cplusplus
155 | }
156 | #endif
157 | #include "close_code.h"
158 |
159 | #endif /* _SDL_cpuinfo_h */
160 |
161 | /* vi: set ts=4 sw=4 expandtab: */
162 |
--------------------------------------------------------------------------------
/contrib/SDL/include/SDL_error.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2016 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_error.h
24 | *
25 | * Simple error message routines for SDL.
26 | */
27 |
28 | #ifndef _SDL_error_h
29 | #define _SDL_error_h
30 |
31 | #include "SDL_stdinc.h"
32 |
33 | #include "begin_code.h"
34 | /* Set up for C function definitions, even when using C++ */
35 | #ifdef __cplusplus
36 | extern "C" {
37 | #endif
38 |
39 | /* Public functions */
40 | /* SDL_SetError() unconditionally returns -1. */
41 | extern DECLSPEC int SDLCALL SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1);
42 | extern DECLSPEC const char *SDLCALL SDL_GetError(void);
43 | extern DECLSPEC void SDLCALL SDL_ClearError(void);
44 |
45 | /**
46 | * \name Internal error functions
47 | *
48 | * \internal
49 | * Private error reporting function - used internally.
50 | */
51 | /* @{ */
52 | #define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM)
53 | #define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED)
54 | #define SDL_InvalidParamError(param) SDL_SetError("Parameter '%s' is invalid", (param))
55 | typedef enum
56 | {
57 | SDL_ENOMEM,
58 | SDL_EFREAD,
59 | SDL_EFWRITE,
60 | SDL_EFSEEK,
61 | SDL_UNSUPPORTED,
62 | SDL_LASTERROR
63 | } SDL_errorcode;
64 | /* SDL_Error() unconditionally returns -1. */
65 | extern DECLSPEC int SDLCALL SDL_Error(SDL_errorcode code);
66 | /* @} *//* Internal error functions */
67 |
68 | /* Ends C function definitions when using C++ */
69 | #ifdef __cplusplus
70 | }
71 | #endif
72 | #include "close_code.h"
73 |
74 | #endif /* _SDL_error_h */
75 |
76 | /* vi: set ts=4 sw=4 expandtab: */
77 |
--------------------------------------------------------------------------------
/contrib/SDL/include/SDL_gesture.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2016 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_gesture.h
24 | *
25 | * Include file for SDL gesture event handling.
26 | */
27 |
28 | #ifndef _SDL_gesture_h
29 | #define _SDL_gesture_h
30 |
31 | #include "SDL_stdinc.h"
32 | #include "SDL_error.h"
33 | #include "SDL_video.h"
34 |
35 | #include "SDL_touch.h"
36 |
37 |
38 | #include "begin_code.h"
39 | /* Set up for C function definitions, even when using C++ */
40 | #ifdef __cplusplus
41 | extern "C" {
42 | #endif
43 |
44 | typedef Sint64 SDL_GestureID;
45 |
46 | /* Function prototypes */
47 |
48 | /**
49 | * \brief Begin Recording a gesture on the specified touch, or all touches (-1)
50 | *
51 | *
52 | */
53 | extern DECLSPEC int SDLCALL SDL_RecordGesture(SDL_TouchID touchId);
54 |
55 |
56 | /**
57 | * \brief Save all currently loaded Dollar Gesture templates
58 | *
59 | *
60 | */
61 | extern DECLSPEC int SDLCALL SDL_SaveAllDollarTemplates(SDL_RWops *dst);
62 |
63 | /**
64 | * \brief Save a currently loaded Dollar Gesture template
65 | *
66 | *
67 | */
68 | extern DECLSPEC int SDLCALL SDL_SaveDollarTemplate(SDL_GestureID gestureId,SDL_RWops *dst);
69 |
70 |
71 | /**
72 | * \brief Load Dollar Gesture templates from a file
73 | *
74 | *
75 | */
76 | extern DECLSPEC int SDLCALL SDL_LoadDollarTemplates(SDL_TouchID touchId, SDL_RWops *src);
77 |
78 |
79 | /* Ends C function definitions when using C++ */
80 | #ifdef __cplusplus
81 | }
82 | #endif
83 | #include "close_code.h"
84 |
85 | #endif /* _SDL_gesture_h */
86 |
87 | /* vi: set ts=4 sw=4 expandtab: */
88 |
--------------------------------------------------------------------------------
/contrib/SDL/include/SDL_loadso.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2016 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_loadso.h
24 | *
25 | * System dependent library loading routines
26 | *
27 | * Some things to keep in mind:
28 | * \li These functions only work on C function names. Other languages may
29 | * have name mangling and intrinsic language support that varies from
30 | * compiler to compiler.
31 | * \li Make sure you declare your function pointers with the same calling
32 | * convention as the actual library function. Your code will crash
33 | * mysteriously if you do not do this.
34 | * \li Avoid namespace collisions. If you load a symbol from the library,
35 | * it is not defined whether or not it goes into the global symbol
36 | * namespace for the application. If it does and it conflicts with
37 | * symbols in your code or other shared libraries, you will not get
38 | * the results you expect. :)
39 | */
40 |
41 | #ifndef _SDL_loadso_h
42 | #define _SDL_loadso_h
43 |
44 | #include "SDL_stdinc.h"
45 | #include "SDL_error.h"
46 |
47 | #include "begin_code.h"
48 | /* Set up for C function definitions, even when using C++ */
49 | #ifdef __cplusplus
50 | extern "C" {
51 | #endif
52 |
53 | /**
54 | * This function dynamically loads a shared object and returns a pointer
55 | * to the object handle (or NULL if there was an error).
56 | * The 'sofile' parameter is a system dependent name of the object file.
57 | */
58 | extern DECLSPEC void *SDLCALL SDL_LoadObject(const char *sofile);
59 |
60 | /**
61 | * Given an object handle, this function looks up the address of the
62 | * named function in the shared object and returns it. This address
63 | * is no longer valid after calling SDL_UnloadObject().
64 | */
65 | extern DECLSPEC void *SDLCALL SDL_LoadFunction(void *handle,
66 | const char *name);
67 |
68 | /**
69 | * Unload a shared object from memory.
70 | */
71 | extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle);
72 |
73 | /* Ends C function definitions when using C++ */
74 | #ifdef __cplusplus
75 | }
76 | #endif
77 | #include "close_code.h"
78 |
79 | #endif /* _SDL_loadso_h */
80 |
81 | /* vi: set ts=4 sw=4 expandtab: */
82 |
--------------------------------------------------------------------------------
/contrib/SDL/include/SDL_main.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2016 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | #ifndef _SDL_main_h
23 | #define _SDL_main_h
24 |
25 | #include "SDL_stdinc.h"
26 |
27 | /**
28 | * \file SDL_main.h
29 | *
30 | * Redefine main() on some platforms so that it is called by SDL.
31 | */
32 |
33 | #ifndef SDL_MAIN_HANDLED
34 | #if defined(__WIN32__)
35 | /* On Windows SDL provides WinMain(), which parses the command line and passes
36 | the arguments to your main function.
37 |
38 | If you provide your own WinMain(), you may define SDL_MAIN_HANDLED
39 | */
40 | #define SDL_MAIN_AVAILABLE
41 |
42 | #elif defined(__WINRT__)
43 | /* On WinRT, SDL provides a main function that initializes CoreApplication,
44 | creating an instance of IFrameworkView in the process.
45 |
46 | Please note that #include'ing SDL_main.h is not enough to get a main()
47 | function working. In non-XAML apps, the file,
48 | src/main/winrt/SDL_WinRT_main_NonXAML.cpp, or a copy of it, must be compiled
49 | into the app itself. In XAML apps, the function, SDL_WinRTRunApp must be
50 | called, with a pointer to the Direct3D-hosted XAML control passed in.
51 | */
52 | #define SDL_MAIN_NEEDED
53 |
54 | #elif defined(__IPHONEOS__)
55 | /* On iOS SDL provides a main function that creates an application delegate
56 | and starts the iOS application run loop.
57 |
58 | See src/video/uikit/SDL_uikitappdelegate.m for more details.
59 | */
60 | #define SDL_MAIN_NEEDED
61 |
62 | #elif defined(__ANDROID__)
63 | /* On Android SDL provides a Java class in SDLActivity.java that is the
64 | main activity entry point.
65 |
66 | See README-android.txt for more details on extending that class.
67 | */
68 | #define SDL_MAIN_NEEDED
69 |
70 | #elif defined(__NACL__)
71 | /* On NACL we use ppapi_simple to set up the application helper code,
72 | then wait for the first PSE_INSTANCE_DIDCHANGEVIEW event before
73 | starting the user main function.
74 | All user code is run in a separate thread by ppapi_simple, thus
75 | allowing for blocking io to take place via nacl_io
76 | */
77 | #define SDL_MAIN_NEEDED
78 |
79 | #endif
80 | #endif /* SDL_MAIN_HANDLED */
81 |
82 | #ifdef __cplusplus
83 | #define C_LINKAGE "C"
84 | #else
85 | #define C_LINKAGE
86 | #endif /* __cplusplus */
87 |
88 | /**
89 | * \file SDL_main.h
90 | *
91 | * The application's main() function must be called with C linkage,
92 | * and should be declared like this:
93 | * \code
94 | * #ifdef __cplusplus
95 | * extern "C"
96 | * #endif
97 | * int main(int argc, char *argv[])
98 | * {
99 | * }
100 | * \endcode
101 | */
102 |
103 | #if defined(SDL_MAIN_NEEDED) || defined(SDL_MAIN_AVAILABLE)
104 | #define main SDL_main
105 | #endif
106 |
107 | /**
108 | * The prototype for the application's main() function
109 | */
110 | extern C_LINKAGE int SDL_main(int argc, char *argv[]);
111 |
112 |
113 | #include "begin_code.h"
114 | #ifdef __cplusplus
115 | extern "C" {
116 | #endif
117 |
118 | /**
119 | * This is called by the real SDL main function to let the rest of the
120 | * library know that initialization was done properly.
121 | *
122 | * Calling this yourself without knowing what you're doing can cause
123 | * crashes and hard to diagnose problems with your application.
124 | */
125 | extern DECLSPEC void SDLCALL SDL_SetMainReady(void);
126 |
127 | #ifdef __WIN32__
128 |
129 | /**
130 | * This can be called to set the application class at startup
131 | */
132 | extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style,
133 | void *hInst);
134 | extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
135 |
136 | #endif /* __WIN32__ */
137 |
138 |
139 | #ifdef __WINRT__
140 |
141 | /**
142 | * \brief Initializes and launches an SDL/WinRT application.
143 | *
144 | * \param mainFunction The SDL app's C-style main().
145 | * \param reserved Reserved for future use; should be NULL
146 | * \return 0 on success, -1 on failure. On failure, use SDL_GetError to retrieve more
147 | * information on the failure.
148 | */
149 | extern DECLSPEC int SDLCALL SDL_WinRTRunApp(int (*mainFunction)(int, char **), void * reserved);
150 |
151 | #endif /* __WINRT__ */
152 |
153 |
154 | #ifdef __cplusplus
155 | }
156 | #endif
157 | #include "close_code.h"
158 |
159 | #endif /* _SDL_main_h */
160 |
161 | /* vi: set ts=4 sw=4 expandtab: */
162 |
--------------------------------------------------------------------------------
/contrib/SDL/include/SDL_messagebox.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2016 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | #ifndef _SDL_messagebox_h
23 | #define _SDL_messagebox_h
24 |
25 | #include "SDL_stdinc.h"
26 | #include "SDL_video.h" /* For SDL_Window */
27 |
28 | #include "begin_code.h"
29 | /* Set up for C function definitions, even when using C++ */
30 | #ifdef __cplusplus
31 | extern "C" {
32 | #endif
33 |
34 | /**
35 | * \brief SDL_MessageBox flags. If supported will display warning icon, etc.
36 | */
37 | typedef enum
38 | {
39 | SDL_MESSAGEBOX_ERROR = 0x00000010, /**< error dialog */
40 | SDL_MESSAGEBOX_WARNING = 0x00000020, /**< warning dialog */
41 | SDL_MESSAGEBOX_INFORMATION = 0x00000040 /**< informational dialog */
42 | } SDL_MessageBoxFlags;
43 |
44 | /**
45 | * \brief Flags for SDL_MessageBoxButtonData.
46 | */
47 | typedef enum
48 | {
49 | SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT = 0x00000001, /**< Marks the default button when return is hit */
50 | SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT = 0x00000002 /**< Marks the default button when escape is hit */
51 | } SDL_MessageBoxButtonFlags;
52 |
53 | /**
54 | * \brief Individual button data.
55 | */
56 | typedef struct
57 | {
58 | Uint32 flags; /**< ::SDL_MessageBoxButtonFlags */
59 | int buttonid; /**< User defined button id (value returned via SDL_ShowMessageBox) */
60 | const char * text; /**< The UTF-8 button text */
61 | } SDL_MessageBoxButtonData;
62 |
63 | /**
64 | * \brief RGB value used in a message box color scheme
65 | */
66 | typedef struct
67 | {
68 | Uint8 r, g, b;
69 | } SDL_MessageBoxColor;
70 |
71 | typedef enum
72 | {
73 | SDL_MESSAGEBOX_COLOR_BACKGROUND,
74 | SDL_MESSAGEBOX_COLOR_TEXT,
75 | SDL_MESSAGEBOX_COLOR_BUTTON_BORDER,
76 | SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND,
77 | SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED,
78 | SDL_MESSAGEBOX_COLOR_MAX
79 | } SDL_MessageBoxColorType;
80 |
81 | /**
82 | * \brief A set of colors to use for message box dialogs
83 | */
84 | typedef struct
85 | {
86 | SDL_MessageBoxColor colors[SDL_MESSAGEBOX_COLOR_MAX];
87 | } SDL_MessageBoxColorScheme;
88 |
89 | /**
90 | * \brief MessageBox structure containing title, text, window, etc.
91 | */
92 | typedef struct
93 | {
94 | Uint32 flags; /**< ::SDL_MessageBoxFlags */
95 | SDL_Window *window; /**< Parent window, can be NULL */
96 | const char *title; /**< UTF-8 title */
97 | const char *message; /**< UTF-8 message text */
98 |
99 | int numbuttons;
100 | const SDL_MessageBoxButtonData *buttons;
101 |
102 | const SDL_MessageBoxColorScheme *colorScheme; /**< ::SDL_MessageBoxColorScheme, can be NULL to use system settings */
103 | } SDL_MessageBoxData;
104 |
105 | /**
106 | * \brief Create a modal message box.
107 | *
108 | * \param messageboxdata The SDL_MessageBoxData structure with title, text, etc.
109 | * \param buttonid The pointer to which user id of hit button should be copied.
110 | *
111 | * \return -1 on error, otherwise 0 and buttonid contains user id of button
112 | * hit or -1 if dialog was closed.
113 | *
114 | * \note This function should be called on the thread that created the parent
115 | * window, or on the main thread if the messagebox has no parent. It will
116 | * block execution of that thread until the user clicks a button or
117 | * closes the messagebox.
118 | */
119 | extern DECLSPEC int SDLCALL SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid);
120 |
121 | /**
122 | * \brief Create a simple modal message box
123 | *
124 | * \param flags ::SDL_MessageBoxFlags
125 | * \param title UTF-8 title text
126 | * \param message UTF-8 message text
127 | * \param window The parent window, or NULL for no parent
128 | *
129 | * \return 0 on success, -1 on error
130 | *
131 | * \sa SDL_ShowMessageBox
132 | */
133 | extern DECLSPEC int SDLCALL SDL_ShowSimpleMessageBox(Uint32 flags, const char *title, const char *message, SDL_Window *window);
134 |
135 |
136 | /* Ends C function definitions when using C++ */
137 | #ifdef __cplusplus
138 | }
139 | #endif
140 | #include "close_code.h"
141 |
142 | #endif /* _SDL_messagebox_h */
143 |
144 | /* vi: set ts=4 sw=4 expandtab: */
145 |
--------------------------------------------------------------------------------
/contrib/SDL/include/SDL_name.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2016 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | #ifndef _SDLname_h_
23 | #define _SDLname_h_
24 |
25 | #if defined(__STDC__) || defined(__cplusplus)
26 | #define NeedFunctionPrototypes 1
27 | #endif
28 |
29 | #define SDL_NAME(X) SDL_##X
30 |
31 | #endif /* _SDLname_h_ */
32 |
33 | /* vi: set ts=4 sw=4 expandtab: */
34 |
--------------------------------------------------------------------------------
/contrib/SDL/include/SDL_opengles.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2016 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_opengles.h
24 | *
25 | * This is a simple file to encapsulate the OpenGL ES 1.X API headers.
26 | */
27 |
28 | #ifdef __IPHONEOS__
29 | #include
30 | #include
31 | #else
32 | #include
33 | #include
34 | #endif
35 |
36 | #ifndef APIENTRY
37 | #define APIENTRY
38 | #endif
39 |
--------------------------------------------------------------------------------
/contrib/SDL/include/SDL_opengles2.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2016 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_opengles2.h
24 | *
25 | * This is a simple file to encapsulate the OpenGL ES 2.0 API headers.
26 | */
27 | #ifndef _MSC_VER
28 |
29 | #ifdef __IPHONEOS__
30 | #include
31 | #include
32 | #else
33 | #include
34 | #include
35 | #include
36 | #endif
37 |
38 | #else /* _MSC_VER */
39 |
40 | /* OpenGL ES2 headers for Visual Studio */
41 | #include "SDL_opengles2_khrplatform.h"
42 | #include "SDL_opengles2_gl2platform.h"
43 | #include "SDL_opengles2_gl2.h"
44 | #include "SDL_opengles2_gl2ext.h"
45 |
46 | #endif /* _MSC_VER */
47 |
48 | #ifndef APIENTRY
49 | #define APIENTRY GL_APIENTRY
50 | #endif
51 |
--------------------------------------------------------------------------------
/contrib/SDL/include/SDL_opengles2_gl2platform.h:
--------------------------------------------------------------------------------
1 | #ifndef __gl2platform_h_
2 | #define __gl2platform_h_
3 |
4 | /* $Revision: 10602 $ on $Date:: 2010-03-04 22:35:34 -0800 #$ */
5 |
6 | /*
7 | * This document is licensed under the SGI Free Software B License Version
8 | * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
9 | */
10 |
11 | /* Platform-specific types and definitions for OpenGL ES 2.X gl2.h
12 | *
13 | * Adopters may modify khrplatform.h and this file to suit their platform.
14 | * You are encouraged to submit all modifications to the Khronos group so that
15 | * they can be included in future versions of this file. Please submit changes
16 | * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
17 | * by filing a bug against product "OpenGL-ES" component "Registry".
18 | */
19 |
20 | /*#include */
21 |
22 | #ifndef GL_APICALL
23 | #define GL_APICALL KHRONOS_APICALL
24 | #endif
25 |
26 | #ifndef GL_APIENTRY
27 | #define GL_APIENTRY KHRONOS_APIENTRY
28 | #endif
29 |
30 | #endif /* __gl2platform_h_ */
31 |
--------------------------------------------------------------------------------
/contrib/SDL/include/SDL_platform.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2016 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_platform.h
24 | *
25 | * Try to get a standard set of platform defines.
26 | */
27 |
28 | #ifndef _SDL_platform_h
29 | #define _SDL_platform_h
30 |
31 | #if defined(_AIX)
32 | #undef __AIX__
33 | #define __AIX__ 1
34 | #endif
35 | #if defined(__HAIKU__)
36 | #undef __HAIKU__
37 | #define __HAIKU__ 1
38 | #endif
39 | #if defined(bsdi) || defined(__bsdi) || defined(__bsdi__)
40 | #undef __BSDI__
41 | #define __BSDI__ 1
42 | #endif
43 | #if defined(_arch_dreamcast)
44 | #undef __DREAMCAST__
45 | #define __DREAMCAST__ 1
46 | #endif
47 | #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
48 | #undef __FREEBSD__
49 | #define __FREEBSD__ 1
50 | #endif
51 | #if defined(hpux) || defined(__hpux) || defined(__hpux__)
52 | #undef __HPUX__
53 | #define __HPUX__ 1
54 | #endif
55 | #if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE)
56 | #undef __IRIX__
57 | #define __IRIX__ 1
58 | #endif
59 | #if (defined(linux) || defined(__linux) || defined(__linux__))
60 | #undef __LINUX__
61 | #define __LINUX__ 1
62 | #endif
63 | #if defined(ANDROID) || defined(__ANDROID__)
64 | #undef __ANDROID__
65 | #undef __LINUX__ /* do we need to do this? */
66 | #define __ANDROID__ 1
67 | #endif
68 |
69 | #if defined(__APPLE__)
70 | /* lets us know what version of Mac OS X we're compiling on */
71 | #include "AvailabilityMacros.h"
72 | #include "TargetConditionals.h"
73 | #if TARGET_OS_IPHONE
74 | /* if compiling for iPhone */
75 | #undef __IPHONEOS__
76 | #define __IPHONEOS__ 1
77 | #undef __MACOSX__
78 | #else
79 | /* if not compiling for iPhone */
80 | #undef __MACOSX__
81 | #define __MACOSX__ 1
82 | #if MAC_OS_X_VERSION_MIN_REQUIRED < 1050
83 | # error SDL for Mac OS X only supports deploying on 10.5 and above.
84 | #endif /* MAC_OS_X_VERSION_MIN_REQUIRED < 1050 */
85 | #endif /* TARGET_OS_IPHONE */
86 | #endif /* defined(__APPLE__) */
87 |
88 | #if defined(__NetBSD__)
89 | #undef __NETBSD__
90 | #define __NETBSD__ 1
91 | #endif
92 | #if defined(__OpenBSD__)
93 | #undef __OPENBSD__
94 | #define __OPENBSD__ 1
95 | #endif
96 | #if defined(__OS2__)
97 | #undef __OS2__
98 | #define __OS2__ 1
99 | #endif
100 | #if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE)
101 | #undef __OSF__
102 | #define __OSF__ 1
103 | #endif
104 | #if defined(__QNXNTO__)
105 | #undef __QNXNTO__
106 | #define __QNXNTO__ 1
107 | #endif
108 | #if defined(riscos) || defined(__riscos) || defined(__riscos__)
109 | #undef __RISCOS__
110 | #define __RISCOS__ 1
111 | #endif
112 | #if defined(__sun) && defined(__SVR4)
113 | #undef __SOLARIS__
114 | #define __SOLARIS__ 1
115 | #endif
116 |
117 | #if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__)
118 | /* Try to find out if we're compiling for WinRT or non-WinRT */
119 | /* If _USING_V110_SDK71_ is defined it means we are using the v110_xp or v120_xp toolset. */
120 | #if (defined(_MSC_VER) && (_MSC_VER >= 1700) && !_USING_V110_SDK71_) /* _MSC_VER==1700 for MSVC 2012 */
121 | #include
122 | #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
123 | #undef __WINDOWS__
124 | #define __WINDOWS__ 1
125 | /* See if we're compiling for WinRT: */
126 | #elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
127 | #undef __WINRT__
128 | #define __WINRT__ 1
129 | #endif
130 | #else
131 | #undef __WINDOWS__
132 | #define __WINDOWS__ 1
133 | #endif /* _MSC_VER < 1700 */
134 | #endif /* defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) */
135 |
136 | #if defined(__WINDOWS__)
137 | #undef __WIN32__
138 | #define __WIN32__ 1
139 | #endif
140 | #if defined(__PSP__)
141 | #undef __PSP__
142 | #define __PSP__ 1
143 | #endif
144 |
145 | /* The NACL compiler defines __native_client__ and __pnacl__
146 | * Ref: http://www.chromium.org/nativeclient/pnacl/stability-of-the-pnacl-bitcode-abi
147 | */
148 | #if defined(__native_client__)
149 | #undef __LINUX__
150 | #undef __NACL__
151 | #define __NACL__ 1
152 | #endif
153 | #if defined(__pnacl__)
154 | #undef __LINUX__
155 | #undef __PNACL__
156 | #define __PNACL__ 1
157 | /* PNACL with newlib supports static linking only */
158 | #define __SDL_NOGETPROCADDR__
159 | #endif
160 |
161 |
162 | #include "begin_code.h"
163 | /* Set up for C function definitions, even when using C++ */
164 | #ifdef __cplusplus
165 | extern "C" {
166 | #endif
167 |
168 | /**
169 | * \brief Gets the name of the platform.
170 | */
171 | extern DECLSPEC const char * SDLCALL SDL_GetPlatform (void);
172 |
173 | /* Ends C function definitions when using C++ */
174 | #ifdef __cplusplus
175 | }
176 | #endif
177 | #include "close_code.h"
178 |
179 | #endif /* _SDL_platform_h */
180 |
181 | /* vi: set ts=4 sw=4 expandtab: */
182 |
--------------------------------------------------------------------------------
/contrib/SDL/include/SDL_power.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2016 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | #ifndef _SDL_power_h
23 | #define _SDL_power_h
24 |
25 | /**
26 | * \file SDL_power.h
27 | *
28 | * Header for the SDL power management routines.
29 | */
30 |
31 | #include "SDL_stdinc.h"
32 |
33 | #include "begin_code.h"
34 | /* Set up for C function definitions, even when using C++ */
35 | #ifdef __cplusplus
36 | extern "C" {
37 | #endif
38 |
39 | /**
40 | * \brief The basic state for the system's power supply.
41 | */
42 | typedef enum
43 | {
44 | SDL_POWERSTATE_UNKNOWN, /**< cannot determine power status */
45 | SDL_POWERSTATE_ON_BATTERY, /**< Not plugged in, running on the battery */
46 | SDL_POWERSTATE_NO_BATTERY, /**< Plugged in, no battery available */
47 | SDL_POWERSTATE_CHARGING, /**< Plugged in, charging battery */
48 | SDL_POWERSTATE_CHARGED /**< Plugged in, battery charged */
49 | } SDL_PowerState;
50 |
51 |
52 | /**
53 | * \brief Get the current power supply details.
54 | *
55 | * \param secs Seconds of battery life left. You can pass a NULL here if
56 | * you don't care. Will return -1 if we can't determine a
57 | * value, or we're not running on a battery.
58 | *
59 | * \param pct Percentage of battery life left, between 0 and 100. You can
60 | * pass a NULL here if you don't care. Will return -1 if we
61 | * can't determine a value, or we're not running on a battery.
62 | *
63 | * \return The state of the battery (if any).
64 | */
65 | extern DECLSPEC SDL_PowerState SDLCALL SDL_GetPowerInfo(int *secs, int *pct);
66 |
67 | /* Ends C function definitions when using C++ */
68 | #ifdef __cplusplus
69 | }
70 | #endif
71 | #include "close_code.h"
72 |
73 | #endif /* _SDL_power_h */
74 |
75 | /* vi: set ts=4 sw=4 expandtab: */
76 |
--------------------------------------------------------------------------------
/contrib/SDL/include/SDL_quit.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2016 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_quit.h
24 | *
25 | * Include file for SDL quit event handling.
26 | */
27 |
28 | #ifndef _SDL_quit_h
29 | #define _SDL_quit_h
30 |
31 | #include "SDL_stdinc.h"
32 | #include "SDL_error.h"
33 |
34 | /**
35 | * \file SDL_quit.h
36 | *
37 | * An ::SDL_QUIT event is generated when the user tries to close the application
38 | * window. If it is ignored or filtered out, the window will remain open.
39 | * If it is not ignored or filtered, it is queued normally and the window
40 | * is allowed to close. When the window is closed, screen updates will
41 | * complete, but have no effect.
42 | *
43 | * SDL_Init() installs signal handlers for SIGINT (keyboard interrupt)
44 | * and SIGTERM (system termination request), if handlers do not already
45 | * exist, that generate ::SDL_QUIT events as well. There is no way
46 | * to determine the cause of an ::SDL_QUIT event, but setting a signal
47 | * handler in your application will override the default generation of
48 | * quit events for that signal.
49 | *
50 | * \sa SDL_Quit()
51 | */
52 |
53 | /* There are no functions directly affecting the quit event */
54 |
55 | #define SDL_QuitRequested() \
56 | (SDL_PumpEvents(), (SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUIT,SDL_QUIT) > 0))
57 |
58 | #endif /* _SDL_quit_h */
59 |
--------------------------------------------------------------------------------
/contrib/SDL/include/SDL_rect.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2016 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_rect.h
24 | *
25 | * Header file for SDL_rect definition and management functions.
26 | */
27 |
28 | #ifndef _SDL_rect_h
29 | #define _SDL_rect_h
30 |
31 | #include "SDL_stdinc.h"
32 | #include "SDL_error.h"
33 | #include "SDL_pixels.h"
34 | #include "SDL_rwops.h"
35 |
36 | #include "begin_code.h"
37 | /* Set up for C function definitions, even when using C++ */
38 | #ifdef __cplusplus
39 | extern "C" {
40 | #endif
41 |
42 | /**
43 | * \brief The structure that defines a point
44 | *
45 | * \sa SDL_EnclosePoints
46 | * \sa SDL_PointInRect
47 | */
48 | typedef struct SDL_Point
49 | {
50 | int x;
51 | int y;
52 | } SDL_Point;
53 |
54 | /**
55 | * \brief A rectangle, with the origin at the upper left.
56 | *
57 | * \sa SDL_RectEmpty
58 | * \sa SDL_RectEquals
59 | * \sa SDL_HasIntersection
60 | * \sa SDL_IntersectRect
61 | * \sa SDL_UnionRect
62 | * \sa SDL_EnclosePoints
63 | */
64 | typedef struct SDL_Rect
65 | {
66 | int x, y;
67 | int w, h;
68 | } SDL_Rect;
69 |
70 | /**
71 | * \brief Returns true if point resides inside a rectangle.
72 | */
73 | SDL_FORCE_INLINE SDL_bool SDL_PointInRect(const SDL_Point *p, const SDL_Rect *r)
74 | {
75 | return ( (p->x >= r->x) && (p->x < (r->x + r->w)) &&
76 | (p->y >= r->y) && (p->y < (r->y + r->h)) ) ? SDL_TRUE : SDL_FALSE;
77 | }
78 |
79 | /**
80 | * \brief Returns true if the rectangle has no area.
81 | */
82 | SDL_FORCE_INLINE SDL_bool SDL_RectEmpty(const SDL_Rect *r)
83 | {
84 | return ((!r) || (r->w <= 0) || (r->h <= 0)) ? SDL_TRUE : SDL_FALSE;
85 | }
86 |
87 | /**
88 | * \brief Returns true if the two rectangles are equal.
89 | */
90 | SDL_FORCE_INLINE SDL_bool SDL_RectEquals(const SDL_Rect *a, const SDL_Rect *b)
91 | {
92 | return (a && b && (a->x == b->x) && (a->y == b->y) &&
93 | (a->w == b->w) && (a->h == b->h)) ? SDL_TRUE : SDL_FALSE;
94 | }
95 |
96 | /**
97 | * \brief Determine whether two rectangles intersect.
98 | *
99 | * \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
100 | */
101 | extern DECLSPEC SDL_bool SDLCALL SDL_HasIntersection(const SDL_Rect * A,
102 | const SDL_Rect * B);
103 |
104 | /**
105 | * \brief Calculate the intersection of two rectangles.
106 | *
107 | * \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
108 | */
109 | extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRect(const SDL_Rect * A,
110 | const SDL_Rect * B,
111 | SDL_Rect * result);
112 |
113 | /**
114 | * \brief Calculate the union of two rectangles.
115 | */
116 | extern DECLSPEC void SDLCALL SDL_UnionRect(const SDL_Rect * A,
117 | const SDL_Rect * B,
118 | SDL_Rect * result);
119 |
120 | /**
121 | * \brief Calculate a minimal rectangle enclosing a set of points
122 | *
123 | * \return SDL_TRUE if any points were within the clipping rect
124 | */
125 | extern DECLSPEC SDL_bool SDLCALL SDL_EnclosePoints(const SDL_Point * points,
126 | int count,
127 | const SDL_Rect * clip,
128 | SDL_Rect * result);
129 |
130 | /**
131 | * \brief Calculate the intersection of a rectangle and line segment.
132 | *
133 | * \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
134 | */
135 | extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRectAndLine(const SDL_Rect *
136 | rect, int *X1,
137 | int *Y1, int *X2,
138 | int *Y2);
139 |
140 | /* Ends C function definitions when using C++ */
141 | #ifdef __cplusplus
142 | }
143 | #endif
144 | #include "close_code.h"
145 |
146 | #endif /* _SDL_rect_h */
147 |
148 | /* vi: set ts=4 sw=4 expandtab: */
149 |
--------------------------------------------------------------------------------
/contrib/SDL/include/SDL_revision.h:
--------------------------------------------------------------------------------
1 | #define SDL_REVISION "hg-10001:e12c38730512"
2 | #define SDL_REVISION_NUMBER 10001
3 |
--------------------------------------------------------------------------------
/contrib/SDL/include/SDL_test.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2016 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_test.h
24 | *
25 | * Include file for SDL test framework.
26 | *
27 | * This code is a part of the SDL2_test library, not the main SDL library.
28 | */
29 |
30 | #ifndef _SDL_test_h
31 | #define _SDL_test_h
32 |
33 | #include "SDL.h"
34 | #include "SDL_test_common.h"
35 | #include "SDL_test_font.h"
36 | #include "SDL_test_random.h"
37 | #include "SDL_test_fuzzer.h"
38 | #include "SDL_test_crc32.h"
39 | #include "SDL_test_md5.h"
40 | #include "SDL_test_log.h"
41 | #include "SDL_test_assert.h"
42 | #include "SDL_test_harness.h"
43 | #include "SDL_test_images.h"
44 | #include "SDL_test_compare.h"
45 |
46 | #include "begin_code.h"
47 | /* Set up for C function definitions, even when using C++ */
48 | #ifdef __cplusplus
49 | extern "C" {
50 | #endif
51 |
52 | /* Global definitions */
53 |
54 | /*
55 | * Note: Maximum size of SDLTest log message is less than SDL's limit
56 | * to ensure we can fit additional information such as the timestamp.
57 | */
58 | #define SDLTEST_MAX_LOGMESSAGE_LENGTH 3584
59 |
60 | /* Ends C function definitions when using C++ */
61 | #ifdef __cplusplus
62 | }
63 | #endif
64 | #include "close_code.h"
65 |
66 | #endif /* _SDL_test_h */
67 |
68 | /* vi: set ts=4 sw=4 expandtab: */
69 |
--------------------------------------------------------------------------------
/contrib/SDL/include/SDL_test_assert.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2016 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_test_assert.h
24 | *
25 | * Include file for SDL test framework.
26 | *
27 | * This code is a part of the SDL2_test library, not the main SDL library.
28 | */
29 |
30 | /*
31 | *
32 | * Assert API for test code and test cases
33 | *
34 | */
35 |
36 | #ifndef _SDL_test_assert_h
37 | #define _SDL_test_assert_h
38 |
39 | #include "begin_code.h"
40 | /* Set up for C function definitions, even when using C++ */
41 | #ifdef __cplusplus
42 | extern "C" {
43 | #endif
44 |
45 | /**
46 | * \brief Fails the assert.
47 | */
48 | #define ASSERT_FAIL 0
49 |
50 | /**
51 | * \brief Passes the assert.
52 | */
53 | #define ASSERT_PASS 1
54 |
55 | /**
56 | * \brief Assert that logs and break execution flow on failures.
57 | *
58 | * \param assertCondition Evaluated condition or variable to assert; fail (==0) or pass (!=0).
59 | * \param assertDescription Message to log with the assert describing it.
60 | */
61 | void SDLTest_Assert(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(2);
62 |
63 | /**
64 | * \brief Assert for test cases that logs but does not break execution flow on failures. Updates assertion counters.
65 | *
66 | * \param assertCondition Evaluated condition or variable to assert; fail (==0) or pass (!=0).
67 | * \param assertDescription Message to log with the assert describing it.
68 | *
69 | * \returns Returns the assertCondition so it can be used to externally to break execution flow if desired.
70 | */
71 | int SDLTest_AssertCheck(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(2);
72 |
73 | /**
74 | * \brief Explicitly pass without checking an assertion condition. Updates assertion counter.
75 | *
76 | * \param assertDescription Message to log with the assert describing it.
77 | */
78 | void SDLTest_AssertPass(SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(1);
79 |
80 | /**
81 | * \brief Resets the assert summary counters to zero.
82 | */
83 | void SDLTest_ResetAssertSummary();
84 |
85 | /**
86 | * \brief Logs summary of all assertions (total, pass, fail) since last reset as INFO or ERROR.
87 | */
88 | void SDLTest_LogAssertSummary();
89 |
90 |
91 | /**
92 | * \brief Converts the current assert summary state to a test result.
93 | *
94 | * \returns TEST_RESULT_PASSED, TEST_RESULT_FAILED, or TEST_RESULT_NO_ASSERT
95 | */
96 | int SDLTest_AssertSummaryToTestResult();
97 |
98 | #ifdef __cplusplus
99 | }
100 | #endif
101 | #include "close_code.h"
102 |
103 | #endif /* _SDL_test_assert_h */
104 |
105 | /* vi: set ts=4 sw=4 expandtab: */
106 |
--------------------------------------------------------------------------------
/contrib/SDL/include/SDL_test_compare.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2016 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_test_compare.h
24 | *
25 | * Include file for SDL test framework.
26 | *
27 | * This code is a part of the SDL2_test library, not the main SDL library.
28 | */
29 |
30 | /*
31 |
32 | Defines comparison functions (i.e. for surfaces).
33 |
34 | */
35 |
36 | #ifndef _SDL_test_compare_h
37 | #define _SDL_test_compare_h
38 |
39 | #include "SDL.h"
40 |
41 | #include "SDL_test_images.h"
42 |
43 | #include "begin_code.h"
44 | /* Set up for C function definitions, even when using C++ */
45 | #ifdef __cplusplus
46 | extern "C" {
47 | #endif
48 |
49 | /**
50 | * \brief Compares a surface and with reference image data for equality
51 | *
52 | * \param surface Surface used in comparison
53 | * \param referenceSurface Test Surface used in comparison
54 | * \param allowable_error Allowable difference (=sum of squared difference for each RGB component) in blending accuracy.
55 | *
56 | * \returns 0 if comparison succeeded, >0 (=number of pixels for which the comparison failed) if comparison failed, -1 if any of the surfaces were NULL, -2 if the surface sizes differ.
57 | */
58 | int SDLTest_CompareSurfaces(SDL_Surface *surface, SDL_Surface *referenceSurface, int allowable_error);
59 |
60 |
61 | /* Ends C function definitions when using C++ */
62 | #ifdef __cplusplus
63 | }
64 | #endif
65 | #include "close_code.h"
66 |
67 | #endif /* _SDL_test_compare_h */
68 |
69 | /* vi: set ts=4 sw=4 expandtab: */
70 |
--------------------------------------------------------------------------------
/contrib/SDL/include/SDL_test_crc32.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2016 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_test_crc32.h
24 | *
25 | * Include file for SDL test framework.
26 | *
27 | * This code is a part of the SDL2_test library, not the main SDL library.
28 | */
29 |
30 | /*
31 |
32 | Implements CRC32 calculations (default output is Perl String::CRC32 compatible).
33 |
34 | */
35 |
36 | #ifndef _SDL_test_crc32_h
37 | #define _SDL_test_crc32_h
38 |
39 | #include "begin_code.h"
40 | /* Set up for C function definitions, even when using C++ */
41 | #ifdef __cplusplus
42 | extern "C" {
43 | #endif
44 |
45 |
46 | /* ------------ Definitions --------- */
47 |
48 | /* Definition shared by all CRC routines */
49 |
50 | #ifndef CrcUint32
51 | #define CrcUint32 unsigned int
52 | #endif
53 | #ifndef CrcUint8
54 | #define CrcUint8 unsigned char
55 | #endif
56 |
57 | #ifdef ORIGINAL_METHOD
58 | #define CRC32_POLY 0x04c11db7 /* AUTODIN II, Ethernet, & FDDI */
59 | #else
60 | #define CRC32_POLY 0xEDB88320 /* Perl String::CRC32 compatible */
61 | #endif
62 |
63 | /**
64 | * Data structure for CRC32 (checksum) computation
65 | */
66 | typedef struct {
67 | CrcUint32 crc32_table[256]; /* CRC table */
68 | } SDLTest_Crc32Context;
69 |
70 | /* ---------- Function Prototypes ------------- */
71 |
72 | /**
73 | * \brief Initialize the CRC context
74 | *
75 | * Note: The function initializes the crc table required for all crc calculations.
76 | *
77 | * \param crcContext pointer to context variable
78 | *
79 | * \returns 0 for OK, -1 on error
80 | *
81 | */
82 | int SDLTest_Crc32Init(SDLTest_Crc32Context * crcContext);
83 |
84 |
85 | /**
86 | * \brief calculate a crc32 from a data block
87 | *
88 | * \param crcContext pointer to context variable
89 | * \param inBuf input buffer to checksum
90 | * \param inLen length of input buffer
91 | * \param crc32 pointer to Uint32 to store the final CRC into
92 | *
93 | * \returns 0 for OK, -1 on error
94 | *
95 | */
96 | int SDLTest_crc32Calc(SDLTest_Crc32Context * crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32);
97 |
98 | /* Same routine broken down into three steps */
99 | int SDLTest_Crc32CalcStart(SDLTest_Crc32Context * crcContext, CrcUint32 *crc32);
100 | int SDLTest_Crc32CalcEnd(SDLTest_Crc32Context * crcContext, CrcUint32 *crc32);
101 | int SDLTest_Crc32CalcBuffer(SDLTest_Crc32Context * crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32);
102 |
103 |
104 | /**
105 | * \brief clean up CRC context
106 | *
107 | * \param crcContext pointer to context variable
108 | *
109 | * \returns 0 for OK, -1 on error
110 | *
111 | */
112 |
113 | int SDLTest_Crc32Done(SDLTest_Crc32Context * crcContext);
114 |
115 |
116 | /* Ends C function definitions when using C++ */
117 | #ifdef __cplusplus
118 | }
119 | #endif
120 | #include "close_code.h"
121 |
122 | #endif /* _SDL_test_crc32_h */
123 |
124 | /* vi: set ts=4 sw=4 expandtab: */
125 |
--------------------------------------------------------------------------------
/contrib/SDL/include/SDL_test_font.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2016 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_test_font.h
24 | *
25 | * Include file for SDL test framework.
26 | *
27 | * This code is a part of the SDL2_test library, not the main SDL library.
28 | */
29 |
30 | #ifndef _SDL_test_font_h
31 | #define _SDL_test_font_h
32 |
33 | #include "begin_code.h"
34 | /* Set up for C function definitions, even when using C++ */
35 | #ifdef __cplusplus
36 | extern "C" {
37 | #endif
38 |
39 | /* Function prototypes */
40 |
41 | #define FONT_CHARACTER_SIZE 8
42 |
43 | /**
44 | * \brief Draw a string in the currently set font.
45 | *
46 | * \param renderer The renderer to draw on.
47 | * \param x The X coordinate of the upper left corner of the character.
48 | * \param y The Y coordinate of the upper left corner of the character.
49 | * \param c The character to draw.
50 | *
51 | * \returns Returns 0 on success, -1 on failure.
52 | */
53 | int SDLTest_DrawCharacter( SDL_Renderer *renderer, int x, int y, char c );
54 |
55 | /**
56 | * \brief Draw a string in the currently set font.
57 | *
58 | * \param renderer The renderer to draw on.
59 | * \param x The X coordinate of the upper left corner of the string.
60 | * \param y The Y coordinate of the upper left corner of the string.
61 | * \param s The string to draw.
62 | *
63 | * \returns Returns 0 on success, -1 on failure.
64 | */
65 | int SDLTest_DrawString( SDL_Renderer * renderer, int x, int y, const char *s );
66 |
67 |
68 | /* Ends C function definitions when using C++ */
69 | #ifdef __cplusplus
70 | }
71 | #endif
72 | #include "close_code.h"
73 |
74 | #endif /* _SDL_test_font_h */
75 |
76 | /* vi: set ts=4 sw=4 expandtab: */
77 |
--------------------------------------------------------------------------------
/contrib/SDL/include/SDL_test_harness.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2016 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_test_harness.h
24 | *
25 | * Include file for SDL test framework.
26 | *
27 | * This code is a part of the SDL2_test library, not the main SDL library.
28 | */
29 |
30 | /*
31 | Defines types for test case definitions and the test execution harness API.
32 |
33 | Based on original GSOC code by Markus Kauppila
34 | */
35 |
36 | #ifndef _SDL_test_harness_h
37 | #define _SDL_test_harness_h
38 |
39 | #include "begin_code.h"
40 | /* Set up for C function definitions, even when using C++ */
41 | #ifdef __cplusplus
42 | extern "C" {
43 | #endif
44 |
45 |
46 | /* ! Definitions for test case structures */
47 | #define TEST_ENABLED 1
48 | #define TEST_DISABLED 0
49 |
50 | /* ! Definition of all the possible test return values of the test case method */
51 | #define TEST_ABORTED -1
52 | #define TEST_STARTED 0
53 | #define TEST_COMPLETED 1
54 | #define TEST_SKIPPED 2
55 |
56 | /* ! Definition of all the possible test results for the harness */
57 | #define TEST_RESULT_PASSED 0
58 | #define TEST_RESULT_FAILED 1
59 | #define TEST_RESULT_NO_ASSERT 2
60 | #define TEST_RESULT_SKIPPED 3
61 | #define TEST_RESULT_SETUP_FAILURE 4
62 |
63 | /* !< Function pointer to a test case setup function (run before every test) */
64 | typedef void (*SDLTest_TestCaseSetUpFp)(void *arg);
65 |
66 | /* !< Function pointer to a test case function */
67 | typedef int (*SDLTest_TestCaseFp)(void *arg);
68 |
69 | /* !< Function pointer to a test case teardown function (run after every test) */
70 | typedef void (*SDLTest_TestCaseTearDownFp)(void *arg);
71 |
72 | /**
73 | * Holds information about a single test case.
74 | */
75 | typedef struct SDLTest_TestCaseReference {
76 | /* !< Func2Stress */
77 | SDLTest_TestCaseFp testCase;
78 | /* !< Short name (or function name) "Func2Stress" */
79 | char *name;
80 | /* !< Long name or full description "This test pushes func2() to the limit." */
81 | char *description;
82 | /* !< Set to TEST_ENABLED or TEST_DISABLED (test won't be run) */
83 | int enabled;
84 | } SDLTest_TestCaseReference;
85 |
86 | /**
87 | * Holds information about a test suite (multiple test cases).
88 | */
89 | typedef struct SDLTest_TestSuiteReference {
90 | /* !< "PlatformSuite" */
91 | char *name;
92 | /* !< The function that is run before each test. NULL skips. */
93 | SDLTest_TestCaseSetUpFp testSetUp;
94 | /* !< The test cases that are run as part of the suite. Last item should be NULL. */
95 | const SDLTest_TestCaseReference **testCases;
96 | /* !< The function that is run after each test. NULL skips. */
97 | SDLTest_TestCaseTearDownFp testTearDown;
98 | } SDLTest_TestSuiteReference;
99 |
100 |
101 | /**
102 | * \brief Execute a test suite using the given run seed and execution key.
103 | *
104 | * \param testSuites Suites containing the test case.
105 | * \param userRunSeed Custom run seed provided by user, or NULL to autogenerate one.
106 | * \param userExecKey Custom execution key provided by user, or 0 to autogenerate one.
107 | * \param filter Filter specification. NULL disables. Case sensitive.
108 | * \param testIterations Number of iterations to run each test case.
109 | *
110 | * \returns Test run result; 0 when all tests passed, 1 if any tests failed.
111 | */
112 | int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *userRunSeed, Uint64 userExecKey, const char *filter, int testIterations);
113 |
114 |
115 | /* Ends C function definitions when using C++ */
116 | #ifdef __cplusplus
117 | }
118 | #endif
119 | #include "close_code.h"
120 |
121 | #endif /* _SDL_test_harness_h */
122 |
123 | /* vi: set ts=4 sw=4 expandtab: */
124 |
--------------------------------------------------------------------------------
/contrib/SDL/include/SDL_test_images.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2016 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_test_images.h
24 | *
25 | * Include file for SDL test framework.
26 | *
27 | * This code is a part of the SDL2_test library, not the main SDL library.
28 | */
29 |
30 | /*
31 |
32 | Defines some images for tests.
33 |
34 | */
35 |
36 | #ifndef _SDL_test_images_h
37 | #define _SDL_test_images_h
38 |
39 | #include "SDL.h"
40 |
41 | #include "begin_code.h"
42 | /* Set up for C function definitions, even when using C++ */
43 | #ifdef __cplusplus
44 | extern "C" {
45 | #endif
46 |
47 | /**
48 | *Type for test images.
49 | */
50 | typedef struct SDLTest_SurfaceImage_s {
51 | int width;
52 | int height;
53 | unsigned int bytes_per_pixel; /* 3:RGB, 4:RGBA */
54 | const char *pixel_data;
55 | } SDLTest_SurfaceImage_t;
56 |
57 | /* Test images */
58 | SDL_Surface *SDLTest_ImageBlit();
59 | SDL_Surface *SDLTest_ImageBlitColor();
60 | SDL_Surface *SDLTest_ImageBlitAlpha();
61 | SDL_Surface *SDLTest_ImageBlitBlendAdd();
62 | SDL_Surface *SDLTest_ImageBlitBlend();
63 | SDL_Surface *SDLTest_ImageBlitBlendMod();
64 | SDL_Surface *SDLTest_ImageBlitBlendNone();
65 | SDL_Surface *SDLTest_ImageBlitBlendAll();
66 | SDL_Surface *SDLTest_ImageFace();
67 | SDL_Surface *SDLTest_ImagePrimitives();
68 | SDL_Surface *SDLTest_ImagePrimitivesBlend();
69 |
70 | /* Ends C function definitions when using C++ */
71 | #ifdef __cplusplus
72 | }
73 | #endif
74 | #include "close_code.h"
75 |
76 | #endif /* _SDL_test_images_h */
77 |
78 | /* vi: set ts=4 sw=4 expandtab: */
79 |
--------------------------------------------------------------------------------
/contrib/SDL/include/SDL_test_log.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2016 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_test_log.h
24 | *
25 | * Include file for SDL test framework.
26 | *
27 | * This code is a part of the SDL2_test library, not the main SDL library.
28 | */
29 |
30 | /*
31 | *
32 | * Wrapper to log in the TEST category
33 | *
34 | */
35 |
36 | #ifndef _SDL_test_log_h
37 | #define _SDL_test_log_h
38 |
39 | #include "begin_code.h"
40 | /* Set up for C function definitions, even when using C++ */
41 | #ifdef __cplusplus
42 | extern "C" {
43 | #endif
44 |
45 | /**
46 | * \brief Prints given message with a timestamp in the TEST category and INFO priority.
47 | *
48 | * \param fmt Message to be logged
49 | */
50 | void SDLTest_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1);
51 |
52 | /**
53 | * \brief Prints given message with a timestamp in the TEST category and the ERROR priority.
54 | *
55 | * \param fmt Message to be logged
56 | */
57 | void SDLTest_LogError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1);
58 |
59 | /* Ends C function definitions when using C++ */
60 | #ifdef __cplusplus
61 | }
62 | #endif
63 | #include "close_code.h"
64 |
65 | #endif /* _SDL_test_log_h */
66 |
67 | /* vi: set ts=4 sw=4 expandtab: */
68 |
--------------------------------------------------------------------------------
/contrib/SDL/include/SDL_test_md5.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2016 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_test_md5.h
24 | *
25 | * Include file for SDL test framework.
26 | *
27 | * This code is a part of the SDL2_test library, not the main SDL library.
28 | */
29 |
30 | /*
31 | ***********************************************************************
32 | ** Header file for implementation of MD5 **
33 | ** RSA Data Security, Inc. MD5 Message-Digest Algorithm **
34 | ** Created: 2/17/90 RLR **
35 | ** Revised: 12/27/90 SRD,AJ,BSK,JT Reference C version **
36 | ** Revised (for MD5): RLR 4/27/91 **
37 | ** -- G modified to have y&~z instead of y&z **
38 | ** -- FF, GG, HH modified to add in last register done **
39 | ** -- Access pattern: round 2 works mod 5, round 3 works mod 3 **
40 | ** -- distinct additive constant for each step **
41 | ** -- round 4 added, working mod 7 **
42 | ***********************************************************************
43 | */
44 |
45 | /*
46 | ***********************************************************************
47 | ** Message-digest routines: **
48 | ** To form the message digest for a message M **
49 | ** (1) Initialize a context buffer mdContext using MD5Init **
50 | ** (2) Call MD5Update on mdContext and M **
51 | ** (3) Call MD5Final on mdContext **
52 | ** The message digest is now in mdContext->digest[0...15] **
53 | ***********************************************************************
54 | */
55 |
56 | #ifndef _SDL_test_md5_h
57 | #define _SDL_test_md5_h
58 |
59 | #include "begin_code.h"
60 | /* Set up for C function definitions, even when using C++ */
61 | #ifdef __cplusplus
62 | extern "C" {
63 | #endif
64 |
65 | /* ------------ Definitions --------- */
66 |
67 | /* typedef a 32-bit type */
68 | typedef unsigned long int MD5UINT4;
69 |
70 | /* Data structure for MD5 (Message-Digest) computation */
71 | typedef struct {
72 | MD5UINT4 i[2]; /* number of _bits_ handled mod 2^64 */
73 | MD5UINT4 buf[4]; /* scratch buffer */
74 | unsigned char in[64]; /* input buffer */
75 | unsigned char digest[16]; /* actual digest after Md5Final call */
76 | } SDLTest_Md5Context;
77 |
78 | /* ---------- Function Prototypes ------------- */
79 |
80 | /**
81 | * \brief initialize the context
82 | *
83 | * \param mdContext pointer to context variable
84 | *
85 | * Note: The function initializes the message-digest context
86 | * mdContext. Call before each new use of the context -
87 | * all fields are set to zero.
88 | */
89 | void SDLTest_Md5Init(SDLTest_Md5Context * mdContext);
90 |
91 |
92 | /**
93 | * \brief update digest from variable length data
94 | *
95 | * \param mdContext pointer to context variable
96 | * \param inBuf pointer to data array/string
97 | * \param inLen length of data array/string
98 | *
99 | * Note: The function updates the message-digest context to account
100 | * for the presence of each of the characters inBuf[0..inLen-1]
101 | * in the message whose digest is being computed.
102 | */
103 |
104 | void SDLTest_Md5Update(SDLTest_Md5Context * mdContext, unsigned char *inBuf,
105 | unsigned int inLen);
106 |
107 |
108 | /**
109 | * \brief complete digest computation
110 | *
111 | * \param mdContext pointer to context variable
112 | *
113 | * Note: The function terminates the message-digest computation and
114 | * ends with the desired message digest in mdContext.digest[0..15].
115 | * Always call before using the digest[] variable.
116 | */
117 |
118 | void SDLTest_Md5Final(SDLTest_Md5Context * mdContext);
119 |
120 |
121 | /* Ends C function definitions when using C++ */
122 | #ifdef __cplusplus
123 | }
124 | #endif
125 | #include "close_code.h"
126 |
127 | #endif /* _SDL_test_md5_h */
128 |
129 | /* vi: set ts=4 sw=4 expandtab: */
130 |
--------------------------------------------------------------------------------
/contrib/SDL/include/SDL_test_random.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2016 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_test_random.h
24 | *
25 | * Include file for SDL test framework.
26 | *
27 | * This code is a part of the SDL2_test library, not the main SDL library.
28 | */
29 |
30 | /*
31 |
32 | A "32-bit Multiply with carry random number generator. Very fast.
33 | Includes a list of recommended multipliers.
34 |
35 | multiply-with-carry generator: x(n) = a*x(n-1) + carry mod 2^32.
36 | period: (a*2^31)-1
37 |
38 | */
39 |
40 | #ifndef _SDL_test_random_h
41 | #define _SDL_test_random_h
42 |
43 | #include "begin_code.h"
44 | /* Set up for C function definitions, even when using C++ */
45 | #ifdef __cplusplus
46 | extern "C" {
47 | #endif
48 |
49 | /* --- Definitions */
50 |
51 | /*
52 | * Macros that return a random number in a specific format.
53 | */
54 | #define SDLTest_RandomInt(c) ((int)SDLTest_Random(c))
55 |
56 | /*
57 | * Context structure for the random number generator state.
58 | */
59 | typedef struct {
60 | unsigned int a;
61 | unsigned int x;
62 | unsigned int c;
63 | unsigned int ah;
64 | unsigned int al;
65 | } SDLTest_RandomContext;
66 |
67 |
68 | /* --- Function prototypes */
69 |
70 | /**
71 | * \brief Initialize random number generator with two integers.
72 | *
73 | * Note: The random sequence of numbers returned by ...Random() is the
74 | * same for the same two integers and has a period of 2^31.
75 | *
76 | * \param rndContext pointer to context structure
77 | * \param xi integer that defines the random sequence
78 | * \param ci integer that defines the random sequence
79 | *
80 | */
81 | void SDLTest_RandomInit(SDLTest_RandomContext * rndContext, unsigned int xi,
82 | unsigned int ci);
83 |
84 | /**
85 | * \brief Initialize random number generator based on current system time.
86 | *
87 | * \param rndContext pointer to context structure
88 | *
89 | */
90 | void SDLTest_RandomInitTime(SDLTest_RandomContext *rndContext);
91 |
92 |
93 | /**
94 | * \brief Initialize random number generator based on current system time.
95 | *
96 | * Note: ...RandomInit() or ...RandomInitTime() must have been called
97 | * before using this function.
98 | *
99 | * \param rndContext pointer to context structure
100 | *
101 | * \returns A random number (32bit unsigned integer)
102 | *
103 | */
104 | unsigned int SDLTest_Random(SDLTest_RandomContext *rndContext);
105 |
106 |
107 | /* Ends C function definitions when using C++ */
108 | #ifdef __cplusplus
109 | }
110 | #endif
111 | #include "close_code.h"
112 |
113 | #endif /* _SDL_test_random_h */
114 |
115 | /* vi: set ts=4 sw=4 expandtab: */
116 |
--------------------------------------------------------------------------------
/contrib/SDL/include/SDL_timer.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2016 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | #ifndef _SDL_timer_h
23 | #define _SDL_timer_h
24 |
25 | /**
26 | * \file SDL_timer.h
27 | *
28 | * Header for the SDL time management routines.
29 | */
30 |
31 | #include "SDL_stdinc.h"
32 | #include "SDL_error.h"
33 |
34 | #include "begin_code.h"
35 | /* Set up for C function definitions, even when using C++ */
36 | #ifdef __cplusplus
37 | extern "C" {
38 | #endif
39 |
40 | /**
41 | * \brief Get the number of milliseconds since the SDL library initialization.
42 | *
43 | * \note This value wraps if the program runs for more than ~49 days.
44 | */
45 | extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void);
46 |
47 | /**
48 | * \brief Compare SDL ticks values, and return true if A has passed B
49 | *
50 | * e.g. if you want to wait 100 ms, you could do this:
51 | * Uint32 timeout = SDL_GetTicks() + 100;
52 | * while (!SDL_TICKS_PASSED(SDL_GetTicks(), timeout)) {
53 | * ... do work until timeout has elapsed
54 | * }
55 | */
56 | #define SDL_TICKS_PASSED(A, B) ((Sint32)((B) - (A)) <= 0)
57 |
58 | /**
59 | * \brief Get the current value of the high resolution counter
60 | */
61 | extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceCounter(void);
62 |
63 | /**
64 | * \brief Get the count per second of the high resolution counter
65 | */
66 | extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceFrequency(void);
67 |
68 | /**
69 | * \brief Wait a specified number of milliseconds before returning.
70 | */
71 | extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms);
72 |
73 | /**
74 | * Function prototype for the timer callback function.
75 | *
76 | * The callback function is passed the current timer interval and returns
77 | * the next timer interval. If the returned value is the same as the one
78 | * passed in, the periodic alarm continues, otherwise a new alarm is
79 | * scheduled. If the callback returns 0, the periodic alarm is cancelled.
80 | */
81 | typedef Uint32 (SDLCALL * SDL_TimerCallback) (Uint32 interval, void *param);
82 |
83 | /**
84 | * Definition of the timer ID type.
85 | */
86 | typedef int SDL_TimerID;
87 |
88 | /**
89 | * \brief Add a new timer to the pool of timers already running.
90 | *
91 | * \return A timer ID, or 0 when an error occurs.
92 | */
93 | extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval,
94 | SDL_TimerCallback callback,
95 | void *param);
96 |
97 | /**
98 | * \brief Remove a timer knowing its ID.
99 | *
100 | * \return A boolean value indicating success or failure.
101 | *
102 | * \warning It is not safe to remove a timer multiple times.
103 | */
104 | extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID id);
105 |
106 |
107 | /* Ends C function definitions when using C++ */
108 | #ifdef __cplusplus
109 | }
110 | #endif
111 | #include "close_code.h"
112 |
113 | #endif /* _SDL_timer_h */
114 |
115 | /* vi: set ts=4 sw=4 expandtab: */
116 |
--------------------------------------------------------------------------------
/contrib/SDL/include/SDL_touch.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2016 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_touch.h
24 | *
25 | * Include file for SDL touch event handling.
26 | */
27 |
28 | #ifndef _SDL_touch_h
29 | #define _SDL_touch_h
30 |
31 | #include "SDL_stdinc.h"
32 | #include "SDL_error.h"
33 | #include "SDL_video.h"
34 |
35 | #include "begin_code.h"
36 | /* Set up for C function definitions, even when using C++ */
37 | #ifdef __cplusplus
38 | extern "C" {
39 | #endif
40 |
41 | typedef Sint64 SDL_TouchID;
42 | typedef Sint64 SDL_FingerID;
43 |
44 | typedef struct SDL_Finger
45 | {
46 | SDL_FingerID id;
47 | float x;
48 | float y;
49 | float pressure;
50 | } SDL_Finger;
51 |
52 | /* Used as the device ID for mouse events simulated with touch input */
53 | #define SDL_TOUCH_MOUSEID ((Uint32)-1)
54 |
55 |
56 | /* Function prototypes */
57 |
58 | /**
59 | * \brief Get the number of registered touch devices.
60 | */
61 | extern DECLSPEC int SDLCALL SDL_GetNumTouchDevices(void);
62 |
63 | /**
64 | * \brief Get the touch ID with the given index, or 0 if the index is invalid.
65 | */
66 | extern DECLSPEC SDL_TouchID SDLCALL SDL_GetTouchDevice(int index);
67 |
68 | /**
69 | * \brief Get the number of active fingers for a given touch device.
70 | */
71 | extern DECLSPEC int SDLCALL SDL_GetNumTouchFingers(SDL_TouchID touchID);
72 |
73 | /**
74 | * \brief Get the finger object of the given touch, with the given index.
75 | */
76 | extern DECLSPEC SDL_Finger * SDLCALL SDL_GetTouchFinger(SDL_TouchID touchID, int index);
77 |
78 | /* Ends C function definitions when using C++ */
79 | #ifdef __cplusplus
80 | }
81 | #endif
82 | #include "close_code.h"
83 |
84 | #endif /* _SDL_touch_h */
85 |
86 | /* vi: set ts=4 sw=4 expandtab: */
87 |
--------------------------------------------------------------------------------
/contrib/SDL/include/SDL_types.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2016 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_types.h
24 | *
25 | * \deprecated
26 | */
27 |
28 | /* DEPRECATED */
29 | #include "SDL_stdinc.h"
30 |
--------------------------------------------------------------------------------
/contrib/SDL/include/begin_code.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2016 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file begin_code.h
24 | *
25 | * This file sets things up for C dynamic library function definitions,
26 | * static inlined functions, and structures aligned at 4-byte alignment.
27 | * If you don't like ugly C preprocessor code, don't look at this file. :)
28 | */
29 |
30 | /* This shouldn't be nested -- included it around code only. */
31 | #ifdef _begin_code_h
32 | #error Nested inclusion of begin_code.h
33 | #endif
34 | #define _begin_code_h
35 |
36 | #ifndef SDL_DEPRECATED
37 | # if (__GNUC__ >= 4) /* technically, this arrived in gcc 3.1, but oh well. */
38 | # define SDL_DEPRECATED __attribute__((deprecated))
39 | # else
40 | # define SDL_DEPRECATED
41 | # endif
42 | #endif
43 |
44 | #ifndef SDL_UNUSED
45 | # ifdef __GNUC__
46 | # define SDL_UNUSED __attribute__((unused))
47 | # else
48 | # define SDL_UNUSED
49 | # endif
50 | #endif
51 |
52 | /* Some compilers use a special export keyword */
53 | #ifndef DECLSPEC
54 | # if defined(__WIN32__) || defined(__WINRT__)
55 | # ifdef __BORLANDC__
56 | # ifdef BUILD_SDL
57 | # define DECLSPEC
58 | # else
59 | # define DECLSPEC __declspec(dllimport)
60 | # endif
61 | # else
62 | # define DECLSPEC __declspec(dllexport)
63 | # endif
64 | # else
65 | # if defined(__GNUC__) && __GNUC__ >= 4
66 | # define DECLSPEC __attribute__ ((visibility("default")))
67 | # else
68 | # define DECLSPEC
69 | # endif
70 | # endif
71 | #endif
72 |
73 | /* By default SDL uses the C calling convention */
74 | #ifndef SDLCALL
75 | #if (defined(__WIN32__) || defined(__WINRT__)) && !defined(__GNUC__)
76 | #define SDLCALL __cdecl
77 | #else
78 | #define SDLCALL
79 | #endif
80 | #endif /* SDLCALL */
81 |
82 | /* Removed DECLSPEC on Symbian OS because SDL cannot be a DLL in EPOC */
83 | #ifdef __SYMBIAN32__
84 | #undef DECLSPEC
85 | #define DECLSPEC
86 | #endif /* __SYMBIAN32__ */
87 |
88 | /* Force structure packing at 4 byte alignment.
89 | This is necessary if the header is included in code which has structure
90 | packing set to an alternate value, say for loading structures from disk.
91 | The packing is reset to the previous value in close_code.h
92 | */
93 | #if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__)
94 | #ifdef _MSC_VER
95 | #pragma warning(disable: 4103)
96 | #endif
97 | #ifdef __BORLANDC__
98 | #pragma nopackwarning
99 | #endif
100 | #ifdef _M_X64
101 | /* Use 8-byte alignment on 64-bit architectures, so pointers are aligned */
102 | #pragma pack(push,8)
103 | #else
104 | #pragma pack(push,4)
105 | #endif
106 | #endif /* Compiler needs structure packing set */
107 |
108 | #ifndef SDL_INLINE
109 | #if defined(__GNUC__)
110 | #define SDL_INLINE __inline__
111 | #elif defined(_MSC_VER) || defined(__BORLANDC__) || \
112 | defined(__DMC__) || defined(__SC__) || \
113 | defined(__WATCOMC__) || defined(__LCC__) || \
114 | defined(__DECC)
115 | #define SDL_INLINE __inline
116 | #ifndef __inline__
117 | #define __inline__ __inline
118 | #endif
119 | #else
120 | #define SDL_INLINE inline
121 | #ifndef __inline__
122 | #define __inline__ inline
123 | #endif
124 | #endif
125 | #endif /* SDL_INLINE not defined */
126 |
127 | #ifndef SDL_FORCE_INLINE
128 | #if defined(_MSC_VER)
129 | #define SDL_FORCE_INLINE __forceinline
130 | #elif ( (defined(__GNUC__) && (__GNUC__ >= 4)) || defined(__clang__) )
131 | #define SDL_FORCE_INLINE __attribute__((always_inline)) static __inline__
132 | #else
133 | #define SDL_FORCE_INLINE static SDL_INLINE
134 | #endif
135 | #endif /* SDL_FORCE_INLINE not defined */
136 |
137 | /* Apparently this is needed by several Windows compilers */
138 | #if !defined(__MACH__)
139 | #ifndef NULL
140 | #ifdef __cplusplus
141 | #define NULL 0
142 | #else
143 | #define NULL ((void *)0)
144 | #endif
145 | #endif /* NULL */
146 | #endif /* ! Mac OS X - breaks precompiled headers */
147 |
--------------------------------------------------------------------------------
/contrib/SDL/include/close_code.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2016 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file close_code.h
24 | *
25 | * This file reverses the effects of begin_code.h and should be included
26 | * after you finish any function and structure declarations in your headers
27 | */
28 |
29 | #undef _begin_code_h
30 |
31 | /* Reset structure packing at previous byte alignment */
32 | #if defined(_MSC_VER) || defined(__MWERKS__) || defined(__WATCOMC__) || defined(__BORLANDC__)
33 | #ifdef __BORLANDC__
34 | #pragma nopackwarning
35 | #endif
36 | #pragma pack(pop)
37 | #endif /* Compiler needs structure packing set */
38 |
--------------------------------------------------------------------------------
/contrib/SDL/lib/x64/SDL2.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kondrak/quake_bsp_viewer_vr/d04590571f3959f40706a58a6ef21b34f82119a0/contrib/SDL/lib/x64/SDL2.dll
--------------------------------------------------------------------------------
/contrib/SDL/lib/x64/SDL2.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kondrak/quake_bsp_viewer_vr/d04590571f3959f40706a58a6ef21b34f82119a0/contrib/SDL/lib/x64/SDL2.lib
--------------------------------------------------------------------------------
/contrib/SDL/lib/x64/SDL2main.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kondrak/quake_bsp_viewer_vr/d04590571f3959f40706a58a6ef21b34f82119a0/contrib/SDL/lib/x64/SDL2main.lib
--------------------------------------------------------------------------------
/contrib/SDL/lib/x64/SDL2test.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kondrak/quake_bsp_viewer_vr/d04590571f3959f40706a58a6ef21b34f82119a0/contrib/SDL/lib/x64/SDL2test.lib
--------------------------------------------------------------------------------
/contrib/SDL/lib/x86/SDL2.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kondrak/quake_bsp_viewer_vr/d04590571f3959f40706a58a6ef21b34f82119a0/contrib/SDL/lib/x86/SDL2.dll
--------------------------------------------------------------------------------
/contrib/SDL/lib/x86/SDL2.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kondrak/quake_bsp_viewer_vr/d04590571f3959f40706a58a6ef21b34f82119a0/contrib/SDL/lib/x86/SDL2.lib
--------------------------------------------------------------------------------
/contrib/SDL/lib/x86/SDL2main.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kondrak/quake_bsp_viewer_vr/d04590571f3959f40706a58a6ef21b34f82119a0/contrib/SDL/lib/x86/SDL2main.lib
--------------------------------------------------------------------------------
/contrib/SDL/lib/x86/SDL2test.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kondrak/quake_bsp_viewer_vr/d04590571f3959f40706a58a6ef21b34f82119a0/contrib/SDL/lib/x86/SDL2test.lib
--------------------------------------------------------------------------------
/contrib/glew-1.11.0/LICENSE.txt:
--------------------------------------------------------------------------------
1 | The OpenGL Extension Wrangler Library
2 | Copyright (C) 2002-2007, Milan Ikits
3 | Copyright (C) 2002-2007, Marcelo E. Magallon
4 | Copyright (C) 2002, Lev Povalahev
5 | All rights reserved.
6 |
7 | Redistribution and use in source and binary forms, with or without
8 | modification, are permitted provided that the following conditions are met:
9 |
10 | * Redistributions of source code must retain the above copyright notice,
11 | this list of conditions and the following disclaimer.
12 | * Redistributions in binary form must reproduce the above copyright notice,
13 | this list of conditions and the following disclaimer in the documentation
14 | and/or other materials provided with the distribution.
15 | * The name of the author may be used to endorse or promote products
16 | derived from this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
22 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
28 | THE POSSIBILITY OF SUCH DAMAGE.
29 |
30 |
31 | Mesa 3-D graphics library
32 | Version: 7.0
33 |
34 | Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
35 |
36 | Permission is hereby granted, free of charge, to any person obtaining a
37 | copy of this software and associated documentation files (the "Software"),
38 | to deal in the Software without restriction, including without limitation
39 | the rights to use, copy, modify, merge, publish, distribute, sublicense,
40 | and/or sell copies of the Software, and to permit persons to whom the
41 | Software is furnished to do so, subject to the following conditions:
42 |
43 | The above copyright notice and this permission notice shall be included
44 | in all copies or substantial portions of the Software.
45 |
46 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
47 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
48 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
49 | BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
50 | AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
51 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
52 |
53 |
54 | Copyright (c) 2007 The Khronos Group Inc.
55 |
56 | Permission is hereby granted, free of charge, to any person obtaining a
57 | copy of this software and/or associated documentation files (the
58 | "Materials"), to deal in the Materials without restriction, including
59 | without limitation the rights to use, copy, modify, merge, publish,
60 | distribute, sublicense, and/or sell copies of the Materials, and to
61 | permit persons to whom the Materials are furnished to do so, subject to
62 | the following conditions:
63 |
64 | The above copyright notice and this permission notice shall be included
65 | in all copies or substantial portions of the Materials.
66 |
67 | THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
68 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
69 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
70 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
71 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
72 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
73 | MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
74 |
--------------------------------------------------------------------------------
/contrib/glew-1.11.0/README.txt:
--------------------------------------------------------------------------------
1 | See doc/index.html for more information.
2 |
3 | If you downloaded the tarball from the GLEW website, you just need to:
4 |
5 | Unix:
6 |
7 | make
8 |
9 | sudo -s
10 |
11 | make install
12 |
13 | make clean
14 |
15 | Windows:
16 |
17 | use the project file in build/vc6/
18 |
19 | If you wish to build GLEW from scratch (update the extension data from
20 | the net or add your own extension information), you need a Unix
21 | environment (including wget, perl, and GNU make). The extension data
22 | is regenerated from the top level source directory with:
23 |
24 | make extensions
25 |
--------------------------------------------------------------------------------
/contrib/glew-1.11.0/TODO.txt:
--------------------------------------------------------------------------------
1 | Major:
2 | - add support for windows mini-client drivers
3 | - add windows installer (msi)
4 | - separate build of static and shared object files (for mingw and
5 | cygwin)
6 | - start designing GLEW 2.0
7 |
8 | Minor:
9 | - make auto scripts work with text mode cygwin mounts
10 | - add support for all SUN, MTX, and OML extensions
11 | - make auto/Makefile more robust against auto/core/*~ mistakes
12 | - web poll on separating glew, glxew and wglew
13 |
--------------------------------------------------------------------------------
/contrib/glew-1.11.0/bin/Release MX/Win32/glew32mx.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kondrak/quake_bsp_viewer_vr/d04590571f3959f40706a58a6ef21b34f82119a0/contrib/glew-1.11.0/bin/Release MX/Win32/glew32mx.dll
--------------------------------------------------------------------------------
/contrib/glew-1.11.0/bin/Release MX/x64/glew32mx.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kondrak/quake_bsp_viewer_vr/d04590571f3959f40706a58a6ef21b34f82119a0/contrib/glew-1.11.0/bin/Release MX/x64/glew32mx.dll
--------------------------------------------------------------------------------
/contrib/glew-1.11.0/bin/Release/Win32/glew32.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kondrak/quake_bsp_viewer_vr/d04590571f3959f40706a58a6ef21b34f82119a0/contrib/glew-1.11.0/bin/Release/Win32/glew32.dll
--------------------------------------------------------------------------------
/contrib/glew-1.11.0/bin/Release/Win32/glewinfo.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kondrak/quake_bsp_viewer_vr/d04590571f3959f40706a58a6ef21b34f82119a0/contrib/glew-1.11.0/bin/Release/Win32/glewinfo.exe
--------------------------------------------------------------------------------
/contrib/glew-1.11.0/bin/Release/Win32/visualinfo.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kondrak/quake_bsp_viewer_vr/d04590571f3959f40706a58a6ef21b34f82119a0/contrib/glew-1.11.0/bin/Release/Win32/visualinfo.exe
--------------------------------------------------------------------------------
/contrib/glew-1.11.0/bin/Release/x64/glew32.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kondrak/quake_bsp_viewer_vr/d04590571f3959f40706a58a6ef21b34f82119a0/contrib/glew-1.11.0/bin/Release/x64/glew32.dll
--------------------------------------------------------------------------------
/contrib/glew-1.11.0/bin/Release/x64/glewinfo.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kondrak/quake_bsp_viewer_vr/d04590571f3959f40706a58a6ef21b34f82119a0/contrib/glew-1.11.0/bin/Release/x64/glewinfo.exe
--------------------------------------------------------------------------------
/contrib/glew-1.11.0/bin/Release/x64/visualinfo.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kondrak/quake_bsp_viewer_vr/d04590571f3959f40706a58a6ef21b34f82119a0/contrib/glew-1.11.0/bin/Release/x64/visualinfo.exe
--------------------------------------------------------------------------------
/contrib/glew-1.11.0/doc/glew.css:
--------------------------------------------------------------------------------
1 | h1
2 | {
3 | color: black;
4 | font: 23px "Verdana", "Arial", "Helvetica", sans-serif;
5 | font-weight: bold;
6 | text-align: center;
7 | margin-top: 12px;
8 | margin-bottom: 18px;
9 | }
10 |
11 | h2
12 | {
13 | color: black;
14 | font: 18px "Verdana", "Arial", "Helvetica", sans-serif;
15 | font-weight: bold;
16 | text-align: left;
17 | padding-top: 0px;
18 | padding-bottom: 0px;
19 | margin-top: 18px;
20 | margin-bottom: 12px;
21 | }
22 |
23 | h3
24 | {
25 | color: black;
26 | font: 17px "Verdana", "Arial", "Helvetica", sans-serif;
27 | text-align: left;
28 | padding-top: 0px;
29 | padding-bottom: 0px;
30 | margin-top: 12px;
31 | margin-bottom: 12px;
32 | }
33 |
34 | small
35 | {
36 | font: 8pt "Verdana", "Arial", "Helvetica", sans-serif;
37 | }
38 |
39 | body
40 | {
41 | color: black;
42 | font: 10pt "Verdana", "Arial", "Helvetica", sans-serif;
43 | text-align: left;
44 | }
45 |
46 | td
47 | {
48 | color: black;
49 | font: 10pt "Verdana", "Arial", "Helvetica", sans-serif;
50 | }
51 |
52 | tt
53 | {
54 | color: rgb(0,120,0);
55 | }
56 | /* color: maroon; */
57 |
58 | td.num
59 | {
60 | color: lightgrey;
61 | font: 10pt "Verdana", "Arial", "Helvetica", sans-serif;
62 | text-align: right;
63 | }
64 |
65 | blockquote
66 | {
67 | color: rgb(0,120,0);
68 | background: #f0f0f0;
69 | text-align: left;
70 | margin-left: 40px;
71 | margin-right: 40px;
72 | margin-bottom: 6px;
73 | padding-bottom: 0px;
74 | margin-top: 0px;
75 | padding-top: 0px;
76 | border-top: 0px;
77 | border-width: 0px;
78 | }
79 |
80 | pre
81 | {
82 | color: rgb(0,120,0);
83 | background: #f0f0f0;
84 | text-align: left;
85 | margin-left: 40px;
86 | margin-right: 40px;
87 | margin-bottom: 6px;
88 | padding-bottom: 0px;
89 | margin-top: 0px;
90 | padding-top: 0px;
91 | border-top: 0px;
92 | border-width: 0px;
93 | }
94 |
95 | p
96 | {
97 | color: black;
98 | font: 10pt "Verdana", "Arial", "Helvetica", sans-serif;
99 | text-align: left;
100 | margin-bottom: 0px;
101 | padding-bottom: 6px;
102 | margin-top: 0px;
103 | padding-top: 0px;
104 | }
105 |
106 | p.right
107 | {
108 | color: black;
109 | font: 10pt "Verdana", "Arial", "Helvetica", sans-serif;
110 | text-align: right;
111 | margin-bottom: 0px;
112 | padding-bottom: 6px;
113 | margin-top: 0px;
114 | padding-top: 0px;
115 | }
116 |
117 | p.pre
118 | {
119 | color: rgb(0,120,0);
120 | font: 10pt "Courier New", "Courier", monospace;
121 | background: #f0f0f0;
122 | text-align: left;
123 | margin-top: 0px;
124 | margin-bottom: 6px;
125 | margin-left: 40px;
126 | margin-right: 40px;
127 | padding-top: 0px;
128 | padding-bottom: 6px;
129 | padding-left: 6px;
130 | padding-right: 6px;
131 | border-top: 0px;
132 | border-width: 0px;
133 | }
134 |
135 | a:link
136 | {
137 | color: rgb(0,0,139);
138 | text-decoration: none;
139 | }
140 |
141 | a:visited
142 | {
143 | color: rgb(220,20,60);
144 | text-decoration: none;
145 | }
146 |
147 | a:hover
148 | {
149 | color: rgb(220,20,60);
150 | text-decoration: underline;
151 | background: "#e8e8e8";
152 | }
153 |
154 | ul
155 | {
156 | list-style-type: disc;
157 | text-align: left;
158 | margin-left: 40px;
159 | margin-top: 0px;
160 | padding-top: 0px;
161 | margin-bottom: 0px;
162 | padding-bottom: 3px;
163 | }
164 |
165 | ul.none
166 | {
167 | list-style-type: none;
168 | }
169 |
170 | ol
171 | {
172 | text-align: left;
173 | margin-left: 40px;
174 | margin-top: 0px;
175 | padding-top: 0px;
176 | margin-bottom: 0px;
177 | padding-bottom: 12px;
178 | }
179 |
180 | hr
181 | {
182 | color: maroon;
183 | background-color: maroon;
184 | height: 1px;
185 | border: 0px;
186 | width: 80%;
187 | }
188 |
--------------------------------------------------------------------------------
/contrib/glew-1.11.0/doc/glew.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kondrak/quake_bsp_viewer_vr/d04590571f3959f40706a58a6ef21b34f82119a0/contrib/glew-1.11.0/doc/glew.png
--------------------------------------------------------------------------------
/contrib/glew-1.11.0/doc/glew.txt:
--------------------------------------------------------------------------------
1 | The OpenGL Extension Wrangler Library
2 | Copyright (C) 2002-2008, Milan Ikits
3 | Copyright (C) 2002-2008, Marcelo E. Magallon
4 | Copyright (C) 2002, Lev Povalahev
5 | All rights reserved.
6 |
7 | Redistribution and use in source and binary forms, with or without
8 | modification, are permitted provided that the following conditions are met:
9 |
10 | * Redistributions of source code must retain the above copyright notice,
11 | this list of conditions and the following disclaimer.
12 | * Redistributions in binary form must reproduce the above copyright notice,
13 | this list of conditions and the following disclaimer in the documentation
14 | and/or other materials provided with the distribution.
15 | * The name of the author may be used to endorse or promote products
16 | derived from this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
22 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
28 | THE POSSIBILITY OF SUCH DAMAGE.
29 |
--------------------------------------------------------------------------------
/contrib/glew-1.11.0/doc/khronos.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) 2007 The Khronos Group Inc.
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a
4 | copy of this software and/or associated documentation files (the
5 | "Materials"), to deal in the Materials without restriction, including
6 | without limitation the rights to use, copy, modify, merge, publish,
7 | distribute, sublicense, and/or sell copies of the Materials, and to
8 | permit persons to whom the Materials are furnished to do so, subject to
9 | the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included
12 | in all copies or substantial portions of the Materials.
13 |
14 | THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20 | MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
21 |
--------------------------------------------------------------------------------
/contrib/glew-1.11.0/doc/mesa.txt:
--------------------------------------------------------------------------------
1 | Mesa 3-D graphics library
2 | Version: 7.0
3 |
4 | Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a
7 | copy of this software and associated documentation files (the "Software"),
8 | to deal in the Software without restriction, including without limitation
9 | the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 | and/or sell copies of the Software, and to permit persons to whom the
11 | Software is furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included
14 | in all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 | BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
20 | AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/contrib/glew-1.11.0/doc/new.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kondrak/quake_bsp_viewer_vr/d04590571f3959f40706a58a6ef21b34f82119a0/contrib/glew-1.11.0/doc/new.png
--------------------------------------------------------------------------------
/contrib/glew-1.11.0/doc/ogl_sm.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kondrak/quake_bsp_viewer_vr/d04590571f3959f40706a58a6ef21b34f82119a0/contrib/glew-1.11.0/doc/ogl_sm.jpg
--------------------------------------------------------------------------------
/contrib/glew-1.11.0/lib/Release MX/Win32/glew32mx.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kondrak/quake_bsp_viewer_vr/d04590571f3959f40706a58a6ef21b34f82119a0/contrib/glew-1.11.0/lib/Release MX/Win32/glew32mx.lib
--------------------------------------------------------------------------------
/contrib/glew-1.11.0/lib/Release MX/Win32/glew32mxs.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kondrak/quake_bsp_viewer_vr/d04590571f3959f40706a58a6ef21b34f82119a0/contrib/glew-1.11.0/lib/Release MX/Win32/glew32mxs.lib
--------------------------------------------------------------------------------
/contrib/glew-1.11.0/lib/Release MX/x64/glew32mx.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kondrak/quake_bsp_viewer_vr/d04590571f3959f40706a58a6ef21b34f82119a0/contrib/glew-1.11.0/lib/Release MX/x64/glew32mx.lib
--------------------------------------------------------------------------------
/contrib/glew-1.11.0/lib/Release MX/x64/glew32mxs.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kondrak/quake_bsp_viewer_vr/d04590571f3959f40706a58a6ef21b34f82119a0/contrib/glew-1.11.0/lib/Release MX/x64/glew32mxs.lib
--------------------------------------------------------------------------------
/contrib/glew-1.11.0/lib/Release/Win32/glew32.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kondrak/quake_bsp_viewer_vr/d04590571f3959f40706a58a6ef21b34f82119a0/contrib/glew-1.11.0/lib/Release/Win32/glew32.lib
--------------------------------------------------------------------------------
/contrib/glew-1.11.0/lib/Release/Win32/glew32s.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kondrak/quake_bsp_viewer_vr/d04590571f3959f40706a58a6ef21b34f82119a0/contrib/glew-1.11.0/lib/Release/Win32/glew32s.lib
--------------------------------------------------------------------------------
/contrib/glew-1.11.0/lib/Release/x64/glew32.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kondrak/quake_bsp_viewer_vr/d04590571f3959f40706a58a6ef21b34f82119a0/contrib/glew-1.11.0/lib/Release/x64/glew32.lib
--------------------------------------------------------------------------------
/contrib/glew-1.11.0/lib/Release/x64/glew32s.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kondrak/quake_bsp_viewer_vr/d04590571f3959f40706a58a6ef21b34f82119a0/contrib/glew-1.11.0/lib/Release/x64/glew32s.lib
--------------------------------------------------------------------------------
/glew32.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kondrak/quake_bsp_viewer_vr/d04590571f3959f40706a58a6ef21b34f82119a0/glew32.dll
--------------------------------------------------------------------------------
/images/q3vr1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kondrak/quake_bsp_viewer_vr/d04590571f3959f40706a58a6ef21b34f82119a0/images/q3vr1.png
--------------------------------------------------------------------------------
/images/q3vr2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kondrak/quake_bsp_viewer_vr/d04590571f3959f40706a58a6ef21b34f82119a0/images/q3vr2.png
--------------------------------------------------------------------------------
/images/q3vr_youtube.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kondrak/quake_bsp_viewer_vr/d04590571f3959f40706a58a6ef21b34f82119a0/images/q3vr_youtube.png
--------------------------------------------------------------------------------
/images/qbsp1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kondrak/quake_bsp_viewer_vr/d04590571f3959f40706a58a6ef21b34f82119a0/images/qbsp1.png
--------------------------------------------------------------------------------
/images/qbsp3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kondrak/quake_bsp_viewer_vr/d04590571f3959f40706a58a6ef21b34f82119a0/images/qbsp3.png
--------------------------------------------------------------------------------
/maps/ntkjidm2.bsp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kondrak/quake_bsp_viewer_vr/d04590571f3959f40706a58a6ef21b34f82119a0/maps/ntkjidm2.bsp
--------------------------------------------------------------------------------
/res/Basic.fsh:
--------------------------------------------------------------------------------
1 | #version 410
2 |
3 | uniform sampler2D sTexture;
4 | uniform sampler2D sLightmap;
5 |
6 | uniform int renderLightmaps = 0;
7 | uniform int useLightmaps = 1;
8 | uniform int useAlphaTest = 0;
9 |
10 | layout(location = 3) in vec2 TexCoord;
11 | layout(location = 4) in vec2 TexCoordLightmap;
12 |
13 | out vec4 fragmentColor;
14 |
15 | void main()
16 | {
17 | vec4 baseTex = texture(sTexture, TexCoord);
18 | vec4 lightMap = texture(sLightmap, TexCoordLightmap);
19 |
20 | if(renderLightmaps == 1)
21 | {
22 | fragmentColor = lightMap * 1.2;
23 | }
24 | else
25 | {
26 | if(useLightmaps == 0)
27 | {
28 | lightMap = vec4(1.0, 1.0, 1.0, 1.0);
29 | }
30 |
31 | if(useAlphaTest == 1)
32 | {
33 | if(baseTex.a >= 0.05)
34 | fragmentColor = baseTex * lightMap * 2.0; // make the output more vivid
35 | else
36 | discard;
37 | }
38 | else
39 | {
40 | fragmentColor = baseTex * lightMap * 2.0; // make the output more vivid
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/res/Basic.vsh:
--------------------------------------------------------------------------------
1 | #version 410
2 |
3 | uniform mat4 ModelViewProjectionMatrix;
4 | uniform float worldScaleFactor;
5 |
6 | layout(location = 0) in vec3 inVertex;
7 | layout(location = 1) in vec2 inTexCoord;
8 | layout(location = 2) in vec2 inTexCoordLightmap;
9 |
10 | layout(location = 3) out vec2 TexCoord;
11 | layout(location = 4) out vec2 TexCoordLightmap;
12 |
13 | void main()
14 | {
15 | gl_Position = ModelViewProjectionMatrix * vec4(inVertex * worldScaleFactor, 1.0);
16 | TexCoord = inTexCoord;
17 | TexCoordLightmap = inTexCoordLightmap;
18 | }
19 |
--------------------------------------------------------------------------------
/res/Font.fsh:
--------------------------------------------------------------------------------
1 | #version 410
2 | uniform sampler2D sTexture;
3 | uniform vec4 vertexColor;
4 |
5 | layout(location = 6) in vec2 TexCoord;
6 |
7 | out vec4 fragmentColor;
8 |
9 | void main()
10 | {
11 | fragmentColor = texture2D(sTexture, TexCoord) * vertexColor;
12 | }
13 |
--------------------------------------------------------------------------------
/res/Font.vsh:
--------------------------------------------------------------------------------
1 | #version 410
2 |
3 | layout(location = 5) in vec3 inVertex;
4 |
5 | uniform mat4 ModelViewProjectionMatrix;
6 | uniform mat4 TextureMatrix;
7 |
8 | layout(location = 6) out vec2 TexCoord;
9 |
10 | void main()
11 | {
12 | gl_Position = ModelViewProjectionMatrix * vec4(inVertex, 1.0);
13 | TexCoord = (TextureMatrix * vec4(inVertex, 1.0)).xy;
14 | }
15 |
--------------------------------------------------------------------------------
/res/OVRFrustum.fsh:
--------------------------------------------------------------------------------
1 | #version 330
2 |
3 | uniform vec4 vertexColor;
4 |
5 | out vec4 fragmentColor;
6 |
7 | void main()
8 | {
9 | fragmentColor = vec4(vertexColor);
10 | }
11 |
--------------------------------------------------------------------------------
/res/OVRFrustum.vsh:
--------------------------------------------------------------------------------
1 | #version 330
2 |
3 | uniform mat4 ModelViewProjectionMatrix;
4 |
5 | in vec3 inVertex;
6 |
7 | void main()
8 | {
9 | gl_Position = ModelViewProjectionMatrix * vec4(inVertex, 1.0);
10 | }
11 |
--------------------------------------------------------------------------------
/res/font.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kondrak/quake_bsp_viewer_vr/d04590571f3959f40706a58a6ef21b34f82119a0/res/font.png
--------------------------------------------------------------------------------
/res/missing.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kondrak/quake_bsp_viewer_vr/d04590571f3959f40706a58a6ef21b34f82119a0/res/missing.png
--------------------------------------------------------------------------------
/run.bat:
--------------------------------------------------------------------------------
1 | QuakeBspViewerVR maps/ntkjidm2.bsp -vr
--------------------------------------------------------------------------------
/src/Application.hpp:
--------------------------------------------------------------------------------
1 | #ifndef APPLICATION_INCLUDED
2 | #define APPLICATION_INCLUDED
3 |
4 | #include