Skip to content

[feat] Add SDL3 bindings#97

Merged
lerno merged 4 commits intoc3lang:mainfrom
NiyaDev:feat/add_sdl3
Mar 16, 2026
Merged

[feat] Add SDL3 bindings#97
lerno merged 4 commits intoc3lang:mainfrom
NiyaDev:feat/add_sdl3

Conversation

@NiyaDev
Copy link
Contributor

@NiyaDev NiyaDev commented Mar 2, 2026

SDL3 bindings

@lerno
Copy link
Contributor

lerno commented Mar 2, 2026

Great, can we have it updated to work with 0.7.10 as well? enum Foo : const CInt => constdef Foo : CInt, @extern("someName") => @cname("someName")?

@NiyaDev
Copy link
Contributor Author

NiyaDev commented Mar 3, 2026

I'll start working on it

@lerno
Copy link
Contributor

lerno commented Mar 5, 2026

Add it to the CI so that it gets built too

@NickMundel
Copy link

It seems that a few functions are inlined in the header files. An example from SDL_rect.h

SDL_FORCE_INLINE bool SDL_PointInRect(const SDL_Point *p, const SDL_Rect *r)
{
return ( p && r && (p->x >= r->x) && (p->x < (r->x + r->w)) &&
(p->y >= r->y) && (p->y < (r->y + r->h)) ) ? true : false;
}

It also seems that we cant define those in the interface file. Is there a workaround? Or is it possible to ship implementation / normal c3 files with the library?

@lerno
Copy link
Contributor

lerno commented Mar 16, 2026

They can be added as macros.

@lerno lerno merged commit 3b767ee into c3lang:main Mar 16, 2026
2 checks passed
@lerno
Copy link
Contributor

lerno commented Mar 16, 2026

Thank you!

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.

3 participants