Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ resource_debug_output.txt
*.dylib

# IDE-specific files
.vscode/
.vscode/*
!.vscode/c_cpp_properties.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.idea/
*.sdf
*.suo
Expand All @@ -47,4 +51,4 @@ resource_debug_output.txt

# OS files
.DS_Store
Thumbs.db
Thumbs.db
67 changes: 67 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"version": 4,
"configurations": [
{
"name": "Win32",
"intelliSenseMode": "windows-msvc-x64",
"compilerPath": "cl.exe",
Comment thread
MomdAli marked this conversation as resolved.
"cStandard": "c17",
"cppStandard": "c++17",
"compileCommands": "${workspaceFolder}/build/compile_commands.json",
"includePath": [
"${workspaceFolder}/src/**",
"${workspaceFolder}/src/engine/**",
"${workspaceFolder}/src/editor/**",
"${workspaceFolder}/src/math/**",
"${workspaceFolder}/src/utils/**",
"${workspaceFolder}/vendor/**",
"${workspaceFolder}/build/_deps/**/include",
"${workspaceFolder}/build/_deps/imgui-src",
"${workspaceFolder}/build/_deps/imgui-src/backends"
],
"browse": {
"path": [
"${workspaceFolder}/src",
"${workspaceFolder}/src/engine",
"${workspaceFolder}/src/editor",
"${workspaceFolder}/src/math",
"${workspaceFolder}/src/utils",
"${workspaceFolder}/vendor"
],
"limitSymbolsToIncludedHeaders": true
},
"configurationProvider": "ms-vscode.cmake-tools"
},
{
"name": "Linux",
"intelliSenseMode": "linux-gcc-x64",
Comment thread
MomdAli marked this conversation as resolved.
"compilerPath": "/usr/bin/clang++",
"cStandard": "c17",
"cppStandard": "c++17",
"compileCommands": "${workspaceFolder}/build/compile_commands.json",
"includePath": [
"${workspaceFolder}/src/**",
"${workspaceFolder}/src/engine/**",
"${workspaceFolder}/src/editor/**",
"${workspaceFolder}/src/math/**",
"${workspaceFolder}/src/utils/**",
"${workspaceFolder}/vendor/**",
"${workspaceFolder}/build/_deps/**/include",
"${workspaceFolder}/build/_deps/imgui-src",
"${workspaceFolder}/build/_deps/imgui-src/backends"
],
"browse": {
"path": [
"${workspaceFolder}/src",
"${workspaceFolder}/src/engine",
"${workspaceFolder}/src/editor",
"${workspaceFolder}/src/math",
"${workspaceFolder}/src/utils",
"${workspaceFolder}/vendor"
],
"limitSymbolsToIncludedHeaders": true
},
"configurationProvider": "ms-vscode.cmake-tools"
}
]
}
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"ms-vscode.cmake-tools",
"ms-vscode.cpptools",
"vadimcn.vscode-lldb",
"esbenp.prettier-vscode"
]
}
40 changes: 40 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"version": "0.0.1",
"configurations": [
{
"name": "Voltray (Windows CodeLLDB)",
"type": "lldb",
"request": "launch",
"program": "${workspaceFolder}/build/Debug/Voltray.exe",
"cwd": "${workspaceFolder}/build/Debug",
"preLaunchTask": "Build Voltray (Debug)"
},
{
"name": "Voltray (Windows Debug MSVC)",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}/build/Debug/Voltray.exe",
"cwd": "${workspaceFolder}/build/Debug",
"preLaunchTask": "Build Voltray (Debug)",
"stopAtEntry": false,
"console": "integratedTerminal"
},
{
"name": "Voltray (Linux/macOS Debug)",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/Voltray",
"cwd": "${workspaceFolder}/build",
"preLaunchTask": "Build Voltray (Debug)",
"stopAtEntry": false,
"externalConsole": false,
"MIMode": "gdb",
"linux": {
"MIMode": "gdb"
},
"osx": {
"MIMode": "lldb"
}
}
]
}
32 changes: 32 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Build Voltray (Debug)",
"type": "shell",
"command": "bash",
"args": [
"${workspaceFolder}/scripts/build.sh",
"Debug"
],
"windows": {
"command": "cmd",
"args": [
"/c",
"${workspaceFolder}\\scripts\\build.bat",
"Debug"
]
},
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"reveal": "always",
"panel": "shared",
"clear": true
}
}
]
}
48 changes: 37 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Voltray

A modern, cross-platform C++ real-time rendering engine with an integrated editor.

![Voltray Editor](screenshots/Screenshot-1.png)
Expand All @@ -16,30 +17,52 @@ A modern, cross-platform C++ real-time rendering engine with an integrated edito
---

## About

Voltray is a comprehensive 3D graphics engine designed for learning, experimentation, and educational purposes. It features a clean architecture, extensible design, and professional-grade development practices.

## Features
* **Real-Time 3D Rendering**: OpenGL 4.6 pipeline
* **Integrated Editor**: ImGui-based workspace
* **Cross-Platform**: Windows, Linux, macOS Support

- **Real-Time 3D Rendering**: OpenGL 4.6 pipeline
- **Integrated Editor**: ImGui-based workspace
- **Cross-Platform**: Windows, Linux, macOS Support

## Getting Started

