still tweaking

This commit is contained in:
David Rose 2009-04-24 00:16:08 +00:00
parent 703585b0ac
commit 33c56918d6
5 changed files with 39 additions and 7 deletions

View File

@ -27,9 +27,3 @@
main.mm
#end bin_target
//#begin bin_target
// #define TARGET iphone_pview
// #define SOURCES main.mm
//#end bin_target

View File

@ -101,6 +101,12 @@
return NO;
}
// Make sure the buffer is initially cleared, so we don't look at
// whatever happened to be in the framebuffer.
glClearColor(0, 0, 0, 1);
glClear(GL_COLOR_BUFFER_BIT);
[context presentRenderbuffer:GL_RENDERBUFFER_OES];
return YES;
}

View File

@ -30,7 +30,31 @@ PandaFramework framework;
int argc = 0;
char **argv = NULL;
- (void)applicationDidFinishLaunching:(UIApplication *)application {
void
signal_handler(int i) {
nout << "Caught signal " << i << "\n";
exit(1);
}
- (void)applicationDidFinishLaunching: (UIApplication *)application {
ConfigVariableBool pview_trap_signals("pview-trap-signals", false);
if (pview_trap_signals) {
// Set up a signal handler on every signal, so we can report this to
// the log.
struct sigaction sa;
sa.sa_handler = signal_handler;
sigemptyset(&sa.sa_mask);
sa.sa_flags = 0;
for (int i = 1; i < 32; ++i) {
if (sigaction(i, &sa, NULL) < 0) {
ostringstream strm;
strm << "sigaction(" << i << ")";
perror(strm.str().c_str());
}
}
}
// Parse the "command-line arguments" provided in the Config file.
ConfigVariableString pview_args("pview-args", "");
argc = pview_args.get_num_words() + 1;
typedef char *charp;
@ -49,6 +73,10 @@ char **argv = NULL;
[self startAnimation];
}
- (void)applicationDidReceiveMemoryWarning: (UIApplication *)application {
nout << "applicationDidReceiveMemoryWarning\n";
}
- (void)startAnimation {
self.animationTimer = [NSTimer scheduledTimerWithTimeInterval:animationInterval target:self selector:@selector(drawView) userInfo:nil repeats:YES];
}

View File

@ -12,6 +12,8 @@
//
////////////////////////////////////////////////////////////////////
#include "pandabase.h"
#import <UIKit/UIKit.h>
#import <UIKit/UITextView.h>

View File

@ -13,6 +13,7 @@
////////////////////////////////////////////////////////////////////
#import "viewController.h"
#include "pnotify.h"
@implementation ControllerDemoViewController
@ -65,6 +66,7 @@
- (void)didReceiveMemoryWarning {
[ super didReceiveMemoryWarning ];
/* Add custom low-memory code here */
nout << "low-memory handler in view controller\n";
}
- (void)dealloc {