├── .gitignore ├── CMakeLists.txt ├── README.md ├── cmake └── modules │ ├── FindGLEW.cmake │ └── FindGLFW.cmake ├── deps ├── glew │ ├── CMakeLists.txt │ ├── LICENSE.txt │ ├── include │ │ └── GL │ │ │ ├── glew.h │ │ │ ├── glxew.h │ │ │ └── wglew.h │ └── src │ │ ├── glew.c │ │ ├── glewinfo.c │ │ └── visualinfo.c └── glfw │ ├── CMake │ ├── AppleInfo.plist │ ├── amd64-mingw32msvc.cmake │ ├── i586-mingw32msvc.cmake │ ├── i686-pc-mingw32.cmake │ ├── i686-w64-mingw32.cmake │ ├── modules │ │ ├── FindEGL.cmake │ │ ├── FindGLESv1.cmake │ │ ├── FindGLESv2.cmake │ │ ├── FindMir.cmake │ │ ├── FindWayland.cmake │ │ └── FindXKBCommon.cmake │ └── x86_64-w64-mingw32.cmake │ ├── CMakeLists.txt │ ├── COPYING.txt │ ├── cmake_uninstall.cmake.in │ ├── deps │ ├── EGL │ │ └── eglext.h │ ├── GL │ │ ├── glext.h │ │ ├── glxext.h │ │ └── wglext.h │ ├── KHR │ │ └── khrplatform.h │ ├── getopt.c │ ├── getopt.h │ ├── glad.c │ ├── glad │ │ └── glad.h │ ├── tinycthread.c │ └── tinycthread.h │ ├── docs │ ├── CMakeLists.txt │ ├── Doxyfile.in │ ├── DoxygenLayout.xml │ ├── build.dox │ ├── compat.dox │ ├── compile.dox │ ├── context.dox │ ├── extra.css │ ├── extra.less │ ├── footer.html │ ├── header.html │ ├── html │ │ ├── annotated.html │ │ ├── bc_s.png │ │ ├── bdwn.png │ │ ├── bug.html │ │ ├── build.html │ │ ├── build_8dox.html │ │ ├── classes.html │ │ ├── closed.png │ │ ├── compat.html │ │ ├── compat_8dox.html │ │ ├── compile.html │ │ ├── compile_8dox.html │ │ ├── context.html │ │ ├── context_8dox.html │ │ ├── dir_2424ad704b206c89082f9408cac4dea1.html │ │ ├── dir_cad64ac143687238294d0ef1c4308bc1.html │ │ ├── dir_d0d9ff8e306589526ff939d1e8a51d35.html │ │ ├── doxygen.css │ │ ├── doxygen.png │ │ ├── dynsections.js │ │ ├── extra.css │ │ ├── files.html │ │ ├── ftv2blank.png │ │ ├── ftv2cl.png │ │ ├── ftv2doc.png │ │ ├── ftv2folderclosed.png │ │ ├── ftv2folderopen.png │ │ ├── ftv2lastnode.png │ │ ├── ftv2link.png │ │ ├── ftv2mlastnode.png │ │ ├── ftv2mnode.png │ │ ├── ftv2mo.png │ │ ├── ftv2node.png │ │ ├── ftv2ns.png │ │ ├── ftv2plastnode.png │ │ ├── ftv2pnode.png │ │ ├── ftv2splitbar.png │ │ ├── ftv2vertline.png │ │ ├── functions.html │ │ ├── functions_vars.html │ │ ├── glfw3_8h.html │ │ ├── glfw3_8h_source.html │ │ ├── glfw3native_8h.html │ │ ├── glfw3native_8h_source.html │ │ ├── globals.html │ │ ├── globals_b.html │ │ ├── globals_c.html │ │ ├── globals_d.html │ │ ├── globals_defs.html │ │ ├── globals_defs_b.html │ │ ├── globals_defs_c.html │ │ ├── globals_defs_d.html │ │ ├── globals_defs_f.html │ │ ├── globals_defs_g.html │ │ ├── globals_defs_h.html │ │ ├── globals_defs_i.html │ │ ├── globals_defs_j.html │ │ ├── globals_defs_k.html │ │ ├── globals_defs_l.html │ │ ├── globals_defs_m.html │ │ ├── globals_defs_n.html │ │ ├── globals_defs_o.html │ │ ├── globals_defs_p.html │ │ ├── globals_defs_r.html │ │ ├── globals_defs_s.html │ │ ├── globals_defs_v.html │ │ ├── globals_e.html │ │ ├── globals_f.html │ │ ├── globals_func.html │ │ ├── globals_g.html │ │ ├── globals_h.html │ │ ├── globals_i.html │ │ ├── globals_j.html │ │ ├── globals_k.html │ │ ├── globals_l.html │ │ ├── globals_m.html │ │ ├── globals_n.html │ │ ├── globals_o.html │ │ ├── globals_p.html │ │ ├── globals_r.html │ │ ├── globals_s.html │ │ ├── globals_t.html │ │ ├── globals_type.html │ │ ├── globals_v.html │ │ ├── globals_w.html │ │ ├── group__buttons.html │ │ ├── group__context.html │ │ ├── group__errors.html │ │ ├── group__init.html │ │ ├── group__input.html │ │ ├── group__joysticks.html │ │ ├── group__keys.html │ │ ├── group__mods.html │ │ ├── group__monitor.html │ │ ├── group__native.html │ │ ├── group__shapes.html │ │ ├── group__window.html │ │ ├── index.html │ │ ├── input.html │ │ ├── input_8dox.html │ │ ├── intro.html │ │ ├── intro_8dox.html │ │ ├── jquery.js │ │ ├── main_8dox.html │ │ ├── modules.html │ │ ├── monitor.html │ │ ├── monitor_8dox.html │ │ ├── moving.html │ │ ├── moving_8dox.html │ │ ├── nav_f.png │ │ ├── nav_g.png │ │ ├── nav_h.png │ │ ├── news.html │ │ ├── news_8dox.html │ │ ├── open.png │ │ ├── pages.html │ │ ├── quick.html │ │ ├── quick_8dox.html │ │ ├── rift.html │ │ ├── rift_8dox.html │ │ ├── search │ │ │ ├── all_0.html │ │ │ ├── all_0.js │ │ │ ├── all_1.html │ │ │ ├── all_1.js │ │ │ ├── all_2.html │ │ │ ├── all_2.js │ │ │ ├── all_3.html │ │ │ ├── all_3.js │ │ │ ├── all_4.html │ │ │ ├── all_4.js │ │ │ ├── all_5.html │ │ │ ├── all_5.js │ │ │ ├── all_6.html │ │ │ ├── all_6.js │ │ │ ├── all_7.html │ │ │ ├── all_7.js │ │ │ ├── all_8.html │ │ │ ├── all_8.js │ │ │ ├── all_9.html │ │ │ ├── all_9.js │ │ │ ├── all_a.html │ │ │ ├── all_a.js │ │ │ ├── all_b.html │ │ │ ├── all_b.js │ │ │ ├── all_c.html │ │ │ ├── all_c.js │ │ │ ├── all_d.html │ │ │ ├── all_d.js │ │ │ ├── all_e.html │ │ │ ├── all_e.js │ │ │ ├── all_f.html │ │ │ ├── all_f.js │ │ │ ├── classes_0.html │ │ │ ├── classes_0.js │ │ │ ├── close.png │ │ │ ├── defines_0.html │ │ │ ├── defines_0.js │ │ │ ├── files_0.html │ │ │ ├── files_0.js │ │ │ ├── files_1.html │ │ │ ├── files_1.js │ │ │ ├── files_2.html │ │ │ ├── files_2.js │ │ │ ├── files_3.html │ │ │ ├── files_3.js │ │ │ ├── files_4.html │ │ │ ├── files_4.js │ │ │ ├── files_5.html │ │ │ ├── files_5.js │ │ │ ├── files_6.html │ │ │ ├── files_6.js │ │ │ ├── files_7.html │ │ │ ├── files_7.js │ │ │ ├── files_8.html │ │ │ ├── files_8.js │ │ │ ├── functions_0.html │ │ │ ├── functions_0.js │ │ │ ├── groups_0.html │ │ │ ├── groups_0.js │ │ │ ├── groups_1.html │ │ │ ├── groups_1.js │ │ │ ├── groups_2.html │ │ │ ├── groups_2.js │ │ │ ├── groups_3.html │ │ │ ├── groups_3.js │ │ │ ├── groups_4.html │ │ │ ├── groups_4.js │ │ │ ├── groups_5.html │ │ │ ├── groups_5.js │ │ │ ├── groups_6.html │ │ │ ├── groups_6.js │ │ │ ├── groups_7.html │ │ │ ├── groups_7.js │ │ │ ├── groups_8.html │ │ │ ├── groups_8.js │ │ │ ├── mag_sel.png │ │ │ ├── nomatches.html │ │ │ ├── pages_0.html │ │ │ ├── pages_0.js │ │ │ ├── pages_1.html │ │ │ ├── pages_1.js │ │ │ ├── pages_2.html │ │ │ ├── pages_2.js │ │ │ ├── pages_3.html │ │ │ ├── pages_3.js │ │ │ ├── pages_4.html │ │ │ ├── pages_4.js │ │ │ ├── pages_5.html │ │ │ ├── pages_5.js │ │ │ ├── pages_6.html │ │ │ ├── pages_6.js │ │ │ ├── pages_7.html │ │ │ ├── pages_7.js │ │ │ ├── pages_8.html │ │ │ ├── pages_8.js │ │ │ ├── search.css │ │ │ ├── search.js │ │ │ ├── search_l.png │ │ │ ├── search_m.png │ │ │ ├── search_r.png │ │ │ ├── typedefs_0.html │ │ │ ├── typedefs_0.js │ │ │ ├── variables_0.html │ │ │ ├── variables_0.js │ │ │ ├── variables_1.html │ │ │ ├── variables_1.js │ │ │ ├── variables_2.html │ │ │ ├── variables_2.js │ │ │ ├── variables_3.html │ │ │ ├── variables_3.js │ │ │ ├── variables_4.html │ │ │ ├── variables_4.js │ │ │ ├── variables_5.html │ │ │ ├── variables_5.js │ │ │ ├── variables_6.html │ │ │ └── variables_6.js │ │ ├── spaces.svg │ │ ├── structGLFWgammaramp.html │ │ ├── structGLFWimage.html │ │ ├── structGLFWvidmode.html │ │ ├── sync_off.png │ │ ├── sync_on.png │ │ ├── tab_a.png │ │ ├── tab_b.png │ │ ├── tab_h.png │ │ ├── tab_s.png │ │ ├── tabs.css │ │ ├── window.html │ │ └── window_8dox.html │ ├── input.dox │ ├── internal.dox │ ├── intro.dox │ ├── main.dox │ ├── monitor.dox │ ├── moving.dox │ ├── news.dox │ ├── quick.dox │ ├── rift.dox │ ├── spaces.svg │ └── window.dox │ ├── examples │ ├── CMakeLists.txt │ ├── boing.c │ ├── gears.c │ ├── heightmap.c │ ├── particles.c │ ├── simple.c │ ├── splitview.c │ └── wave.c │ ├── include │ └── GLFW │ │ ├── glfw3.h │ │ └── glfw3native.h │ ├── src │ ├── CMakeLists.txt │ ├── cocoa_init.m │ ├── cocoa_monitor.m │ ├── cocoa_platform.h │ ├── cocoa_window.m │ ├── context.c │ ├── egl_context.c │ ├── egl_context.h │ ├── glfw3.pc.in │ ├── glfw3Config.cmake.in │ ├── glfw_config.h.in │ ├── glx_context.c │ ├── glx_context.h │ ├── init.c │ ├── input.c │ ├── internal.h │ ├── iokit_joystick.h │ ├── iokit_joystick.m │ ├── linux_joystick.c │ ├── linux_joystick.h │ ├── mach_time.c │ ├── mir_init.c │ ├── mir_monitor.c │ ├── mir_platform.h │ ├── mir_window.c │ ├── monitor.c │ ├── nsgl_context.h │ ├── nsgl_context.m │ ├── posix_time.c │ ├── posix_time.h │ ├── posix_tls.c │ ├── posix_tls.h │ ├── wgl_context.c │ ├── wgl_context.h │ ├── win32_init.c │ ├── win32_monitor.c │ ├── win32_platform.h │ ├── win32_time.c │ ├── win32_tls.c │ ├── win32_tls.h │ ├── win32_window.c │ ├── window.c │ ├── winmm_joystick.c │ ├── winmm_joystick.h │ ├── wl_init.c │ ├── wl_monitor.c │ ├── wl_platform.h │ ├── wl_window.c │ ├── x11_init.c │ ├── x11_monitor.c │ ├── x11_platform.h │ ├── x11_window.c │ ├── xkb_unicode.c │ └── xkb_unicode.h │ └── tests │ ├── CMakeLists.txt │ ├── accuracy.c │ ├── clipboard.c │ ├── cursor.c │ ├── cursoranim.c │ ├── defaults.c │ ├── empty.c │ ├── events.c │ ├── fsaa.c │ ├── gamma.c │ ├── glfwinfo.c │ ├── iconify.c │ ├── joysticks.c │ ├── monitors.c │ ├── peter.c │ ├── reopen.c │ ├── sharing.c │ ├── tearing.c │ ├── threads.c │ ├── title.c │ └── windows.c ├── docs ├── CMakeLists.txt ├── Doxyfile └── mainpage.md ├── examples ├── CMakeLists.txt ├── event.cpp ├── template.cpp ├── text.cpp └── triangle.cpp ├── include ├── CMU462 │ ├── CMU462.h │ ├── application.h │ ├── base64.h │ ├── color.h │ ├── complex.h │ ├── console.h │ ├── lodepng.h │ ├── matrix3x3.h │ ├── matrix4x4.h │ ├── misc.h │ ├── osdtext.h │ ├── quaternion.h │ ├── spectrum.h │ ├── timer.h │ ├── tinyexr.h │ ├── tinyxml2.h │ ├── vector2D.h │ ├── vector3D.h │ ├── vector4D.h │ └── viewer.h ├── GL │ ├── glew.h │ ├── glxew.h │ └── wglew.h └── GLFW │ ├── glfw3.h │ └── glfw3native.h ├── src ├── CMakeLists.txt ├── base64.cpp ├── color.cpp ├── complex.cpp ├── lodepng.cpp ├── matrix3x3.cpp ├── matrix4x4.cpp ├── osdfont.c ├── osdtext.cpp ├── quaternion.cpp ├── spectrum.cpp ├── tinyxml2.cpp ├── vector2D.cpp ├── vector3D.cpp ├── vector4D.cpp └── viewer.cpp └── tests ├── CMakeLists.txt └── osd.cpp /.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | .DS_store 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CMU462 Library 2 | 3 | ## About 4 | 5 | The CMU462 library is designed to build simple graphics applications for 6 | 15-462 : Computer Graphics 7 | 8 | The library provides basic vector operations, takes care of OpenGL context 9 | creation, window event handling, and an on-screen text display interface using 10 | freetype. The library is designed to provide a simple interface for building 11 | graphics applications and is used in 15-462 assignments. 12 | 13 | ## Requirements 14 | 15 | Freetype is required to build CMU462. CMU462 uses GLFW3 and GLEW for window 16 | management and context creation. Copies of GLEW and GLFW3 are shipped with 17 | the source code and will be compiled from source if they are not installed 18 | on the system. 19 | 20 | ## Build instruction 21 | 22 | Use CMake to generate the build files for your platform as follows: 23 | 24 | * Create a build directory: ```mkdir build ``` 25 | * Configure your build by modifying: ```CMU462/CMakeLists.txt``` 26 | * Run cmake to generate build files: ```cmake ..``` 27 | * And build: ```make``` 28 | -------------------------------------------------------------------------------- /deps/glew/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(GLEW_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}) 2 | 3 | set(GLEW_SOURCE_DIR ${GLEW_ROOT_DIR}/src) 4 | set(GLEW_HEADER_DIR ${GLEW_ROOT_DIR}/include) 5 | 6 | include_directories(${GLEW_HEADER_DIR}) 7 | 8 | add_library(glew 9 | ${GLEW_SOURCE_DIR}/glew.c 10 | ${GLEW_SOURCE_DIR}/glewinfo.c 11 | ${GLEW_SOURCE_DIR}/visualinfo.c) 12 | 13 | set(GLEW_LIBRARIES glew PARENT_SCOPE) 14 | set(GLEW_INCLUDE_DIRS ${GLEW_HEADER_DIR} PARENT_SCOPE) 15 | 16 | install(TARGETS glew DESTINATION lib) 17 | install(DIRECTORY ${GLEW_HEADER_DIR}/GL DESTINATION include) 18 | -------------------------------------------------------------------------------- /deps/glfw/CMake/AppleInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${APPLE_GUI_EXECUTABLE} 9 | CFBundleGetInfoString 10 | ${APPLE_GUI_INFO_STRING} 11 | CFBundleIconFile 12 | ${APPLE_GUI_ICON} 13 | CFBundleIdentifier 14 | ${APPLE_GUI_IDENTIFIER} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleLongVersionString 18 | ${APPLE_GUI_LONG_VERSION_STRING} 19 | CFBundleName 20 | ${APPLE_GUI_BUNDLE_NAME} 21 | CFBundlePackageType 22 | APPL 23 | CFBundleShortVersionString 24 | ${APPLE_GUI_SHORT_VERSION_STRING} 25 | CFBundleSignature 26 | ???? 27 | CFBundleVersion 28 | ${APPLE_GUI_BUNDLE_VERSION} 29 | CSResourcesFileMapped 30 | 31 | LSRequiresCarbon 32 | 33 | NSHumanReadableCopyright 34 | ${APPLE_GUI_COPYRIGHT} 35 | NSHighResolutionCapable 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /deps/glfw/CMake/amd64-mingw32msvc.cmake: -------------------------------------------------------------------------------- 1 | # Define the environment for cross compiling from Linux to Win64 2 | SET(CMAKE_SYSTEM_NAME Windows) 3 | SET(CMAKE_SYSTEM_VERSION 1) 4 | SET(CMAKE_C_COMPILER "amd64-mingw32msvc-gcc") 5 | SET(CMAKE_CXX_COMPILER "amd64-mingw32msvc-g++") 6 | SET(CMAKE_RC_COMPILER "amd64-mingw32msvc-windres") 7 | SET(CMAKE_RANLIB "amd64-mingw32msvc-ranlib") 8 | 9 | # Configure the behaviour of the find commands 10 | SET(CMAKE_FIND_ROOT_PATH "/usr/amd64-mingw32msvc") 11 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 12 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 13 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 14 | -------------------------------------------------------------------------------- /deps/glfw/CMake/i586-mingw32msvc.cmake: -------------------------------------------------------------------------------- 1 | # Define the environment for cross compiling from Linux to Win32 2 | SET(CMAKE_SYSTEM_NAME Windows) 3 | SET(CMAKE_SYSTEM_VERSION 1) 4 | SET(CMAKE_C_COMPILER "i586-mingw32msvc-gcc") 5 | SET(CMAKE_CXX_COMPILER "i586-mingw32msvc-g++") 6 | SET(CMAKE_RC_COMPILER "i586-mingw32msvc-windres") 7 | SET(CMAKE_RANLIB "i586-mingw32msvc-ranlib") 8 | 9 | # Configure the behaviour of the find commands 10 | SET(CMAKE_FIND_ROOT_PATH "/usr/i586-mingw32msvc") 11 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 12 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 13 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 14 | -------------------------------------------------------------------------------- /deps/glfw/CMake/i686-pc-mingw32.cmake: -------------------------------------------------------------------------------- 1 | # Define the environment for cross compiling from Linux to Win32 2 | SET(CMAKE_SYSTEM_NAME Windows) # Target system name 3 | SET(CMAKE_SYSTEM_VERSION 1) 4 | SET(CMAKE_C_COMPILER "i686-pc-mingw32-gcc") 5 | SET(CMAKE_CXX_COMPILER "i686-pc-mingw32-g++") 6 | SET(CMAKE_RC_COMPILER "i686-pc-mingw32-windres") 7 | SET(CMAKE_RANLIB "i686-pc-mingw32-ranlib") 8 | 9 | #Configure the behaviour of the find commands 10 | SET(CMAKE_FIND_ROOT_PATH "/opt/mingw/usr/i686-pc-mingw32") 11 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 12 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 13 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 14 | -------------------------------------------------------------------------------- /deps/glfw/CMake/i686-w64-mingw32.cmake: -------------------------------------------------------------------------------- 1 | # Define the environment for cross compiling from Linux to Win32 2 | SET(CMAKE_SYSTEM_NAME Windows) # Target system name 3 | SET(CMAKE_SYSTEM_VERSION 1) 4 | SET(CMAKE_C_COMPILER "i686-w64-mingw32-gcc") 5 | SET(CMAKE_CXX_COMPILER "i686-w64-mingw32-g++") 6 | SET(CMAKE_RC_COMPILER "i686-w64-mingw32-windres") 7 | SET(CMAKE_RANLIB "i686-w64-mingw32-ranlib") 8 | 9 | # Configure the behaviour of the find commands 10 | SET(CMAKE_FIND_ROOT_PATH "/usr/i686-w64-mingw32") 11 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 12 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 13 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 14 | -------------------------------------------------------------------------------- /deps/glfw/CMake/modules/FindEGL.cmake: -------------------------------------------------------------------------------- 1 | # Find EGL 2 | # 3 | # EGL_INCLUDE_DIR 4 | # EGL_LIBRARY 5 | # EGL_FOUND 6 | 7 | find_path(EGL_INCLUDE_DIR NAMES EGL/egl.h PATHS /opt/vc/include) 8 | 9 | set(EGL_NAMES ${EGL_NAMES} egl EGL) 10 | find_library(EGL_LIBRARY NAMES ${EGL_NAMES} PATHS /opt/vc/lib) 11 | 12 | include(FindPackageHandleStandardArgs) 13 | find_package_handle_standard_args(EGL DEFAULT_MSG EGL_LIBRARY EGL_INCLUDE_DIR) 14 | 15 | mark_as_advanced(EGL_INCLUDE_DIR EGL_LIBRARY) 16 | 17 | -------------------------------------------------------------------------------- /deps/glfw/CMake/modules/FindGLESv1.cmake: -------------------------------------------------------------------------------- 1 | # Find GLESv1 2 | # 3 | # GLESv1_INCLUDE_DIR 4 | # GLESv1_LIBRARY 5 | # GLESv1_FOUND 6 | 7 | find_path(GLESv1_INCLUDE_DIR NAMES GLES/gl.h PATHS /opt/vc/include) 8 | 9 | set(GLESv1_NAMES ${GLESv1_NAMES} GLESv1_CM) 10 | find_library(GLESv1_LIBRARY NAMES ${GLESv1_NAMES} PATHS /opt/vc/lib) 11 | 12 | include(FindPackageHandleStandardArgs) 13 | find_package_handle_standard_args(GLESv1 DEFAULT_MSG GLESv1_LIBRARY GLESv1_INCLUDE_DIR) 14 | 15 | mark_as_advanced(GLESv1_INCLUDE_DIR GLESv1_LIBRARY) 16 | 17 | -------------------------------------------------------------------------------- /deps/glfw/CMake/modules/FindGLESv2.cmake: -------------------------------------------------------------------------------- 1 | # Find GLESv2 2 | # 3 | # GLESv2_INCLUDE_DIR 4 | # GLESv2_LIBRARY 5 | # GLESv2_FOUND 6 | 7 | find_path(GLESv2_INCLUDE_DIR NAMES GLES2/gl2.h PATHS /opt/vc/include) 8 | 9 | set(GLESv2_NAMES ${GLESv2_NAMES} GLESv2) 10 | find_library(GLESv2_LIBRARY NAMES ${GLESv2_NAMES} PATHS /opt/vc/lib) 11 | 12 | include(FindPackageHandleStandardArgs) 13 | find_package_handle_standard_args(GLESv2 DEFAULT_MSG GLESv2_LIBRARY GLESv2_INCLUDE_DIR) 14 | 15 | mark_as_advanced(GLESv2_INCLUDE_DIR GLESv2_LIBRARY) 16 | 17 | -------------------------------------------------------------------------------- /deps/glfw/CMake/modules/FindMir.cmake: -------------------------------------------------------------------------------- 1 | # Try to find Mir on a Unix system 2 | # 3 | # This will define: 4 | # 5 | # MIR_LIBRARIES - Link these to use Wayland 6 | # MIR_INCLUDE_DIR - Include directory for Wayland 7 | # 8 | # Copyright (c) 2014 Brandon Schaefer 9 | 10 | if (NOT WIN32) 11 | 12 | find_package (PkgConfig) 13 | pkg_check_modules (PKG_MIR QUIET mirclient) 14 | 15 | set (MIR_INCLUDE_DIR ${PKG_MIR_INCLUDE_DIRS}) 16 | set (MIR_LIBRARIES ${PKG_MIR_LIBRARIES}) 17 | 18 | endif () 19 | -------------------------------------------------------------------------------- /deps/glfw/CMake/modules/FindWayland.cmake: -------------------------------------------------------------------------------- 1 | # Try to find Wayland on a Unix system 2 | # 3 | # This will define: 4 | # 5 | # WAYLAND_FOUND - True if Wayland is found 6 | # WAYLAND_LIBRARIES - Link these to use Wayland 7 | # WAYLAND_INCLUDE_DIR - Include directory for Wayland 8 | # WAYLAND_DEFINITIONS - Compiler flags for using Wayland 9 | # 10 | # In addition the following more fine grained variables will be defined: 11 | # 12 | # WAYLAND_CLIENT_FOUND WAYLAND_CLIENT_INCLUDE_DIR WAYLAND_CLIENT_LIBRARIES 13 | # WAYLAND_SERVER_FOUND WAYLAND_SERVER_INCLUDE_DIR WAYLAND_SERVER_LIBRARIES 14 | # WAYLAND_EGL_FOUND WAYLAND_EGL_INCLUDE_DIR WAYLAND_EGL_LIBRARIES 15 | # 16 | # Copyright (c) 2013 Martin Gräßlin 17 | # 18 | # Redistribution and use is allowed according to the terms of the BSD license. 19 | # For details see the accompanying COPYING-CMAKE-SCRIPTS file. 20 | 21 | IF (NOT WIN32) 22 | IF (WAYLAND_INCLUDE_DIR AND WAYLAND_LIBRARIES) 23 | # In the cache already 24 | SET(WAYLAND_FIND_QUIETLY TRUE) 25 | ENDIF () 26 | 27 | # Use pkg-config to get the directories and then use these values 28 | # in the FIND_PATH() and FIND_LIBRARY() calls 29 | FIND_PACKAGE(PkgConfig) 30 | PKG_CHECK_MODULES(PKG_WAYLAND QUIET wayland-client wayland-server wayland-egl wayland-cursor) 31 | 32 | SET(WAYLAND_DEFINITIONS ${PKG_WAYLAND_CFLAGS}) 33 | 34 | FIND_PATH(WAYLAND_CLIENT_INCLUDE_DIR NAMES wayland-client.h HINTS ${PKG_WAYLAND_INCLUDE_DIRS}) 35 | FIND_PATH(WAYLAND_SERVER_INCLUDE_DIR NAMES wayland-server.h HINTS ${PKG_WAYLAND_INCLUDE_DIRS}) 36 | FIND_PATH(WAYLAND_EGL_INCLUDE_DIR NAMES wayland-egl.h HINTS ${PKG_WAYLAND_INCLUDE_DIRS}) 37 | FIND_PATH(WAYLAND_CURSOR_INCLUDE_DIR NAMES wayland-cursor.h HINTS ${PKG_WAYLAND_INCLUDE_DIRS}) 38 | 39 | FIND_LIBRARY(WAYLAND_CLIENT_LIBRARIES NAMES wayland-client HINTS ${PKG_WAYLAND_LIBRARY_DIRS}) 40 | FIND_LIBRARY(WAYLAND_SERVER_LIBRARIES NAMES wayland-server HINTS ${PKG_WAYLAND_LIBRARY_DIRS}) 41 | FIND_LIBRARY(WAYLAND_EGL_LIBRARIES NAMES wayland-egl HINTS ${PKG_WAYLAND_LIBRARY_DIRS}) 42 | FIND_LIBRARY(WAYLAND_CURSOR_LIBRARIES NAMES wayland-cursor HINTS ${PKG_WAYLAND_LIBRARY_DIRS}) 43 | 44 | set(WAYLAND_INCLUDE_DIR ${WAYLAND_CLIENT_INCLUDE_DIR} ${WAYLAND_SERVER_INCLUDE_DIR} ${WAYLAND_EGL_INCLUDE_DIR} ${WAYLAND_CURSOR_INCLUDE_DIR}) 45 | 46 | set(WAYLAND_LIBRARIES ${WAYLAND_CLIENT_LIBRARIES} ${WAYLAND_SERVER_LIBRARIES} ${WAYLAND_EGL_LIBRARIES} ${WAYLAND_CURSOR_LIBRARIES}) 47 | 48 | list(REMOVE_DUPLICATES WAYLAND_INCLUDE_DIR) 49 | 50 | include(FindPackageHandleStandardArgs) 51 | 52 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(WAYLAND_CLIENT DEFAULT_MSG WAYLAND_CLIENT_LIBRARIES WAYLAND_CLIENT_INCLUDE_DIR) 53 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(WAYLAND_SERVER DEFAULT_MSG WAYLAND_SERVER_LIBRARIES WAYLAND_SERVER_INCLUDE_DIR) 54 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(WAYLAND_EGL DEFAULT_MSG WAYLAND_EGL_LIBRARIES WAYLAND_EGL_INCLUDE_DIR) 55 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(WAYLAND_CURSOR DEFAULT_MSG WAYLAND_CURSOR_LIBRARIES WAYLAND_CURSOR_INCLUDE_DIR) 56 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(WAYLAND DEFAULT_MSG WAYLAND_LIBRARIES WAYLAND_INCLUDE_DIR) 57 | 58 | MARK_AS_ADVANCED( 59 | WAYLAND_INCLUDE_DIR WAYLAND_LIBRARIES 60 | WAYLAND_CLIENT_INCLUDE_DIR WAYLAND_CLIENT_LIBRARIES 61 | WAYLAND_SERVER_INCLUDE_DIR WAYLAND_SERVER_LIBRARIES 62 | WAYLAND_EGL_INCLUDE_DIR WAYLAND_EGL_LIBRARIES 63 | WAYLAND_CURSOR_INCLUDE_DIR WAYLAND_CURSOR_LIBRARIES 64 | ) 65 | 66 | ENDIF () 67 | -------------------------------------------------------------------------------- /deps/glfw/CMake/modules/FindXKBCommon.cmake: -------------------------------------------------------------------------------- 1 | # - Try to find XKBCommon 2 | # Once done, this will define 3 | # 4 | # XKBCOMMON_FOUND - System has XKBCommon 5 | # XKBCOMMON_INCLUDE_DIRS - The XKBCommon include directories 6 | # XKBCOMMON_LIBRARIES - The libraries needed to use XKBCommon 7 | # XKBCOMMON_DEFINITIONS - Compiler switches required for using XKBCommon 8 | 9 | find_package(PkgConfig) 10 | pkg_check_modules(PC_XKBCOMMON QUIET xkbcommon) 11 | set(XKBCOMMON_DEFINITIONS ${PC_XKBCOMMON_CFLAGS_OTHER}) 12 | 13 | find_path(XKBCOMMON_INCLUDE_DIR 14 | NAMES xkbcommon/xkbcommon.h 15 | HINTS ${PC_XKBCOMMON_INCLUDE_DIR} ${PC_XKBCOMMON_INCLUDE_DIRS} 16 | ) 17 | 18 | find_library(XKBCOMMON_LIBRARY 19 | NAMES xkbcommon 20 | HINTS ${PC_XKBCOMMON_LIBRARY} ${PC_XKBCOMMON_LIBRARY_DIRS} 21 | ) 22 | 23 | set(XKBCOMMON_LIBRARIES ${XKBCOMMON_LIBRARY}) 24 | set(XKBCOMMON_LIBRARY_DIRS ${XKBCOMMON_LIBRARY_DIRS}) 25 | set(XKBCOMMON_INCLUDE_DIRS ${XKBCOMMON_INCLUDE_DIR}) 26 | 27 | include(FindPackageHandleStandardArgs) 28 | find_package_handle_standard_args(XKBCommon DEFAULT_MSG 29 | XKBCOMMON_LIBRARY 30 | XKBCOMMON_INCLUDE_DIR 31 | ) 32 | 33 | mark_as_advanced(XKBCOMMON_LIBRARY XKBCOMMON_INCLUDE_DIR) 34 | 35 | -------------------------------------------------------------------------------- /deps/glfw/CMake/x86_64-w64-mingw32.cmake: -------------------------------------------------------------------------------- 1 | # Define the environment for cross compiling from Linux to Win32 2 | SET(CMAKE_SYSTEM_NAME Windows) # Target system name 3 | SET(CMAKE_SYSTEM_VERSION 1) 4 | SET(CMAKE_C_COMPILER "x86_64-w64-mingw32-gcc") 5 | SET(CMAKE_CXX_COMPILER "x86_64-w64-mingw32-g++") 6 | SET(CMAKE_RC_COMPILER "x86_64-w64-mingw32-windres") 7 | SET(CMAKE_RANLIB "x86_64-w64-mingw32-ranlib") 8 | 9 | # Configure the behaviour of the find commands 10 | SET(CMAKE_FIND_ROOT_PATH "/usr/x86_64-w64-mingw32") 11 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 12 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 13 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 14 | -------------------------------------------------------------------------------- /deps/glfw/COPYING.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2002-2006 Marcus Geelnard 2 | Copyright (c) 2006-2010 Camilla Berglund 3 | 4 | This software is provided 'as-is', without any express or implied 5 | warranty. In no event will the authors be held liable for any damages 6 | arising from the use of this software. 7 | 8 | Permission is granted to anyone to use this software for any purpose, 9 | including commercial applications, and to alter it and redistribute it 10 | freely, subject to the following restrictions: 11 | 12 | 1. The origin of this software must not be misrepresented; you must not 13 | claim that you wrote the original software. If you use this software 14 | in a product, an acknowledgment in the product documentation would 15 | be appreciated but is not required. 16 | 17 | 2. Altered source versions must be plainly marked as such, and must not 18 | be misrepresented as being the original software. 19 | 20 | 3. This notice may not be removed or altered from any source 21 | distribution. 22 | 23 | -------------------------------------------------------------------------------- /deps/glfw/cmake_uninstall.cmake.in: -------------------------------------------------------------------------------- 1 | 2 | if (NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 3 | message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"") 4 | endif() 5 | 6 | file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) 7 | string(REGEX REPLACE "\n" ";" files "${files}") 8 | 9 | foreach (file ${files}) 10 | message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"") 11 | if (EXISTS "$ENV{DESTDIR}${file}") 12 | exec_program("@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" 13 | OUTPUT_VARIABLE rm_out 14 | RETURN_VALUE rm_retval) 15 | if (NOT "${rm_retval}" STREQUAL 0) 16 | MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") 17 | endif() 18 | elseif (IS_SYMLINK "$ENV{DESTDIR}${file}") 19 | EXEC_PROGRAM("@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" 20 | OUTPUT_VARIABLE rm_out 21 | RETURN_VALUE rm_retval) 22 | if (NOT "${rm_retval}" STREQUAL 0) 23 | message(FATAL_ERROR "Problem when removing symlink \"$ENV{DESTDIR}${file}\"") 24 | endif() 25 | else() 26 | message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.") 27 | endif() 28 | endforeach() 29 | 30 | -------------------------------------------------------------------------------- /deps/glfw/deps/getopt.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2012, Kim Gräsman 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * * Redistributions of source code must retain the above copyright notice, 7 | * this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above copyright notice, 9 | * this list of conditions and the following disclaimer in the documentation 10 | * and/or other materials provided with the distribution. 11 | * * Neither the name of Kim Gräsman nor the names of contributors may be used 12 | * to endorse or promote products derived from this software without specific 13 | * prior written permission. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | * ARE DISCLAIMED. IN NO EVENT SHALL KIM GRÄSMAN BE LIABLE FOR ANY DIRECT, 19 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef INCLUDED_GETOPT_PORT_H 28 | #define INCLUDED_GETOPT_PORT_H 29 | 30 | #if defined(__cplusplus) 31 | extern "C" { 32 | #endif 33 | 34 | extern const int no_argument; 35 | extern const int required_argument; 36 | extern const int optional_argument; 37 | 38 | extern char* optarg; 39 | extern int optind, opterr, optopt; 40 | 41 | struct option { 42 | const char* name; 43 | int has_arg; 44 | int* flag; 45 | int val; 46 | }; 47 | 48 | int getopt(int argc, char* const argv[], const char* optstring); 49 | 50 | int getopt_long(int argc, char* const argv[], 51 | const char* optstring, const struct option* longopts, int* longindex); 52 | 53 | #if defined(__cplusplus) 54 | } 55 | #endif 56 | 57 | #endif // INCLUDED_GETOPT_PORT_H 58 | -------------------------------------------------------------------------------- /deps/glfw/docs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | add_custom_target(docs ALL ${DOXYGEN_EXECUTABLE} 3 | WORKING_DIRECTORY ${GLFW_BINARY_DIR}/docs 4 | COMMENT "Generating HTML documentation" VERBATIM) 5 | 6 | -------------------------------------------------------------------------------- /deps/glfw/docs/footer.html: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /deps/glfw/docs/header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | $projectname: $title 8 | $title 9 | 10 | 11 | 12 | $treeview 13 | $search 14 | $mathjax 15 | 16 | $extrastylesheet 17 | 18 | 19 |
20 | 21 | 22 |
23 |
24 | GLFW 25 | 31 |
32 |
33 | 34 | 35 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/bc_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/462cmu/CMU462/bdadd1e8b3a323f4808af4dbb7b2c7278c851c3e/deps/glfw/docs/html/bc_s.png -------------------------------------------------------------------------------- /deps/glfw/docs/html/bdwn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/462cmu/CMU462/bdadd1e8b3a323f4808af4dbb7b2c7278c851c3e/deps/glfw/docs/html/bdwn.png -------------------------------------------------------------------------------- /deps/glfw/docs/html/closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/462cmu/CMU462/bdadd1e8b3a323f4808af4dbb7b2c7278c851c3e/deps/glfw/docs/html/closed.png -------------------------------------------------------------------------------- /deps/glfw/docs/html/doxygen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/462cmu/CMU462/bdadd1e8b3a323f4808af4dbb7b2c7278c851c3e/deps/glfw/docs/html/doxygen.png -------------------------------------------------------------------------------- /deps/glfw/docs/html/dynsections.js: -------------------------------------------------------------------------------- 1 | function toggleVisibility(linkObj) 2 | { 3 | var base = $(linkObj).attr('id'); 4 | var summary = $('#'+base+'-summary'); 5 | var content = $('#'+base+'-content'); 6 | var trigger = $('#'+base+'-trigger'); 7 | var src=$(trigger).attr('src'); 8 | if (content.is(':visible')===true) { 9 | content.hide(); 10 | summary.show(); 11 | $(linkObj).addClass('closed').removeClass('opened'); 12 | $(trigger).attr('src',src.substring(0,src.length-8)+'closed.png'); 13 | } else { 14 | content.show(); 15 | summary.hide(); 16 | $(linkObj).removeClass('closed').addClass('opened'); 17 | $(trigger).attr('src',src.substring(0,src.length-10)+'open.png'); 18 | } 19 | return false; 20 | } 21 | 22 | function updateStripes() 23 | { 24 | $('table.directory tr'). 25 | removeClass('even').filter(':visible:even').addClass('even'); 26 | } 27 | function toggleLevel(level) 28 | { 29 | $('table.directory tr').each(function(){ 30 | var l = this.id.split('_').length-1; 31 | var i = $('#img'+this.id.substring(3)); 32 | var a = $('#arr'+this.id.substring(3)); 33 | if (l 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/all_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['blue',['blue',['../structGLFWgammaramp.html#acf0c836d0efe29c392fe8d1a1042744b',1,'GLFWgammaramp']]], 4 | ['bluebits',['blueBits',['../structGLFWvidmode.html#af310977f58d2e3b188175b6e3d314047',1,'GLFWvidmode']]], 5 | ['bug_20list',['Bug List',['../bug.html',1,'']]], 6 | ['building_20applications',['Building applications',['../build.html',1,'']]], 7 | ['build_2edox',['build.dox',['../build_8dox.html',1,'']]] 8 | ]; 9 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/all_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/all_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['compat_2edox',['compat.dox',['../compat_8dox.html',1,'']]], 4 | ['compiling_20glfw',['Compiling GLFW',['../compile.html',1,'']]], 5 | ['compile_2edox',['compile.dox',['../compile_8dox.html',1,'']]], 6 | ['context_20handling',['Context handling',['../group__context.html',1,'(Global Namespace)'],['../context.html',1,'(Global Namespace)']]], 7 | ['context_2edox',['context.dox',['../context_8dox.html',1,'']]] 8 | ]; 9 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/all_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/all_2.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['error_20codes',['Error codes',['../group__errors.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/all_3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/all_4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/all_4.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['height',['height',['../structGLFWvidmode.html#ac65942a5f6981695517437a9d571d03c',1,'GLFWvidmode::height()'],['../structGLFWimage.html#a0b7d95368f0c80d5e5c9875057c7dbec',1,'GLFWimage::height()']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/all_5.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/all_5.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['initialization_2c_20version_20and_20errors',['Initialization, version and errors',['../group__init.html',1,'']]], 4 | ['input_20handling',['Input handling',['../group__input.html',1,'(Global Namespace)'],['../input.html',1,'(Global Namespace)']]], 5 | ['input_2edox',['input.dox',['../input_8dox.html',1,'']]], 6 | ['introduction_20to_20the_20api',['Introduction to the API',['../intro.html',1,'']]], 7 | ['intro_2edox',['intro.dox',['../intro_8dox.html',1,'']]] 8 | ]; 9 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/all_6.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/all_6.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['joysticks',['Joysticks',['../group__joysticks.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/all_7.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/all_7.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['keyboard_20keys',['Keyboard keys',['../group__keys.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/all_8.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/all_8.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['mouse_20buttons',['Mouse buttons',['../group__buttons.html',1,'']]], 4 | ['main_2edox',['main.dox',['../main_8dox.html',1,'']]], 5 | ['modifier_20key_20flags',['Modifier key flags',['../group__mods.html',1,'']]], 6 | ['monitor_20handling',['Monitor handling',['../group__monitor.html',1,'(Global Namespace)'],['../monitor.html',1,'(Global Namespace)']]], 7 | ['monitor_2edox',['monitor.dox',['../monitor_8dox.html',1,'']]], 8 | ['moving_20from_20glfw_202_20to_203',['Moving from GLFW 2 to 3',['../moving.html',1,'']]], 9 | ['moving_2edox',['moving.dox',['../moving_8dox.html',1,'']]] 10 | ]; 11 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/all_9.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/all_9.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['notitle',['notitle',['../index.html',1,'']]], 4 | ['native_20access',['Native access',['../group__native.html',1,'']]], 5 | ['new_20features',['New features',['../news.html',1,'']]], 6 | ['news_2edox',['news.dox',['../news_8dox.html',1,'']]] 7 | ]; 8 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/all_a.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/all_a.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['oculus_20rift_20guide',['Oculus Rift guide',['../rift.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/all_b.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/all_b.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['pixels',['pixels',['../structGLFWimage.html#a0c532a5c2bb715555279b7817daba0fb',1,'GLFWimage']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/all_c.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/all_c.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['quick_2edox',['quick.dox',['../quick_8dox.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/all_d.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/all_d.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['red',['red',['../structGLFWgammaramp.html#a2cce5d968734b685623eef913e635138',1,'GLFWgammaramp']]], 4 | ['redbits',['redBits',['../structGLFWvidmode.html#a6066c4ecd251098700062d3b735dba1b',1,'GLFWvidmode']]], 5 | ['refreshrate',['refreshRate',['../structGLFWvidmode.html#a791bdd6c7697b09f7e9c97054bf05649',1,'GLFWvidmode']]], 6 | ['rift_2edox',['rift.dox',['../rift_8dox.html',1,'']]] 7 | ]; 8 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/all_e.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/all_e.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['standards_20conformance',['Standards conformance',['../compat.html',1,'']]], 4 | ['standard_20cursor_20shapes',['Standard cursor shapes',['../group__shapes.html',1,'']]], 5 | ['size',['size',['../structGLFWgammaramp.html#ad620e1cffbff9a32c51bca46301b59a5',1,'GLFWgammaramp']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/all_f.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/all_f.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['width',['width',['../structGLFWvidmode.html#a698dcb200562051a7249cb6ae154c71d',1,'GLFWvidmode::width()'],['../structGLFWimage.html#af6a71cc999fe6d3aea31dd7e9687d835',1,'GLFWimage::width()']]], 4 | ['window_20handling',['Window handling',['../group__window.html',1,'(Global Namespace)'],['../window.html',1,'(Global Namespace)']]], 5 | ['window_2edox',['window.dox',['../window_8dox.html',1,'']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/classes_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/classes_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['glfwgammaramp',['GLFWgammaramp',['../structGLFWgammaramp.html',1,'']]], 4 | ['glfwimage',['GLFWimage',['../structGLFWimage.html',1,'']]], 5 | ['glfwvidmode',['GLFWvidmode',['../structGLFWvidmode.html',1,'']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/462cmu/CMU462/bdadd1e8b3a323f4808af4dbb7b2c7278c851c3e/deps/glfw/docs/html/search/close.png -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/defines_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/files_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/files_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['build_2edox',['build.dox',['../build_8dox.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/files_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/files_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['compat_2edox',['compat.dox',['../compat_8dox.html',1,'']]], 4 | ['compile_2edox',['compile.dox',['../compile_8dox.html',1,'']]], 5 | ['context_2edox',['context.dox',['../context_8dox.html',1,'']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/files_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/files_2.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['glfw3_2eh',['glfw3.h',['../glfw3_8h.html',1,'']]], 4 | ['glfw3native_2eh',['glfw3native.h',['../glfw3native_8h.html',1,'']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/files_3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/files_3.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['input_2edox',['input.dox',['../input_8dox.html',1,'']]], 4 | ['intro_2edox',['intro.dox',['../intro_8dox.html',1,'']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/files_4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/files_4.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['main_2edox',['main.dox',['../main_8dox.html',1,'']]], 4 | ['monitor_2edox',['monitor.dox',['../monitor_8dox.html',1,'']]], 5 | ['moving_2edox',['moving.dox',['../moving_8dox.html',1,'']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/files_5.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/files_5.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['news_2edox',['news.dox',['../news_8dox.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/files_6.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/files_6.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['quick_2edox',['quick.dox',['../quick_8dox.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/files_7.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/files_7.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['rift_2edox',['rift.dox',['../rift_8dox.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/files_8.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/files_8.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['window_2edox',['window.dox',['../window_8dox.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/functions_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/groups_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/groups_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['context_20handling',['Context handling',['../group__context.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/groups_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/groups_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['error_20codes',['Error codes',['../group__errors.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/groups_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/groups_2.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['initialization_2c_20version_20and_20errors',['Initialization, version and errors',['../group__init.html',1,'']]], 4 | ['input_20handling',['Input handling',['../group__input.html',1,'']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/groups_3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/groups_3.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['joysticks',['Joysticks',['../group__joysticks.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/groups_4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/groups_4.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['keyboard_20keys',['Keyboard keys',['../group__keys.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/groups_5.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/groups_5.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['mouse_20buttons',['Mouse buttons',['../group__buttons.html',1,'']]], 4 | ['modifier_20key_20flags',['Modifier key flags',['../group__mods.html',1,'']]], 5 | ['monitor_20handling',['Monitor handling',['../group__monitor.html',1,'']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/groups_6.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/groups_6.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['native_20access',['Native access',['../group__native.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/groups_7.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/groups_7.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['standard_20cursor_20shapes',['Standard cursor shapes',['../group__shapes.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/groups_8.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/groups_8.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['window_20handling',['Window handling',['../group__window.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/mag_sel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/462cmu/CMU462/bdadd1e8b3a323f4808af4dbb7b2c7278c851c3e/deps/glfw/docs/html/search/mag_sel.png -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/nomatches.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 |
No Matches
10 |
11 | 12 | 13 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/pages_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/pages_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['bug_20list',['Bug List',['../bug.html',1,'']]], 4 | ['building_20applications',['Building applications',['../build.html',1,'']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/pages_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/pages_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['compiling_20glfw',['Compiling GLFW',['../compile.html',1,'']]], 4 | ['context_20guide',['Context guide',['../context.html',1,'']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/pages_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/pages_2.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['getting_20started',['Getting started',['../quick.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/pages_3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/pages_3.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['input_20guide',['Input guide',['../input.html',1,'']]], 4 | ['introduction_20to_20the_20api',['Introduction to the API',['../intro.html',1,'']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/pages_4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/pages_4.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['monitor_20guide',['Monitor guide',['../monitor.html',1,'']]], 4 | ['moving_20from_20glfw_202_20to_203',['Moving from GLFW 2 to 3',['../moving.html',1,'']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/pages_5.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/pages_5.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['notitle',['notitle',['../index.html',1,'']]], 4 | ['new_20features',['New features',['../news.html',1,'']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/pages_6.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/pages_6.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['oculus_20rift_20guide',['Oculus Rift guide',['../rift.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/pages_7.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/pages_7.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['standards_20conformance',['Standards conformance',['../compat.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/pages_8.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/pages_8.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['window_20guide',['Window guide',['../window.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/search_l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/462cmu/CMU462/bdadd1e8b3a323f4808af4dbb7b2c7278c851c3e/deps/glfw/docs/html/search/search_l.png -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/search_m.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/462cmu/CMU462/bdadd1e8b3a323f4808af4dbb7b2c7278c851c3e/deps/glfw/docs/html/search/search_m.png -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/search_r.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/462cmu/CMU462/bdadd1e8b3a323f4808af4dbb7b2c7278c851c3e/deps/glfw/docs/html/search/search_r.png -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/typedefs_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/typedefs_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['glfwcharfun',['GLFWcharfun',['../group__input.html#ga1103f1876518acecb5976f6b307c51d1',1,'glfw3.h']]], 4 | ['glfwcharmodsfun',['GLFWcharmodsfun',['../group__input.html#ga3826e9cf33f760c1480d6ce873f9d002',1,'glfw3.h']]], 5 | ['glfwcursor',['GLFWcursor',['../glfw3_8h.html#a89261ae18c75e863aaf2656ecdd238f4',1,'glfw3.h']]], 6 | ['glfwcursorenterfun',['GLFWcursorenterfun',['../group__input.html#ga762d898d9b0241d7e3e3b767c6cf318f',1,'glfw3.h']]], 7 | ['glfwcursorposfun',['GLFWcursorposfun',['../group__input.html#ga592fbfef76d88f027cb1bc4c36ebd437',1,'glfw3.h']]], 8 | ['glfwdropfun',['GLFWdropfun',['../group__input.html#gacc95e259ad21d4f666faa6280d4018fd',1,'glfw3.h']]], 9 | ['glfwerrorfun',['GLFWerrorfun',['../group__init.html#ga6f2c8574259246a83b1d0c3baf23046f',1,'glfw3.h']]], 10 | ['glfwframebuffersizefun',['GLFWframebuffersizefun',['../group__window.html#ga311bb32e578aa240b6464af494debffc',1,'glfw3.h']]], 11 | ['glfwgammaramp',['GLFWgammaramp',['../group__monitor.html#gaec0bd37af673be8813592849f13e02f0',1,'glfw3.h']]], 12 | ['glfwglproc',['GLFWglproc',['../group__context.html#gabf42b10edde1c4fc71e212e576b9f811',1,'glfw3.h']]], 13 | ['glfwimage',['GLFWimage',['../glfw3_8h.html#ac81c32f4437de7b3aa58ab62c3d9e5b1',1,'glfw3.h']]], 14 | ['glfwkeyfun',['GLFWkeyfun',['../group__input.html#ga592dd1919f8a1dc7576b13cdd8b7b695',1,'glfw3.h']]], 15 | ['glfwmonitor',['GLFWmonitor',['../group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3',1,'glfw3.h']]], 16 | ['glfwmonitorfun',['GLFWmonitorfun',['../group__monitor.html#ga67b74af6cecfdbccc7e57a6319a57210',1,'glfw3.h']]], 17 | ['glfwmousebuttonfun',['GLFWmousebuttonfun',['../group__input.html#ga1e008c7a8751cea648c8f42cc91104cf',1,'glfw3.h']]], 18 | ['glfwscrollfun',['GLFWscrollfun',['../group__input.html#ga6228cdf94d28fbd3a9a1fbb0e5922a8a',1,'glfw3.h']]], 19 | ['glfwvidmode',['GLFWvidmode',['../group__monitor.html#gae48aadf4ea0967e6605c8f58fa5daccb',1,'glfw3.h']]], 20 | ['glfwwindow',['GLFWwindow',['../group__window.html#ga3c96d80d363e67d13a41b5d1821f3242',1,'glfw3.h']]], 21 | ['glfwwindowclosefun',['GLFWwindowclosefun',['../group__window.html#ga07cff8bd3b3d573ecf49bb02d7669c1f',1,'glfw3.h']]], 22 | ['glfwwindowfocusfun',['GLFWwindowfocusfun',['../group__window.html#ga6b5f973531ea91663ad707ba4f2ac104',1,'glfw3.h']]], 23 | ['glfwwindowiconifyfun',['GLFWwindowiconifyfun',['../group__window.html#gae47ae066eea9fe6050a62360928ae524',1,'glfw3.h']]], 24 | ['glfwwindowposfun',['GLFWwindowposfun',['../group__window.html#ga1c36e52549efd47790eb3f324da71924',1,'glfw3.h']]], 25 | ['glfwwindowrefreshfun',['GLFWwindowrefreshfun',['../group__window.html#ga16764f89bf2060e6fa477f0943e1412b',1,'glfw3.h']]], 26 | ['glfwwindowsizefun',['GLFWwindowsizefun',['../group__window.html#gaaca1c2715759d03da9834eac19323d4a',1,'glfw3.h']]] 27 | ]; 28 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/variables_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/variables_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['blue',['blue',['../structGLFWgammaramp.html#acf0c836d0efe29c392fe8d1a1042744b',1,'GLFWgammaramp']]], 4 | ['bluebits',['blueBits',['../structGLFWvidmode.html#af310977f58d2e3b188175b6e3d314047',1,'GLFWvidmode']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/variables_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/variables_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['green',['green',['../structGLFWgammaramp.html#affccc6f5df47820b6562d709da3a5a3a',1,'GLFWgammaramp']]], 4 | ['greenbits',['greenBits',['../structGLFWvidmode.html#a292fdd281f3485fb3ff102a5bda43faa',1,'GLFWvidmode']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/variables_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/variables_2.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['height',['height',['../structGLFWvidmode.html#ac65942a5f6981695517437a9d571d03c',1,'GLFWvidmode::height()'],['../structGLFWimage.html#a0b7d95368f0c80d5e5c9875057c7dbec',1,'GLFWimage::height()']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/variables_3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/variables_3.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['pixels',['pixels',['../structGLFWimage.html#a0c532a5c2bb715555279b7817daba0fb',1,'GLFWimage']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/variables_4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/variables_4.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['red',['red',['../structGLFWgammaramp.html#a2cce5d968734b685623eef913e635138',1,'GLFWgammaramp']]], 4 | ['redbits',['redBits',['../structGLFWvidmode.html#a6066c4ecd251098700062d3b735dba1b',1,'GLFWvidmode']]], 5 | ['refreshrate',['refreshRate',['../structGLFWvidmode.html#a791bdd6c7697b09f7e9c97054bf05649',1,'GLFWvidmode']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/variables_5.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/variables_5.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['size',['size',['../structGLFWgammaramp.html#ad620e1cffbff9a32c51bca46301b59a5',1,'GLFWgammaramp']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/variables_6.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Loading...
12 |
13 | 16 |
Searching...
17 |
No Matches
18 | 24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/search/variables_6.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['width',['width',['../structGLFWvidmode.html#a698dcb200562051a7249cb6ae154c71d',1,'GLFWvidmode::width()'],['../structGLFWimage.html#af6a71cc999fe6d3aea31dd7e9687d835',1,'GLFWimage::width()']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /deps/glfw/docs/html/sync_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/462cmu/CMU462/bdadd1e8b3a323f4808af4dbb7b2c7278c851c3e/deps/glfw/docs/html/sync_off.png -------------------------------------------------------------------------------- /deps/glfw/docs/html/sync_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/462cmu/CMU462/bdadd1e8b3a323f4808af4dbb7b2c7278c851c3e/deps/glfw/docs/html/sync_on.png -------------------------------------------------------------------------------- /deps/glfw/docs/html/tab_a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/462cmu/CMU462/bdadd1e8b3a323f4808af4dbb7b2c7278c851c3e/deps/glfw/docs/html/tab_a.png -------------------------------------------------------------------------------- /deps/glfw/docs/html/tab_b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/462cmu/CMU462/bdadd1e8b3a323f4808af4dbb7b2c7278c851c3e/deps/glfw/docs/html/tab_b.png -------------------------------------------------------------------------------- /deps/glfw/docs/html/tab_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/462cmu/CMU462/bdadd1e8b3a323f4808af4dbb7b2c7278c851c3e/deps/glfw/docs/html/tab_h.png -------------------------------------------------------------------------------- /deps/glfw/docs/html/tab_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/462cmu/CMU462/bdadd1e8b3a323f4808af4dbb7b2c7278c851c3e/deps/glfw/docs/html/tab_s.png -------------------------------------------------------------------------------- /deps/glfw/docs/html/tabs.css: -------------------------------------------------------------------------------- 1 | .tabs, .tabs2, .tabs3 { 2 | background-image: url('tab_b.png'); 3 | width: 100%; 4 | z-index: 101; 5 | font-size: 13px; 6 | font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; 7 | } 8 | 9 | .tabs2 { 10 | font-size: 10px; 11 | } 12 | .tabs3 { 13 | font-size: 9px; 14 | } 15 | 16 | .tablist { 17 | margin: 0; 18 | padding: 0; 19 | display: table; 20 | } 21 | 22 | .tablist li { 23 | float: left; 24 | display: table-cell; 25 | background-image: url('tab_b.png'); 26 | line-height: 36px; 27 | list-style: none; 28 | } 29 | 30 | .tablist a { 31 | display: block; 32 | padding: 0 20px; 33 | font-weight: bold; 34 | background-image:url('tab_s.png'); 35 | background-repeat:no-repeat; 36 | background-position:right; 37 | color: #283A5D; 38 | text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); 39 | text-decoration: none; 40 | outline: none; 41 | } 42 | 43 | .tabs3 .tablist a { 44 | padding: 0 10px; 45 | } 46 | 47 | .tablist a:hover { 48 | background-image: url('tab_h.png'); 49 | background-repeat:repeat-x; 50 | color: #fff; 51 | text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); 52 | text-decoration: none; 53 | } 54 | 55 | .tablist li.current a { 56 | background-image: url('tab_a.png'); 57 | background-repeat:repeat-x; 58 | color: #fff; 59 | text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); 60 | } 61 | -------------------------------------------------------------------------------- /deps/glfw/docs/main.dox: -------------------------------------------------------------------------------- 1 | /*! 2 | 3 | @mainpage notitle 4 | 5 | @section main_intro Introduction 6 | 7 | __GLFW__ is a free, Open Source, multi-platform library for creating windows 8 | with OpenGL or OpenGL ES contexts and receiving many kinds of input. It is easy 9 | to integrate into existing applications and does not lay claim to the main loop. 10 | 11 | See @ref news_31 for release highlights or the 12 | [version history](http://www.glfw.org/changelog.html) for details. 13 | 14 | @ref quick is a guide for those new to GLFW. It takes you through how to write 15 | a small but complete program. For people coming from GLFW 2, the @ref moving 16 | guide explains what has changed and how to update existing code to use the new 17 | API. 18 | 19 | There are guides for each of the various areas of the API. 20 | 21 | - @ref intro – initialization, error handling and high-level design 22 | - @ref window – creating and working with windows and framebuffers 23 | - @ref context – working with OpenGL and OpenGL ES contexts 24 | - @ref monitor – enumerating and working with monitors and video modes 25 | - @ref input – receiving events, polling and processing input 26 | 27 | Once you have written a program, see the @ref compile and @ref build guides. 28 | 29 | The [reference documentation](modules.html) provides more detailed information 30 | about specific functions. 31 | 32 | There is a section on @ref guarantees_limitations for pointer lifetimes, 33 | reentrancy, thread safety, event order and backward and forward compatibility. 34 | 35 | The @ref rift fills in the gaps for how to use LibOVR with GLFW. 36 | 37 | The [FAQ](http://www.glfw.org/faq.html) answers many common questions about the 38 | design, implementation and use of GLFW. 39 | 40 | Finally, the @ref compat guide explains what APIs, standards and protocols GLFW 41 | uses and what happens when they are not present on a given machine. 42 | 43 | This documentation was generated with Doxygen. The sources for it are available 44 | in both the [source distribution](http://www.glfw.org/download.html) and 45 | [GitHub repository](https://github.com/glfw/glfw). 46 | 47 | */ 48 | -------------------------------------------------------------------------------- /deps/glfw/examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | link_libraries(glfw "${OPENGL_glu_LIBRARY}") 3 | 4 | if (BUILD_SHARED_LIBS) 5 | add_definitions(-DGLFW_DLL) 6 | link_libraries("${OPENGL_gl_LIBRARY}" "${MATH_LIBRARY}") 7 | else() 8 | link_libraries(${glfw_LIBRARIES}) 9 | endif() 10 | 11 | include_directories("${GLFW_SOURCE_DIR}/include" 12 | "${GLFW_SOURCE_DIR}/deps") 13 | 14 | if ("${OPENGL_INCLUDE_DIR}") 15 | include_directories("${OPENGL_INCLUDE_DIR}") 16 | endif() 17 | 18 | set(GLAD "${GLFW_SOURCE_DIR}/deps/glad/glad.h" 19 | "${GLFW_SOURCE_DIR}/deps/glad.c") 20 | set(GETOPT "${GLFW_SOURCE_DIR}/deps/getopt.h" 21 | "${GLFW_SOURCE_DIR}/deps/getopt.c") 22 | set(TINYCTHREAD "${GLFW_SOURCE_DIR}/deps/tinycthread.h" 23 | "${GLFW_SOURCE_DIR}/deps/tinycthread.c") 24 | 25 | if (APPLE) 26 | # Set fancy names for bundles 27 | add_executable(Boing MACOSX_BUNDLE boing.c) 28 | add_executable(Gears MACOSX_BUNDLE gears.c) 29 | add_executable(Heightmap MACOSX_BUNDLE heightmap.c ${GLAD}) 30 | add_executable(Particles MACOSX_BUNDLE particles.c ${TINYCTHREAD}) 31 | add_executable(Simple MACOSX_BUNDLE simple.c) 32 | add_executable(SplitView MACOSX_BUNDLE splitview.c) 33 | add_executable(Wave MACOSX_BUNDLE wave.c) 34 | 35 | set_target_properties(Boing PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Boing") 36 | set_target_properties(Gears PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Gears") 37 | set_target_properties(Heightmap PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Heightmap") 38 | set_target_properties(Particles PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Particles") 39 | set_target_properties(Simple PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Simple") 40 | set_target_properties(SplitView PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Split View") 41 | set_target_properties(Wave PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Wave") 42 | 43 | set_target_properties(Boing Gears Heightmap Particles Simple SplitView Wave PROPERTIES 44 | FOLDER "GLFW3/Examples" 45 | MACOSX_BUNDLE_INFO_PLIST "${GLFW_SOURCE_DIR}/CMake/AppleInfo.plist") 46 | 47 | else() 48 | # Set boring names for executables 49 | add_executable(boing WIN32 boing.c) 50 | add_executable(gears WIN32 gears.c) 51 | add_executable(heightmap WIN32 heightmap.c ${GLAD}) 52 | add_executable(particles WIN32 particles.c ${TINYCTHREAD} ${GETOPT}) 53 | add_executable(simple WIN32 simple.c) 54 | add_executable(splitview WIN32 splitview.c) 55 | add_executable(wave WIN32 wave.c) 56 | 57 | set_target_properties(boing gears heightmap particles simple splitview wave PROPERTIES 58 | FOLDER "GLFW3/Examples") 59 | endif() 60 | 61 | if (APPLE) 62 | target_link_libraries(Particles "${CMAKE_THREAD_LIBS_INIT}") 63 | elseif (UNIX) 64 | target_link_libraries(particles "${CMAKE_THREAD_LIBS_INIT}" "${RT_LIBRARY}") 65 | endif() 66 | 67 | if (MSVC) 68 | set(WINDOWS_BINARIES boing gears heightmap particles simple splitview wave) 69 | 70 | # Tell MSVC to use main instead of WinMain for Windows subsystem executables 71 | set_target_properties(${WINDOWS_BINARIES} PROPERTIES 72 | LINK_FLAGS "/ENTRY:mainCRTStartup") 73 | endif() 74 | 75 | if (APPLE) 76 | set(BUNDLE_BINARIES Boing Gears Heightmap Particles Simple SplitView Wave) 77 | 78 | set_target_properties(${BUNDLE_BINARIES} PROPERTIES 79 | MACOSX_BUNDLE_SHORT_VERSION_STRING ${GLFW_VERSION} 80 | MACOSX_BUNDLE_LONG_VERSION_STRING ${GLFW_VERSION_FULL}) 81 | endif() 82 | 83 | -------------------------------------------------------------------------------- /deps/glfw/examples/simple.c: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // Simple GLFW example 3 | // Copyright (c) Camilla Berglund 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 16 | // be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, and must not 19 | // be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source 22 | // distribution. 23 | // 24 | //======================================================================== 25 | //! [code] 26 | 27 | #include 28 | 29 | #include 30 | #include 31 | 32 | static void error_callback(int error, const char* description) 33 | { 34 | fputs(description, stderr); 35 | } 36 | 37 | static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) 38 | { 39 | if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS) 40 | glfwSetWindowShouldClose(window, GL_TRUE); 41 | } 42 | 43 | int main(void) 44 | { 45 | GLFWwindow* window; 46 | 47 | glfwSetErrorCallback(error_callback); 48 | 49 | if (!glfwInit()) 50 | exit(EXIT_FAILURE); 51 | 52 | window = glfwCreateWindow(640, 480, "Simple example", NULL, NULL); 53 | if (!window) 54 | { 55 | glfwTerminate(); 56 | exit(EXIT_FAILURE); 57 | } 58 | 59 | glfwMakeContextCurrent(window); 60 | glfwSwapInterval(1); 61 | 62 | glfwSetKeyCallback(window, key_callback); 63 | 64 | while (!glfwWindowShouldClose(window)) 65 | { 66 | float ratio; 67 | int width, height; 68 | 69 | glfwGetFramebufferSize(window, &width, &height); 70 | ratio = width / (float) height; 71 | 72 | glViewport(0, 0, width, height); 73 | glClear(GL_COLOR_BUFFER_BIT); 74 | 75 | glMatrixMode(GL_PROJECTION); 76 | glLoadIdentity(); 77 | glOrtho(-ratio, ratio, -1.f, 1.f, 1.f, -1.f); 78 | glMatrixMode(GL_MODELVIEW); 79 | 80 | glLoadIdentity(); 81 | glRotatef((float) glfwGetTime() * 50.f, 0.f, 0.f, 1.f); 82 | 83 | glBegin(GL_TRIANGLES); 84 | glColor3f(1.f, 0.f, 0.f); 85 | glVertex3f(-0.6f, -0.4f, 0.f); 86 | glColor3f(0.f, 1.f, 0.f); 87 | glVertex3f(0.6f, -0.4f, 0.f); 88 | glColor3f(0.f, 0.f, 1.f); 89 | glVertex3f(0.f, 0.6f, 0.f); 90 | glEnd(); 91 | 92 | glfwSwapBuffers(window); 93 | glfwPollEvents(); 94 | } 95 | 96 | glfwDestroyWindow(window); 97 | 98 | glfwTerminate(); 99 | exit(EXIT_SUCCESS); 100 | } 101 | 102 | //! [code] 103 | -------------------------------------------------------------------------------- /deps/glfw/src/egl_context.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.1 EGL - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2002-2006 Marcus Geelnard 5 | // Copyright (c) 2006-2010 Camilla Berglund 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would 18 | // be appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | //======================================================================== 27 | 28 | #ifndef _egl_context_h_ 29 | #define _egl_context_h_ 30 | 31 | #include 32 | 33 | // This path may need to be changed if you build GLFW using your own setup 34 | // We ship and use our own copy of eglext.h since GLFW uses fairly new 35 | // extensions and not all operating systems come with an up-to-date version 36 | #include "../deps/EGL/eglext.h" 37 | 38 | // Do we have support for dlopen/dlsym? 39 | #if defined(_GLFW_HAS_DLOPEN) 40 | #include 41 | #endif 42 | 43 | #define _GLFW_PLATFORM_FBCONFIG EGLConfig egl 44 | #define _GLFW_PLATFORM_CONTEXT_STATE _GLFWcontextEGL egl 45 | #define _GLFW_PLATFORM_LIBRARY_CONTEXT_STATE _GLFWlibraryEGL egl 46 | 47 | 48 | // EGL-specific per-context data 49 | // 50 | typedef struct _GLFWcontextEGL 51 | { 52 | EGLConfig config; 53 | EGLContext context; 54 | EGLSurface surface; 55 | 56 | #if defined(_GLFW_X11) 57 | XVisualInfo* visual; 58 | #endif 59 | 60 | } _GLFWcontextEGL; 61 | 62 | 63 | // EGL-specific global data 64 | // 65 | typedef struct _GLFWlibraryEGL 66 | { 67 | EGLDisplay display; 68 | EGLint versionMajor, versionMinor; 69 | 70 | GLboolean KHR_create_context; 71 | 72 | } _GLFWlibraryEGL; 73 | 74 | 75 | int _glfwInitContextAPI(void); 76 | void _glfwTerminateContextAPI(void); 77 | int _glfwCreateContext(_GLFWwindow* window, 78 | const _GLFWctxconfig* ctxconfig, 79 | const _GLFWfbconfig* fbconfig); 80 | void _glfwDestroyContext(_GLFWwindow* window); 81 | int _glfwAnalyzeContext(const _GLFWwindow* window, 82 | const _GLFWctxconfig* ctxconfig, 83 | const _GLFWfbconfig* fbconfig); 84 | 85 | #endif // _egl_context_h_ 86 | -------------------------------------------------------------------------------- /deps/glfw/src/glfw3.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | exec_prefix=${prefix} 3 | includedir=${prefix}/include 4 | libdir=${exec_prefix}/lib@LIB_SUFFIX@ 5 | 6 | Name: GLFW 7 | Description: A multi-platform library for OpenGL, window and input 8 | Version: @GLFW_VERSION_FULL@ 9 | URL: http://www.glfw.org/ 10 | Requires.private: @GLFW_PKG_DEPS@ 11 | Libs: -L${libdir} -l@GLFW_LIB_NAME@ 12 | Libs.private: @GLFW_PKG_LIBS@ 13 | Cflags: -I${includedir} 14 | -------------------------------------------------------------------------------- /deps/glfw/src/glfw3Config.cmake.in: -------------------------------------------------------------------------------- 1 | # - Config file for the glfw3 package 2 | # It defines the following variables 3 | # GLFW3_INCLUDE_DIR, the path where GLFW headers are located 4 | # GLFW3_LIBRARY_DIR, folder in which the GLFW library is located 5 | # GLFW3_LIBRARY, library to link against to use GLFW 6 | 7 | set(GLFW3_VERSION "@GLFW_VERSION_FULL@") 8 | 9 | @PACKAGE_INIT@ 10 | 11 | set_and_check(GLFW3_INCLUDE_DIR "@PACKAGE_CMAKE_INSTALL_PREFIX@/include") 12 | set_and_check(GLFW3_LIBRARY_DIR "@PACKAGE_CMAKE_INSTALL_PREFIX@/lib@LIB_SUFFIX@") 13 | 14 | find_library(GLFW3_LIBRARY "@GLFW_LIB_NAME@" HINTS ${GLFW3_LIBRARY_DIR}) 15 | 16 | -------------------------------------------------------------------------------- /deps/glfw/src/iokit_joystick.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.1 IOKit - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2006-2014 Camilla Berglund 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | 27 | #ifndef _iokit_joystick_h_ 28 | #define _iokit_joystick_h_ 29 | 30 | #include 31 | #include 32 | #include 33 | #include 34 | 35 | #define _GLFW_PLATFORM_LIBRARY_JOYSTICK_STATE \ 36 | _GLFWjoystickIOKit iokit_js[GLFW_JOYSTICK_LAST + 1] 37 | 38 | 39 | // IOKit-specific per-joystick data 40 | // 41 | typedef struct _GLFWjoystickIOKit 42 | { 43 | int present; 44 | char name[256]; 45 | 46 | IOHIDDeviceInterface** interface; 47 | 48 | CFMutableArrayRef axisElements; 49 | CFMutableArrayRef buttonElements; 50 | CFMutableArrayRef hatElements; 51 | 52 | float* axes; 53 | unsigned char* buttons; 54 | 55 | } _GLFWjoystickIOKit; 56 | 57 | 58 | void _glfwInitJoysticks(void); 59 | void _glfwTerminateJoysticks(void); 60 | 61 | #endif // _iokit_joystick_h_ 62 | -------------------------------------------------------------------------------- /deps/glfw/src/linux_joystick.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.1 Linux - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2014 Jonas Ådahl 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | 27 | #ifndef _linux_joystick_h_ 28 | #define _linux_joystick_h_ 29 | 30 | #include 31 | 32 | #define _GLFW_PLATFORM_LIBRARY_JOYSTICK_STATE \ 33 | _GLFWjoystickLinux linux_js 34 | 35 | 36 | // Linux-specific joystick API data 37 | // 38 | typedef struct _GLFWjoystickLinux 39 | { 40 | struct 41 | { 42 | int present; 43 | int fd; 44 | float* axes; 45 | int axisCount; 46 | unsigned char* buttons; 47 | int buttonCount; 48 | char* name; 49 | char* path; 50 | } js[GLFW_JOYSTICK_LAST + 1]; 51 | 52 | #if defined(__linux__) 53 | int inotify; 54 | int watch; 55 | regex_t regex; 56 | #endif /*__linux__*/ 57 | } _GLFWjoystickLinux; 58 | 59 | 60 | int _glfwInitJoysticks(void); 61 | void _glfwTerminateJoysticks(void); 62 | 63 | #endif // _linux_joystick_h_ 64 | -------------------------------------------------------------------------------- /deps/glfw/src/mach_time.c: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.1 OS X - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2009-2010 Camilla Berglund 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | 27 | #include "internal.h" 28 | 29 | #include 30 | 31 | 32 | // Return raw time 33 | // 34 | static uint64_t getRawTime(void) 35 | { 36 | return mach_absolute_time(); 37 | } 38 | 39 | 40 | ////////////////////////////////////////////////////////////////////////// 41 | ////// GLFW internal API ////// 42 | ////////////////////////////////////////////////////////////////////////// 43 | 44 | // Initialise timer 45 | // 46 | void _glfwInitTimer(void) 47 | { 48 | mach_timebase_info_data_t info; 49 | mach_timebase_info(&info); 50 | 51 | _glfw.ns_time.resolution = (double) info.numer / (info.denom * 1.0e9); 52 | _glfw.ns_time.base = getRawTime(); 53 | } 54 | 55 | 56 | ////////////////////////////////////////////////////////////////////////// 57 | ////// GLFW platform API ////// 58 | ////////////////////////////////////////////////////////////////////////// 59 | 60 | double _glfwPlatformGetTime(void) 61 | { 62 | return (double) (getRawTime() - _glfw.ns_time.base) * 63 | _glfw.ns_time.resolution; 64 | } 65 | 66 | void _glfwPlatformSetTime(double time) 67 | { 68 | _glfw.ns_time.base = getRawTime() - 69 | (uint64_t) (time / _glfw.ns_time.resolution); 70 | } 71 | 72 | -------------------------------------------------------------------------------- /deps/glfw/src/mir_init.c: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.1 Mir - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2014 Brandon Schaefer 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | 27 | #include "internal.h" 28 | 29 | #include 30 | #include 31 | 32 | 33 | ////////////////////////////////////////////////////////////////////////// 34 | ////// GLFW internal API ////// 35 | ////////////////////////////////////////////////////////////////////////// 36 | 37 | int _glfwPlatformInit(void) 38 | { 39 | int error; 40 | 41 | _glfw.mir.connection = mir_connect_sync(NULL, __PRETTY_FUNCTION__); 42 | 43 | if (!mir_connection_is_valid(_glfw.mir.connection)) 44 | { 45 | _glfwInputError(GLFW_PLATFORM_ERROR, 46 | "Mir: Unable to connect to server: %s", 47 | mir_connection_get_error_message(_glfw.mir.connection)); 48 | 49 | return GL_FALSE; 50 | } 51 | 52 | _glfw.mir.display = 53 | mir_connection_get_egl_native_display(_glfw.mir.connection); 54 | 55 | if (!_glfwInitContextAPI()) 56 | return GL_FALSE; 57 | 58 | _glfwInitTimer(); 59 | _glfwInitJoysticks(); 60 | 61 | _glfw.mir.event_queue = calloc(1, sizeof(EventQueue)); 62 | _glfwInitEventQueue(_glfw.mir.event_queue); 63 | 64 | error = pthread_mutex_init(&_glfw.mir.event_mutex, NULL); 65 | if (error) 66 | { 67 | _glfwInputError(GLFW_PLATFORM_ERROR, 68 | "Mir: Failed to create event mutex: %s", 69 | strerror(error)); 70 | return GL_FALSE; 71 | } 72 | 73 | return GL_TRUE; 74 | } 75 | 76 | void _glfwPlatformTerminate(void) 77 | { 78 | _glfwTerminateContextAPI(); 79 | _glfwTerminateJoysticks(); 80 | 81 | _glfwDeleteEventQueue(_glfw.mir.event_queue); 82 | 83 | pthread_mutex_destroy(&_glfw.mir.event_mutex); 84 | 85 | mir_connection_release(_glfw.mir.connection); 86 | } 87 | 88 | const char* _glfwPlatformGetVersionString(void) 89 | { 90 | const char* version = _GLFW_VERSION_NUMBER " Mir EGL" 91 | #if defined(_POSIX_TIMERS) && defined(_POSIX_MONOTONIC_CLOCK) 92 | " clock_gettime" 93 | #endif 94 | #if defined(_GLFW_BUILD_DLL) 95 | " shared" 96 | #endif 97 | ; 98 | 99 | return version; 100 | } 101 | 102 | -------------------------------------------------------------------------------- /deps/glfw/src/mir_platform.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.1 Mir - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2014 Brandon Schaefer 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | 27 | #ifndef _mir_platform_h_ 28 | #define _mir_platform_h_ 29 | 30 | #include 31 | 32 | #include "posix_tls.h" 33 | #include "posix_time.h" 34 | #include "linux_joystick.h" 35 | 36 | #include 37 | 38 | #include 39 | 40 | #if defined(_GLFW_EGL) 41 | #include "egl_context.h" 42 | #else 43 | #error "The Mir backend depends on EGL platform support" 44 | #endif 45 | 46 | #define _GLFW_EGL_NATIVE_WINDOW window->mir.window 47 | #define _GLFW_EGL_NATIVE_DISPLAY _glfw.mir.display 48 | 49 | #define _GLFW_PLATFORM_WINDOW_STATE _GLFWwindowMir mir 50 | #define _GLFW_PLATFORM_MONITOR_STATE _GLFWmonitorMir mir 51 | #define _GLFW_PLATFORM_LIBRARY_WINDOW_STATE _GLFWlibraryMir mir 52 | #define _GLFW_PLATFORM_CURSOR_STATE _GLFWcursorMir mir 53 | 54 | // Mir-specific Event Queue 55 | // 56 | typedef struct EventQueue 57 | { 58 | TAILQ_HEAD(, EventNode) head; 59 | } EventQueue; 60 | 61 | // Mir-specific per-window data 62 | // 63 | typedef struct _GLFWwindowMir 64 | { 65 | MirSurface* surface; 66 | int width; 67 | int height; 68 | MirEGLNativeWindowType window; 69 | 70 | } _GLFWwindowMir; 71 | 72 | 73 | // Mir-specific per-monitor data 74 | // 75 | typedef struct _GLFWmonitorMir 76 | { 77 | int cur_mode; 78 | int output_id; 79 | int x; 80 | int y; 81 | 82 | } _GLFWmonitorMir; 83 | 84 | 85 | // Mir-specific global data 86 | // 87 | typedef struct _GLFWlibraryMir 88 | { 89 | MirConnection* connection; 90 | MirEGLNativeDisplayType display; 91 | EventQueue* event_queue; 92 | 93 | pthread_mutex_t event_mutex; 94 | pthread_cond_t event_cond; 95 | 96 | } _GLFWlibraryMir; 97 | 98 | 99 | // Mir-specific per-cursor data 100 | // TODO: Only system cursors are implemented in Mir atm. Need to wait for support. 101 | // 102 | typedef struct _GLFWcursorMir 103 | { 104 | } _GLFWcursorMir; 105 | 106 | 107 | extern void _glfwInitEventQueue(EventQueue* queue); 108 | extern void _glfwDeleteEventQueue(EventQueue* queue); 109 | 110 | #endif // _mir_platform_h_ 111 | -------------------------------------------------------------------------------- /deps/glfw/src/nsgl_context.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.1 OS X - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2009-2010 Camilla Berglund 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | 27 | #ifndef _nsgl_context_h_ 28 | #define _nsgl_context_h_ 29 | 30 | #define _GLFW_PLATFORM_FBCONFIG 31 | #define _GLFW_PLATFORM_CONTEXT_STATE _GLFWcontextNSGL nsgl 32 | #define _GLFW_PLATFORM_LIBRARY_CONTEXT_STATE _GLFWlibraryNSGL nsgl 33 | 34 | 35 | // NSGL-specific per-context data 36 | // 37 | typedef struct _GLFWcontextNSGL 38 | { 39 | id pixelFormat; 40 | id context; 41 | 42 | } _GLFWcontextNSGL; 43 | 44 | 45 | // NSGL-specific global data 46 | // 47 | typedef struct _GLFWlibraryNSGL 48 | { 49 | // dlopen handle for OpenGL.framework (for glfwGetProcAddress) 50 | void* framework; 51 | 52 | } _GLFWlibraryNSGL; 53 | 54 | 55 | int _glfwInitContextAPI(void); 56 | void _glfwTerminateContextAPI(void); 57 | int _glfwCreateContext(_GLFWwindow* window, 58 | const _GLFWctxconfig* ctxconfig, 59 | const _GLFWfbconfig* fbconfig); 60 | void _glfwDestroyContext(_GLFWwindow* window); 61 | 62 | #endif // _nsgl_context_h_ 63 | -------------------------------------------------------------------------------- /deps/glfw/src/posix_time.c: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.1 POSIX - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2002-2006 Marcus Geelnard 5 | // Copyright (c) 2006-2010 Camilla Berglund 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would 18 | // be appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | //======================================================================== 27 | 28 | #include "internal.h" 29 | 30 | #include 31 | #include 32 | 33 | // Return raw time 34 | // 35 | static uint64_t getRawTime(void) 36 | { 37 | #if defined(CLOCK_MONOTONIC) 38 | if (_glfw.posix_time.monotonic) 39 | { 40 | struct timespec ts; 41 | 42 | clock_gettime(CLOCK_MONOTONIC, &ts); 43 | return (uint64_t) ts.tv_sec * (uint64_t) 1000000000 + (uint64_t) ts.tv_nsec; 44 | } 45 | else 46 | #endif 47 | { 48 | struct timeval tv; 49 | 50 | gettimeofday(&tv, NULL); 51 | return (uint64_t) tv.tv_sec * (uint64_t) 1000000 + (uint64_t) tv.tv_usec; 52 | } 53 | } 54 | 55 | 56 | ////////////////////////////////////////////////////////////////////////// 57 | ////// GLFW internal API ////// 58 | ////////////////////////////////////////////////////////////////////////// 59 | 60 | // Initialise timer 61 | // 62 | void _glfwInitTimer(void) 63 | { 64 | #if defined(CLOCK_MONOTONIC) 65 | struct timespec ts; 66 | 67 | if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0) 68 | { 69 | _glfw.posix_time.monotonic = GL_TRUE; 70 | _glfw.posix_time.resolution = 1e-9; 71 | } 72 | else 73 | #endif 74 | { 75 | _glfw.posix_time.resolution = 1e-6; 76 | } 77 | 78 | _glfw.posix_time.base = getRawTime(); 79 | } 80 | 81 | 82 | ////////////////////////////////////////////////////////////////////////// 83 | ////// GLFW platform API ////// 84 | ////////////////////////////////////////////////////////////////////////// 85 | 86 | double _glfwPlatformGetTime(void) 87 | { 88 | return (double) (getRawTime() - _glfw.posix_time.base) * 89 | _glfw.posix_time.resolution; 90 | } 91 | 92 | void _glfwPlatformSetTime(double time) 93 | { 94 | _glfw.posix_time.base = getRawTime() - 95 | (uint64_t) (time / _glfw.posix_time.resolution); 96 | } 97 | 98 | -------------------------------------------------------------------------------- /deps/glfw/src/posix_time.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.1 POSIX - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2002-2006 Marcus Geelnard 5 | // Copyright (c) 2006-2010 Camilla Berglund 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would 18 | // be appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | //======================================================================== 27 | 28 | #ifndef _posix_time_h_ 29 | #define _posix_time_h_ 30 | 31 | #define _GLFW_PLATFORM_LIBRARY_TIME_STATE _GLFWtimePOSIX posix_time 32 | 33 | #include 34 | 35 | 36 | // POSIX-specific global timer data 37 | // 38 | typedef struct _GLFWtimePOSIX 39 | { 40 | GLboolean monotonic; 41 | double resolution; 42 | uint64_t base; 43 | 44 | } _GLFWtimePOSIX; 45 | 46 | 47 | void _glfwInitTimer(void); 48 | 49 | #endif // _posix_time_h_ 50 | -------------------------------------------------------------------------------- /deps/glfw/src/posix_tls.c: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.1 POSIX - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2002-2006 Marcus Geelnard 5 | // Copyright (c) 2006-2010 Camilla Berglund 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would 18 | // be appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | //======================================================================== 27 | 28 | #include "internal.h" 29 | 30 | 31 | ////////////////////////////////////////////////////////////////////////// 32 | ////// GLFW internal API ////// 33 | ////////////////////////////////////////////////////////////////////////// 34 | 35 | int _glfwInitTLS(void) 36 | { 37 | if (pthread_key_create(&_glfw.posix_tls.context, NULL) != 0) 38 | { 39 | _glfwInputError(GLFW_PLATFORM_ERROR, 40 | "POSIX: Failed to create context TLS"); 41 | return GL_FALSE; 42 | } 43 | 44 | return GL_TRUE; 45 | } 46 | 47 | void _glfwTerminateTLS(void) 48 | { 49 | pthread_key_delete(_glfw.posix_tls.context); 50 | } 51 | 52 | void _glfwSetCurrentContext(_GLFWwindow* context) 53 | { 54 | pthread_setspecific(_glfw.posix_tls.context, context); 55 | } 56 | 57 | 58 | ////////////////////////////////////////////////////////////////////////// 59 | ////// GLFW platform API ////// 60 | ////////////////////////////////////////////////////////////////////////// 61 | 62 | _GLFWwindow* _glfwPlatformGetCurrentContext(void) 63 | { 64 | return pthread_getspecific(_glfw.posix_tls.context); 65 | } 66 | 67 | -------------------------------------------------------------------------------- /deps/glfw/src/posix_tls.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.1 POSIX - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2002-2006 Marcus Geelnard 5 | // Copyright (c) 2006-2010 Camilla Berglund 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would 18 | // be appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | //======================================================================== 27 | 28 | #ifndef _posix_tls_h_ 29 | #define _posix_tls_h_ 30 | 31 | #include 32 | 33 | #define _GLFW_PLATFORM_LIBRARY_TLS_STATE _GLFWtlsPOSIX posix_tls 34 | 35 | 36 | // POSIX-specific global TLS data 37 | // 38 | typedef struct _GLFWtlsPOSIX 39 | { 40 | pthread_key_t context; 41 | 42 | } _GLFWtlsPOSIX; 43 | 44 | 45 | int _glfwInitTLS(void); 46 | void _glfwTerminateTLS(void); 47 | void _glfwSetCurrentContext(_GLFWwindow* context); 48 | 49 | #endif // _posix_tls_h_ 50 | -------------------------------------------------------------------------------- /deps/glfw/src/win32_time.c: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.1 Win32 - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2002-2006 Marcus Geelnard 5 | // Copyright (c) 2006-2010 Camilla Berglund 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would 18 | // be appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | //======================================================================== 27 | 28 | #include "internal.h" 29 | 30 | 31 | // Return raw time 32 | // 33 | static unsigned __int64 getRawTime(void) 34 | { 35 | if (_glfw.win32_time.hasPC) 36 | { 37 | unsigned __int64 time; 38 | QueryPerformanceCounter((LARGE_INTEGER*) &time); 39 | return time; 40 | } 41 | else 42 | return (unsigned __int64) _glfw_timeGetTime(); 43 | } 44 | 45 | 46 | ////////////////////////////////////////////////////////////////////////// 47 | ////// GLFW internal API ////// 48 | ////////////////////////////////////////////////////////////////////////// 49 | 50 | // Initialise timer 51 | // 52 | void _glfwInitTimer(void) 53 | { 54 | unsigned __int64 frequency; 55 | 56 | if (QueryPerformanceFrequency((LARGE_INTEGER*) &frequency)) 57 | { 58 | _glfw.win32_time.hasPC = GL_TRUE; 59 | _glfw.win32_time.resolution = 1.0 / (double) frequency; 60 | } 61 | else 62 | { 63 | _glfw.win32_time.hasPC = GL_FALSE; 64 | _glfw.win32_time.resolution = 0.001; // winmm resolution is 1 ms 65 | } 66 | 67 | _glfw.win32_time.base = getRawTime(); 68 | } 69 | 70 | 71 | ////////////////////////////////////////////////////////////////////////// 72 | ////// GLFW platform API ////// 73 | ////////////////////////////////////////////////////////////////////////// 74 | 75 | double _glfwPlatformGetTime(void) 76 | { 77 | return (double) (getRawTime() - _glfw.win32_time.base) * 78 | _glfw.win32_time.resolution; 79 | } 80 | 81 | void _glfwPlatformSetTime(double time) 82 | { 83 | _glfw.win32_time.base = getRawTime() - 84 | (unsigned __int64) (time / _glfw.win32_time.resolution); 85 | } 86 | 87 | -------------------------------------------------------------------------------- /deps/glfw/src/win32_tls.c: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.1 Win32 - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2002-2006 Marcus Geelnard 5 | // Copyright (c) 2006-2010 Camilla Berglund 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would 18 | // be appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | //======================================================================== 27 | 28 | #include "internal.h" 29 | 30 | 31 | ////////////////////////////////////////////////////////////////////////// 32 | ////// GLFW internal API ////// 33 | ////////////////////////////////////////////////////////////////////////// 34 | 35 | int _glfwInitTLS(void) 36 | { 37 | _glfw.win32_tls.context = TlsAlloc(); 38 | if (_glfw.win32_tls.context == TLS_OUT_OF_INDEXES) 39 | { 40 | _glfwInputError(GLFW_PLATFORM_ERROR, 41 | "Win32: Failed to allocate TLS index"); 42 | return GL_FALSE; 43 | } 44 | 45 | _glfw.win32_tls.allocated = GL_TRUE; 46 | return GL_TRUE; 47 | } 48 | 49 | void _glfwTerminateTLS(void) 50 | { 51 | if (_glfw.win32_tls.allocated) 52 | TlsFree(_glfw.win32_tls.context); 53 | } 54 | 55 | void _glfwSetCurrentContext(_GLFWwindow* context) 56 | { 57 | TlsSetValue(_glfw.win32_tls.context, context); 58 | } 59 | 60 | 61 | ////////////////////////////////////////////////////////////////////////// 62 | ////// GLFW platform API ////// 63 | ////////////////////////////////////////////////////////////////////////// 64 | 65 | _GLFWwindow* _glfwPlatformGetCurrentContext(void) 66 | { 67 | return TlsGetValue(_glfw.win32_tls.context); 68 | } 69 | 70 | -------------------------------------------------------------------------------- /deps/glfw/src/win32_tls.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.1 Win32 - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2002-2006 Marcus Geelnard 5 | // Copyright (c) 2006-2010 Camilla Berglund 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would 18 | // be appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | //======================================================================== 27 | 28 | #ifndef _win32_tls_h_ 29 | #define _win32_tls_h_ 30 | 31 | #define _GLFW_PLATFORM_LIBRARY_TLS_STATE _GLFWtlsWin32 win32_tls 32 | 33 | 34 | // Win32-specific global TLS data 35 | // 36 | typedef struct _GLFWtlsWin32 37 | { 38 | GLboolean allocated; 39 | DWORD context; 40 | 41 | } _GLFWtlsWin32; 42 | 43 | 44 | int _glfwInitTLS(void); 45 | void _glfwTerminateTLS(void); 46 | void _glfwSetCurrentContext(_GLFWwindow* context); 47 | 48 | #endif // _win32_tls_h_ 49 | -------------------------------------------------------------------------------- /deps/glfw/src/winmm_joystick.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.1 WinMM - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2006-2014 Camilla Berglund 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | 27 | #ifndef _winmm_joystick_h_ 28 | #define _winmm_joystick_h_ 29 | 30 | #define _GLFW_PLATFORM_LIBRARY_JOYSTICK_STATE \ 31 | _GLFWjoystickWinMM winmm_js[GLFW_JOYSTICK_LAST + 1] 32 | 33 | 34 | // WinMM-specific per-joystick data 35 | // 36 | typedef struct _GLFWjoystickWinMM 37 | { 38 | float axes[6]; 39 | unsigned char buttons[36]; // 32 buttons plus one hat 40 | char* name; 41 | } _GLFWjoystickWinMM; 42 | 43 | 44 | void _glfwInitJoysticks(void); 45 | void _glfwTerminateJoysticks(void); 46 | 47 | #endif // _winmm_joystick_h_ 48 | -------------------------------------------------------------------------------- /deps/glfw/src/xkb_unicode.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.1 Linux - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2014 Jonas Ådahl 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | 27 | #ifndef _xkb_unicode_h_ 28 | #define _xkb_unicode_h_ 29 | 30 | 31 | long _glfwKeySym2Unicode(unsigned int keysym); 32 | 33 | #endif // _xkb_unicode_h_ 34 | -------------------------------------------------------------------------------- /deps/glfw/tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | link_libraries(glfw) 3 | 4 | if (BUILD_SHARED_LIBS) 5 | add_definitions(-DGLFW_DLL) 6 | link_libraries("${OPENGL_gl_LIBRARY}" "${MATH_LIBRARY}") 7 | else() 8 | link_libraries(${glfw_LIBRARIES}) 9 | endif() 10 | 11 | include_directories("${GLFW_SOURCE_DIR}/include" 12 | "${GLFW_SOURCE_DIR}/deps") 13 | 14 | if ("${OPENGL_INCLUDE_DIR}") 15 | include_directories("${OPENGL_INCLUDE_DIR}") 16 | endif() 17 | 18 | set(GETOPT "${GLFW_SOURCE_DIR}/deps/getopt.h" 19 | "${GLFW_SOURCE_DIR}/deps/getopt.c") 20 | set(TINYCTHREAD "${GLFW_SOURCE_DIR}/deps/tinycthread.h" 21 | "${GLFW_SOURCE_DIR}/deps/tinycthread.c") 22 | 23 | add_executable(clipboard clipboard.c ${GETOPT}) 24 | add_executable(defaults defaults.c) 25 | add_executable(events events.c ${GETOPT}) 26 | add_executable(fsaa fsaa.c ${GETOPT}) 27 | add_executable(gamma gamma.c ${GETOPT}) 28 | add_executable(glfwinfo glfwinfo.c ${GETOPT}) 29 | add_executable(iconify iconify.c ${GETOPT}) 30 | add_executable(joysticks joysticks.c) 31 | add_executable(monitors monitors.c ${GETOPT}) 32 | add_executable(peter peter.c) 33 | add_executable(reopen reopen.c) 34 | add_executable(cursor cursor.c) 35 | 36 | add_executable(cursoranim WIN32 MACOSX_BUNDLE cursoranim.c) 37 | set_target_properties(cursoranim PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Cursor animation") 38 | 39 | add_executable(accuracy WIN32 MACOSX_BUNDLE accuracy.c) 40 | set_target_properties(accuracy PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Accuracy") 41 | 42 | add_executable(empty WIN32 MACOSX_BUNDLE empty.c ${TINYCTHREAD}) 43 | set_target_properties(empty PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Empty Event") 44 | 45 | add_executable(sharing WIN32 MACOSX_BUNDLE sharing.c) 46 | set_target_properties(sharing PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Sharing") 47 | 48 | add_executable(tearing WIN32 MACOSX_BUNDLE tearing.c) 49 | set_target_properties(tearing PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Tearing") 50 | 51 | add_executable(threads WIN32 MACOSX_BUNDLE threads.c ${TINYCTHREAD}) 52 | set_target_properties(threads PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Threads") 53 | 54 | add_executable(title WIN32 MACOSX_BUNDLE title.c) 55 | set_target_properties(title PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Title") 56 | 57 | add_executable(windows WIN32 MACOSX_BUNDLE windows.c) 58 | set_target_properties(windows PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Windows") 59 | 60 | target_link_libraries(empty "${CMAKE_THREAD_LIBS_INIT}" "${RT_LIBRARY}") 61 | target_link_libraries(threads "${CMAKE_THREAD_LIBS_INIT}" "${RT_LIBRARY}") 62 | 63 | set(WINDOWS_BINARIES accuracy empty sharing tearing threads title windows cursoranim) 64 | set(CONSOLE_BINARIES clipboard defaults events fsaa gamma glfwinfo 65 | iconify joysticks monitors peter reopen cursor) 66 | 67 | set_target_properties(${WINDOWS_BINARIES} ${CONSOLE_BINARIES} PROPERTIES 68 | FOLDER "GLFW3/Tests") 69 | 70 | if (MSVC) 71 | # Tell MSVC to use main instead of WinMain for Windows subsystem executables 72 | set_target_properties(${WINDOWS_BINARIES} ${CONSOLE_BINARIES} PROPERTIES 73 | LINK_FLAGS "/ENTRY:mainCRTStartup") 74 | endif() 75 | 76 | if (APPLE) 77 | set_target_properties(${WINDOWS_BINARIES} ${CONSOLE_BINARIES} PROPERTIES 78 | MACOSX_BUNDLE_SHORT_VERSION_STRING ${GLFW_VERSION} 79 | MACOSX_BUNDLE_LONG_VERSION_STRING ${GLFW_VERSION_FULL} 80 | MACOSX_BUNDLE_INFO_PLIST "${GLFW_SOURCE_DIR}/CMake/AppleInfo.plist") 81 | endif() 82 | 83 | -------------------------------------------------------------------------------- /deps/glfw/tests/title.c: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // UTF-8 window title test 3 | // Copyright (c) Camilla Berglund 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 16 | // be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, and must not 19 | // be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source 22 | // distribution. 23 | // 24 | //======================================================================== 25 | // 26 | // This test sets a UTF-8 window title 27 | // 28 | //======================================================================== 29 | 30 | #include 31 | 32 | #include 33 | #include 34 | 35 | static void error_callback(int error, const char* description) 36 | { 37 | fprintf(stderr, "Error: %s\n", description); 38 | } 39 | 40 | static void framebuffer_size_callback(GLFWwindow* window, int width, int height) 41 | { 42 | glViewport(0, 0, width, height); 43 | } 44 | 45 | int main(void) 46 | { 47 | GLFWwindow* window; 48 | 49 | glfwSetErrorCallback(error_callback); 50 | 51 | if (!glfwInit()) 52 | exit(EXIT_FAILURE); 53 | 54 | window = glfwCreateWindow(400, 400, "English 日本語 русский язык 官話", NULL, NULL); 55 | if (!window) 56 | { 57 | glfwTerminate(); 58 | exit(EXIT_FAILURE); 59 | } 60 | 61 | glfwMakeContextCurrent(window); 62 | glfwSwapInterval(1); 63 | 64 | glfwSetFramebufferSizeCallback(window, framebuffer_size_callback); 65 | 66 | while (!glfwWindowShouldClose(window)) 67 | { 68 | glClear(GL_COLOR_BUFFER_BIT); 69 | glfwSwapBuffers(window); 70 | glfwWaitEvents(); 71 | } 72 | 73 | glfwTerminate(); 74 | exit(EXIT_SUCCESS); 75 | } 76 | 77 | -------------------------------------------------------------------------------- /deps/glfw/tests/windows.c: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // Simple multi-window test 3 | // Copyright (c) Camilla Berglund 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 16 | // be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, and must not 19 | // be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source 22 | // distribution. 23 | // 24 | //======================================================================== 25 | // 26 | // This test creates four windows and clears each in a different color 27 | // 28 | //======================================================================== 29 | 30 | #include 31 | 32 | #include 33 | #include 34 | 35 | static const char* titles[4] = 36 | { 37 | "Foo", 38 | "Bar", 39 | "Baz", 40 | "Quux" 41 | }; 42 | 43 | static void error_callback(int error, const char* description) 44 | { 45 | fprintf(stderr, "Error: %s\n", description); 46 | } 47 | 48 | static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) 49 | { 50 | if (key == GLFW_KEY_SPACE && action == GLFW_PRESS) 51 | { 52 | int xpos, ypos; 53 | glfwGetWindowPos(window, &xpos, &ypos); 54 | glfwSetWindowPos(window, xpos, ypos); 55 | } 56 | } 57 | 58 | int main(void) 59 | { 60 | int i; 61 | GLboolean running = GL_TRUE; 62 | GLFWwindow* windows[4]; 63 | 64 | glfwSetErrorCallback(error_callback); 65 | 66 | if (!glfwInit()) 67 | exit(EXIT_FAILURE); 68 | 69 | glfwWindowHint(GLFW_VISIBLE, GL_FALSE); 70 | 71 | for (i = 0; i < 4; i++) 72 | { 73 | int left, top, right, bottom; 74 | 75 | windows[i] = glfwCreateWindow(200, 200, titles[i], NULL, NULL); 76 | if (!windows[i]) 77 | { 78 | glfwTerminate(); 79 | exit(EXIT_FAILURE); 80 | } 81 | 82 | glfwSetKeyCallback(windows[i], key_callback); 83 | 84 | glfwMakeContextCurrent(windows[i]); 85 | glClearColor((GLclampf) (i & 1), 86 | (GLclampf) (i >> 1), 87 | i ? 0.f : 1.f, 88 | 0.f); 89 | 90 | glfwGetWindowFrameSize(windows[i], &left, &top, &right, &bottom); 91 | glfwSetWindowPos(windows[i], 92 | 100 + (i & 1) * (200 + left + right), 93 | 100 + (i >> 1) * (200 + top + bottom)); 94 | } 95 | 96 | for (i = 0; i < 4; i++) 97 | glfwShowWindow(windows[i]); 98 | 99 | while (running) 100 | { 101 | for (i = 0; i < 4; i++) 102 | { 103 | glfwMakeContextCurrent(windows[i]); 104 | glClear(GL_COLOR_BUFFER_BIT); 105 | glfwSwapBuffers(windows[i]); 106 | 107 | if (glfwWindowShouldClose(windows[i])) 108 | running = GL_FALSE; 109 | } 110 | 111 | glfwPollEvents(); 112 | } 113 | 114 | glfwTerminate(); 115 | exit(EXIT_SUCCESS); 116 | } 117 | 118 | -------------------------------------------------------------------------------- /docs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_custom_target(docs ALL ${DOXYGEN_EXECUTABLE} 2 | WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/docs 3 | COMMENT "Generating HTML documentation" VERBATIM) 4 | 5 | -------------------------------------------------------------------------------- /docs/mainpage.md: -------------------------------------------------------------------------------- 1 | CMU462 {#mainpage} 2 | ================== 3 | 4 | Library for 15-462 : Computer Graphics 5 | 6 | The library provides basic vector operations, takes care of OpenGL context creation, window event handling, and an on-screen text display interface using freetype. The library is designed to provide a simple interface for building graphics applications and is used in 15-462 assignments. -------------------------------------------------------------------------------- /examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | link_libraries(CMU462) 2 | 3 | include_directories("${PROJECT_SOURCE_DIR}/include") 4 | 5 | link_libraries( 6 | glfw ${GLFW_LIBRARIES} 7 | glew ${GLEW_LIBRARIES} 8 | ${OPENGL_LIBRARIES} 9 | ${FREETYPE_LIBRARIES} 10 | ) 11 | 12 | add_executable(triangle triangle.cpp) 13 | add_executable(text text.cpp) 14 | add_executable(event event.cpp) 15 | 16 | # NOTE (Sky): 17 | # the template application uses some deprecated stuff from GLUT and makes 18 | # clang go crazy on OSX 10.9+. Someone should update that implementation. 19 | add_executable(template template.cpp) 20 | set_target_properties(template PROPERTIES COMPILE_FLAGS 21 | "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations") 22 | 23 | 24 | # Install examples 25 | install(TARGETS triangle DESTINATION bin/examples) 26 | -------------------------------------------------------------------------------- /examples/event.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "CMU462/viewer.h" 5 | #include "CMU462/application.h" 6 | 7 | using namespace std; 8 | using namespace CMU462; 9 | 10 | class EventDemo : public Application { 11 | public: 12 | 13 | ~EventDemo() { } 14 | 15 | string name() { 16 | return "Event handling example"; 17 | } 18 | 19 | string info() { 20 | return "Event handling example"; 21 | } 22 | 23 | void init() { 24 | 25 | text_mgr.init(use_hdpi); 26 | 27 | size = 16; 28 | line0 = text_mgr.add_line(0.0, 0.0, "Hi there!", size, Color::White); 29 | 30 | return; 31 | } 32 | 33 | void render() { 34 | 35 | text_mgr.render(); 36 | 37 | } 38 | 39 | void resize(size_t w, size_t h) { 40 | 41 | this->w = w; 42 | this->h = h; 43 | 44 | text_mgr.resize(w,h); 45 | 46 | return; 47 | } 48 | 49 | void cursor_event(float x, float y) { 50 | if (left_down) { 51 | text_mgr.set_anchor(line0, 2 * (x - .5 * w) / w, 2 * (.5 * h - y) / h); 52 | } 53 | } 54 | 55 | void scroll_event(float offset_x, float offset_y) { 56 | size += int(offset_y + offset_x); 57 | text_mgr.set_size(line0, size); 58 | } 59 | 60 | void mouse_event(int key, int event, unsigned char mods) { 61 | if (key == MOUSE_LEFT) { 62 | if (event == EVENT_PRESS) left_down = true; 63 | if (event == EVENT_RELEASE) left_down = false; 64 | } 65 | } 66 | 67 | void keyboard_event(int key, int event, unsigned char mods) { 68 | 69 | string s; 70 | switch (event) { 71 | case EVENT_PRESS: 72 | s = "You just pressed: "; 73 | break; 74 | case EVENT_RELEASE: 75 | s = "You just released: "; 76 | break; 77 | case EVENT_REPEAT: 78 | s = "You are holding: "; 79 | break; 80 | } 81 | 82 | if (key == KEYBOARD_ENTER) { 83 | s += "Enter"; 84 | } else { 85 | char c = key; 86 | s += c; 87 | } 88 | 89 | text_mgr.set_text(line0, s); 90 | } 91 | 92 | private: 93 | 94 | // OSD text manager 95 | OSDText text_mgr; 96 | 97 | // my line id's 98 | int line0; 99 | 100 | // my line's font size 101 | size_t size; 102 | 103 | // frame buffer size 104 | size_t w, h; 105 | 106 | // key states 107 | bool left_down; 108 | 109 | }; 110 | 111 | 112 | int main( int argc, char** argv ) { 113 | 114 | // create viewer 115 | Viewer viewer = Viewer(); 116 | 117 | // create user application 118 | Application* event_demo = new EventDemo(); 119 | 120 | // set user application 121 | viewer.set_application(event_demo); 122 | 123 | // start the viewer 124 | viewer.init(); 125 | viewer.start(); 126 | 127 | return 0; 128 | } 129 | -------------------------------------------------------------------------------- /examples/text.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "CMU462/viewer.h" 5 | #include "CMU462/application.h" 6 | 7 | using namespace std; 8 | using namespace CMU462; 9 | 10 | class TextDemo : public Application { 11 | public: 12 | 13 | ~TextDemo() { } 14 | 15 | string name() { 16 | return "Text manager example"; 17 | } 18 | 19 | string info() { 20 | return "Text manager example"; 21 | } 22 | 23 | void init() { 24 | 25 | text_mgr.init(use_hdpi); 26 | 27 | size = 16; 28 | line0 = text_mgr.add_line(0.0, 0.0, "Hi there!", size, Color::White); 29 | 30 | return; 31 | } 32 | 33 | void render() { 34 | 35 | text_mgr.render(); 36 | 37 | } 38 | 39 | void resize(size_t w, size_t h) { 40 | 41 | this->w = w; 42 | this->h = h; 43 | 44 | text_mgr.resize(w,h); 45 | 46 | return; 47 | } 48 | 49 | void cursor_event(float x, float y) { 50 | text_mgr.set_anchor(line0, 2 * (x - .5 * w) / w, 2 * (.5 * h - y) / h); 51 | } 52 | 53 | void scroll_event(float offset_x, float offset_y) { 54 | size += int(offset_y + offset_x); 55 | text_mgr.set_size(line0, size); 56 | } 57 | 58 | 59 | private: 60 | 61 | // OSD text manager 62 | OSDText text_mgr; 63 | 64 | // my line id's 65 | int line0; 66 | 67 | // my line's font size 68 | size_t size; 69 | 70 | // frame buffer size 71 | size_t w, h; 72 | 73 | }; 74 | 75 | 76 | int main( int argc, char** argv ) { 77 | 78 | // create viewer 79 | Viewer viewer = Viewer(); 80 | 81 | // create user application 82 | Application* text_demo = new TextDemo(); 83 | 84 | // set user application 85 | viewer.set_application(text_demo); 86 | 87 | // start the viewer 88 | viewer.init(); 89 | viewer.start(); 90 | 91 | return 0; 92 | } 93 | -------------------------------------------------------------------------------- /examples/triangle.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "CMU462/viewer.h" 5 | #include "CMU462/application.h" 6 | 7 | using namespace std; 8 | using namespace CMU462; 9 | 10 | class TriangleDrawer : public Application { 11 | public: 12 | 13 | ~TriangleDrawer() { } 14 | 15 | string name() { 16 | return "Drawing example"; 17 | } 18 | 19 | string info() { 20 | return "Drawing example"; 21 | } 22 | 23 | void init() { 24 | return; 25 | } 26 | 27 | void render() { 28 | if (shoud_draw) { 29 | glBegin(GL_TRIANGLES); 30 | glColor3f( 0.1, 0.2, 0.3); 31 | glVertex3f(0.0, 0.5, 0.0); 32 | glVertex3f(-.5, -.5, 0.0); 33 | glVertex3f(0.5, -.5, 0.0); 34 | glEnd(); 35 | } 36 | } 37 | 38 | void resize(size_t w, size_t h) { 39 | 40 | this->w = w; 41 | this->h = h; 42 | 43 | return; 44 | } 45 | 46 | void keyboard_event(int key, int event, unsigned char mods) { 47 | if (key == 'R') shoud_draw = !shoud_draw; 48 | return; 49 | } 50 | 51 | private: 52 | 53 | // show draw triangle 54 | bool shoud_draw; 55 | 56 | // frame buffer size 57 | size_t w, h; 58 | 59 | }; 60 | 61 | int main( int argc, char** argv ) { 62 | 63 | // create viewer 64 | Viewer viewer = Viewer(); 65 | 66 | // create user application 67 | Application* renderer = new TriangleDrawer(); 68 | 69 | // set user application 70 | viewer.set_application(renderer); 71 | 72 | // start the viewer 73 | viewer.init(); 74 | viewer.start(); 75 | 76 | return 0; 77 | } 78 | -------------------------------------------------------------------------------- /include/CMU462/CMU462.h: -------------------------------------------------------------------------------- 1 | #ifndef CMU462_H 2 | #define CMU462_H 3 | 4 | #include "misc.h" 5 | 6 | // CMU462 Forward Declarations // 7 | 8 | namespace CMU462 { 9 | 10 | class Vector2D; 11 | class Vector3D; 12 | class Vector4D; 13 | 14 | class Matrix3x3; 15 | class Matrix4x4; 16 | 17 | class Quaternion; 18 | class Complex; 19 | 20 | class Color; 21 | class Spectrum; 22 | 23 | class Application; 24 | class OSDText; 25 | class Viewer; 26 | class Timer; 27 | 28 | } // namespace CMU462 29 | 30 | #endif // CMU462_H 31 | -------------------------------------------------------------------------------- /include/CMU462/base64.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | std::string base64_encode(unsigned char const* , unsigned int len); 4 | std::string base64_decode(std::string const& s); 5 | -------------------------------------------------------------------------------- /include/CMU462/complex.h: -------------------------------------------------------------------------------- 1 | #ifndef CMU462_COMPLEX_H 2 | #define CMU462_COMPLEX_H 3 | 4 | #include "CMU462.h" 5 | #include "vector2D.h" 6 | 7 | namespace CMU462 { 8 | 9 | /** 10 | * Represents complex numbers as 2D vectors of their real and 11 | * imaginary components. 12 | */ 13 | class Complex : public Vector2D { 14 | public: 15 | /** 16 | * Constructor. 17 | * Initializes to 0. 18 | */ 19 | Complex() : Vector2D(0.0, 0.0) {} 20 | 21 | /** 22 | * Constructor. 23 | * Initializes to a+bi. 24 | */ 25 | Complex(double a, double b) : Vector2D(a, b) {} 26 | 27 | /** 28 | * Constructor. 29 | * Initializes to a+bi from vector v = (a,b) 30 | */ 31 | Complex(const Vector2D &v) : Vector2D(v) {} 32 | 33 | /** 34 | * Compute the complex conjugate. 35 | */ 36 | inline Complex conj() const { return Complex(x, -y); } 37 | 38 | /** 39 | * Compute the inverse. 40 | */ 41 | inline Complex inv() const { 42 | double r = 1.0 / norm2(); 43 | return Complex(r * x, -r * y); 44 | } 45 | 46 | /** 47 | * Return argument. 48 | */ 49 | inline double arg() const { return atan2(y, x); } 50 | 51 | /** 52 | * Complex exponentiation. 53 | */ 54 | inline Complex exponential() const { 55 | return exp(x) * Complex(cos(y), sin(y)); 56 | } 57 | 58 | /** 59 | * Complex multiply by z 60 | */ 61 | inline void operator*=(const Complex &z) { 62 | double a = x; 63 | double b = y; 64 | double c = z.x; 65 | double d = z.y; 66 | x = a * c - b * d; 67 | y = a * d + b * c; 68 | } 69 | 70 | /** 71 | * Complex divide by z 72 | */ 73 | void operator/=(const Complex &z) { *this *= z.inv(); } 74 | 75 | /** 76 | * Returns the real part 77 | */ 78 | double Re() const { return x; } 79 | 80 | /** 81 | * Returns the imaginary 82 | */ 83 | double Im() const { return y; } 84 | 85 | }; // class Complex 86 | 87 | // binary Complex multiplication 88 | inline Complex operator*(const Complex &z1, const Complex &z2) { 89 | Complex z = z1; 90 | z *= z2; 91 | return z; 92 | } 93 | 94 | // complex division 95 | inline Complex operator/(const Complex &z1, const Complex &z2) { 96 | Complex z = z1; 97 | z /= z2; 98 | return z; 99 | } 100 | 101 | // prints components 102 | std::ostream &operator<<(std::ostream &os, const Complex &z); 103 | 104 | } // namespace CMU462 105 | 106 | #endif // CMU462_COMPLEX_H 107 | -------------------------------------------------------------------------------- /include/CMU462/console.h: -------------------------------------------------------------------------------- 1 | #ifndef CMU462_CONSOLE_H 2 | #define CMU462_CONSOLE_H 3 | 4 | #include 5 | 6 | #define ANSI_RESET "\x1b[0m" 7 | #define ANSI_R "\x1b[31m" 8 | #define ANSI_G "\x1b[32m" 9 | #define ANSI_B "\x1b[34m" 10 | #define ANSI_C "\x1b[36m" 11 | #define ANSI_M "\x1b[35m" 12 | #define ANSI_Y "\x1b[33m" 13 | 14 | #define out_msg(s) std::cout << ANSI_B << "[CMU462] " << ANSI_RESET << s << std::endl << std::flush 15 | #define out_wrn(s) std::cout << ANSI_Y << "[CMU462] " << ANSI_RESET << s << std::endl << std::flush 16 | #define out_err(s) std::cout << ANSI_R << "[CMU462] " << ANSI_RESET << s << std::endl << std::flush 17 | 18 | #endif // CMU462_CONSOLE_H 19 | -------------------------------------------------------------------------------- /include/CMU462/matrix3x3.h: -------------------------------------------------------------------------------- 1 | #ifndef CMU462_MATRIX3X3_H 2 | #define CMU462_MATRIX3X3_H 3 | 4 | #include "CMU462.h" 5 | #include "vector2D.h" 6 | #include "vector3D.h" 7 | 8 | #include 9 | 10 | namespace CMU462 { 11 | 12 | /** 13 | * Defines a 3x3 matrix. 14 | */ 15 | class Matrix3x3 { 16 | 17 | public: 18 | 19 | // The default constructor. 20 | Matrix3x3(void) { } 21 | 22 | // Constructor for row major form data. 23 | // Transposes to the internal column major form. 24 | // REQUIRES: data should be of size 9 for a 3 by 3 matrix.. 25 | Matrix3x3(double * data) 26 | { 27 | for( int i = 0; i < 3; i++ ) { 28 | for( int j = 0; j < 3; j++ ) { 29 | // Transpostion happens within the () query. 30 | (*this)(i,j) = data[i*3 + j]; 31 | } 32 | } 33 | } 34 | 35 | /** 36 | * Sets all elements to val. 37 | */ 38 | void zero(double val = 0.0 ); 39 | 40 | /** 41 | * Returns the determinant of A. 42 | */ 43 | double det( void ) const; 44 | 45 | /** 46 | * Returns the Frobenius norm of A. 47 | */ 48 | double norm( void ) const; 49 | 50 | /** 51 | * Returns the 3x3 identity matrix. 52 | */ 53 | static Matrix3x3 identity( void ); 54 | 55 | /** 56 | * Returns matrix encoding a 2D counter-clockwise rotation by the angle theta in homogeneous coordinates. The angle is given in Radians. 57 | */ 58 | static Matrix3x3 rotation( double theta ); 59 | 60 | /** 61 | * Returns matrix encoding 2D translation by the vector t in homogeneous coordinates. 62 | */ 63 | static Matrix3x3 translation( Vector2D t ); 64 | 65 | /** 66 | * Returns a matrix representing the (left) cross product with u. 67 | */ 68 | static Matrix3x3 crossProduct( const Vector3D& u ); 69 | 70 | /** 71 | * Assuming this matrix represents a 2D homogeneous transformation, 72 | * returns the rotation it encodes as an angle in radians. 73 | */ 74 | double getRotation( void ) const; 75 | 76 | /** 77 | * Returns the ith column. 78 | */ 79 | Vector3D& column( int i ); 80 | const Vector3D& column( int i ) const; 81 | 82 | /** 83 | * Returns the transpose of A. 84 | */ 85 | Matrix3x3 T( void ) const; 86 | 87 | /** 88 | * Returns the inverse of A. 89 | */ 90 | Matrix3x3 inv( void ) const; 91 | 92 | // accesses element (i,j) of A using 0-based indexing 93 | double& operator()( int i, int j ); 94 | const double& operator()( int i, int j ) const; 95 | 96 | // accesses the ith column of A 97 | Vector3D& operator[]( int i ); 98 | const Vector3D& operator[]( int i ) const; 99 | 100 | // increments by B 101 | void operator+=( const Matrix3x3& B ); 102 | 103 | // returns -A 104 | Matrix3x3 operator-( void ) const; 105 | 106 | // returns A+B 107 | Matrix3x3 operator+( const Matrix3x3& B ) const; 108 | 109 | // returns A-B 110 | Matrix3x3 operator-( const Matrix3x3& B ) const; 111 | 112 | // returns c*A 113 | Matrix3x3 operator*( double c ) const; 114 | 115 | // returns A*B 116 | Matrix3x3 operator*( const Matrix3x3& B ) const; 117 | 118 | // returns A*x 119 | Vector3D operator*( const Vector3D& x ) const; 120 | 121 | // divides each element by x 122 | void operator/=( double x ); 123 | 124 | protected: 125 | 126 | // column vectors 127 | Vector3D entries[3]; 128 | 129 | }; // class Matrix3x3 130 | 131 | // returns the outer product of u and v 132 | Matrix3x3 outer( const Vector3D& u, const Vector3D& v ); 133 | 134 | // returns c*A 135 | Matrix3x3 operator*( double c, const Matrix3x3& A ); 136 | 137 | // prints entries 138 | std::ostream& operator<<( std::ostream& os, const Matrix3x3& A ); 139 | 140 | } // namespace CMU462 141 | 142 | #endif // CMU462_MATRIX3X3_H 143 | -------------------------------------------------------------------------------- /include/CMU462/matrix4x4.h: -------------------------------------------------------------------------------- 1 | #ifndef CMU462_MATRIX4X4_H 2 | #define CMU462_MATRIX4X4_H 3 | 4 | #include "CMU462.h" 5 | #include "vector4D.h" 6 | 7 | #include 8 | 9 | namespace CMU462 { 10 | 11 | /** 12 | * Defines a 4x4 matrix. 13 | */ 14 | class Matrix4x4 { 15 | 16 | public: 17 | // The default constructor. 18 | Matrix4x4(void) {} 19 | 20 | // Constructor for row major form data. 21 | // Transposes to the internal column major form. 22 | // REQUIRES: data should be of size 16. 23 | Matrix4x4(double *data) { 24 | for (int i = 0; i < 4; i++) 25 | for (int j = 0; j < 4; j++) { 26 | // Transpostion happens within the () query. 27 | (*this)(i, j) = data[i * 4 + j]; 28 | } 29 | } 30 | 31 | /** 32 | * Sets all elements to val. 33 | */ 34 | void zero(double val = 0.0); 35 | 36 | /** 37 | * Returns the determinant of A. 38 | */ 39 | double det(void) const; 40 | 41 | /** 42 | * Returns the Frobenius norm of A. 43 | */ 44 | double norm(void) const; 45 | 46 | /** 47 | * Returns a fresh 4x4 identity matrix. 48 | */ 49 | static Matrix4x4 identity(void); 50 | 51 | // No Cross products for 4 by 4 matrix. 52 | 53 | /** 54 | * Returns the ith column. 55 | */ 56 | Vector4D &column(int i); 57 | const Vector4D &column(int i) const; 58 | 59 | /** 60 | * Returns the transpose of A. 61 | */ 62 | Matrix4x4 T(void) const; 63 | 64 | /** 65 | * Returns the inverse of A. 66 | */ 67 | Matrix4x4 inv(void) const; 68 | 69 | // accesses element (i,j) of A using 0-based indexing 70 | // where (i, j) is (row, column). 71 | double &operator()(int i, int j); 72 | const double &operator()(int i, int j) const; 73 | 74 | // accesses the ith column of A 75 | Vector4D &operator[](int i); 76 | const Vector4D &operator[](int i) const; 77 | 78 | // increments by B 79 | void operator+=(const Matrix4x4 &B); 80 | 81 | // returns -A 82 | Matrix4x4 operator-(void) const; 83 | 84 | // returns A+B 85 | Matrix4x4 operator+(const Matrix4x4 &B) const; 86 | 87 | // returns A-B 88 | Matrix4x4 operator-(const Matrix4x4 &B) const; 89 | 90 | // returns c*A 91 | Matrix4x4 operator*(double c) const; 92 | 93 | // returns A*B 94 | Matrix4x4 operator*(const Matrix4x4 &B) const; 95 | 96 | // returns A*x 97 | Vector4D operator*(const Vector4D &x) const; 98 | 99 | // divides each element by x 100 | void operator/=(double x); 101 | 102 | protected: 103 | 104 | // 4 by 4 matrices are represented by an array of 4 column vectors. 105 | Vector4D entries[4]; 106 | 107 | }; // class Matrix3x3 108 | 109 | // returns the outer product of u and v. 110 | Matrix4x4 outer(const Vector4D &u, const Vector4D &v); 111 | 112 | // returns c*A 113 | Matrix4x4 operator*(double c, const Matrix4x4 &A); 114 | 115 | // prints entries 116 | std::ostream &operator<<(std::ostream &os, const Matrix4x4 &A); 117 | 118 | } // namespace CMU462 119 | 120 | #endif // CMU462_MATRIX4X4_H 121 | -------------------------------------------------------------------------------- /include/CMU462/misc.h: -------------------------------------------------------------------------------- 1 | #ifndef CMU462_MISC_H 2 | #define CMU462_MISC_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace CMU462 { 9 | 10 | #define PI (3.14159265358979323) 11 | #define EPS_D (0.00000000001) 12 | #define EPS_F (0.00001f) 13 | #define INF_D (std::numeric_limits::infinity()) 14 | #define INF_F (std::numeric_limits::infinity()) 15 | 16 | // MOUSE INPUTS // 17 | #define MOUSE_LEFT 0 18 | #define MOUSE_RIGHT 1 19 | #define MOUSE_MIDDLE 2 20 | 21 | // KEYBOARD INPUTS // 22 | #define KEYBOARD_ENTER 257 23 | #define KEYBOARD_TAB 258 24 | #define KEYBOARD_BACKSPACE 259 25 | #define KEYBOARD_INSERT 260 26 | #define KEYBOARD_DELETE 261 27 | #define KEYBOARD_RIGHT 262 28 | #define KEYBOARD_LEFT 263 29 | #define KEYBOARD_DOWN 264 30 | #define KEYBOARD_UP 265 31 | #define KEYBOARD_PAGE_UP 266 32 | #define KEYBOARD_PAGE_DOWN 267 33 | #define KEYBOARD_HOME 268 34 | #define KEYBOARD_END 269 35 | #define KEYBOARD_PRINT_SCREEN 283 36 | 37 | 38 | // EVENT TYPES // 39 | #define EVENT_RELEASE 0 40 | #define EVENT_PRESS 1 41 | #define EVENT_REPEAT 2 42 | 43 | // MODIFIERS // 44 | #define MOD_SHIFT 0x0001 45 | #define MOD_CTRL 0x0002 46 | #define MOD_ALT 0x0004 47 | #define MOD_SUPER 0x0008 48 | 49 | /** 50 | * Takes any kind of number and converts from degrees to radians. 51 | */ 52 | template 53 | inline T radians(T deg) { 54 | return deg * (PI / 180); 55 | } 56 | 57 | /** 58 | * Takes any kind of number and converts from radians to degrees. 59 | */ 60 | template 61 | inline T degrees(T rad) { 62 | return rad * (180 / PI); 63 | } 64 | 65 | /** 66 | * Takes any kind of number, as well as a lower and upper bound, and clamps the 67 | * number to be within the bound. 68 | * NOTE: x, lo, and hi must all be the same type or compilation will fail. A 69 | * common mistake is to pass an int for x and size_ts for lo and hi. 70 | */ 71 | template 72 | inline T clamp(T x, T lo, T hi) { 73 | return std::min(std::max(x, lo), hi); 74 | } 75 | 76 | } // namespace CMU462 77 | 78 | #endif // CMU462_MISCMATH_H 79 | -------------------------------------------------------------------------------- /include/CMU462/spectrum.h: -------------------------------------------------------------------------------- 1 | #ifndef CMU462_SPECTRUM_H 2 | #define CMU462_SPECTRUM_H 3 | 4 | #include "CMU462.h" 5 | #include "color.h" 6 | 7 | namespace CMU462 { 8 | 9 | /** 10 | * Encodes radiance & irradiance values by the intensity of each visible 11 | * spectrum. Note that this is not strictly an actual spectrum with all 12 | * wavelengths, but it gives us enough information as we can only sense 13 | * a particular wavelengths. 14 | */ 15 | class Spectrum { 16 | public: 17 | float r; ///< intensity of red spectrum 18 | float g; ///< intensity of green spectrum 19 | float b; ///< intensity of blue spectrum 20 | 21 | /** 22 | * Parameterized Constructor. 23 | * Initialize from component values. 24 | * \param r Intensity of the red spectrum 25 | * \param g Intensity of the green spectrum 26 | * \param b Intensity of the blue spectrum 27 | */ 28 | Spectrum(float r = 0, float g = 0, float b = 0) : r(r), g(g), b(b) {} 29 | 30 | /** 31 | * Constructor. 32 | * Initialize from an 8-bit RGB color represented as a uint8_t array. 33 | * \param arr Array containing component values. 34 | */ 35 | Spectrum(const uint8_t *arr); 36 | 37 | // operators // 38 | 39 | inline Spectrum operator+(const Spectrum &rhs) const { 40 | return Spectrum(r + rhs.r, g + rhs.g, b + rhs.b); 41 | } 42 | 43 | inline Spectrum &operator+=(const Spectrum &rhs) { 44 | r += rhs.r; 45 | g += rhs.g; 46 | b += rhs.b; 47 | return *this; 48 | } 49 | 50 | inline Spectrum operator*(const Spectrum &rhs) const { 51 | return Spectrum(r * rhs.r, g * rhs.g, b * rhs.b); 52 | } 53 | 54 | inline Spectrum &operator*=(const Spectrum &rhs) { 55 | r *= rhs.r; 56 | g *= rhs.g; 57 | b *= rhs.b; 58 | return *this; 59 | } 60 | 61 | inline Spectrum operator*(float s) const { 62 | return Spectrum(r * s, g * s, b * s); 63 | } 64 | 65 | inline Spectrum &operator*=(float s) { 66 | r *= s; 67 | g *= s; 68 | b *= s; 69 | return *this; 70 | } 71 | 72 | inline bool operator==(const Spectrum &rhs) const { 73 | return r == rhs.r && g == rhs.g && b == rhs.b; 74 | } 75 | 76 | inline bool operator!=(const Spectrum &rhs) const { return !operator==(rhs); } 77 | 78 | inline Color toColor() const { 79 | return Color(r, g, b, 1); 80 | } 81 | 82 | inline float illum() const { 83 | return 0.2126f * r + 0.7152f * g + 0.0722f * b; 84 | } 85 | 86 | static Spectrum fromColor(const Color &c) { 87 | return Spectrum(c.a * c.r, c.a * c.g, c.a * c.b); 88 | } 89 | 90 | }; // class Spectrum 91 | 92 | // Commutable scalar multiplication 93 | inline Spectrum operator*(float s, const Spectrum &c) { return c * s; } 94 | 95 | // Prints components 96 | std::ostream &operator<<(std::ostream &os, const Spectrum &c); 97 | 98 | } // namespace CMU462 99 | 100 | #endif // CMU462_SPECTRUM_H 101 | -------------------------------------------------------------------------------- /include/CMU462/timer.h: -------------------------------------------------------------------------------- 1 | #ifndef CMU462_TIMER_H 2 | #define CMU462_TIMER_H 3 | 4 | #include "CMU462.h" 5 | #include 6 | 7 | namespace CMU462 { 8 | 9 | /** 10 | * A basic timer class. 11 | */ 12 | class Timer { 13 | public: 14 | /** 15 | * Starts the timer 16 | */ 17 | inline void start() { t0 = std::chrono::steady_clock::now(); } 18 | 19 | /** 20 | * Stops the timer 21 | */ 22 | inline void stop() { t1 = std::chrono::steady_clock::now(); } 23 | 24 | /** 25 | * Return duration between the last call to start and last call to stop 26 | */ 27 | inline double duration() { 28 | return (std::chrono::duration(t1 - t0)).count(); 29 | } 30 | 31 | private: 32 | std::chrono::time_point t0; 33 | std::chrono::time_point t1; 34 | }; 35 | 36 | } // namespace CMU462 37 | 38 | #endif // CMU462_TIMER_H 39 | -------------------------------------------------------------------------------- /include/CMU462/vector2D.h: -------------------------------------------------------------------------------- 1 | #ifndef CMU462_VECTOR2D_H 2 | #define CMU462_VECTOR2D_H 3 | 4 | #include "CMU462.h" 5 | 6 | #include 7 | #include 8 | 9 | namespace CMU462 { 10 | 11 | /** 12 | * Defines 2D vectors. 13 | */ 14 | class Vector2D { 15 | public: 16 | // components 17 | double x, y; 18 | 19 | /** 20 | * Constructor. 21 | * Initializes to vector (0,0). 22 | */ 23 | Vector2D() : x(0.0), y(0.0) {} 24 | 25 | /** 26 | * Constructor. 27 | * Initializes to vector (a,b). 28 | */ 29 | Vector2D(double x, double y) : x(x), y(y) {} 30 | 31 | /** 32 | * Constructor. 33 | * Copy constructor. Creates a copy of the given vector. 34 | */ 35 | Vector2D(const Vector2D &v) : x(v.x), y(v.y) {} 36 | 37 | // additive inverse 38 | inline Vector2D operator-(void) const { return Vector2D(-x, -y); } 39 | 40 | // addition 41 | inline Vector2D operator+(const Vector2D &v) const { 42 | Vector2D u = *this; 43 | u += v; 44 | return u; 45 | } 46 | 47 | // subtraction 48 | inline Vector2D operator-(const Vector2D &v) const { 49 | Vector2D u = *this; 50 | u -= v; 51 | return u; 52 | } 53 | 54 | // right scalar multiplication 55 | inline Vector2D operator*(double r) const { 56 | Vector2D vr = *this; 57 | vr *= r; 58 | return vr; 59 | } 60 | 61 | // scalar division 62 | inline Vector2D operator/(double r) const { 63 | Vector2D vr = *this; 64 | vr /= r; 65 | return vr; 66 | } 67 | 68 | // add v 69 | inline void operator+=(const Vector2D &v) { 70 | x += v.x; 71 | y += v.y; 72 | } 73 | 74 | // subtract v 75 | inline void operator-=(const Vector2D &v) { 76 | x -= v.x; 77 | y -= v.y; 78 | } 79 | 80 | // scalar multiply by r 81 | inline void operator*=(double r) { 82 | x *= r; 83 | y *= r; 84 | } 85 | 86 | // scalar divide by r 87 | inline void operator/=(double r) { 88 | x /= r; 89 | y /= r; 90 | } 91 | 92 | /** 93 | * Returns norm. 94 | */ 95 | inline double norm(void) const { return sqrt(x * x + y * y); } 96 | 97 | /** 98 | * Returns norm squared. 99 | */ 100 | inline double norm2(void) const { return x * x + y * y; } 101 | 102 | /** 103 | * Returns unit vector parallel to this one. 104 | */ 105 | inline Vector2D unit(void) const { return *this / this->norm(); } 106 | 107 | }; // clasd Vector2D 108 | 109 | // left scalar multiplication 110 | inline Vector2D operator*(double r, const Vector2D &v) { return v * r; } 111 | 112 | // inner product 113 | inline double dot(const Vector2D &v1, const Vector2D &v2) { 114 | return v1.x * v2.x + v1.y * v2.y; 115 | } 116 | 117 | // cross product 118 | inline double cross(const Vector2D &v1, const Vector2D &v2) { 119 | return v1.x * v2.y - v1.y * v2.x; 120 | } 121 | 122 | // prints components 123 | std::ostream &operator<<(std::ostream &os, const Vector2D &v); 124 | 125 | } // namespace CMU462 126 | 127 | #endif // CMU462_VECTOR2D_H 128 | -------------------------------------------------------------------------------- /include/CMU462/viewer.h: -------------------------------------------------------------------------------- 1 | #ifndef CMU462_VIEWER_H 2 | #define CMU462_VIEWER_H 3 | 4 | #include "application.h" 5 | #include "osdtext.h" 6 | 7 | #include 8 | 9 | #include "GLFW/glfw3.h" 10 | 11 | namespace CMU462 { 12 | 13 | /** 14 | * Provides OpenGL context, window display, and event handling routines. 15 | * A user may draw to the window's context by providing an application 16 | * implementation. The viewer manages other display components such as the 17 | * zoom views, text OSD, etc. It also takes care of window event handling and 18 | * event passing, through which the application may interact with user inputs. 19 | */ 20 | class Viewer { 21 | public: 22 | /** 23 | * Constructor. 24 | * Creates a new viewer with the default title (CMU462). 25 | */ 26 | Viewer(void); 27 | 28 | /** 29 | * Constructor. 30 | * Creates a new viweer with the given title. 31 | */ 32 | Viewer(const char *title); 33 | 34 | /** 35 | * Destructor. 36 | * Destroys the viewer instance and frees memory. 37 | * Note that this does not change the user space application. 38 | */ 39 | 40 | // FIXME (kmc): is this really true? The current implementation of 41 | // Viewer::~Viewer() calls "delete application;" 42 | ~Viewer(void); 43 | 44 | /** 45 | * Initialize the viewer. 46 | * This will open up a window and install all the event handlers 47 | * and make the viewer ready for drawing. 48 | */ 49 | void init(void); 50 | 51 | /** 52 | * Start the drawing loop of the viewer. 53 | * Once called this will block until the viewer is close. 54 | */ 55 | void start(void); 56 | 57 | /** 58 | * Set a user application. 59 | * The viewer will run the given user application. 60 | * \param application The user application to run in the viewer. 61 | */ 62 | void set_application(Application *application); 63 | 64 | private: 65 | /** 66 | * Main update loop. 67 | */ 68 | static void update(void); 69 | 70 | /** 71 | * Draw information view. 72 | */ 73 | static void drawInfo(void); 74 | 75 | // window event callbacks 76 | static void err_callback(int error, const char *description); 77 | static void key_callback(GLFWwindow *window, int key, int scancode, 78 | int action, int mods); 79 | static void resize_callback(GLFWwindow *window, int width, int height); 80 | static void cursor_callback(GLFWwindow *window, double xpos, double ypos); 81 | static void scroll_callback(GLFWwindow *window, double xoffset, 82 | double yoffset); 83 | static void mouse_button_callback(GLFWwindow *window, int button, int action, 84 | int mods); 85 | 86 | // HDPI display 87 | static bool HDPI; 88 | 89 | // framerate related timeers 90 | static int framecount; 91 | static std::chrono::time_point sys_last; 92 | static std::chrono::time_point sys_curr; 93 | 94 | // info toggle 95 | static bool showInfo; 96 | 97 | // window properties 98 | static GLFWwindow *window; 99 | static size_t buffer_w; 100 | static size_t buffer_h; 101 | 102 | // user application 103 | static Application *application; 104 | 105 | // on-screen display 106 | static OSDText *osd_text; 107 | static int line_id_application; 108 | static int line_id_framerate; 109 | 110 | }; // class Viewer 111 | 112 | } // namespace CMU462 113 | 114 | #endif // CMU462_VIEWER_H 115 | -------------------------------------------------------------------------------- /src/color.cpp: -------------------------------------------------------------------------------- 1 | #include "color.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | using namespace std; 9 | 10 | namespace CMU462 { 11 | 12 | // Constants 13 | const Color Color::White = Color(1, 1, 1, 1); 14 | const Color Color::Black = Color(0, 0, 0, 1); 15 | 16 | Color::Color(const unsigned char *arr) { 17 | float inv = 1.0 / 255.0; 18 | r = arr[0] * inv; 19 | g = arr[1] * inv; 20 | b = arr[2] * inv; 21 | a = 1.0; 22 | } 23 | 24 | Color Color::fromHex(const char *s) { 25 | // If the color is "none", return any color 26 | // with alpha zero (completely transparent). 27 | if (!strcmp(s, "none")) { 28 | return Color(0, 0, 0, 0); 29 | } 30 | 31 | // Ignore leading hashmark. 32 | if (s[0] == '#') { 33 | s++; 34 | } 35 | 36 | // Set stream formatting to hexadecimal. 37 | stringstream ss; 38 | ss << hex; 39 | 40 | // Convert to integer. 41 | unsigned int rgb; 42 | ss << s; 43 | ss >> rgb; 44 | 45 | // Extract 8-byte chunks and normalize. 46 | Color c; 47 | c.r = (float)((rgb & 0xFF0000) >> 16) / 255.0; 48 | c.g = (float)((rgb & 0x00FF00) >> 8) / 255.0; 49 | c.b = (float)((rgb & 0x0000FF) >> 0) / 255.0; 50 | c.a = 1.0; // set alpha to 1 (opaque) by default 51 | 52 | return c; 53 | } 54 | 55 | string Color::toHex(void) const { 56 | int R = (unsigned char)max(0., min(255.0, 255.0 * r)); 57 | int G = (unsigned char)max(0., min(255.0, 255.0 * g)); 58 | int B = (unsigned char)max(0., min(255.0, 255.0 * b)); 59 | 60 | stringstream ss; 61 | ss << hex; 62 | 63 | ss << R << G << B; 64 | return ss.str(); 65 | } 66 | 67 | Color Color::fromPickIndex(int i) { 68 | unsigned char R, G, B; 69 | R = (i & 0x000000FF) >> 0; 70 | G = (i & 0x0000FF00) >> 8; 71 | B = (i & 0x00FF0000) >> 16; 72 | 73 | return Color((float)R / 255., (float)G / 255., (float)B / 255., 1.); 74 | } 75 | 76 | int Color::toPickIndex(void) const { 77 | int R, G, B; 78 | R = (int)(r * 255.); 79 | G = (int)(g * 255.); 80 | B = (int)(b * 255.); 81 | 82 | return R + G * 256 + 256 * 256 * B; 83 | } 84 | 85 | std::ostream &operator<<(std::ostream &os, const Color &c) { 86 | os << "(r=" << c.r; 87 | os << " g=" << c.g; 88 | os << " b=" << c.b; 89 | os << " a=" << c.a; 90 | os << ")"; 91 | return os; 92 | } 93 | 94 | } // namespace CMU462 95 | -------------------------------------------------------------------------------- /src/complex.cpp: -------------------------------------------------------------------------------- 1 | #include "complex.h" 2 | 3 | namespace CMU462 { 4 | 5 | std::ostream &operator<<(std::ostream &os, const Complex &z) { 6 | if (z.y > 0) { 7 | os << z.x << " + " << z.y << "i"; 8 | } else if (z.y < 0) { 9 | os << z.x << " - " << -z.y << "i"; 10 | } else { 11 | os << z.x; 12 | } 13 | return os; 14 | } 15 | 16 | } // namespace CMU462 17 | -------------------------------------------------------------------------------- /src/quaternion.cpp: -------------------------------------------------------------------------------- 1 | #include "quaternion.h" 2 | 3 | namespace CMU462 { 4 | 5 | std::ostream &operator<<(std::ostream &os, const Quaternion &v) { 6 | os << "{ " << v.x << "i, " << v.y << "j, " << v.z << "k, " << v.w << " }"; 7 | return os; 8 | } 9 | 10 | } // namespace CMU462 11 | -------------------------------------------------------------------------------- /src/spectrum.cpp: -------------------------------------------------------------------------------- 1 | #include "spectrum.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | using namespace std; 9 | 10 | namespace CMU462 { 11 | 12 | std::ostream &operator<<(std::ostream &os, const Spectrum &c) { 13 | os << "(r=" << c.r; 14 | os << " g=" << c.g; 15 | os << " b=" << c.b; 16 | os << ")"; 17 | return os; 18 | } 19 | 20 | } // namespace CMU462 21 | -------------------------------------------------------------------------------- /src/vector2D.cpp: -------------------------------------------------------------------------------- 1 | #include "vector2D.h" 2 | 3 | namespace CMU462 { 4 | 5 | std::ostream &operator<<(std::ostream &os, const Vector2D &v) { 6 | os << "(" << v.x << "," << v.y << ")"; 7 | return os; 8 | } 9 | 10 | } // namespace CMU462 11 | -------------------------------------------------------------------------------- /src/vector3D.cpp: -------------------------------------------------------------------------------- 1 | #include "vector3D.h" 2 | 3 | namespace CMU462 { 4 | 5 | std::ostream &operator<<(std::ostream &os, const Vector3D &v) { 6 | os << "(" << v.x << "," << v.y << "," << v.z << ")"; 7 | return os; 8 | } 9 | 10 | } // namespace CMU462 11 | -------------------------------------------------------------------------------- /src/vector4D.cpp: -------------------------------------------------------------------------------- 1 | #include "vector4D.h" 2 | 3 | namespace CMU462 { 4 | 5 | std::ostream &operator<<(std::ostream &os, const Vector4D &v) { 6 | os << "(" << v.x << "," << v.y << "," << v.z << "," << v.w << ")"; 7 | return os; 8 | } 9 | 10 | Vector3D Vector4D::to3D() { return Vector3D(x, y, z); } 11 | 12 | Vector3D Vector4D::projectTo3D() { 13 | double invW = 1.0 / w; 14 | return Vector3D(x * invW, y * invW, z * invW); 15 | } 16 | 17 | } // namespace CMU462 18 | -------------------------------------------------------------------------------- /tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | link_libraries(CMU462) 2 | 3 | include_directories("${PROJECT_SOURCE_DIR}/include") 4 | 5 | link_libraries( 6 | glfw ${GLFW_LIBRARIES} 7 | glew ${GLEW_LIBRARIES} 8 | ${OPENGL_LIBRARIES} 9 | ${FREETYPE_LIBRARIES} 10 | ) 11 | 12 | # OSD 13 | add_executable(osd osd.cpp) 14 | 15 | # Install tests 16 | install(TARGETS osd DESTINATION bin/tests) 17 | -------------------------------------------------------------------------------- /tests/osd.cpp: -------------------------------------------------------------------------------- 1 | #include "CMU462/color.h" 2 | #include "CMU462/osdtext.h" 3 | 4 | #include 5 | 6 | #include "GL/glew.h" 7 | #include "GLFW/glfw3.h" 8 | 9 | using namespace CMU462; 10 | 11 | #define USE_HDPI false 12 | 13 | int main(int argc, char *argv[]) { 14 | 15 | GLFWwindow *window; 16 | OSDText *osd_text; 17 | 18 | // init glfw 19 | if (!glfwInit()) { 20 | fprintf(stderr, "Error: could not initialize GLFW!"); 21 | exit(EXIT_FAILURE); 22 | } 23 | 24 | // create window 25 | window = glfwCreateWindow(640, 480, "TEXT", NULL, NULL); 26 | if (!window) { 27 | fprintf(stderr, "Error: could not create window!"); 28 | glfwTerminate(); 29 | exit(EXIT_FAILURE); 30 | } 31 | 32 | // set context 33 | glfwMakeContextCurrent(window); 34 | glfwSwapInterval(1); 35 | 36 | // init glew 37 | GLenum glew_status = glewInit(); 38 | if (GLEW_OK != glew_status) { 39 | fprintf(stderr, "Error: %s\n", glewGetErrorString(glew_status)); 40 | return 1; 41 | } 42 | 43 | if (!GLEW_VERSION_2_0) { 44 | fprintf(stderr, "No support for OpenGL 2.0 found\n"); 45 | return 1; 46 | } 47 | 48 | // enable alpha blending 49 | glEnable(GL_BLEND); 50 | glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 51 | 52 | // create on-screen display text 53 | osd_text = new OSDText(); 54 | osd_text->init(USE_HDPI); 55 | osd_text->resize(640, 480); 56 | 57 | // add lines 58 | const char *text = "The Quick Brown Fox Jumps Over The Lazy Dog."; 59 | osd_text->add_line(-0.95, 0.85, text, 26, Color::White); 60 | osd_text->add_line(-0.95, 0.70, text, 24, Color(0.75, 0.75, 0.75, 1)); 61 | osd_text->add_line(-0.95, 0.58, text, 22, Color(0.5, 0.5, 0.5, 1)); 62 | osd_text->add_line(-0.95, 0.46, text, 20, Color(1, 0, 0, 1)); 63 | osd_text->add_line(-0.95, 0.34, text, 18, Color(0, 1, 0, 1)); 64 | osd_text->add_line(-0.95, 0.25, text, 16, Color(0, 0, 1, 1)); 65 | osd_text->add_line(-0.95, 0.16, text, 14, Color(1, 1, 0, 1)); 66 | osd_text->add_line(-0.95, 0.08, text, 12, Color(0, 1, 1, 1)); 67 | osd_text->add_line(-0.95, 0.00, text, 10, Color(1, 0, 1, 1)); 68 | 69 | while (!glfwWindowShouldClose(window)) { 70 | 71 | // clear 72 | glClear(GL_COLOR_BUFFER_BIT); 73 | 74 | // render text OSD 75 | osd_text->render(); 76 | 77 | // swap buffers 78 | glfwSwapBuffers(window); 79 | 80 | // poll events 81 | glfwPollEvents(); 82 | } 83 | 84 | return 0; 85 | } 86 | --------------------------------------------------------------------------------