aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorultramn <dchapm2@umbc.edu>2017-05-17 18:51:22 -0700
committerultramn <dchapm2@umbc.edu>2017-05-17 18:51:22 -0700
commit890497a56fde7a4c234d236c3c97afaaddcb1824 (patch)
treee374a4a03343eb3775bc3c03674c0750cd8ffa0a
parentf811151049ca98e955c6d824be9f939b4e55a491 (diff)
downloadlibsurvive-890497a56fde7a4c234d236c3c97afaaddcb1824.tar.gz
libsurvive-890497a56fde7a4c234d236c3c97afaaddcb1824.tar.bz2
Included CNFGCocoaNSImageDriver now default
-rw-r--r--Makefile8
-rw-r--r--redist/CocoaDriver.m6
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