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

Update sdl2.c3i #7

Merged
merged 1 commit into from
Jul 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 37 additions & 46 deletions libraries/sdl2.c3l/sdl2.c3i
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// sdl2.c3i
// Created 14/07/2023
// Updated 19/07/2023
// Updated 21/07/2023
// Originally created Kenta @ https://github.com/Its-Kenta

module sdl;
Expand Down Expand Up @@ -88,53 +88,44 @@ def WriteFn = fn long(RWops context, void* ptr, long size);
def CloseFn = fn int(RWops context);

struct RWops {
SizeFn* size;
SeekFn* seek;
ReadFn* read;
WriteFn* write;
CloseFn* close;
SizeFn size;
SeekFn seek;
ReadFn read;
WriteFn write;
CloseFn close;
uint type;
// union {
// #ifdef __ANDROID__
// struct
// {
// void *asset;
// } androidio;

// #elif defined(__WIN32__) || defined(__GDK__)
// struct
// {
// SDL_bool append;
// void *h;
// struct
// {
// void *data;
// size_t size;
// size_t left;
// } buffer;
// } windowsio;
// #endif

// struct
// {
// SDL_bool autoclose;
// void *fp;
// } stdio;

// struct
// {
// Uint8 *base;
// Uint8 *here;
// Uint8 *stop;
// } mem;

// struct
// {
// void *data1;
// void *data2;
// } unknown;
// } hidden;
union hidden {
// struct androidio @if(env::ANDROID) {
// void *asset;
// } Android not yet supported in C3

struct windowsio @if(env::WIN32) {
bool append;
void *h;
struct buffer {
void *data;
usz size;
usz left;
}
}

struct stdio {
bool autoclose;
void *fp;
}

struct mem {
char *base;
char *here;
char *stop;
}

struct unknown
{
void *data1;
void *data2;
}
}
}

def AudioFormat = int;
Expand Down