GL/SDL2 examples: Make it build on Visual Studio
Hi,
In recent releases SDL2's CMake build produces pkg-config files for us, which will enable the GL/SDL examples to build. So this attempts to make such builds work, by:
-
Updating the C sources so that they will compile on Visual Studio:
-
Change
WIN32
to_WIN32
, since_WIN32
is always defined for compilers targeting Windows. -
Include
stdio.h
forstderr
. -
Define
GL_CLAMP_TO_EDGE
if needed, as Windows's stockGL/gl.h
may not have supported that. -
Update the Meson build files to link to
SDL2main.lib
on Visual Studio-like compilers, since it's required, and Meson's SDL2 support does not yet cover using CMake, so we can't use thecomponents:
keyword in thedependency...
call.
The code still needs some update to work under Windows, but at least the code now builds.
With blessings, thank you!