Complete build guide for compiling the native C++17 Direct3D/DXGI engine and packaging the Java JAR.
- Windows 10 or 11 (64-bit)
- JDK 17+ (Eclipse Adoptium or Oracle JDK)
- Visual Studio 2022 or 2026 (Community, Professional, or Enterprise) with "Desktop development with C++" workload
- Windows 10/11 SDK (installed with Visual Studio)
- Maven 3.9+
FastScreen includes an intelligent compilation script with automatic Visual Studio and JDK discovery:
# In the FastScreen repository root:
compile.batWhat compile.bat does automatically:
- Queries
vswhere.exeto locate the latest installed Visual Studio (VS 2026 or VS 2022). - Initializes the 64-bit developer environment (
vcvars64.bat). - Auto-detects
JAVA_HOMEif not already set. - Compiles
native/fastscreen.cppandnative/DXGICapture.cppwith/O2optimization and links againstuser32.lib,gdi32.lib,dxgi.lib,d3d11.lib, andd3dcompiler.lib. - Deploys
fastscreen.dlldirectly to:native/fastscreen.dllsrc/main/resources/native/fastscreen.dll(for inclusion inside JARs)%USERPROFILE%\.fastcore\native\fastscreen\fastscreen.dll(for runtime lookup by FastCore)
Once the native DLL is compiled, build and install the module to your local Maven repository:
# Build and install to ~/.m2/repository
mvn clean install -DskipTestsIf you prefer building manually from a Visual Studio Developer Command Prompt:
cd native
cl /LD /EHsc /O2 /W3 /nologo ^
/I"%JAVA_HOME%\include" ^
/I"%JAVA_HOME%\include\win32" ^
fastscreen.cpp ^
DXGICapture.cpp ^
/link ^
user32.lib ^
gdi32.lib ^
dxgi.lib ^
d3d11.lib ^
d3dcompiler.lib ^
/OUT:fastscreen.dll ^
/MACHINE:X64FastScreen/
├── src/main/java/ # Java source code
│ └── fastscreen/
│ └── FastScreen.java # Public Java API & JNI bridges
├── src/main/resources/native/ # Bundled native DLL in JAR
│ └── fastscreen.dll
├── native/ # C++ DirectX 11 source
│ ├── fastscreen.h # JNI declarations
│ ├── fastscreen.cpp # JNI bridge & window exclusion
│ └── DXGICapture.cpp # DirectX 11 & GDI fallback engine
├── examples/ # Standalone runnable demos & benchmarks
│ ├── Demo/ # Visual Showcase Hero Demo (FastTheme, AA, COVER)
│ └── Benchmark/ # JMH Microbenchmark Suite
├── docs/ # Architectural documentation
├── compile.bat # Automated VS compiler script
├── run-demo.bat # Launch Hero Demo
├── run-benchmark.bat # Run JMH Benchmark Suite
└── pom.xml # Maven build configuration
- Cause: FastScreen was launched from a non-interactive console, headless background agent, or Remote Desktop session without active DWM desktop composition.
- Solution: FastScreen automatically handles this via its built-in Win32 GDI DIBSection hardware fallback, continuing execution seamlessly with zero crashes.
- Run
compile.bat— it usesvswhere.exeto find modern Visual Studio installations automatically.
Part of the FastJava Ecosystem — Making the JVM faster. ⚡