Skip to content

Fix MSVC UTF-8 build error and seed rays in 2D lensing demo - #49

Open
thisisanubhav wants to merge 1 commit into
kavan010:mainfrom
thisisanubhav:main
Open

Fix MSVC UTF-8 build error and seed rays in 2D lensing demo#49
thisisanubhav wants to merge 1 commit into
kavan010:mainfrom
thisisanubhav:main

Conversation

@thisisanubhav

Copy link
Copy Markdown

Summary

  • 2D_lensing.cpp had its ray-seeding line commented out, so the 2D demo window showed only a static black hole with no light rays. Uncommented it and expanded to a small fan of rays at varying heights so gravitational lensing is actually visible when you run it.
  • CMakeLists.txt didn't compile on MSVC out of the box: source files use non-ASCII identifiers (e.g. ), which MSVC misreads without an explicit UTF-8 flag, causing error C3872: this character is not allowed in an identifier. Added /utf-8 under an if (MSVC) guard to fix this without touching other platforms.

Test plan

  • Built both BlackHole2D and BlackHole3D targets on Windows with MSVC (VS 2022 Build Tools) + vcpkg (glfw3, glm, glew) — both compile and run.
  • Confirmed 2D window now shows rays curving around the event horizon instead of a static disc.

- Uncomment and expand ray seeding in 2D_lensing.cpp so gravitational
  lensing is actually visible (fan of rays at varying heights).
- Add /utf-8 MSVC compile flag so source files using non-ASCII
  identifiers (e.g. dλ) build correctly on MSVC.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant