Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDL build improvements #1270

Merged
merged 9 commits into from
Dec 19, 2023
Merged

SDL build improvements #1270

merged 9 commits into from
Dec 19, 2023

Conversation

ryandesign
Copy link
Contributor

@ryandesign ryandesign commented Dec 15, 2023

Here are several improvements to the scons/SDL/OpenGL build, especially for macOS.

Update GitHub workflow: also build SDL UI on macOS

Import PATH into scons environment

Fixes

/bin/sh: sdl2-config: command not found

when sdl2-config is not in a standard system bin directory (e.g. MacPorts).

Use the right include path for SDL.h

Fixes

main.cpp:22:10: fatal error: 'SDL2/SDL.h' file not found

when SDL2 is not in a standard system include directory (e.g. MacPorts).

Link with Accelerate framework on macOS

Fixes

Undefined symbols for architecture x86_64:
  "_vDSP_dotpr_s1_15", referenced from:
      Outputs::Speaker::LowpassBase<Outputs::Speaker::PushLowpass<true>, true>::resample_input_buffer(int) in Audio.o
      Outputs::Speaker::LowpassBase<Outputs::Speaker::PullLowpass<GI::AY38910::AY38910<true> >, true>::resample_input_buffer(int) in AmstradCPC.o
      Outputs::Speaker::LowpassBase<Outputs::Speaker::PullLowpass<Audio::Toggle>, false>::resample_input_buffer(int) in AppleII.o
      Outputs::Speaker::LowpassBase<Outputs::Speaker::PullLowpass<Outputs::Speaker::CompoundSource<Apple::IIgs::Sound::GLU, Audio::Toggle> >, false>::resample_input_buffer(int) in AppleIIgs.o
      Outputs::Speaker::LowpassBase<Outputs::Speaker::PullLowpass<Apple::Macintosh::Audio>, false>::process(unsigned long) in Macintosh.o
      Outputs::Speaker::LowpassBase<Outputs::Speaker::PullLowpass<Apple::Macintosh::Audio>, false>::update_filter_coefficients(Outputs::Speaker::LowpassBase<Outputs::Speaker::PullLowpass<Apple::Macintosh::Audio>, false>::FilterParameters const&) in Macintosh.o
      Outputs::Speaker::LowpassBase<Outputs::Speaker::PullLowpass<Atari2600::TIASound>, false>::process(unsigned long) in Atari2600.o
      ...
ld: symbol(s) not found for architecture x86_64

Silence macOS OpenGL deprecation warnings

Removes warnings like this:

main.cpp:900:2: warning: 'glGetIntegerv' is deprecated: first deprecated in macOS 10.14 - OpenGL API deprecated. (Define GL_SILENCE_DEPRECATION to silence these warnings) [-Wdeprecated-declarations]

Link with OpenGL framework on macOS

Fixes

ld: library not found for -lGL

Improve Macintosh video & Apple II colors on macOS

Hacks in AppleII/Video.cpp, AppleII/Video.hpp, and Macintosh/Video.cpp assume that building on macOS means building for Metal unless IGNORE_APPLE is defined. By defining this in the macOS SDL build, Macintosh video is now sized and positioned correctly and Apple II colors are now just as wrong as they are on other OpenGL builds instead of being wrong in a unique way.

See #872

Fix OpenGL Apple II colors

Adjust phase by 90 degress.

Closes #872

Change phase from int to uint8_t

output_colour_burst expects a uint8_t so may as well make that clear.

Fixes "/bin/sh: sdl2-config: command not found" when sdl2-config is not
in a standard system bin directory.
Fixes "main.cpp:22:10: fatal error: 'SDL2/SDL.h' file not found" when
SDL2 is not in a standard system include directory.
Fixes "Undefined symbols for architecture x86_64: '_vDSP_dotpr_s1_15'"
Fixes "ld: library not found for -lGL"
Hacks in AppleII/Video.cpp, AppleII/Video.hpp, and Macintosh/Video.cpp
assume that building on macOS means building for Metal unless
IGNORE_APPLE is defined. By defining this in the macOS SDL build,
Macintosh video is now sized and positioned correctly and Apple II
colors are now just as wrong as they are on other OpenGL builds instead
of being wrong in a unique way.

See TomHarte#872
Adjust phase by 90 degress.

Closes TomHarte#872
output_colour_burst expects a uint8_t so may as well make that clear.
@TomHarte
Copy link
Owner

In my mild defence, I've never actually intended to support SDL on the Mac — it's purely there for development convenience. This is still an improvement though.

@TomHarte TomHarte merged commit abea3d1 into TomHarte:master Dec 19, 2023
3 checks passed
@ryandesign ryandesign deleted the MacSDL branch December 19, 2023 07:12
@ryandesign
Copy link
Contributor Author

Oh sure. But hey, now it works!

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.

AppleII Conan game intro screen incorrect (rde/blue mixed with green/mauve)
2 participants