From 890497a56fde7a4c234d236c3c97afaaddcb1824 Mon Sep 17 00:00:00 2001 From: ultramn Date: Wed, 17 May 2017 18:51:22 -0700 Subject: Included CNFGCocoaNSImageDriver now default --- Makefile | 8 +++++--- redist/CocoaDriver.m | 6 +++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 2f4ab5c..69b8e37 100644 --- a/Makefile +++ b/Makefile @@ -17,8 +17,10 @@ ifeq ($(UNAME), Darwin) CFLAGS:=$(CFLAGS) -DRASTERIZER -DHIDAPI -I/usr/local/include -x objective-c LDFLAGS:=$(LDFLAGS) -framework OpenGL -framework Cocoa -framework IOKit -DRAWFUNCTIONS=redist/CNFGFunctions.c redist/CocoaDriver.m -GRAPHICS_LOFI:=redist/CNFGFunctions.o redist/CocoaDriver.o +#DRAWFUNCTIONS=redist/CNFGFunctions.c redist/CocoaDriver.m +#GRAPHICS_LOFI:=redist/CNFGFunctions.o redist/CocoaDriver.o +DRAWFUNCTIONS=redist/CNFGFunctions.c redist/CNFGCocoaNSImageDriver.m +GRAPHICS_LOFI:=redist/CNFGFunctions.o redist/CNFGCocoaNSImageDriver.o # Linux / FreeBSD else @@ -90,7 +92,7 @@ calibrate_tcc : $(LIBSURVIVE_C) tcc -DRUNTIME_SYMNUM $(CFLAGS) -o $@ $^ $(LDFLAGS) calibrate.c redist/os_generic.c $(DRAWFUNCTIONS) redist/symbol_enumerator.c clean : - rm -rf *.o src/*.o *~ src/*~ test data_recorder calibrate lib/libsurvive.so redist/*.o redist/*~ + rm -rf *.o src/*.o *~ src/*~ test data_recorder calibrate testCocoa lib/libsurvive.so redist/*.o redist/*~ diff --git a/redist/CocoaDriver.m b/redist/CocoaDriver.m index 842d372..2181e28 100644 --- a/redist/CocoaDriver.m +++ b/redist/CocoaDriver.m @@ -456,6 +456,7 @@ void CNFGSetup( const char * WindowName, int sw, int sh ) app_window = [[[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, sw, sh) styleMask:NSTitledWindowMask backing:NSBackingStoreBuffered defer:NO] autorelease]; + app_oglView = [[[MyOpenGLView alloc] initWithFrame:NSMakeRect(0, 0, sw, sh) ] autorelease]; [app_window setContentView:app_oglView]; [app_window cascadeTopLeftFromPoint:NSMakePoint(20,20)]; @@ -467,7 +468,6 @@ void CNFGSetup( const char * WindowName, int sw, int sh ) oglCompatibilityInit(sw*sh); // Initialize the OpenGL compatibility layer - //-------------------- // Clear the screen to black //-------------------- @@ -478,6 +478,7 @@ void CNFGSetup( const char * WindowName, int sw, int sh ) // Peek at the next event app_currDate = [[NSDate alloc] init]; + NSEvent *event = [NSApp nextEventMatchingMask:NSAnyEventMask @@ -485,7 +486,7 @@ void CNFGSetup( const char * WindowName, int sw, int sh ) inMode:NSEventTrackingRunLoopMode dequeue:YES]; [app_currDate release]; - + [NSApp updateWindows]; glClearColor(0.0,0.0,0.0,0.0); @@ -493,7 +494,6 @@ void CNFGSetup( const char * WindowName, int sw, int sh ) [app_oglContext flushBuffer]; - // Set up a 2D projection //oglMatrixMode(OGL_PROJECTION); // Select The Projection Matrix //oglLoadIdentity(); // Reset The Projection Matrix -- cgit v1.2.3