iOS frontend and XCode project
This commit is contained in:
33
JGE/src/iOS/EAGLView.h
Executable file
33
JGE/src/iOS/EAGLView.h
Executable file
@@ -0,0 +1,33 @@
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <QuartzCore/QuartzCore.h>
|
||||
|
||||
#import "ESRenderer.h"
|
||||
|
||||
// This class wraps the CAEAGLLayer from CoreAnimation into a convenient UIView subclass.
|
||||
// The view content is basically an EAGL surface you render your OpenGL scene into.
|
||||
// Note that setting the view non-opaque will only work if the EAGL surface has an alpha channel.
|
||||
@interface EAGLView : UIView
|
||||
{
|
||||
@private
|
||||
id <ESRenderer> renderer;
|
||||
|
||||
BOOL animating;
|
||||
BOOL started;
|
||||
NSInteger animationFrameInterval;
|
||||
// Use of the CADisplayLink class is the preferred method for controlling your animation timing.
|
||||
// CADisplayLink will link to the main display and fire every vsync when added to a given run-loop.
|
||||
// The NSTimer class is used only as fallback when running on a pre 3.1 device where CADisplayLink
|
||||
// isn't available.
|
||||
id displayLink;
|
||||
CGPoint currentLocation;
|
||||
}
|
||||
|
||||
@property (readonly, nonatomic, getter=isAnimating) BOOL animating;
|
||||
@property (nonatomic) NSInteger animationFrameInterval;
|
||||
@property(nonatomic, readwrite) CGPoint currentLocation;
|
||||
|
||||
- (void)startAnimation;
|
||||
- (void)stopAnimation;
|
||||
- (void)drawView:(id)sender;
|
||||
|
||||
@end
|
||||
349
JGE/src/iOS/EAGLView.m
Executable file
349
JGE/src/iOS/EAGLView.m
Executable file
@@ -0,0 +1,349 @@
|
||||
#import "EAGLView.h"
|
||||
|
||||
#import "ES2Renderer.h"
|
||||
|
||||
#include <sys/time.h>
|
||||
#include "JGE.h"
|
||||
#include "JTypes.h"
|
||||
#include "JApp.h"
|
||||
#include "JFileSystem.h"
|
||||
#include "JRenderer.h"
|
||||
#include "JGameLauncher.h"
|
||||
|
||||
|
||||
uint64_t lastTickCount;
|
||||
JGE* g_engine = NULL;
|
||||
static JApp* g_app = NULL;
|
||||
static JGameLauncher* g_launcher = NULL;
|
||||
|
||||
void JGECreateDefaultBindings()
|
||||
{
|
||||
}
|
||||
|
||||
int JGEGetTime()
|
||||
{
|
||||
return CFAbsoluteTimeGetCurrent() * 1000;
|
||||
}
|
||||
|
||||
bool InitGame(void)
|
||||
{
|
||||
g_engine = JGE::GetInstance();
|
||||
g_app = g_launcher->GetGameApp();
|
||||
g_app->Create();
|
||||
g_engine->SetApp(g_app);
|
||||
|
||||
JRenderer::GetInstance()->Enable2D();
|
||||
struct timeval tv;
|
||||
gettimeofday(&tv, NULL);
|
||||
lastTickCount = tv.tv_sec * 1000 + tv.tv_usec / 1000;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void DestroyGame(void)
|
||||
{
|
||||
g_engine->SetApp(NULL);
|
||||
if (g_app)
|
||||
{
|
||||
g_app->Destroy();
|
||||
delete g_app;
|
||||
g_app = NULL;
|
||||
}
|
||||
|
||||
JGE::Destroy();
|
||||
|
||||
g_engine = NULL;
|
||||
}
|
||||
|
||||
|
||||
@implementation EAGLView
|
||||
|
||||
@synthesize animating;
|
||||
@dynamic animationFrameInterval;
|
||||
@synthesize currentLocation;
|
||||
|
||||
// You must implement this method
|
||||
+ (Class)layerClass
|
||||
{
|
||||
return [CAEAGLLayer class];
|
||||
}
|
||||
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[renderer release];
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
-(id)initWithFrame:(CGRect)frame {
|
||||
|
||||
NSLog(@"EAGL View - init With Frame: origin(%f %f) size(%f %f)",
|
||||
frame.origin.x, frame.origin.y, frame.size.width, frame.size.height);
|
||||
|
||||
if ((self = [super initWithFrame:frame])) {
|
||||
|
||||
self = [self initialize];
|
||||
|
||||
} // if ((self = [super initWithFrame:frame]))
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
//The EAGL view is stored in the nib file. When it's unarchived it's sent -initWithCoder:
|
||||
- (id)initWithCoder:(NSCoder*)coder
|
||||
{
|
||||
if ((self = [super initWithCoder:coder]))
|
||||
{
|
||||
self = [self initialize];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
-(id)initialize {
|
||||
|
||||
NSLog(@"EAGL View - initialize EAGL");
|
||||
|
||||
CAEAGLLayer *eaglLayer = (CAEAGLLayer *)self.layer;
|
||||
|
||||
NSLog(@"bounds: %f %f %f %f", eaglLayer.bounds.origin.x, eaglLayer.bounds.origin.y, eaglLayer.bounds.size.width, eaglLayer.bounds.size.height);
|
||||
|
||||
eaglLayer.opaque = TRUE;
|
||||
eaglLayer.drawableProperties = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
[NSNumber numberWithBool:FALSE], kEAGLDrawablePropertyRetainedBacking,
|
||||
kEAGLColorFormatRGBA8, kEAGLDrawablePropertyColorFormat,
|
||||
nil];
|
||||
|
||||
renderer = [[ES2Renderer alloc] init];
|
||||
|
||||
if (!renderer)
|
||||
{
|
||||
NSLog(@"OpenGl ES2 Renderer creation failed, time to code some OpenGl ES1.1 Renderer !!!");
|
||||
|
||||
[self release];
|
||||
return nil;
|
||||
}
|
||||
|
||||
animating = FALSE;
|
||||
started = FALSE;
|
||||
animationFrameInterval = 1;
|
||||
displayLink = nil;
|
||||
|
||||
UIGestureRecognizer *recognizer;
|
||||
|
||||
/*
|
||||
Create a double tap recognizer to handle OK.
|
||||
*/
|
||||
recognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleOK:)];
|
||||
[self addGestureRecognizer:recognizer];
|
||||
((UITapGestureRecognizer*)recognizer).numberOfTapsRequired = 2;
|
||||
[recognizer release];
|
||||
|
||||
/*
|
||||
Create a 2 fingers right swipe gesture recognizer to handle next phase.
|
||||
*/
|
||||
recognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleNextPhase:)];
|
||||
((UISwipeGestureRecognizer*)recognizer).direction = UISwipeGestureRecognizerDirectionRight;
|
||||
((UISwipeGestureRecognizer*)recognizer).numberOfTouchesRequired = 2;
|
||||
[self addGestureRecognizer:recognizer];
|
||||
[recognizer release];
|
||||
|
||||
/*
|
||||
Create a 2 fingers left swipe gesture recognizer to handle interruption.
|
||||
*/
|
||||
recognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleInterrupt:)];
|
||||
((UISwipeGestureRecognizer*)recognizer).direction = UISwipeGestureRecognizerDirectionLeft;
|
||||
((UISwipeGestureRecognizer*)recognizer).numberOfTouchesRequired = 2;
|
||||
[self addGestureRecognizer:recognizer];
|
||||
[recognizer release];
|
||||
|
||||
/*
|
||||
Create a 3 fingers up swipe gesture recognizer to handle menu.
|
||||
*/
|
||||
recognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleMenu:)];
|
||||
((UISwipeGestureRecognizer*)recognizer).direction = UISwipeGestureRecognizerDirectionUp;
|
||||
((UISwipeGestureRecognizer*)recognizer).numberOfTouchesRequired = 3;
|
||||
[self addGestureRecognizer:recognizer];
|
||||
[recognizer release];
|
||||
|
||||
/*
|
||||
Create a 2 fingers long press gesture recognizer to handle hand display.
|
||||
*/
|
||||
recognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleHand:)];
|
||||
((UILongPressGestureRecognizer*)recognizer).minimumPressDuration = 1;
|
||||
((UILongPressGestureRecognizer*)recognizer).numberOfTouchesRequired = 2;
|
||||
|
||||
[self addGestureRecognizer:recognizer];
|
||||
[recognizer release];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)handleHand:(UILongPressGestureRecognizer *)recognizer {
|
||||
g_engine->HoldKey_NoRepeat(JGE_BTN_NEXT);
|
||||
}
|
||||
|
||||
- (void)handleMenu:(UISwipeGestureRecognizer *)recognizer {
|
||||
g_engine->HoldKey_NoRepeat(JGE_BTN_MENU);
|
||||
}
|
||||
|
||||
- (void)handleInterrupt:(UISwipeGestureRecognizer *)recognizer {
|
||||
g_engine->HoldKey_NoRepeat(JGE_BTN_SEC);
|
||||
}
|
||||
|
||||
- (void)handleNextPhase:(UISwipeGestureRecognizer *)recognizer {
|
||||
g_engine->HoldKey_NoRepeat(JGE_BTN_PREV);
|
||||
}
|
||||
|
||||
- (void)handleOK:(UITapGestureRecognizer *)recognizer {
|
||||
g_engine->HoldKey_NoRepeat(JGE_BTN_OK);
|
||||
}
|
||||
|
||||
- (void)drawView:(id)sender
|
||||
{
|
||||
[renderer render];
|
||||
}
|
||||
|
||||
- (void)layoutSubviews
|
||||
{
|
||||
[self stopAnimation];
|
||||
[renderer resizeFromLayer:(CAEAGLLayer*)self.layer];
|
||||
[self startAnimation];
|
||||
|
||||
[self drawView:nil];
|
||||
}
|
||||
|
||||
- (NSInteger)animationFrameInterval
|
||||
{
|
||||
return animationFrameInterval;
|
||||
}
|
||||
|
||||
- (void)setAnimationFrameInterval:(NSInteger)frameInterval
|
||||
{
|
||||
// Frame interval defines how many display frames must pass between each time the
|
||||
// display link fires. The display link will only fire 30 times a second when the
|
||||
// frame internal is two on a display that refreshes 60 times a second. The default
|
||||
// frame interval setting of one will fire 60 times a second when the display refreshes
|
||||
// at 60 times a second. A frame interval setting of less than one results in undefined
|
||||
// behavior.
|
||||
if (frameInterval >= 1)
|
||||
{
|
||||
animationFrameInterval = frameInterval;
|
||||
|
||||
if (animating)
|
||||
{
|
||||
[self stopAnimation];
|
||||
[self startAnimation];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)startAnimation
|
||||
{
|
||||
if (!animating)
|
||||
{
|
||||
// CADisplayLink is API new to iPhone SDK 3.1. Compiling against earlier versions will result in a warning, but can be dismissed
|
||||
// if the system version runtime check for CADisplayLink exists in -initWithCoder:. The runtime check ensures this code will
|
||||
// not be called in system versions earlier than 3.1.
|
||||
|
||||
displayLink = [NSClassFromString(@"CADisplayLink") displayLinkWithTarget:self selector:@selector(drawView:)];
|
||||
[displayLink setFrameInterval:animationFrameInterval];
|
||||
[displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
|
||||
|
||||
animating = TRUE;
|
||||
}
|
||||
|
||||
if(!started)
|
||||
{
|
||||
// Init JGE mess
|
||||
g_launcher = new JGameLauncher();
|
||||
|
||||
u32 flags = g_launcher->GetInitFlags();
|
||||
|
||||
if ((flags&JINIT_FLAG_ENABLE3D)!=0)
|
||||
{
|
||||
JRenderer::Set3DFlag(true);
|
||||
}
|
||||
|
||||
if (!InitGame())
|
||||
{
|
||||
//return 1;
|
||||
}
|
||||
|
||||
JGECreateDefaultBindings();
|
||||
|
||||
started = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)stopAnimation
|
||||
{
|
||||
if (animating)
|
||||
{
|
||||
[displayLink invalidate];
|
||||
displayLink = nil;
|
||||
|
||||
animating = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
// Handles the start of a touch
|
||||
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
|
||||
{
|
||||
UITouch* touch = [[event touchesForView:self] anyObject];
|
||||
|
||||
// Convert touch point from UIView referential to OpenGL one (upside-down flip)
|
||||
currentLocation = [touch previousLocationInView:self];
|
||||
ES2Renderer* es2renderer = (ES2Renderer*)renderer;
|
||||
|
||||
int actualWidth = (int) JRenderer::GetInstance()->GetActualWidth();
|
||||
int actualHeight = (int) JRenderer::GetInstance()->GetActualHeight();
|
||||
if (currentLocation.y >= es2renderer.viewPort.top &&
|
||||
currentLocation.y <= es2renderer.viewPort.bottom &&
|
||||
currentLocation.x <= es2renderer.viewPort.right &&
|
||||
currentLocation.x >= es2renderer.viewPort.left) {
|
||||
g_engine->LeftClicked(
|
||||
((currentLocation.x-es2renderer.viewPort.left)*SCREEN_WIDTH)/actualWidth,
|
||||
((currentLocation.y-es2renderer.viewPort.top)*SCREEN_HEIGHT)/actualHeight);
|
||||
} else if(currentLocation.y<es2renderer.viewPort.top) {
|
||||
g_engine->HoldKey_NoRepeat(JGE_BTN_MENU);
|
||||
} else if(currentLocation.y>es2renderer.viewPort.bottom) {
|
||||
g_engine->HoldKey_NoRepeat(JGE_BTN_NEXT);
|
||||
}
|
||||
}
|
||||
|
||||
// Handles the continuation of a touch.
|
||||
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
|
||||
{
|
||||
UITouch* touch = [[event touchesForView:self] anyObject];
|
||||
|
||||
// Convert touch point from UIView referential to OpenGL one (upside-down flip)
|
||||
currentLocation = [touch previousLocationInView:self];
|
||||
ES2Renderer* es2renderer = (ES2Renderer*)renderer;
|
||||
|
||||
int actualWidth = (int) JRenderer::GetInstance()->GetActualWidth();
|
||||
int actualHeight = (int) JRenderer::GetInstance()->GetActualHeight();
|
||||
if (currentLocation.y >= es2renderer.viewPort.top &&
|
||||
currentLocation.y <= es2renderer.viewPort.bottom &&
|
||||
currentLocation.x <= es2renderer.viewPort.right &&
|
||||
currentLocation.x >= es2renderer.viewPort.left) {
|
||||
g_engine->LeftClicked(
|
||||
((currentLocation.x-es2renderer.viewPort.left)*SCREEN_WIDTH)/actualWidth,
|
||||
((currentLocation.y-es2renderer.viewPort.top)*SCREEN_HEIGHT)/actualHeight);
|
||||
} else if(currentLocation.y<es2renderer.viewPort.top) {
|
||||
g_engine->HoldKey_NoRepeat(JGE_BTN_MENU);
|
||||
} else if(currentLocation.y>es2renderer.viewPort.bottom) {
|
||||
g_engine->HoldKey_NoRepeat(JGE_BTN_NEXT);
|
||||
}
|
||||
}
|
||||
|
||||
// Handles the end of a touch event.
|
||||
- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event
|
||||
{
|
||||
// If appropriate, add code necessary to save the state of the application.
|
||||
// This application is not saving state.
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
7
JGE/src/iOS/EAGLViewController.h
Executable file
7
JGE/src/iOS/EAGLViewController.h
Executable file
@@ -0,0 +1,7 @@
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface EAGLViewController : UIViewController {
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
171
JGE/src/iOS/EAGLViewController.m
Executable file
171
JGE/src/iOS/EAGLViewController.m
Executable file
@@ -0,0 +1,171 @@
|
||||
#import "EAGLViewController.h"
|
||||
#import "EAGLView.h"
|
||||
|
||||
|
||||
|
||||
@interface EAGLViewController (PrivateMethods)
|
||||
- (NSString*)interfaceOrientationName:(UIInterfaceOrientation) interfaceOrientation;
|
||||
- (NSString*)deviceOrientationName:(UIDeviceOrientation) deviceOrientation;
|
||||
@end
|
||||
|
||||
@implementation EAGLViewController
|
||||
|
||||
- (id)init {
|
||||
self = [super init];
|
||||
if (self) {
|
||||
// Custom initialization.
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
||||
// Implement loadView to create a view hierarchy programmatically, without using a nib.
|
||||
- (void)loadView {
|
||||
NSLog(@"EAGL ViewController - loadView");
|
||||
|
||||
CGRect frame = [[UIScreen mainScreen] applicationFrame];
|
||||
|
||||
EAGLView *eaglView = [[[EAGLView alloc] initWithFrame:frame] autorelease];
|
||||
|
||||
self.view = eaglView;
|
||||
}
|
||||
|
||||
|
||||
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
|
||||
- (void)viewDidLoad {
|
||||
NSLog(@"EAGL ViewController - view Did Load");
|
||||
[super viewDidLoad];
|
||||
}
|
||||
|
||||
- (void)viewWillAppear:(BOOL)animated {
|
||||
|
||||
NSLog(@"EAGL ViewController - view Will Appear");
|
||||
|
||||
}
|
||||
|
||||
|
||||
- (void)viewDidAppear:(BOOL)animated {
|
||||
|
||||
NSLog(@"EAGL ViewController - view Did Appear");
|
||||
|
||||
UIDeviceOrientation currentDeviceOrientation = [UIDevice currentDevice].orientation;
|
||||
UIInterfaceOrientation currentInterfaceOrientation = self.interfaceOrientation;
|
||||
|
||||
NSLog(@"Current Interface: %@. Current Device: %@",
|
||||
[self interfaceOrientationName:currentInterfaceOrientation],
|
||||
[self deviceOrientationName:currentDeviceOrientation]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
|
||||
// Overriden to allow any orientation.
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
|
||||
|
||||
UIDeviceOrientation currentDeviceOrientation = [UIDevice currentDevice].orientation;
|
||||
UIInterfaceOrientation currentInterfaceOrientation = self.interfaceOrientation;
|
||||
|
||||
NSLog(@"EAGL ViewController - will Rotate To Interface: %@. Current Interface: %@. Current Device: %@",
|
||||
[self interfaceOrientationName:toInterfaceOrientation],
|
||||
[self interfaceOrientationName:currentInterfaceOrientation],
|
||||
[self deviceOrientationName:currentDeviceOrientation]);
|
||||
|
||||
}
|
||||
|
||||
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
|
||||
|
||||
UIDeviceOrientation currentDeviceOrientation = [UIDevice currentDevice].orientation;
|
||||
UIInterfaceOrientation currentInterfaceOrientation = self.interfaceOrientation;
|
||||
|
||||
NSLog(@"EAGL ViewController - did Rotate From Interface: %@. Current Interface: %@. Current Device: %@",
|
||||
[self interfaceOrientationName:fromInterfaceOrientation],
|
||||
[self interfaceOrientationName:currentInterfaceOrientation],
|
||||
[self deviceOrientationName:currentDeviceOrientation]);
|
||||
|
||||
}
|
||||
|
||||
|
||||
- (void)didReceiveMemoryWarning {
|
||||
// Releases the view if it doesn't have a superview.
|
||||
[super didReceiveMemoryWarning];
|
||||
|
||||
// Release any cached data, images, etc. that aren't in use.
|
||||
}
|
||||
|
||||
|
||||
- (void)viewDidUnload {
|
||||
[super viewDidUnload];
|
||||
// Release any retained subviews of the main view.
|
||||
// e.g. self.myOutlet = nil;
|
||||
}
|
||||
|
||||
|
||||
- (NSString*)interfaceOrientationName:(UIInterfaceOrientation) interfaceOrientation {
|
||||
|
||||
NSString* result = nil;
|
||||
|
||||
switch (interfaceOrientation) {
|
||||
|
||||
case UIInterfaceOrientationPortrait:
|
||||
result = @"Portrait";
|
||||
break;
|
||||
case UIInterfaceOrientationPortraitUpsideDown:
|
||||
result = @"Portrait UpsideDown";
|
||||
break;
|
||||
case UIInterfaceOrientationLandscapeLeft:
|
||||
result = @"LandscapeLeft";
|
||||
break;
|
||||
case UIInterfaceOrientationLandscapeRight:
|
||||
result = @"LandscapeRight";
|
||||
break;
|
||||
default:
|
||||
result = @"Unknown Interface Orientation";
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
- (NSString*)deviceOrientationName:(UIDeviceOrientation) deviceOrientation {
|
||||
|
||||
NSString* result = nil;
|
||||
|
||||
switch (deviceOrientation) {
|
||||
|
||||
case UIDeviceOrientationUnknown:
|
||||
result = @"Unknown";
|
||||
break;
|
||||
case UIDeviceOrientationPortrait:
|
||||
result = @"Portrait";
|
||||
break;
|
||||
case UIDeviceOrientationPortraitUpsideDown:
|
||||
result = @"Portrait UpsideDown";
|
||||
break;
|
||||
case UIDeviceOrientationLandscapeLeft:
|
||||
result = @"LandscapeLeft";
|
||||
break;
|
||||
case UIDeviceOrientationLandscapeRight:
|
||||
result = @"LandscapeRight";
|
||||
break;
|
||||
case UIDeviceOrientationFaceUp:
|
||||
result = @"FaceUp";
|
||||
break;
|
||||
case UIDeviceOrientationFaceDown:
|
||||
result = @"FaceDown";
|
||||
break;
|
||||
default:
|
||||
result = @"Unknown Device Orientation";
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@end
|
||||
333
JGE/src/iOS/EAGLViewController.xib
Executable file
333
JGE/src/iOS/EAGLViewController.xib
Executable file
@@ -0,0 +1,333 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="7.10">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">800</int>
|
||||
<string key="IBDocument.SystemVersion">10D573</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">762</string>
|
||||
<string key="IBDocument.AppKitVersion">1038.29</string>
|
||||
<string key="IBDocument.HIToolboxVersion">460.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys" id="0">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
</object>
|
||||
<reference key="IBDocument.PluginDependencies" ref="0"/>
|
||||
<object class="NSMutableDictionary" key="IBDocument.Metadata">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference key="dict.sortedKeys" ref="0"/>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBProxyObject" id="841351856">
|
||||
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
|
||||
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
|
||||
</object>
|
||||
<object class="IBProxyObject" id="371349661">
|
||||
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
|
||||
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBObjectContainer" key="IBDocument.Objects">
|
||||
<object class="NSMutableArray" key="connectionRecords">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
</object>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
<object class="NSArray" key="orderedObjects">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">0</int>
|
||||
<reference key="object" ref="0"/>
|
||||
<reference key="children" ref="1000"/>
|
||||
<nil key="parent"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-1</int>
|
||||
<reference key="object" ref="841351856"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
<string key="objectName">EAGL View Controller</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-2</int>
|
||||
<reference key="object" ref="371349661"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="flattenedProperties">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>-1.CustomClassName</string>
|
||||
<string>-2.CustomClassName</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>EAGLViewController</string>
|
||||
<string>UIResponder</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="unlocalizedProperties">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference key="dict.sortedKeys" ref="0"/>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
</object>
|
||||
</object>
|
||||
<nil key="activeLocalization"/>
|
||||
<object class="NSMutableDictionary" key="localizations">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference key="dict.sortedKeys" ref="0"/>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
</object>
|
||||
</object>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">3</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">EAGLViewController</string>
|
||||
<string key="superclassName">UIViewController</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">Classes/EAGLViewController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">Foundation.framework/Headers/NSError.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">Foundation.framework/Headers/NSFileManager.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">Foundation.framework/Headers/NSKeyValueCoding.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">Foundation.framework/Headers/NSKeyValueObserving.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">Foundation.framework/Headers/NSKeyedArchiver.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">Foundation.framework/Headers/NSNetServices.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">Foundation.framework/Headers/NSObject.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">Foundation.framework/Headers/NSPort.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">Foundation.framework/Headers/NSRunLoop.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">Foundation.framework/Headers/NSStream.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">Foundation.framework/Headers/NSThread.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">Foundation.framework/Headers/NSURL.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">Foundation.framework/Headers/NSURLConnection.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">Foundation.framework/Headers/NSXMLParser.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">QuartzCore.framework/Headers/CAAnimation.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">QuartzCore.framework/Headers/CALayer.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">UIKit.framework/Headers/UIAccessibility.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">UIKit.framework/Headers/UINibLoading.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="633373281">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">UIKit.framework/Headers/UIResponder.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">UIResponder</string>
|
||||
<string key="superclassName">NSObject</string>
|
||||
<reference key="sourceIdentifier" ref="633373281"/>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">UISearchBar</string>
|
||||
<string key="superclassName">UIView</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">UIKit.framework/Headers/UISearchBar.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">UISearchDisplayController</string>
|
||||
<string key="superclassName">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">UIKit.framework/Headers/UISearchDisplayController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">UIView</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">UIKit.framework/Headers/UITextField.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">UIView</string>
|
||||
<string key="superclassName">UIResponder</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">UIKit.framework/Headers/UIView.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">UIViewController</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">UIKit.framework/Headers/UINavigationController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">UIViewController</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">UIKit.framework/Headers/UIPopoverController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">UIViewController</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">UIKit.framework/Headers/UISplitViewController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">UIViewController</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">UIKit.framework/Headers/UITabBarController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">UIViewController</string>
|
||||
<string key="superclassName">UIResponder</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">UIKit.framework/Headers/UIViewController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<int key="IBDocument.localizationMode">0</int>
|
||||
<string key="IBDocument.TargetRuntimeIdentifier">IBIPadFramework</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
|
||||
<integer value="800" key="NS.object.0"/>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
|
||||
<integer value="3100" key="NS.object.0"/>
|
||||
</object>
|
||||
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
|
||||
<string key="IBDocument.LastKnownRelativeProjectPath">wagic.xcodeproj</string>
|
||||
<int key="IBDocument.defaultPropertyAccessControl">3</int>
|
||||
<string key="IBCocoaTouchPluginVersion">87</string>
|
||||
</data>
|
||||
</archive>
|
||||
27
JGE/src/iOS/ES2Renderer.h
Executable file
27
JGE/src/iOS/ES2Renderer.h
Executable file
@@ -0,0 +1,27 @@
|
||||
#import "ESRenderer.h"
|
||||
|
||||
#import <OpenGLES/ES2/gl.h>
|
||||
#import <OpenGLES/ES2/glext.h>
|
||||
|
||||
@interface ES2Renderer : NSObject <ESRenderer>
|
||||
{
|
||||
@private
|
||||
EAGLContext *context;
|
||||
|
||||
// The pixel dimensions of the CAEAGLLayer
|
||||
GLint backingWidth;
|
||||
GLint backingHeight;
|
||||
|
||||
// The OpenGL ES names for the framebuffer and renderbuffer used to render to this view
|
||||
GLuint defaultFramebuffer, colorRenderbuffer;
|
||||
|
||||
Rect viewPort;
|
||||
}
|
||||
|
||||
- (void)render;
|
||||
- (BOOL)resizeFromLayer:(CAEAGLLayer *)layer;
|
||||
|
||||
@property(nonatomic, readwrite) Rect viewPort;
|
||||
@property(nonatomic, readwrite) GLint backingHeight;
|
||||
|
||||
@end
|
||||
192
JGE/src/iOS/ES2Renderer.m
Executable file
192
JGE/src/iOS/ES2Renderer.m
Executable file
@@ -0,0 +1,192 @@
|
||||
#import "ES2Renderer.h"
|
||||
|
||||
#include <sys/time.h>
|
||||
#include "JGE.h"
|
||||
#include "JTypes.h"
|
||||
#include "JApp.h"
|
||||
#include "JFileSystem.h"
|
||||
#include "JRenderer.h"
|
||||
#include "JGameLauncher.h"
|
||||
|
||||
#define ACTUAL_SCREEN_WIDTH (SCREEN_WIDTH)
|
||||
#define ACTUAL_SCREEN_HEIGHT (SCREEN_HEIGHT)
|
||||
#define ACTUAL_RATIO ((GLfloat)ACTUAL_SCREEN_WIDTH / (GLfloat)ACTUAL_SCREEN_HEIGHT)
|
||||
|
||||
extern JGE* g_engine;
|
||||
extern uint64_t lastTickCount;
|
||||
bool checkFramebufferStatus();
|
||||
|
||||
|
||||
@implementation ES2Renderer
|
||||
|
||||
@synthesize viewPort;
|
||||
@synthesize backingHeight;
|
||||
|
||||
// Create an OpenGL ES 2.0 context
|
||||
- (id)init
|
||||
{
|
||||
if ((self = [super init]))
|
||||
{
|
||||
backingWidth = -1;
|
||||
backingHeight = -1;
|
||||
|
||||
context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
|
||||
|
||||
if (!context || ![EAGLContext setCurrentContext:context])
|
||||
{
|
||||
[self release];
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)render
|
||||
{
|
||||
NSLog(@"Renderer - render");
|
||||
|
||||
struct timeval tv;
|
||||
uint dt;
|
||||
|
||||
// This application only creates a single context which is already set current at this point.
|
||||
// This call is redundant, but needed if dealing with multiple contexts.
|
||||
[EAGLContext setCurrentContext:context];
|
||||
|
||||
// This application only creates a single default framebuffer which is already bound at this point.
|
||||
// This call is redundant, but needed if dealing with multiple framebuffers.
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, defaultFramebuffer);
|
||||
|
||||
if ((GLfloat)backingWidth / (GLfloat)backingHeight < ACTUAL_RATIO)
|
||||
{
|
||||
viewPort.left = 0;
|
||||
viewPort.top = -((backingWidth/ACTUAL_RATIO)-backingHeight)/2;
|
||||
viewPort.right = backingWidth;
|
||||
viewPort.bottom = -((backingWidth/ACTUAL_RATIO)-backingHeight)/2 + backingWidth / ACTUAL_RATIO;
|
||||
}
|
||||
else
|
||||
{
|
||||
viewPort.left = -(backingHeight*ACTUAL_RATIO-backingWidth)/2;
|
||||
viewPort.top = 0;
|
||||
viewPort.right = backingHeight * ACTUAL_RATIO;
|
||||
viewPort.bottom = -((backingWidth/ACTUAL_RATIO)-backingHeight)/2 + backingWidth / ACTUAL_RATIO + backingHeight;
|
||||
}
|
||||
|
||||
glViewport(viewPort.left, viewPort.top, viewPort.right-viewPort.left, viewPort.bottom-viewPort.top);
|
||||
|
||||
JRenderer::GetInstance()->SetActualWidth(viewPort.right-viewPort.left);
|
||||
JRenderer::GetInstance()->SetActualHeight(viewPort.bottom-viewPort.top);
|
||||
|
||||
|
||||
gettimeofday(&tv, NULL);
|
||||
uint64_t tickCount = tv.tv_sec * 1000 + tv.tv_usec / 1000;
|
||||
dt = (tickCount - lastTickCount);
|
||||
lastTickCount = tickCount;
|
||||
|
||||
g_engine->SetDelta((float)dt / 1000.0f);
|
||||
g_engine->Update((float)dt / 1000.0f);
|
||||
|
||||
g_engine->Render();
|
||||
|
||||
// This application only creates a single color renderbuffer which is already bound at this point.
|
||||
// This call is redundant, but needed if dealing with multiple renderbuffers.
|
||||
glBindRenderbuffer(GL_RENDERBUFFER, colorRenderbuffer);
|
||||
[context presentRenderbuffer:GL_RENDERBUFFER];
|
||||
}
|
||||
|
||||
|
||||
- (BOOL)resizeFromLayer:(CAEAGLLayer *)layer
|
||||
{
|
||||
if(defaultFramebuffer) {
|
||||
glDeleteFramebuffers(1, &defaultFramebuffer);
|
||||
defaultFramebuffer = 0;
|
||||
}
|
||||
|
||||
if(colorRenderbuffer) {
|
||||
glDeleteRenderbuffers(1, &colorRenderbuffer);
|
||||
colorRenderbuffer = 0;
|
||||
}
|
||||
|
||||
glGenFramebuffers(1, &defaultFramebuffer);
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, defaultFramebuffer);
|
||||
|
||||
glGenRenderbuffers(1, &colorRenderbuffer);
|
||||
glBindRenderbuffer(GL_RENDERBUFFER, colorRenderbuffer);
|
||||
|
||||
// Allocate color buffer backing based on the current layer size
|
||||
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, colorRenderbuffer);
|
||||
[context renderbufferStorage:GL_RENDERBUFFER fromDrawable:layer];
|
||||
glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, &backingWidth);
|
||||
glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_HEIGHT, &backingHeight);
|
||||
|
||||
checkFramebufferStatus();
|
||||
|
||||
glDepthFunc(GL_LEQUAL); // The Type Of Depth Testing (Less Or Equal)
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glEnable(GL_CULL_FACE); // do not calculate inside of poly's
|
||||
glFrontFace(GL_CCW);
|
||||
glEnable (GL_BLEND);
|
||||
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
// glEnable(GL_SCISSOR_TEST); // Enable Clipping
|
||||
|
||||
glClearColor(0.0f, 0.0f, 0.0f, 0.0f); // Black Background (yes that's the way fuckers)
|
||||
glClearDepthf(1.0f); // Depth Buffer Setup
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
bool checkFramebufferStatus() {
|
||||
|
||||
GLenum status = (GLenum)glCheckFramebufferStatus(GL_FRAMEBUFFER);
|
||||
|
||||
switch(status) {
|
||||
|
||||
case GL_FRAMEBUFFER_COMPLETE:
|
||||
return true;
|
||||
|
||||
case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT:
|
||||
printf("Framebuffer incomplete,incomplete attachment\n");
|
||||
return false;
|
||||
|
||||
case GL_FRAMEBUFFER_UNSUPPORTED:
|
||||
printf("Unsupported framebuffer format\n");
|
||||
return false;
|
||||
|
||||
case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:
|
||||
printf("Framebuffer incomplete,missing attachment\n");
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
// Tear down GL
|
||||
if (defaultFramebuffer)
|
||||
{
|
||||
glDeleteFramebuffers(1, &defaultFramebuffer);
|
||||
defaultFramebuffer = 0;
|
||||
}
|
||||
|
||||
if (colorRenderbuffer)
|
||||
{
|
||||
glDeleteRenderbuffers(1, &colorRenderbuffer);
|
||||
colorRenderbuffer = 0;
|
||||
}
|
||||
|
||||
// Tear down context
|
||||
if ([EAGLContext currentContext] == context)
|
||||
[EAGLContext setCurrentContext:nil];
|
||||
|
||||
[context release];
|
||||
context = nil;
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@end
|
||||
11
JGE/src/iOS/ESRenderer.h
Executable file
11
JGE/src/iOS/ESRenderer.h
Executable file
@@ -0,0 +1,11 @@
|
||||
#import <QuartzCore/QuartzCore.h>
|
||||
|
||||
#import <OpenGLES/EAGL.h>
|
||||
#import <OpenGLES/EAGLDrawable.h>
|
||||
|
||||
@protocol ESRenderer <NSObject>
|
||||
|
||||
- (void)render;
|
||||
- (BOOL)resizeFromLayer:(CAEAGLLayer *)layer;
|
||||
|
||||
@end
|
||||
465
JGE/src/iOS/MainWindow.xib
Executable file
465
JGE/src/iOS/MainWindow.xib
Executable file
@@ -0,0 +1,465 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="7.10">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1056</int>
|
||||
<string key="IBDocument.SystemVersion">10H574</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">823</string>
|
||||
<string key="IBDocument.AppKitVersion">1038.35</string>
|
||||
<string key="IBDocument.HIToolboxVersion">461.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="NS.object.0">132</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<integer value="11"/>
|
||||
</object>
|
||||
<object class="NSArray" key="IBDocument.PluginDependencies">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="IBDocument.Metadata">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys" id="0">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBProxyObject" id="841351856">
|
||||
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
|
||||
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
|
||||
</object>
|
||||
<object class="IBProxyObject" id="606714003">
|
||||
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
|
||||
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
|
||||
</object>
|
||||
<object class="IBUICustomObject" id="250404236">
|
||||
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
|
||||
</object>
|
||||
<object class="IBUIViewController" id="762928214">
|
||||
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics">
|
||||
<int key="IBUIStatusBarStyle">2</int>
|
||||
</object>
|
||||
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
|
||||
<int key="interfaceOrientation">1</int>
|
||||
</object>
|
||||
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
|
||||
<bool key="IBUIHorizontal">NO</bool>
|
||||
</object>
|
||||
<object class="IBUIWindow" id="62075450">
|
||||
<nil key="NSNextResponder"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrameSize">{768, 1024}</string>
|
||||
<object class="NSColor" key="IBUIBackgroundColor">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MSAxIDEAA</bytes>
|
||||
</object>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
|
||||
<bool key="IBUIVisibleAtLaunch">YES</bool>
|
||||
<bool key="IBUIResizesToFullScreen">YES</bool>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBObjectContainer" key="IBDocument.Objects">
|
||||
<object class="NSMutableArray" key="connectionRecords">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">window</string>
|
||||
<reference key="source" ref="250404236"/>
|
||||
<reference key="destination" ref="62075450"/>
|
||||
</object>
|
||||
<int key="connectionID">7</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">delegate</string>
|
||||
<reference key="source" ref="841351856"/>
|
||||
<reference key="destination" ref="250404236"/>
|
||||
</object>
|
||||
<int key="connectionID">8</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">glViewController</string>
|
||||
<reference key="source" ref="250404236"/>
|
||||
<reference key="destination" ref="762928214"/>
|
||||
</object>
|
||||
<int key="connectionID">12</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
<object class="NSArray" key="orderedObjects">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">0</int>
|
||||
<reference key="object" ref="0"/>
|
||||
<reference key="children" ref="1000"/>
|
||||
<nil key="parent"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-1</int>
|
||||
<reference key="object" ref="841351856"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
<string key="objectName">File's Owner</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-2</int>
|
||||
<reference key="object" ref="606714003"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">2</int>
|
||||
<reference key="object" ref="62075450"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
</object>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">6</int>
|
||||
<reference key="object" ref="250404236"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">11</int>
|
||||
<reference key="object" ref="762928214"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
<string key="objectName">EAGL View Controller</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="flattenedProperties">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>-1.CustomClassName</string>
|
||||
<string>-2.CustomClassName</string>
|
||||
<string>11.CustomClassName</string>
|
||||
<string>11.IBEditorWindowLastContentRect</string>
|
||||
<string>11.IBPluginDependency</string>
|
||||
<string>2.IBEditorWindowLastContentRect</string>
|
||||
<string>2.IBPluginDependency</string>
|
||||
<string>2.IBViewBoundsToFrameTransform</string>
|
||||
<string>6.CustomClassName</string>
|
||||
<string>6.IBPluginDependency</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>UIApplication</string>
|
||||
<string>UIResponder</string>
|
||||
<string>EAGLViewController</string>
|
||||
<string>{{-4, -150}, {500, 698}}</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>{{0, 4}, {783, 852}}</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<object class="NSAffineTransform">
|
||||
<bytes key="NSTransformStruct">P4AAAL+AAAAAAAAAxH+AAA</bytes>
|
||||
</object>
|
||||
<string>wagicAppDelegate</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="unlocalizedProperties">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference key="dict.sortedKeys" ref="0"/>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
</object>
|
||||
</object>
|
||||
<nil key="activeLocalization"/>
|
||||
<object class="NSMutableDictionary" key="localizations">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference key="dict.sortedKeys" ref="0"/>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
</object>
|
||||
</object>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">12</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">EAGLViewController</string>
|
||||
<string key="superclassName">UIViewController</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">Classes/EAGLViewController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">wagicAppDelegate</string>
|
||||
<string key="superclassName">NSObject</string>
|
||||
<object class="NSMutableDictionary" key="outlets">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>glViewController</string>
|
||||
<string>window</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>EAGLViewController</string>
|
||||
<string>UIWindow</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>glViewController</string>
|
||||
<string>window</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">glViewController</string>
|
||||
<string key="candidateClassName">EAGLViewController</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">window</string>
|
||||
<string key="candidateClassName">UIWindow</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">Classes/wagicAppDelegate.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">wagicAppDelegate</string>
|
||||
<string key="superclassName">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBUserSource</string>
|
||||
<string key="minorKey"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">Foundation.framework/Headers/NSError.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">Foundation.framework/Headers/NSFileManager.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">Foundation.framework/Headers/NSKeyValueCoding.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">Foundation.framework/Headers/NSKeyValueObserving.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">Foundation.framework/Headers/NSKeyedArchiver.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">Foundation.framework/Headers/NSObject.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">Foundation.framework/Headers/NSRunLoop.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">Foundation.framework/Headers/NSThread.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">Foundation.framework/Headers/NSURL.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">Foundation.framework/Headers/NSURLConnection.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">QuartzCore.framework/Headers/CAAnimation.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">QuartzCore.framework/Headers/CALayer.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">UIKit.framework/Headers/UIAccessibility.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">UIKit.framework/Headers/UINibLoading.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="786211723">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">UIKit.framework/Headers/UIResponder.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">UIApplication</string>
|
||||
<string key="superclassName">UIResponder</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">UIKit.framework/Headers/UIApplication.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">UIResponder</string>
|
||||
<string key="superclassName">NSObject</string>
|
||||
<reference key="sourceIdentifier" ref="786211723"/>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">UISearchBar</string>
|
||||
<string key="superclassName">UIView</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">UIKit.framework/Headers/UISearchBar.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">UISearchDisplayController</string>
|
||||
<string key="superclassName">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">UIKit.framework/Headers/UISearchDisplayController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">UIView</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">UIKit.framework/Headers/UIPrintFormatter.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">UIView</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">UIKit.framework/Headers/UITextField.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">UIView</string>
|
||||
<string key="superclassName">UIResponder</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">UIKit.framework/Headers/UIView.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">UIViewController</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">UIKit.framework/Headers/UINavigationController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">UIViewController</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">UIKit.framework/Headers/UIPopoverController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">UIViewController</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">UIKit.framework/Headers/UISplitViewController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">UIViewController</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">UIKit.framework/Headers/UITabBarController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">UIViewController</string>
|
||||
<string key="superclassName">UIResponder</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">UIKit.framework/Headers/UIViewController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">UIWindow</string>
|
||||
<string key="superclassName">UIView</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">UIKit.framework/Headers/UIWindow.h</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<int key="IBDocument.localizationMode">0</int>
|
||||
<string key="IBDocument.TargetRuntimeIdentifier">IBIPadFramework</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
|
||||
<integer value="1056" key="NS.object.0"/>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
|
||||
<integer value="3100" key="NS.object.0"/>
|
||||
</object>
|
||||
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
|
||||
<string key="IBDocument.LastKnownRelativeProjectPath">wagic.xcodeproj</string>
|
||||
<int key="IBDocument.defaultPropertyAccessControl">3</int>
|
||||
<string key="IBCocoaTouchPluginVersion">132</string>
|
||||
</data>
|
||||
</archive>
|
||||
9
JGE/src/iOS/main.m
Executable file
9
JGE/src/iOS/main.m
Executable file
@@ -0,0 +1,9 @@
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
|
||||
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
|
||||
int retVal = UIApplicationMain(argc, argv, nil, nil);
|
||||
[pool release];
|
||||
return retVal;
|
||||
}
|
||||
14
JGE/src/iOS/wagicAppDelegate.h
Executable file
14
JGE/src/iOS/wagicAppDelegate.h
Executable file
@@ -0,0 +1,14 @@
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@class EAGLViewController;
|
||||
|
||||
@interface wagicAppDelegate : NSObject <UIApplicationDelegate> {
|
||||
UIWindow *window;
|
||||
EAGLViewController *glViewController;
|
||||
}
|
||||
|
||||
@property (nonatomic, retain) IBOutlet UIWindow *window;
|
||||
@property (nonatomic, retain) IBOutlet EAGLViewController *glViewController;
|
||||
|
||||
@end
|
||||
|
||||
43
JGE/src/iOS/wagicAppDelegate.m
Executable file
43
JGE/src/iOS/wagicAppDelegate.m
Executable file
@@ -0,0 +1,43 @@
|
||||
#import "wagicAppDelegate.h"
|
||||
#import "EAGLView.h"
|
||||
#import "EAGLViewController.h"
|
||||
|
||||
|
||||
@implementation wagicAppDelegate
|
||||
|
||||
@synthesize window;
|
||||
@synthesize glViewController;
|
||||
|
||||
|
||||
- (void) applicationDidFinishLaunching:(UIApplication *)application
|
||||
{
|
||||
[self.window addSubview:self.glViewController.view];
|
||||
[self.window makeKeyAndVisible];
|
||||
}
|
||||
|
||||
- (void)applicationWillResignActive:(UIApplication *)application
|
||||
{
|
||||
EAGLView *eaglView = (EAGLView *)self.glViewController.view;
|
||||
[eaglView stopAnimation];
|
||||
}
|
||||
|
||||
- (void)applicationDidBecomeActive:(UIApplication *)application
|
||||
{
|
||||
// [glView startAnimation];
|
||||
}
|
||||
|
||||
- (void)applicationWillTerminate:(UIApplication *)application
|
||||
{
|
||||
EAGLView *eaglView = (EAGLView *)self.glViewController.view;
|
||||
[eaglView stopAnimation];
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[window release];
|
||||
[glViewController release];
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@end
|
||||
43
projects/mtg/wagic-Info.plist
Executable file
43
projects/mtg/wagic-Info.plist
Executable file
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>wagic-64x64.png</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string></string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string></string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>somethingsmart.com.${PRODUCT_NAME:rfc1034identifier}</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>NSMainNibFile</key>
|
||||
<string>MainWindow</string>
|
||||
<key>UIStatusBarHidden</key>
|
||||
<true/>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
1259
projects/mtg/wagic.xcodeproj/project.pbxproj
Executable file
1259
projects/mtg/wagic.xcodeproj/project.pbxproj
Executable file
File diff suppressed because it is too large
Load Diff
14
projects/mtg/wagic_Prefix.pch
Executable file
14
projects/mtg/wagic_Prefix.pch
Executable file
@@ -0,0 +1,14 @@
|
||||
//
|
||||
// Prefix header for all source files of the 'testproject' target in the 'testproject' project
|
||||
//
|
||||
|
||||
#import <Availability.h>
|
||||
|
||||
#ifndef __IPHONE_3_0
|
||||
#warning "This project uses features only available in iPhone SDK 3.0 and later."
|
||||
#endif
|
||||
|
||||
#ifdef __OBJC__
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
#endif
|
||||
Reference in New Issue
Block a user