13
114
Fork
You've already forked zig-sdl3
19

allow using system SDL #204

Merged
Gota7 merged 2 commits from chinmay/zig-sdl3:push-nsouuruxnkyo into master 2026年06月01日 02:21:50 +02:00
Contributor
Copy link
No description provided.
src/thread.zig Outdated
@ -39,11 +39,11 @@ pub const Priority = enum(c.SDL_ThreadPriority) {
/// This enum is available since SDL 3.2.0.
pubconstState=enum(c.SDL_ThreadState){
/// The thread is currently running.
alive,
Author
Contributor
Copy link

My system SDL has the following:

typedef enum SDL_ThreadState
{
 SDL_THREAD_UNKNOWN, /**< The thread is not valid */
 SDL_THREAD_ALIVE, /**< The thread is currently running */
 SDL_THREAD_DETACHED, /**< The thread is detached and can't be waited on */
 SDL_THREAD_COMPLETE /**< The thread has finished and should be cleaned up with SDL_WaitThread() */
} SDL_ThreadState;

i.e. SDL_THREAD_UNKNOWN is zero and everything else is shifted up by one. This caused tests to fail so I explicitly assigned it

My system SDL has the following: ```c typedef enum SDL_ThreadState { SDL_THREAD_UNKNOWN, /**< The thread is not valid */ SDL_THREAD_ALIVE, /**< The thread is currently running */ SDL_THREAD_DETACHED, /**< The thread is detached and can't be waited on */ SDL_THREAD_COMPLETE /**< The thread has finished and should be cleaned up with SDL_WaitThread() */ } SDL_ThreadState; ``` i.e. `SDL_THREAD_UNKNOWN` is zero and everything else is shifted up by one. This caused tests to fail so I explicitly assigned it
Author
Contributor
Copy link

This allows using the (wonderful) bindings without building SDL from source. zig build test -Dext_image -Dext_ttf -fsys=sdl passes

This allows using the (wonderful) bindings without building SDL from source. `zig build test -Dext_image -Dext_ttf -fsys=sdl` passes
Author
Contributor
Copy link

possibly closes #93? not clear if this is what they want

possibly closes #93? not clear if this is what they want
chinmay force-pushed push-nsouuruxnkyo from 1241fae756
Some checks failed
test / Build Documentation (pull_request) Failing after 32s
test / Testing (pull_request) Successful in 1m54s
test / Build Template (pull_request) Successful in 2m31s
test / Build Examples (pull_request) Successful in 3m53s
to 04a89026ad
Some checks failed
test / Build Examples (pull_request) Failing after 1m34s
test / Testing (pull_request) Successful in 36s
test / Build Documentation (pull_request) Successful in 3m46s
test / Build Template (pull_request) Successful in 2m25s
2026年05月30日 04:35:56 +02:00
Compare
chinmay force-pushed push-nsouuruxnkyo from 04a89026ad
Some checks failed
test / Build Examples (pull_request) Failing after 1m34s
test / Testing (pull_request) Successful in 36s
test / Build Documentation (pull_request) Successful in 3m46s
test / Build Template (pull_request) Successful in 2m25s
to a8ab5067da
Some checks failed
test / Build Documentation (pull_request) Successful in 34s
test / Build Template (pull_request) Successful in 37s
test / Testing (pull_request) Successful in 33s
test / Build Examples (pull_request) Failing after 1m19s
2026年05月31日 00:58:00 +02:00
Compare
Author
Contributor
Copy link

I've now split it into two commits, the first one just reorders some stuff around in build.zig to make it easier to review the actual changes for system sdl in the second commit

I've now split it into two commits, the first one just reorders some stuff around in build.zig to make it easier to review the actual changes for system sdl in the second commit
Gota7 left a comment
Copy link

Great job! If this passes CI, then I will merge.

Great job! If this passes CI, then I will merge.
@ -40,3 +40,3 @@
pubconstState=enum(c.SDL_ThreadState){
/// The thread is currently running.
alive,
alive=c.SDL_THREAD_ALIVE,
Owner
Copy link

How did I miss this??? Good catch thanks.

How did I miss this??? Good catch thanks.
Owner
Copy link

Closes #93

Closes #93
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
7Games/zig-sdl3!204
Reference in a new issue
7Games/zig-sdl3
No description provided.
Delete branch "chinmay/zig-sdl3:push-nsouuruxnkyo"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?