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

Clang linux #34

Open
wants to merge 54 commits into
base: master
Choose a base branch
from
Open

Clang linux #34

wants to merge 54 commits into from

Conversation

phire
Copy link

@phire phire commented Aug 11, 2022

Some of this is still rough WIP

And it only gets to the point of building, not linking. And a few things aren't even built (like opengl), or don't exist (like new input, sound, windowing)

phire and others added 26 commits August 23, 2022 13:04
This allows subclasses to be enabled-disabled at compile-time simply
by if the ysRegisterSubclass instantiation is linked in.
This is probably a horrible idea, my original plan was to replace all uses
of _s functions with std::string where possible.

But they are everywhere in the codebase. and we need to do this port in
smaller steps. So this is the more sane solution in the short term.

Ideally we will remove these later
Does microsoft have a specialization for when the desitnation is a fixed
size buffer? Or is this a bug?
Lets not reinvent the wheel, it will be faster and less error prone to
use c++'s built in buffering and padding.

And I needed to get rid of some _s functions anyway. Also, despite using
the safe functions, this code still had a potential buffer overrun.
From memory, microsoft leave a non-std:: version of these lying around
as a landmine for cross-platform compatibility.
I think these are leftover, we will see if this causes any errors down the line
Arguably, it should be Hidden. But the existing behavour of the Win32
Windowing system is Visable, and lets keep that for now
Also use size_t's and add a template for the "no size provided" calls.
This is basically a copy of the Windows impl, but with some of the
extensions that aren't required removed.
Also remove Windows.h since the headers include them anyway if they're
required on your platform.
I'm not sure what's going on on other platforms, but having this here
causes the compiler to always pick this rather than waiting on the
linker to pick the externally implemented ones.
Spotted by GCC because that last argument isn't a pointer so it
shouldn't have been NULL.
These are Windows GL methods that don't need to exist on other platforms
Forgot to add this on first pass of the SDL context
Not sure how I missed this before...
The size must be a multiple of the alignment and the alignment must be
a power of 2, so static assert on the alignment and round up the size
if necessary.
bobsayshilol and others added 22 commits August 23, 2022 13:13
delete isn't able to deduce the type of the object it's destroying
since it's the caller that runs the destructor. So we need to make sure
that types are as expected before calling the delete.
Compilers are smart. They typically know what to do.
This should be available everywhere, so make use of it.
Useful to find out why programs aren't linking even though the shader
stages compiled.
GLES doesn't like mixing the two and I'm trying to keep them as similar
as possible.
Any use cases of this should use the type required, though wav reading
is simple enough to be generic for all platforms.
Could use SDL here, but it only has millisecond precision.
This avoids having to find and build boost which is always a nice thing
to skip.
This way you only need to use ysAudioWaveFile and it'll Just Work
everywhere.
current_path() is the name of both a setter and a getter depending on
whether or not a path is provided. We want to get the current path so
call it without any arguments.
It's a bit wonky but it serves as a baseline.
Don't dereference realContext until we're sure it's valid.
Using physical button locations rather than keycodes for now since the
code is setup to use a fixed size lookup table.
Also disable Vulkan by default outside of Win32 since it hasn't been
tested when using SDL.
@phire phire marked this pull request as ready for review August 23, 2022 08:30
@jakelstr
Copy link

jakelstr commented Sep 4, 2022

I think line 350 of CMakeLists.txt should be "delta-core", not "delta-code". (I'm taking a crack at building for Mac)

@bobsayshilol bobsayshilol mentioned this pull request Oct 15, 2022
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.

4 participants