2019-12-27 23:54:33 +00:00
|
|
|
/* Mac Objective-C layer for 4coder */
|
2019-12-24 14:57:05 +00:00
|
|
|
|
|
|
|
#include "4coder_base_types.h"
|
2019-12-27 21:59:59 +00:00
|
|
|
#include "4coder_version.h"
|
|
|
|
#include "4coder_events.h"
|
2019-12-25 01:17:12 +00:00
|
|
|
|
2019-12-26 01:39:40 +00:00
|
|
|
#include "4coder_table.h"
|
2019-12-27 21:59:59 +00:00
|
|
|
|
2019-12-27 03:47:12 +00:00
|
|
|
// NOTE(allen): This is a very unfortunate hack, but hopefully there will never be a need to use the Marker
|
|
|
|
// type in the platform layer. If that changes then instead change the name of Marker and make a transition
|
|
|
|
// macro that is only included in custom code.
|
|
|
|
#define Marker Marker__SAVE_THIS_IDENTIFIER
|
2019-12-26 01:39:40 +00:00
|
|
|
#include "4coder_types.h"
|
2019-12-27 03:47:12 +00:00
|
|
|
#undef Marker
|
2019-12-27 21:59:59 +00:00
|
|
|
|
|
|
|
#include "4coder_default_colors.h"
|
|
|
|
|
|
|
|
#include "4coder_system_types.h"
|
|
|
|
#define STATIC_LINK_API
|
|
|
|
#include "generated/system_api.h"
|
|
|
|
|
|
|
|
#include "4ed_font_interface.h"
|
|
|
|
#define STATIC_LINK_API
|
|
|
|
#include "generated/graphics_api.h"
|
|
|
|
#define STATIC_LINK_API
|
|
|
|
#include "generated/font_api.h"
|
|
|
|
|
|
|
|
#include "4ed_font_set.h"
|
|
|
|
#include "4ed_render_target.h"
|
|
|
|
#include "4ed_search_list.h"
|
|
|
|
#include "4ed.h"
|
|
|
|
|
|
|
|
#include "generated/system_api.cpp"
|
|
|
|
#include "generated/graphics_api.cpp"
|
|
|
|
#include "generated/font_api.cpp"
|
|
|
|
|
|
|
|
#include "4coder_base_types.cpp"
|
|
|
|
#include "4coder_stringf.cpp"
|
|
|
|
#include "4coder_events.cpp"
|
|
|
|
#include "4coder_hash_functions.cpp"
|
|
|
|
#include "4coder_table.cpp"
|
|
|
|
#include "4coder_log.cpp"
|
|
|
|
|
|
|
|
#include "4ed_search_list.cpp"
|
2019-12-26 01:39:40 +00:00
|
|
|
|
2019-12-24 20:31:24 +00:00
|
|
|
#include "mac_objective_c_to_cpp_links.h"
|
2019-12-24 14:57:05 +00:00
|
|
|
|
2019-12-24 20:31:24 +00:00
|
|
|
#undef function
|
|
|
|
#undef internal
|
|
|
|
#undef global
|
|
|
|
#undef external
|
2019-12-27 21:59:59 +00:00
|
|
|
#import <Cocoa/Cocoa.h>
|
2019-12-24 14:57:05 +00:00
|
|
|
|
2019-12-25 01:17:12 +00:00
|
|
|
#include <libproc.h> // NOTE(yuval): Used for proc_pidpath
|
2019-12-30 00:33:30 +00:00
|
|
|
#include <mach/mach_time.h> // NOTE(yuval): Used for mach_absolute_time, mach_timebase_info, mach_timebase_info_data_t
|
2019-12-25 01:17:12 +00:00
|
|
|
|
2019-12-27 21:59:59 +00:00
|
|
|
#include <dirent.h> // NOTE(yuval): Used for opendir, readdir
|
2019-12-27 23:54:33 +00:00
|
|
|
#include <dlfcn.h> // NOTE(yuval): Used for dlopen, dlclose, dlsym
|
2019-12-27 21:59:59 +00:00
|
|
|
#include <errno.h> // NOTE(yuval): Used for errno
|
|
|
|
#include <fcntl.h> // NOTE(yuval): Used for open
|
2019-12-31 11:14:05 +00:00
|
|
|
#include <pthread.h> // NOTE(yuval): Used for threads, mutexes, cvs
|
2019-12-27 21:59:59 +00:00
|
|
|
#include <unistd.h> // NOTE(yuval): Used for getcwd, read, write, getpid
|
2019-12-31 21:36:12 +00:00
|
|
|
#include <sys/mman.h> // NOTE(yuval): Used for mmap, munmap, mprotect
|
2019-12-27 21:59:59 +00:00
|
|
|
#include <sys/stat.h> // NOTE(yuval): Used for stat
|
|
|
|
#include <sys/types.h> // NOTE(yuval): Used for struct stat, pid_t
|
|
|
|
|
|
|
|
#include <stdlib.h> // NOTE(yuval): Used for free
|
2019-12-25 01:17:12 +00:00
|
|
|
|
2019-12-27 21:59:59 +00:00
|
|
|
#define function static
|
|
|
|
#define internal static
|
|
|
|
#define global static
|
2019-12-25 01:17:12 +00:00
|
|
|
#define external extern "C"
|
|
|
|
|
2019-12-27 23:54:33 +00:00
|
|
|
////////////////////////////////
|
|
|
|
|
2019-12-27 21:59:59 +00:00
|
|
|
#define SLASH '/'
|
|
|
|
#define DLL "so"
|
|
|
|
|
|
|
|
#include "4coder_hash_functions.cpp"
|
|
|
|
#include "4coder_system_allocator.cpp"
|
|
|
|
#include "4coder_malloc_allocator.cpp"
|
|
|
|
#include "4coder_codepoint_map.cpp"
|
|
|
|
|
|
|
|
#include "4ed_mem.cpp"
|
|
|
|
#include "4ed_font_set.cpp"
|
|
|
|
|
|
|
|
////////////////////////////////
|
|
|
|
|
2019-12-30 01:21:21 +00:00
|
|
|
@interface AppDelegate : NSObject<NSApplicationDelegate, NSWindowDelegate>
|
2019-12-30 00:33:30 +00:00
|
|
|
@end
|
|
|
|
|
2019-12-30 01:21:21 +00:00
|
|
|
@interface OpenGLView : NSOpenGLView
|
|
|
|
- (void)requestDisplay;
|
2019-12-30 00:33:30 +00:00
|
|
|
@end
|
|
|
|
|
|
|
|
////////////////////////////////
|
|
|
|
|
|
|
|
////////////////////////////////
|
|
|
|
|
2019-12-29 22:34:53 +00:00
|
|
|
typedef i32 Mac_Object_Kind;
|
2019-12-29 01:09:28 +00:00
|
|
|
enum{
|
2019-12-29 22:34:53 +00:00
|
|
|
MacObjectKind_ERROR = 0,
|
|
|
|
MacObjectKind_Timer = 1,
|
|
|
|
MacObjectKind_Thread = 2,
|
|
|
|
MacObjectKind_Mutex = 3,
|
|
|
|
MacObjectKind_CV = 4,
|
2019-12-29 01:09:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct Mac_Object{
|
|
|
|
Node node;
|
|
|
|
Mac_Object_Kind kind;
|
|
|
|
|
|
|
|
union{
|
2019-12-31 11:14:05 +00:00
|
|
|
NSTimer* timer;
|
|
|
|
|
2019-12-29 01:09:28 +00:00
|
|
|
struct{
|
2019-12-31 11:14:05 +00:00
|
|
|
pthread_t thread;
|
|
|
|
Thread_Function *proc;
|
|
|
|
void *ptr;
|
|
|
|
} thread;
|
|
|
|
|
|
|
|
pthread_mutex_t mutex;
|
|
|
|
pthread_cond_t cv;
|
2019-12-29 01:09:28 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2019-12-27 21:59:59 +00:00
|
|
|
struct Mac_Vars {
|
|
|
|
Thread_Context *tctx;
|
2019-12-25 21:31:21 +00:00
|
|
|
|
2019-12-27 21:59:59 +00:00
|
|
|
Arena* frame_arena;
|
2019-12-25 21:31:21 +00:00
|
|
|
|
2019-12-27 21:59:59 +00:00
|
|
|
String_Const_u8 binary_path;
|
2019-12-29 01:09:28 +00:00
|
|
|
|
2019-12-30 00:33:30 +00:00
|
|
|
NSWindow* window;
|
2019-12-30 01:21:21 +00:00
|
|
|
OpenGLView* view;
|
2019-12-30 23:56:12 +00:00
|
|
|
f32 screen_scale_factor;
|
2019-12-30 00:33:30 +00:00
|
|
|
|
|
|
|
mach_timebase_info_data_t timebase_info;
|
|
|
|
|
2019-12-29 01:09:28 +00:00
|
|
|
Node free_mac_objects;
|
|
|
|
Node timer_objects;
|
2019-12-31 11:14:05 +00:00
|
|
|
|
|
|
|
pthread_mutex_t thread_launch_mutex;
|
|
|
|
pthread_cond_t thread_launch_cv;
|
|
|
|
b32 waiting_for_launch;
|
|
|
|
|
|
|
|
System_Mutex global_frame_mutex;
|
2019-12-27 21:59:59 +00:00
|
|
|
};
|
2019-12-25 21:31:21 +00:00
|
|
|
|
2019-12-27 21:59:59 +00:00
|
|
|
////////////////////////////////
|
|
|
|
|
2019-12-27 23:54:33 +00:00
|
|
|
global Mac_Vars mac_vars;
|
2019-12-27 21:59:59 +00:00
|
|
|
global Render_Target target;
|
|
|
|
|
2019-12-29 01:09:28 +00:00
|
|
|
////////////////////////////////
|
|
|
|
|
2019-12-30 00:33:30 +00:00
|
|
|
function Mac_Object*
|
2019-12-29 01:09:28 +00:00
|
|
|
mac_alloc_object(Mac_Object_Kind kind){
|
2019-12-29 22:34:53 +00:00
|
|
|
Mac_Object *result = 0;
|
2019-12-29 01:09:28 +00:00
|
|
|
|
|
|
|
if (mac_vars.free_mac_objects.next != &mac_vars.free_mac_objects){
|
|
|
|
result = CastFromMember(Mac_Object, node, mac_vars.free_mac_objects.next);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!result){
|
|
|
|
i32 count = 512;
|
2019-12-29 22:34:53 +00:00
|
|
|
Mac_Object *objects = (Mac_Object*)system_memory_allocate(count * sizeof(Mac_Object), file_name_line_number_lit_u8);
|
2019-12-29 01:09:28 +00:00
|
|
|
|
2019-12-29 22:34:53 +00:00
|
|
|
// NOTE(yuval): Link the first node of the dll to the sentinel
|
2019-12-29 01:09:28 +00:00
|
|
|
objects[0].node.prev = &mac_vars.free_mac_objects;
|
|
|
|
mac_vars.free_mac_objects.next = &objects[0].node;
|
|
|
|
|
2019-12-29 22:34:53 +00:00
|
|
|
// NOTE(yuval): Link all dll nodes to each other
|
2019-12-29 01:09:28 +00:00
|
|
|
for (i32 chain_index = 1; chain_index < count; chain_index += 1){
|
|
|
|
objects[chain_index - 1].node.next = &objects[chain_index].node;
|
|
|
|
objects[chain_index].node.prev = &objects[chain_index - 1].node;
|
|
|
|
}
|
|
|
|
|
2019-12-29 22:34:53 +00:00
|
|
|
// NOTE(yuval): Link the last node of the dll to the sentinel
|
2019-12-29 01:09:28 +00:00
|
|
|
objects[count - 1].node.next = &mac_vars.free_mac_objects;
|
|
|
|
mac_vars.free_mac_objects.prev = &objects[count - 1].node;
|
|
|
|
|
|
|
|
result = CastFromMember(Mac_Object, node, mac_vars.free_mac_objects.next);
|
|
|
|
}
|
|
|
|
|
|
|
|
Assert(result);
|
|
|
|
dll_remove(&result->node);
|
|
|
|
block_zero_struct(result);
|
|
|
|
result->kind = kind;
|
|
|
|
|
|
|
|
return(result);
|
|
|
|
}
|
|
|
|
|
2019-12-30 00:33:30 +00:00
|
|
|
function void
|
2019-12-29 22:34:53 +00:00
|
|
|
mac_free_object(Mac_Object *object){
|
|
|
|
if (object->node.next != 0){
|
|
|
|
dll_remove(&object->node);
|
|
|
|
}
|
|
|
|
|
|
|
|
dll_insert(&mac_vars.free_mac_objects, &object->node);
|
|
|
|
}
|
2019-12-29 01:09:28 +00:00
|
|
|
|
2019-12-31 11:14:05 +00:00
|
|
|
function inline Plat_Handle
|
|
|
|
mac_to_plat_handle(Mac_Object *object){
|
|
|
|
Plat_Handle result = *(Plat_Handle*)(&object);
|
|
|
|
return(result);
|
|
|
|
}
|
|
|
|
|
|
|
|
function inline Mac_Object*
|
|
|
|
mac_to_object(Plat_Handle handle){
|
|
|
|
Mac_Object *result = *(Mac_Object**)(&handle);
|
|
|
|
return(result);
|
|
|
|
}
|
|
|
|
|
2019-12-27 21:59:59 +00:00
|
|
|
////////////////////////////////
|
|
|
|
|
|
|
|
#import "mac_4ed_functions.mm"
|
|
|
|
|
|
|
|
////////////////////////////////
|
2019-12-25 01:17:12 +00:00
|
|
|
|
2019-12-30 01:21:21 +00:00
|
|
|
@implementation AppDelegate
|
2019-12-29 01:09:28 +00:00
|
|
|
- (void)applicationDidFinishLaunching:(id)sender{
|
|
|
|
}
|
|
|
|
|
|
|
|
- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication*)sender{
|
|
|
|
return YES;
|
|
|
|
}
|
|
|
|
|
2019-12-29 22:34:53 +00:00
|
|
|
- (void)applicationWillTerminate:(NSNotification*)notification{
|
2019-12-29 01:09:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (NSSize)windowWillResize:(NSWindow*)window toSize:(NSSize)frame_size{
|
|
|
|
// frame_size.height = ((f32)frame_size.width / global_aspect_ratio);
|
|
|
|
return frame_size;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)windowWillClose:(id)sender{
|
|
|
|
// global_running = false;
|
|
|
|
}
|
|
|
|
@end
|
|
|
|
|
2019-12-30 01:21:21 +00:00
|
|
|
@implementation OpenGLView
|
2019-12-30 00:33:30 +00:00
|
|
|
- (id)init {
|
|
|
|
self = [super init];
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
2019-12-30 01:21:21 +00:00
|
|
|
- (void)prepareOpenGL{
|
2019-12-30 00:33:30 +00:00
|
|
|
[super prepareOpenGL];
|
|
|
|
[[self openGLContext] makeCurrentContext];
|
|
|
|
}
|
|
|
|
|
2019-12-30 01:21:21 +00:00
|
|
|
- (void)reshape{
|
2019-12-30 00:33:30 +00:00
|
|
|
[super reshape];
|
|
|
|
|
|
|
|
NSRect bounds = [self bounds];
|
|
|
|
// [global_opengl_context makeCurrentContext];
|
|
|
|
// [global_opengl_context update];
|
|
|
|
// glViewport(0, 0, (GLsizei)bounds.size.width,
|
|
|
|
// (GLsizei)bounds.size.height);
|
|
|
|
}
|
2019-12-30 01:21:21 +00:00
|
|
|
|
2019-12-30 22:04:33 +00:00
|
|
|
- (void)drawRect:(NSRect)bounds{
|
|
|
|
// [self getFrame];
|
|
|
|
printf("Draw Rect!\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
- (BOOL)acceptsFirstResponder{
|
|
|
|
return YES;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (BOOL)becomeFirstResponder{
|
|
|
|
return YES;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (BOOL)resignFirstResponder{
|
|
|
|
return YES;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)keyDown:(NSEvent *)event{
|
|
|
|
printf("Key Down!\n");
|
|
|
|
[self requestDisplay];
|
|
|
|
}
|
|
|
|
|
2019-12-30 23:56:12 +00:00
|
|
|
/*
|
2019-12-30 22:04:33 +00:00
|
|
|
- (void)mouseMoved:(NSEvent*)event{
|
|
|
|
printf("Mouse Moved!\n");
|
|
|
|
[self requestDisplay];
|
|
|
|
}
|
2019-12-30 23:56:12 +00:00
|
|
|
*/
|
2019-12-30 22:04:33 +00:00
|
|
|
|
|
|
|
- (void)mouseDown:(NSEvent*)event{
|
|
|
|
printf("Mouse Down!\n");
|
|
|
|
[self requestDisplay];
|
|
|
|
}
|
|
|
|
|
2019-12-30 01:21:21 +00:00
|
|
|
- (void)requestDisplay{
|
|
|
|
printf("Display Requested\n");
|
2019-12-30 22:04:33 +00:00
|
|
|
|
|
|
|
[self setNeedsDisplayInRect:[mac_vars.window frame]];
|
2019-12-30 01:21:21 +00:00
|
|
|
}
|
2019-12-30 00:33:30 +00:00
|
|
|
@end
|
|
|
|
|
2019-12-29 01:09:28 +00:00
|
|
|
////////////////////////////////
|
|
|
|
|
2019-12-23 00:39:44 +00:00
|
|
|
int
|
|
|
|
main(int arg_count, char **args){
|
2019-12-30 01:21:21 +00:00
|
|
|
block_zero_struct(&mac_vars);
|
|
|
|
|
2019-12-23 23:22:56 +00:00
|
|
|
@autoreleasepool{
|
2019-12-24 14:57:05 +00:00
|
|
|
// NOTE(yuval): Create NSApplication & Delegate
|
2019-12-29 22:34:53 +00:00
|
|
|
NSApplication *app = [NSApplication sharedApplication];
|
2019-12-23 23:22:56 +00:00
|
|
|
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
|
|
|
|
|
2019-12-30 01:21:21 +00:00
|
|
|
AppDelegate *app_delegate = [[AppDelegate alloc] init];
|
2019-12-23 23:22:56 +00:00
|
|
|
[app setDelegate:app_delegate];
|
|
|
|
|
2019-12-30 01:21:21 +00:00
|
|
|
// NOTE(yuval): Create NSWindow
|
|
|
|
float w = 1280.0f;
|
|
|
|
float h = 720.0f;
|
|
|
|
NSRect screen_rect = [[NSScreen mainScreen] frame];
|
|
|
|
NSRect initial_frame = NSMakeRect((screen_rect.size.width - w) * 0.5f, (screen_rect.size.height - h) * 0.5f, w, h);
|
|
|
|
|
2019-12-30 22:04:33 +00:00
|
|
|
u32 style_mask = NSWindowStyleMaskTitled | NSWindowStyleMaskClosable | NSWindowStyleMaskMiniaturizable | NSWindowStyleMaskResizable;
|
2019-12-30 01:21:21 +00:00
|
|
|
|
2019-12-30 22:04:33 +00:00
|
|
|
mac_vars.window = [[NSWindow alloc] initWithContentRect:initial_frame
|
|
|
|
styleMask:style_mask
|
|
|
|
backing:NSBackingStoreBuffered
|
|
|
|
defer:NO];
|
|
|
|
|
|
|
|
[mac_vars.window setBackgroundColor:NSColor.blackColor];
|
|
|
|
[mac_vars.window setDelegate:app_delegate];
|
|
|
|
[mac_vars.window setTitle:@"4coder"];
|
|
|
|
[mac_vars.window setAcceptsMouseMovedEvents:YES];
|
2019-12-30 01:21:21 +00:00
|
|
|
|
|
|
|
// NOTE(yuval): Create OpenGLView
|
2019-12-30 22:04:33 +00:00
|
|
|
NSView* content_view = [mac_vars.window contentView];
|
2019-12-30 01:21:21 +00:00
|
|
|
|
|
|
|
// TODO(yuval): Finish view setup!
|
|
|
|
mac_vars.view = [[OpenGLView alloc] init];
|
|
|
|
[mac_vars.view setFrame:[content_view bounds]];
|
2019-12-30 22:04:33 +00:00
|
|
|
[mac_vars.view setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
|
2019-12-30 01:21:21 +00:00
|
|
|
|
|
|
|
[content_view addSubview:mac_vars.view];
|
2019-12-30 22:04:33 +00:00
|
|
|
[mac_vars.window makeKeyAndOrderFront:nil];
|
2019-12-30 01:21:21 +00:00
|
|
|
|
|
|
|
dll_init_sentinel(&mac_vars.free_mac_objects);
|
|
|
|
dll_init_sentinel(&mac_vars.timer_objects);
|
2019-12-23 23:22:56 +00:00
|
|
|
|
2019-12-30 23:56:12 +00:00
|
|
|
// NOTE(yuval): Screen scale factor calculation
|
|
|
|
{
|
|
|
|
NSScreen* screen = [NSScreen mainScreen];
|
|
|
|
NSDictionary* desc = [screen deviceDescription];
|
|
|
|
NSSize size = [[desc valueForKey:NSDeviceResolution] sizeValue];
|
|
|
|
f32 max_dpi = Max(size.width, size.height);
|
|
|
|
mac_vars.screen_scale_factor = (max_dpi / 72.0f);
|
|
|
|
}
|
|
|
|
|
|
|
|
printf("screen scale factor: %f\n", system_get_screen_scale_factor());
|
2019-12-30 01:21:21 +00:00
|
|
|
|
|
|
|
// NOTE(yuval): Start the app's run loop
|
2019-12-30 22:04:33 +00:00
|
|
|
#if 1
|
2019-12-31 21:36:12 +00:00
|
|
|
printf("Running using NSApp run\n");
|
2019-12-30 01:21:21 +00:00
|
|
|
[NSApp run];
|
2019-12-30 22:04:33 +00:00
|
|
|
#else
|
2019-12-31 21:36:12 +00:00
|
|
|
printf("Running using manual event loop\n");
|
|
|
|
|
2019-12-30 22:04:33 +00:00
|
|
|
for (;;) {
|
|
|
|
u64 count = 0;
|
|
|
|
|
|
|
|
NSEvent* event;
|
|
|
|
do {
|
|
|
|
event = [NSApp nextEventMatchingMask:NSEventMaskAny
|
2019-12-31 21:36:12 +00:00
|
|
|
untilDate:[NSDate distantFuture]
|
2019-12-30 22:04:33 +00:00
|
|
|
inMode:NSDefaultRunLoopMode
|
|
|
|
dequeue:YES];
|
|
|
|
|
|
|
|
[NSApp sendEvent:event];
|
|
|
|
} while (event != nil);
|
|
|
|
}
|
|
|
|
#endif
|
2019-12-27 21:59:59 +00:00
|
|
|
|
|
|
|
#if 0
|
|
|
|
// NOTE(yuval): Context Setup
|
|
|
|
Thread_Context _tctx = {};
|
|
|
|
thread_ctx_init(&_tctx, ThreadKind_Main,
|
|
|
|
get_base_allocator_system(),
|
|
|
|
get_base_allocator_system());
|
|
|
|
|
|
|
|
mac_vars.tctx = &_tctx;
|
|
|
|
|
|
|
|
API_VTable_system system_vtable = {};
|
|
|
|
system_api_fill_vtable(&system_vtable);
|
|
|
|
|
|
|
|
API_VTable_graphics graphics_vtable = {};
|
|
|
|
graphics_api_fill_vtable(&graphics_vtable);
|
|
|
|
|
|
|
|
API_VTable_font font_vtable = {};
|
|
|
|
font_api_fill_vtable(&font_vtable);
|
|
|
|
|
|
|
|
// NOTE(yuval): Memory
|
|
|
|
mac_vars.frame_arena = reserve_arena(mac_vars.tctx);
|
|
|
|
target.arena = make_arena_system(KB(256));
|
|
|
|
|
|
|
|
mac_vars.cursor_show = MouseCursorShow_Always;
|
|
|
|
mac_vars.prev_cursor_show = MouseCursorShow_Always;
|
|
|
|
|
|
|
|
dll_init_sentinel(&mac_vars.free_mac_objects);
|
|
|
|
dll_init_sentinel(&mac_vars.timer_objects);
|
2019-12-30 00:33:30 +00:00
|
|
|
|
|
|
|
// NOTE(yuval): Get the timebase info
|
|
|
|
mach_timebase_info(&mac_vars.timebase_info);
|
2019-12-27 21:59:59 +00:00
|
|
|
#endif
|
2019-12-24 14:57:05 +00:00
|
|
|
|
2019-12-24 20:31:24 +00:00
|
|
|
#if 0
|
2019-12-23 23:22:56 +00:00
|
|
|
// NOTE(yuval): Application Core Update
|
|
|
|
Application_Step_Result result = {};
|
|
|
|
if (app.step != 0){
|
|
|
|
result = app.step(mac_vars.tctx, &target, base_ptr, &input);
|
|
|
|
}
|
2019-12-24 20:31:24 +00:00
|
|
|
#endif
|
2019-12-23 00:39:44 +00:00
|
|
|
}
|
|
|
|
}
|