sgl

diff src/wsys_ios.m @ 40:f7de32814f34

sortof made the ios backend to compile and run ... sortof
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 28 Jun 2012 03:42:26 +0300
parents e1a27aa24956
children
line diff
     1.1 --- a/src/wsys_ios.m	Wed Jun 27 05:54:57 2012 +0300
     1.2 +++ b/src/wsys_ios.m	Thu Jun 28 03:42:26 2012 +0300
     1.3 @@ -1,8 +1,6 @@
     1.4  /* SimplyGL window system module for iOS */
     1.5  /* mac-framework: -framework UIKit */
     1.6  
     1.7 -#include "config.h"
     1.8 -
     1.9  #ifdef USE_WSYS_MODULE_IOS
    1.10  
    1.11  #include <assert.h>
    1.12 @@ -10,6 +8,8 @@
    1.13  #import <QuartzCore/QuartzCore.h>
    1.14  #include <OpenGLES/ES2/gl.h>
    1.15  #include <OpenGLES/ES2/glext.h>
    1.16 +#include "sgl.h"
    1.17 +#include "wsys.h"
    1.18  
    1.19  @interface SGLView : UIView {
    1.20  @private
    1.21 @@ -35,6 +35,7 @@
    1.22  	SGLView *view;
    1.23  }
    1.24  
    1.25 +
    1.26  @property (nonatomic, retain) IBOutlet UIWindow *win;
    1.27  @property (nonatomic, retain) IBOutlet SGLView *view;
    1.28  @end
    1.29 @@ -333,7 +334,13 @@
    1.30  
    1.31  static int process_events(void)
    1.32  {
    1.33 -	return -1;
    1.34 +	char *argv[] = {"foobar", 0};
    1.35 +	NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    1.36 +	
    1.37 +	int res = UIApplicationMain(1, argv, 0, @"SGLDelegate");
    1.38 +	
    1.39 +	[pool release];
    1.40 +	return res;
    1.41  }
    1.42  
    1.43  
    1.44 @@ -363,7 +370,7 @@
    1.45  
    1.46  void sgl_modules_init(void)
    1.47  {
    1.48 -	sgl_register_uikit();
    1.49 +	sgl_register_ios();
    1.50  }
    1.51  
    1.52  #endif	/* XCODE_BUILD */