### Prerequisites
* **C++17 Compiler** (MSVC, GCC, Clang)
* **CMake 3.17+**
* **Git**

- **C++17 Compiler**
- **Windows**: MSVC (Install "Desktop development with C++" workload via Visual Studio Installer to get `cl.exe`)
- **Linux**: GCC or Clang (`sudo apt install build-essential clang`)
- **macOS**: Clang (via Xcode Command Line Tools)
- **CMake 3.17+**
- **Git**

### IDE Setup (VS Code and forks like Cursor)

To get full C++ IntelliSense and debugging working:

1. Install the recommended extensions: **C/C++** (`ms-vscode.cpptools`), **CMake Tools** (`ms-vscode.cmake-tools`), and **CodeLLDB** (`vadimcn.vscode-lldb`).
2. Open the project folder in your IDE.
3. When prompted by CMake Tools, select the appropriate compiler kit (e.g., `Visual Studio Community 2022 Release - ...` on Windows, or `Clang` / `GCC` on Linux).
4. CMake Tools will automatically configure the project and generate the `compile_commands.json` needed for IntelliSense after build.

**Debugging on Windows**:

- For **VS Code**, use the `"Voltray (Windows Debug MSVC)"` launch configuration.
- For **Cursor or Antigravity** (where Microsoft's `cppvsdbg` is unsupported), use the `"Voltray (Windows CodeLLDB)"` launch configuration instead.

### Build Instructions

**Windows**:

```cmd
git clone https://github.com/MomdAli/Voltray.git
cd Voltray
build.bat
```

**Linux/macOS**:

```bash
git clone https://github.com/MomdAli/Voltray.git
cd Voltray
Expand All @@ -50,16 +73,19 @@ chmod +x build.sh
## Usage

### Running the Editor

After building the project, navigate to the `build` directory (or `build\Release` on Windows) and run the `Voltray` executable.

### Basic Controls
* **Orbit Camera**: Middle Mouse Button + Drag
* **Pan Camera**: Shift + Middle Mouse Button + Drag
* **Zoom**: Mouse Wheel
* **Select Object**: Left Click on object in Viewport
* **Transform Object**: Use the **Inspector** panel to modify position, rotation, and scale.

- **Orbit Camera**: Middle Mouse Button + Drag
- **Pan Camera**: Shift + Middle Mouse Button + Drag
- **Zoom**: Mouse Wheel
- **Select Object**: Left Click on object in Viewport
- **Transform Object**: Use the **Inspector** panel to modify position, rotation, and scale.

## License

This project is licensed under the **Apache License 2.0**. See the [LICENSE](LICENSE) file for details.

---
Expand Down
56 changes: 22 additions & 34 deletions scripts/build.bat
Original file line number Diff line number Diff line change
@@ -1,48 +1,36 @@
@echo off
setlocal

REM === CONFIG ===
set BUILD_TYPE=Release
set GENERATOR="Visual Studio 17 2022"
set BUILD_DIR=build
set BUILD_DOC=voltray-docs

REM === GENERATE PROJECT FILES ===
echo Configuring project with CMake...
cmake -B %BUILD_DIR% -G %GENERATOR% -A x64 -DCMAKE_BUILD_TYPE=%BUILD_TYPE%
set BUILD_TYPE=%~1
if "%BUILD_TYPE%"=="" set BUILD_TYPE=Debug

set SCRIPT_DIR=%~dp0
for %%I in ("%SCRIPT_DIR%..") do set REPO_ROOT=%%~fI
set BUILD_DIR=%REPO_ROOT%\build
set GENERATOR=Visual Studio 17 2022
set FETCHCONTENT_FLAG=-DFETCHCONTENT_UPDATES_DISCONNECTED=ON

if exist "%BUILD_DIR%\_deps\glfw-src" (
if exist "%BUILD_DIR%\_deps\assimp-src" (
if exist "%BUILD_DIR%\_deps\imgui-src" (
set FETCHCONTENT_FLAG=-DFETCHCONTENT_FULLY_DISCONNECTED=ON
)
)
)

echo Configuring Voltray %BUILD_TYPE%...
cmake -S "%REPO_ROOT%" -B "%BUILD_DIR%" -G "%GENERATOR%" -A x64 -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DCMAKE_EXPORT_COMPILE_COMMANDS=ON %FETCHCONTENT_FLAG%
if errorlevel 1 (
echo Failed to configure the project.
exit /b 1
)

REM === BUILD PROJECT ===
echo Building project...
cmake --build %BUILD_DIR% --config %BUILD_TYPE%

echo Building Voltray %BUILD_TYPE%...
cmake --build "%BUILD_DIR%" --config %BUILD_TYPE%
if errorlevel 1 (
echo Build failed.
exit /b 1
)

echo Build successful!


echo Generating documentation...
cmake --build %BUILD_DIR% --target doc --config %BUILD_TYPE%

REM === RUN THE ENGINE ===
set EXE_PATH=%BUILD_DIR%\%BUILD_TYPE%\Voltray.exe
set EXE_DIR=%BUILD_DIR%\%BUILD_TYPE%

if exist "%EXE_PATH%" (
echo Running Voltray...
pushd "%EXE_DIR%"
Voltray.exe
popd
) else (
echo Error: Voltray.exe not found at %EXE_PATH%
)

endlocal
pause
echo Build successful.
endlocal
Loading
Loading