Skip to content

Commit

Permalink
Merge pull request #1 from Sploder12/v2
Browse files Browse the repository at this point in the history
V2
  • Loading branch information
Sploder12 authored Dec 5, 2024
2 parents 55053e2 + be3cd11 commit e2326b1
Show file tree
Hide file tree
Showing 132 changed files with 8,967 additions and 24,105 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Run gtest
run-name: Run tests by ${{ github.actor }}
on: [push]
jobs:
job:
name: ${{ matrix.os }}-${{ github.workflow }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest]
include:
- os: windows-latest
preset: 'x64-release'
binary: '.\out\build\x64-release\src\tests\tests.exe'
- os: ubuntu-latest
preset: 'linux-debug'
binary: './out/build/linux-debug/src/tests/tests'
install_opengl: true

steps:
- name: Checkout
uses: actions/checkout@v4.2.0

- name: Install openGL
if: ${{ matrix.install_opengl }}
run: |
sudo apt-get install libxmu-dev libxi-dev libgl-dev
sudo apt install libxinerama-dev libxcursor-dev xorg-dev libglu1-mesa-dev pkg-config
sudo apt install libxrandr-dev
- uses: ilammy/msvc-dev-cmd@v1.13.0

- uses: lukka/get-cmake@latest
- name: Run vcpkg
uses: lukka/run-vcpkg@v11.5
with:
runVcpkgInstall: true

- name: Run CMake
uses: lukka/run-cmake@v10
with:
configurePreset: ${{ matrix.preset }}

- name: Compile
run: |
cd './out/build/${{ matrix.preset }}'
ninja
- name: Run Tests
timeout-minutes: 5
run: ${{ matrix.binary }}

6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -367,4 +367,8 @@ lib/

GPUCache/

Intel*
Intel*

# Jetbrains IDEs
.idea/
cmake-build-*/
30 changes: 30 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# CMakeList.txt : CMake project for SNDXlib, include source and define
# project specific logic here.
#
cmake_minimum_required (VERSION 3.14)

# Enable Hot Reload for MSVC compilers if supported.
if (POLICY CMP0141)
cmake_policy(SET CMP0141 NEW)
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<IF:$<AND:$<C_COMPILER_ID:MSVC>,$<CXX_COMPILER_ID:MSVC>>,$<$<CONFIG:Debug,RelWithDebInfo>:EditAndContinue>,$<$<CONFIG:Debug,RelWithDebInfo>:ProgramDatabase>>")
endif()

set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake")

project ("SNDXlib")

find_package(OpenAL CONFIG REQUIRED)
find_package(Stb REQUIRED)
find_path(MINIMP3_INCLUDE_DIRS "minimp3/minimp3.h")
find_package(glm CONFIG REQUIRED)
find_package(glfw3 CONFIG REQUIRED)
find_package(GLEW REQUIRED)
find_package(Freetype REQUIRED)
find_package(Vorbis CONFIG REQUIRED)

include_directories(lib/include src/include/sndx)

include_directories(${Stb_INCLUDE_DIR} ${MINIMP3_INCLUDE_DIRS})
link_libraries(OpenAL::OpenAL glm::glm glfw GLEW::GLEW Freetype::Freetype Vorbis::vorbis)

add_subdirectory(src/tests)
102 changes: 102 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
{
"version": 3,
"configurePresets": [
{
"name": "windows-base",
"hidden": true,
"generator": "Ninja",
"binaryDir": "${sourceDir}/out/build/${presetName}",
"installDir": "${sourceDir}/out/install/${presetName}",
"cacheVariables": {
"CMAKE_C_COMPILER": "cl.exe",
"CMAKE_CXX_COMPILER": "cl.exe",
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
},
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
}
},
{
"name": "x64-debug",
"displayName": "x64 Debug",
"inherits": "windows-base",
"architecture": {
"value": "x64",
"strategy": "external"
},
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "x64-release",
"displayName": "x64 Release",
"inherits": "x64-debug",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "x86-debug",
"displayName": "x86 Debug",
"inherits": "windows-base",
"architecture": {
"value": "x86",
"strategy": "external"
},
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "x86-release",
"displayName": "x86 Release",
"inherits": "x86-debug",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "linux-debug",
"displayName": "Linux Debug",
"generator": "Ninja",
"binaryDir": "${sourceDir}/out/build/${presetName}",
"installDir": "${sourceDir}/out/install/${presetName}",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
},
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Linux"
},
"vendor": {
"microsoft.com/VisualStudioRemoteSettings/CMake/1.0": {
"sourceDir": "$env{HOME}/.vs/$ms{projectDirName}"
}
}
},
{
"name": "macos-debug",
"displayName": "macOS Debug",
"generator": "Ninja",
"binaryDir": "${sourceDir}/out/build/${presetName}",
"installDir": "${sourceDir}/out/install/${presetName}",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
},
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Darwin"
},
"vendor": {
"microsoft.com/VisualStudioRemoteSettings/CMake/1.0": {
"sourceDir": "$env{HOME}/.vs/$ms{projectDirName}"
}
}
}
]
}
8 changes: 4 additions & 4 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Copyright 2023 Trevor Schupbach (Sploder12)
Copyright 2024 Trevor Schupbach (Sploder12)

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the Software), to deal in the
this software and associated documentation files (the "Software"), to deal in the
Software without restriction, including without limitation the rights to use, copy,
modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so, subject to the
Expand All @@ -10,11 +10,11 @@ following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND,
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
OR OTHER DEALINGS IN THE SOFTWARE.
OR OTHER DEALINGS IN THE SOFTWARE.
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,16 @@ Includes support for:
- OpenGL with GLFW (for visuals and input)
- OpenAL (for Audio)
- Freetype (for Fonts)
- Assimp (for 3D models)
- ~Assimp (for 3D models)~
- Dynamic Texture Atlas Creation
- Lines and Bezier Curves
- Data Logging
- Tree File parsing that supports arbitrary formats.
- RIFF File parsing.
- Window size management
- 2D/3D collision detection
- Fourier Transform (and inverse)
- WAVE and MP3 audio format loading
- WAVE, MP3, and Ogg Vorbis audio format loading
- Image writing and reading (using stbi)
- Debug widgets (using Dear ImGui)

## Building
Not needed! Just include the files!

Use VisualStudio 2022 for testing.
41 changes: 0 additions & 41 deletions SNDXlib.sln

This file was deleted.

Loading

0 comments on commit e2326b1

Please sign in to comment.