Skip to content

Commit

Permalink
Adjust vcpkg scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
aeris170 committed Sep 27, 2024
1 parent 4a39cfa commit 0efd60d
Show file tree
Hide file tree
Showing 4 changed files with 270 additions and 120 deletions.
2 changes: 0 additions & 2 deletions FetchDependencies.sh

This file was deleted.

79 changes: 36 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,29 @@
**NeoDoa** is still under development and is not ready for producing games, but it will be 😎 Below are the finished and upcoming features.

* **Graphics**
* OpenGL 4.5 Core Profile based renderer
* Agressive Instancing and Batched Rendering!!
* WIP: Point and spot and custom lights
* WIP: High Quality Text Rendering using [Signed Distance Fields](https://steamcdn-a.akamaihd.net/apps/valve/2007/SIGGRAPH2007_AlphaTestedMagnification.pdf)
* WIP: Shadows
* WIP: Waters
* WIP: Skybox
* WIP: Deferred Shading
* WIP: Skeletal Animations
* **Hot-swappable graphics backends**
* OpenGL 4.6 Core Profile
* WIP: OpenGL 3.3 Core Profile
* WIP: Direct3D12
* WIP: Direct3D11
* WIP: Vulkan
* **Collision & Physics**
* WIP: With PhysX
* **Audio**
* WIP: With OpenAL
* **Asset Loading**
* **Don't bother** - automatic importing and categorizing of assets
* **Have control** - import/load/unload assets at will
* **Don't pollute** - use ubiquitous file formats, without needing special formats only NeoDoa can interpret
* **Never crash** - get nice error lists on why loads have failed and placeholders for unloaded assets
* 3D models loading via [Assimp](https://www.assimp.org/)
* Texture loading via [stb_image](https://github.com/nothings/stb)
* **Scripting system**
* Scripting via [AngelScript](https://www.angelcode.com/angelscript/)
* With true ECS!
* Pure ECS
* Define components and implement systems in C++
* **Input**
* Mouse, Keyboard.
* Mouse
* Keyboard
* WIP: Controller
* WIP: Joystick
* **Editor**
Expand Down Expand Up @@ -79,6 +81,7 @@ After this, `git pull` should print `Already up to date.` Proceed to the next st
**If you are using Windows, please skip this step.**

**NeoDoa** requires various installations from `apt-get` to compile. These are listed below:
> libc++-dev libc++abi-dev
> build-essential
> curl zip unzip tar
> pkg-config
Expand All @@ -87,7 +90,7 @@ After this, `git pull` should print `Already up to date.` Proceed to the next st
> xorg xorg-dev
> libglu1-mesa libglu1-mesa-dev
> autoconf autoconf-archive
>
> automake libtool libltdl-dev
These can either be install manually or by launching the helper script by executing:
```sh
Expand All @@ -98,34 +101,28 @@ sh ./scripts/fetch_apt_get.sh
#### 3. Fetching Dependencies

**NeoDoa** uses `vcpkg` to manage packages and depends on packages listed below:
> angelscript[addons]
> argparse
> assimp
> imgui[core,docking-experimental,glfw-binding,opengl3-binding]
> imguizmo
> entt
> eventpp
> glew
> glfw3
> glm
> icu
> lunasvg
> stb
> angelscript[addons],
> argparse,
> assimp,
> cppzmq,
> entt,
> eventpp,
> glew,
> glfw3,
> glm,
> icu,
> imgui[core,docking-experimental,glfw-binding,sdl2-binding,opengl3-binding,vulkan-binding],
> imguizmo,
> lunasvg,
> stb,
> tinyxml2
The packages above must be installed by launching the helper script [`FetchDependencies.sh`](https://github.com/aeris170/NeoDoa/blob/master/FetchDependencies.sh). This script takes two arguments
`platform` and `clonemode`. `platform` defaults to `x64-windows` and can be overriden to `x64-linux` or your OS of choosing
by passing it as the first argument. `clonemode` governs how the script should try to clone `vcpkg` repository. Passing nothing
defaults to `https`, only `https` and `ssh` are accepted.
The packages above must be installed by launching the helper script [`vcpkg.sh`](https://github.com/aeris170/NeoDoa/blob/master/scripts/vcpkg.sh) or
[`vcpkg.ps1`](https://github.com/aeris170/NeoDoa/blob/master/scripts/vcpkg.ps1). The script takes two arguments `clonemode` and `vcpkg-dir`.

Examples:
```sh
chmod +x ./FetchDependencies.sh
sh FetchDependencies.sh # Fetch packages for x64-windows using https
sh FetchDependencies.sh x64-windows ssh # Fetch packages for x64-windows using ssh (must have an ssh key set-up)
sh FetchDependencies.sh x64-linux # Fetch packages for x64-linux using https (doesn't work on our test systems)
sh FetchDependencies.sh x64-linux ssh # Fetch packages for x64-linux using ssh (must have an ssh key set-up)
```
* `clonemode` controls how to clone the `vcpkg` repository. Passing nothing defaults to `ssh`, only `https` and `ssh` are accepted.

* `vcpkg-dir` controls where to clone the `vcpkg` repository. Passing nothing defaults to `./vcpkg`.

You should see no errors when this scripts completes. If you do, please create an issue [here](https://github.com/aeris170/NeoDoa/issues).

Expand Down Expand Up @@ -190,8 +187,4 @@ Please follow these steps to report a bug

2. **Create a testcase** - please create the smallest isolated testcase that you can that reproduces your bug

3. **Share as much information as possible** - everything little helps, OS, IDE, GPU, all that stuff.

## NeoDoa Platform

**NeoDoa** is an open source cross-platform game engine which you can use to develop games on Windows, Linux and MacOS (although untested on).
3. **Share as much information as possible** - everything little helps, OS, IDE, GPU, all that stuff.
119 changes: 119 additions & 0 deletions scripts/vcpkg.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
# Enable detailed error output and logging
$VerbosePreference = "Continue"
$DebugPreference = "Continue"
$ErrorActionPreference = "Stop" # Keep stop behavior to catch errors

# Check if clonemode argument is provided
if (-not $args[0]) {
Write-Host "No clonemode supplied, defaulting to ssh" -ForegroundColor yellow -BackgroundColor black
$clonemode = "ssh"
} else {
$clonemode = $args[0]
}

# Check if vcpkg path argument is provided
if (-not $args[1]) {
Write-Host "No vcpkg path supplied, defaulting to ./vcpkg" -ForegroundColor yellow -BackgroundColor black
$path = "./vcpkg"
} else {
$path = $args[1]
}

Write-Host "Clonemode: $clonemode" -ForegroundColor white -BackgroundColor black
Write-Host "vcpkg path: $path" -ForegroundColor white -BackgroundColor black

# Create the directory if it doesn't exist
if (-not (Test-Path -Path $path)) {
Write-Host "Creating directory: $path" -ForegroundColor white -BackgroundColor black
New-Item -Path $path -ItemType Directory | Out-Null
} else {
Write-Host "Directory already exists: $path" -ForegroundColor yellow -BackgroundColor black
}

# Change directory to the vcpkg path
Write-Host "Changing to directory: $path" -ForegroundColor white -BackgroundColor black
Set-Location -Path $path

# Clone vcpkg using the provided clonemode
Write-Host "Cloning vcpkg..." -ForegroundColor white -BackgroundColor black
if ($clonemode -eq "ssh") {
Start-Process -FilePath "git" -ArgumentList "clone git@github.com:microsoft/vcpkg.git ." `
-NoNewWindow -Wait -PassThru | Tee-Object -Variable cloneOutput
} elseif ($clonemode -eq "https") {
Start-Process -FilePath "git" -ArgumentList "clone https://github.com/Microsoft/vcpkg.git ." `
-NoNewWindow -Wait -PassThru | Tee-Object -Variable cloneOutput
} else {
Write-Host "Incorrect clonemode! Expected https or ssh, got something else" -ForegroundColor red -BackgroundColor black
Set-Location -Path ..
exit 1
}

# Check if clone was successful
if ($cloneOutput.ExitCode -ne 0) {
Write-Host "Error during git clone: $($cloneOutput.StandardError)" -ForegroundColor red -BackgroundColor black
Set-Location -Path ..
exit 1
}

# Pull the latest changes
Write-Host "Pulling latest vcpkg changes..." -ForegroundColor white -BackgroundColor black
$pullOutput = Start-Process -FilePath "git" -ArgumentList "pull" -NoNewWindow -Wait -PassThru
if ($pullOutput.ExitCode -ne 0) {
Write-Host "Error during git pull: $($pullOutput.StandardError)" -ForegroundColor red -BackgroundColor black
Set-Location -Path ..
exit 1
}

# Run the bootstrap script
if (Test-Path -Path "./bootstrap-vcpkg.bat") {
Write-Host "Running bootstrap-vcpkg.bat..." -ForegroundColor white -BackgroundColor black
$bootstrapOutput = Start-Process -FilePath "./bootstrap-vcpkg.bat" -NoNewWindow -Wait -PassThru
if ($bootstrapOutput.ExitCode -ne 0) {
Write-Host "Error during bootstrap: $($bootstrapOutput.StandardError)" -ForegroundColor red -BackgroundColor black
Set-Location -Path ..
exit 1
}
} else {
Write-Host "Bootstrap script not found!" -ForegroundColor red -BackgroundColor black
Set-Location -Path ..
exit 1
}

# Install required packages
Write-Host "Installing required vcpkg packages..." -ForegroundColor white -BackgroundColor black
$installOutput = Start-Process -FilePath "./vcpkg.exe" -ArgumentList @(
'install',
'angelscript[addons]',
'argparse',
'assimp',
'cppzmq',
'entt',
'eventpp',
'glew',
'glfw3',
'glm',
'icu',
'imgui[core,docking-experimental,glfw-binding,sdl2-binding,opengl3-binding,vulkan-binding]',
'imguizmo',
'lunasvg',
'stb',
'tinyxml2',
'--recurse'
) -NoNewWindow -Wait -PassThru
if ($installOutput.ExitCode -ne 0) {
Write-Host "Error during vcpkg install: $($installOutput.StandardError)" -ForegroundColor red -BackgroundColor black
Set-Location -Path ..
exit 1
}

# Integrate vcpkg
Write-Host "Integrating vcpkg..." -ForegroundColor white -BackgroundColor black
$integrateOutput = Start-Process -FilePath "./vcpkg.exe" -ArgumentList 'integrate', 'install' -NoNewWindow -Wait -PassThru
if ($integrateOutput.ExitCode -ne 0) {
Write-Host "Error during vcpkg integrate: $($integrateOutput.StandardError)" -ForegroundColor red -BackgroundColor black
Set-Location -Path ..
exit 1
}

# Notify completion
Write-Host "vcpkg setup complete!" -ForegroundColor green -BackgroundColor black
Loading

0 comments on commit 0efd60d

Please sign in to comment.