Finished most of the system api functions (a few will be implemented later).
This commit is contained in:
parent
8c7600ba09
commit
26fd4cd230
|
@ -71,6 +71,37 @@
|
|||
#define global static
|
||||
#define external extern "C"
|
||||
|
||||
struct Control_Keys{
|
||||
b8 l_ctrl;
|
||||
b8 r_ctrl;
|
||||
b8 l_alt;
|
||||
b8 r_alt;
|
||||
};
|
||||
|
||||
struct Mac_Input_Chunk_Transient{
|
||||
Input_List event_list;
|
||||
b8 mouse_l_press;
|
||||
b8 mouse_l_release;
|
||||
b8 mouse_r_press;
|
||||
b8 mouse_r_release;
|
||||
b8 out_of_window;
|
||||
i8 mouse_wheel;
|
||||
b8 trying_to_kill;
|
||||
};
|
||||
|
||||
struct Mac_Input_Chunk_Persistent{
|
||||
Vec2_i32 mouse;
|
||||
Control_Keys controls;
|
||||
Input_Modifier_Set_Fixed modifiers;
|
||||
b8 mouse_l;
|
||||
b8 mouse_r;
|
||||
};
|
||||
|
||||
struct Mac_Input_Chunk{
|
||||
Mac_Input_Chunk_Transient trans;
|
||||
Mac_Input_Chunk_Persistent pers;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
|
||||
#define SLASH '/'
|
||||
|
@ -128,6 +159,13 @@ struct Mac_Vars {
|
|||
Thread_Context *tctx;
|
||||
|
||||
Arena* frame_arena;
|
||||
Mac_Input_Chunk input_chunk;
|
||||
|
||||
b8 full_screen;
|
||||
b8 do_toggle;
|
||||
|
||||
i32 cursor_show;
|
||||
i32 prev_cursor_show;
|
||||
|
||||
String_Const_u8 binary_path;
|
||||
|
||||
|
|
|
@ -766,33 +766,28 @@ system_memory_annotation_sig(){
|
|||
|
||||
function
|
||||
system_show_mouse_cursor_sig(){
|
||||
NotImplemented;
|
||||
mac_vars.cursor_show = show;
|
||||
}
|
||||
|
||||
function
|
||||
system_set_fullscreen_sig(){
|
||||
b32 result = false;
|
||||
// NOTE(yuval): Read comment in system_set_fullscreen_sig in win32_4ed.cpp
|
||||
mac_vars.do_toggle = (mac_vars.full_screen != full_screen);
|
||||
|
||||
NotImplemented;
|
||||
|
||||
return(result);
|
||||
b32 success = true;
|
||||
return(success);
|
||||
}
|
||||
|
||||
function
|
||||
system_is_fullscreen_sig(){
|
||||
b32 result = false;
|
||||
|
||||
NotImplemented;
|
||||
|
||||
// NOTE(yuval): Read comment in system_is_fullscreen_sig in win32_4ed.cpp
|
||||
b32 result = (mac_vars.full_screen != mac_vars.do_toggle);
|
||||
return(result);
|
||||
}
|
||||
|
||||
function
|
||||
system_get_keyboard_modifiers_sig(){
|
||||
Input_Modifier_Set result = {};
|
||||
|
||||
NotImplemented;
|
||||
|
||||
Input_Modifier_Set result = copy_modifier_set(arena, &mac_vars.input_chunk.pers.modifiers);
|
||||
return(result);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue