mirror of
https://github.com/libretro/RetroArch
synced 2025-02-06 18:40:49 +00:00
(OSX) Xcode solution - start with CocoaGL base app
This commit is contained in:
parent
7977cadfc4
commit
46532e0d3f
155
osx/BasicOpenGLView.h
Executable file
155
osx/BasicOpenGLView.h
Executable file
@ -0,0 +1,155 @@
|
||||
// File: AppDelegate.h
|
||||
//
|
||||
// Abstract: Tells the application to quit once the main window closes
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface AppDelegate : NSObject
|
||||
{
|
||||
}
|
||||
- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)theApplication;
|
||||
|
||||
@end
|
||||
|
||||
//
|
||||
// File: BasicOpenGLView.m
|
||||
//
|
||||
// Abstract: Basic OpenGL View with Renderer information
|
||||
//
|
||||
// Version: 1.1 - minor fixes.
|
||||
// 1.0 - Original release.
|
||||
//
|
||||
//
|
||||
// Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. ("Apple")
|
||||
// in consideration of your agreement to the following terms, and your use,
|
||||
// installation, modification or redistribution of this Apple software
|
||||
// constitutes acceptance of these terms. If you do not agree with these
|
||||
// terms, please do not use, install, modify or redistribute this Apple
|
||||
// software.
|
||||
//
|
||||
// In consideration of your agreement to abide by the following terms, and
|
||||
// subject to these terms, Apple grants you a personal, non - exclusive
|
||||
// license, under Apple's copyrights in this original Apple software ( the
|
||||
// "Apple Software" ), to use, reproduce, modify and redistribute the Apple
|
||||
// Software, with or without modifications, in source and / or binary forms;
|
||||
// provided that if you redistribute the Apple Software in its entirety and
|
||||
// without modifications, you must retain this notice and the following text
|
||||
// and disclaimers in all such redistributions of the Apple Software. Neither
|
||||
// the name, trademarks, service marks or logos of Apple Inc. may be used to
|
||||
// endorse or promote products derived from the Apple Software without specific
|
||||
// prior written permission from Apple. Except as expressly stated in this
|
||||
// notice, no other rights or licenses, express or implied, are granted by
|
||||
// Apple herein, including but not limited to any patent rights that may be
|
||||
// infringed by your derivative works or by other works in which the Apple
|
||||
// Software may be incorporated.
|
||||
//
|
||||
// The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO
|
||||
// WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
|
||||
// WARRANTIES OF NON - INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A
|
||||
// PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION
|
||||
// ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
|
||||
//
|
||||
// IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
|
||||
// CONSEQUENTIAL DAMAGES ( INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
// INTERRUPTION ) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION
|
||||
// AND / OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER
|
||||
// UNDER THEORY OF CONTRACT, TORT ( INCLUDING NEGLIGENCE ), STRICT LIABILITY OR
|
||||
// OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// Copyright ( C ) 2003-2007 Apple Inc. All Rights Reserved.
|
||||
//
|
||||
|
||||
#import <OpenGL/gl.h>
|
||||
#import <OpenGL/glext.h>
|
||||
#import <OpenGL/glu.h>
|
||||
|
||||
#import "GLString.h"
|
||||
|
||||
typedef struct {
|
||||
GLdouble x,y,z;
|
||||
} recVec;
|
||||
|
||||
typedef struct {
|
||||
recVec viewPos; // View position
|
||||
recVec viewDir; // View direction vector
|
||||
recVec viewUp; // View up direction
|
||||
recVec rotPoint; // Point to rotate about
|
||||
GLdouble aperture; // pContextInfo->camera aperture
|
||||
GLint viewWidth, viewHeight; // current window/screen height and width
|
||||
} recCamera;
|
||||
|
||||
@interface BasicOpenGLView : NSOpenGLView
|
||||
{
|
||||
// string attributes
|
||||
NSMutableDictionary * stanStringAttrib;
|
||||
|
||||
// string textures
|
||||
GLString * helpStringTex;
|
||||
GLString * infoStringTex;
|
||||
GLString * camStringTex;
|
||||
GLString * capStringTex;
|
||||
GLString * msgStringTex;
|
||||
CFAbsoluteTime msgTime; // message posting time for expiration
|
||||
|
||||
NSTimer* timer;
|
||||
|
||||
bool fAnimate;
|
||||
IBOutlet NSMenuItem * animateMenuItem;
|
||||
bool fInfo;
|
||||
IBOutlet NSMenuItem * infoMenuItem;
|
||||
bool fDrawHelp;
|
||||
|
||||
CFAbsoluteTime time;
|
||||
|
||||
// camera handling
|
||||
recCamera camera;
|
||||
GLfloat shapeSize;
|
||||
|
||||
}
|
||||
|
||||
+ (NSOpenGLPixelFormat*) basicPixelFormat;
|
||||
|
||||
- (void) updateProjection;
|
||||
- (void) updateModelView;
|
||||
- (void) resizeGL;
|
||||
- (void) resetCamera;
|
||||
|
||||
- (void) updateObjectRotationForTimeDelta:(CFAbsoluteTime)deltaTime;
|
||||
- (void)animationTimer:(NSTimer *)timer;
|
||||
|
||||
- (void) createHelpString;
|
||||
- (void) createMessageString;
|
||||
- (void) updateInfoString;
|
||||
- (void) updateCameraString;
|
||||
- (void) drawInfo;
|
||||
|
||||
-(IBAction) animate: (id) sender;
|
||||
-(IBAction) info: (id) sender;
|
||||
|
||||
- (void)keyDown:(NSEvent *)theEvent;
|
||||
|
||||
- (void) mouseDown:(NSEvent *)theEvent;
|
||||
- (void) rightMouseDown:(NSEvent *)theEvent;
|
||||
- (void) otherMouseDown:(NSEvent *)theEvent;
|
||||
- (void) mouseUp:(NSEvent *)theEvent;
|
||||
- (void) rightMouseUp:(NSEvent *)theEvent;
|
||||
- (void) otherMouseUp:(NSEvent *)theEvent;
|
||||
- (void) mouseDragged:(NSEvent *)theEvent;
|
||||
- (void) scrollWheel:(NSEvent *)theEvent;
|
||||
- (void) rightMouseDragged:(NSEvent *)theEvent;
|
||||
- (void) otherMouseDragged:(NSEvent *)theEvent;
|
||||
|
||||
- (void) drawRect:(NSRect)rect;
|
||||
|
||||
- (void) prepareOpenGL;
|
||||
- (void) update; // moved or resized
|
||||
|
||||
- (BOOL) acceptsFirstResponder;
|
||||
- (BOOL) becomeFirstResponder;
|
||||
- (BOOL) resignFirstResponder;
|
||||
|
||||
- (id) initWithFrame: (NSRect) frameRect;
|
||||
- (void) awakeFromNib;
|
||||
|
||||
@end
|
551
osx/BasicOpenGLView.m
Executable file
551
osx/BasicOpenGLView.m
Executable file
@ -0,0 +1,551 @@
|
||||
//
|
||||
// File: BasicOpenGLView.m
|
||||
//
|
||||
// Abstract: Basic OpenGL View with Renderer information
|
||||
//
|
||||
// Version: 1.1 - minor fixes.
|
||||
// 1.0 - Original release.
|
||||
//
|
||||
//
|
||||
// Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. ("Apple")
|
||||
// in consideration of your agreement to the following terms, and your use,
|
||||
// installation, modification or redistribution of this Apple software
|
||||
// constitutes acceptance of these terms. If you do not agree with these
|
||||
// terms, please do not use, install, modify or redistribute this Apple
|
||||
// software.
|
||||
//
|
||||
// In consideration of your agreement to abide by the following terms, and
|
||||
// subject to these terms, Apple grants you a personal, non - exclusive
|
||||
// license, under Apple's copyrights in this original Apple software ( the
|
||||
// "Apple Software" ), to use, reproduce, modify and redistribute the Apple
|
||||
// Software, with or without modifications, in source and / or binary forms;
|
||||
// provided that if you redistribute the Apple Software in its entirety and
|
||||
// without modifications, you must retain this notice and the following text
|
||||
// and disclaimers in all such redistributions of the Apple Software. Neither
|
||||
// the name, trademarks, service marks or logos of Apple Inc. may be used to
|
||||
// endorse or promote products derived from the Apple Software without specific
|
||||
// prior written permission from Apple. Except as expressly stated in this
|
||||
// notice, no other rights or licenses, express or implied, are granted by
|
||||
// Apple herein, including but not limited to any patent rights that may be
|
||||
// infringed by your derivative works or by other works in which the Apple
|
||||
// Software may be incorporated.
|
||||
//
|
||||
// The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO
|
||||
// WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
|
||||
// WARRANTIES OF NON - INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A
|
||||
// PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION
|
||||
// ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
|
||||
//
|
||||
// IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
|
||||
// CONSEQUENTIAL DAMAGES ( INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
// INTERRUPTION ) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION
|
||||
// AND / OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER
|
||||
// UNDER THEORY OF CONTRACT, TORT ( INCLUDING NEGLIGENCE ), STRICT LIABILITY OR
|
||||
// OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// Copyright ( C ) 2003-2007 Apple Inc. All Rights Reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "BasicOpenGLView.h"
|
||||
|
||||
/* Tells the application to quit once the main window closes */
|
||||
|
||||
@implementation AppDelegate
|
||||
|
||||
- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)theApplication
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
return NSApplicationMain(argc, (const char **) argv);
|
||||
}
|
||||
|
||||
// ==================================
|
||||
|
||||
// time and message info
|
||||
CFAbsoluteTime gMsgPresistance = 10.0f;
|
||||
|
||||
// error output
|
||||
GLString * gErrStringTex;
|
||||
float gErrorTime;
|
||||
|
||||
#pragma mark ---- Utilities ----
|
||||
|
||||
static CFAbsoluteTime gStartTime = 0.0f;
|
||||
|
||||
// set app start time
|
||||
static void setStartTime (void)
|
||||
{
|
||||
gStartTime = CFAbsoluteTimeGetCurrent();
|
||||
}
|
||||
|
||||
// ---------------------------------
|
||||
|
||||
// return float elpased time in seconds since app start
|
||||
static CFAbsoluteTime getElapsedTime (void)
|
||||
{
|
||||
return CFAbsoluteTimeGetCurrent() - gStartTime;
|
||||
}
|
||||
|
||||
#pragma mark ---- Error Reporting ----
|
||||
|
||||
// error reporting as both window message and debugger string
|
||||
void reportError (char * strError)
|
||||
{
|
||||
NSMutableDictionary *attribs = [NSMutableDictionary dictionary];
|
||||
[attribs setObject: [NSFont fontWithName: @"Monaco" size: 9.0f] forKey: NSFontAttributeName];
|
||||
[attribs setObject: [NSColor whiteColor] forKey: NSForegroundColorAttributeName];
|
||||
|
||||
gErrorTime = getElapsedTime ();
|
||||
NSString * errString = [NSString stringWithFormat:@"Error: %s (at time: %0.1f secs).", strError, gErrorTime];
|
||||
NSLog (@"%@\n", errString);
|
||||
if (gErrStringTex)
|
||||
[gErrStringTex setString:errString withAttributes:attribs];
|
||||
else {
|
||||
gErrStringTex = [[GLString alloc] initWithString:errString withAttributes:attribs withTextColor:[NSColor colorWithDeviceRed:1.0f green:1.0f blue:1.0f alpha:1.0f] withBoxColor:[NSColor colorWithDeviceRed:1.0f green:0.0f blue:0.0f alpha:0.3f] withBorderColor:[NSColor colorWithDeviceRed:1.0f green:0.0f blue:0.0f alpha:0.8f]];
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------
|
||||
|
||||
// if error dump gl errors to debugger string, return error
|
||||
GLenum glReportError (void)
|
||||
{
|
||||
GLenum err = glGetError();
|
||||
if (GL_NO_ERROR != err)
|
||||
reportError ((char *) gluErrorString (err));
|
||||
return err;
|
||||
}
|
||||
|
||||
#pragma mark ---- OpenGL Utils ----
|
||||
|
||||
// ===================================
|
||||
|
||||
@implementation BasicOpenGLView
|
||||
|
||||
// pixel format definition
|
||||
+ (NSOpenGLPixelFormat*) basicPixelFormat
|
||||
{
|
||||
NSOpenGLPixelFormatAttribute attributes [] = {
|
||||
NSOpenGLPFAWindow,
|
||||
NSOpenGLPFADoubleBuffer, // double buffered
|
||||
NSOpenGLPFADepthSize, (NSOpenGLPixelFormatAttribute)16, // 16 bit depth buffer
|
||||
(NSOpenGLPixelFormatAttribute)nil
|
||||
};
|
||||
return [[[NSOpenGLPixelFormat alloc] initWithAttributes:attributes] autorelease];
|
||||
}
|
||||
|
||||
// ---------------------------------
|
||||
|
||||
// update the projection matrix based on camera and view info
|
||||
- (void) updateProjection
|
||||
{
|
||||
GLdouble ratio, radians, wd2;
|
||||
GLdouble left, right, top, bottom, near, far;
|
||||
|
||||
[[self openGLContext] makeCurrentContext];
|
||||
|
||||
// set projection
|
||||
glMatrixMode (GL_PROJECTION);
|
||||
glLoadIdentity ();
|
||||
near = -camera.viewPos.z - shapeSize * 0.5;
|
||||
if (near < 0.00001)
|
||||
near = 0.00001;
|
||||
far = -camera.viewPos.z + shapeSize * 0.5;
|
||||
if (far < 1.0)
|
||||
far = 1.0;
|
||||
radians = 0.0174532925 * camera.aperture / 2; // half aperture degrees to radians
|
||||
wd2 = near * tan(radians);
|
||||
ratio = camera.viewWidth / (float) camera.viewHeight;
|
||||
if (ratio >= 1.0) {
|
||||
left = -ratio * wd2;
|
||||
right = ratio * wd2;
|
||||
top = wd2;
|
||||
bottom = -wd2;
|
||||
} else {
|
||||
left = -wd2;
|
||||
right = wd2;
|
||||
top = wd2 / ratio;
|
||||
bottom = -wd2 / ratio;
|
||||
}
|
||||
glFrustum (left, right, bottom, top, near, far);
|
||||
}
|
||||
|
||||
// ---------------------------------
|
||||
|
||||
// handles resizing of GL need context update and if the window dimensions change, a
|
||||
// a window dimension update, reseting of viewport and an update of the projection matrix
|
||||
- (void) resizeGL
|
||||
{
|
||||
NSRect rectView = [self bounds];
|
||||
|
||||
// ensure camera knows size changed
|
||||
if ((camera.viewHeight != rectView.size.height) ||
|
||||
(camera.viewWidth != rectView.size.width)) {
|
||||
camera.viewHeight = rectView.size.height;
|
||||
camera.viewWidth = rectView.size.width;
|
||||
|
||||
glViewport (0, 0, camera.viewWidth, camera.viewHeight);
|
||||
[self updateProjection]; // update projection matrix
|
||||
[self updateInfoString];
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------
|
||||
|
||||
// sets the camera data to initial conditions
|
||||
- (void) resetCamera
|
||||
{
|
||||
camera.aperture = 40;
|
||||
|
||||
camera.viewPos.x = 0.0;
|
||||
camera.viewPos.y = 0.0;
|
||||
camera.viewPos.z = -10.0;
|
||||
camera.viewDir.x = -camera.viewPos.x;
|
||||
camera.viewDir.y = -camera.viewPos.y;
|
||||
camera.viewDir.z = -camera.viewPos.z;
|
||||
|
||||
camera.viewUp.x = 0;
|
||||
camera.viewUp.y = 1;
|
||||
camera.viewUp.z = 0;
|
||||
}
|
||||
|
||||
// ---------------------------------
|
||||
|
||||
// per-window timer function, basic time based animation preformed here
|
||||
- (void)animationTimer:(NSTimer *)timer
|
||||
{
|
||||
BOOL shouldDraw = NO;
|
||||
|
||||
if (fAnimate)
|
||||
{
|
||||
CFTimeInterval deltaTime = CFAbsoluteTimeGetCurrent () - time;
|
||||
|
||||
if (deltaTime > 10.0) // skip pauses
|
||||
return;
|
||||
else
|
||||
shouldDraw = YES; // force redraw
|
||||
}
|
||||
|
||||
time = CFAbsoluteTimeGetCurrent (); //reset time in all cases
|
||||
|
||||
// if we have current messages
|
||||
if (((getElapsedTime () - msgTime) < gMsgPresistance) ||
|
||||
((getElapsedTime () - gErrorTime) < gMsgPresistance))
|
||||
shouldDraw = YES; // force redraw
|
||||
|
||||
if (shouldDraw == YES)
|
||||
[self drawRect:[self bounds]]; // redraw now instead dirty to enable updates during live resize
|
||||
}
|
||||
|
||||
#pragma mark ---- Text Drawing ----
|
||||
|
||||
// these functions create or update GLStrings one should expect to have to regenerate the image, bitmap and texture when the string changes thus these functions are not particularly light weight
|
||||
|
||||
- (void) updateInfoString
|
||||
{ // update info string texture
|
||||
NSString * string = [NSString stringWithFormat:@"(%0.0f x %0.0f) \n%s \n%s", [self bounds].size.width, [self bounds].size.height, glGetString (GL_RENDERER), glGetString (GL_VERSION)];
|
||||
if (infoStringTex)
|
||||
[infoStringTex setString:string withAttributes:stanStringAttrib];
|
||||
else {
|
||||
infoStringTex = [[GLString alloc] initWithString:string withAttributes:stanStringAttrib withTextColor:[NSColor colorWithDeviceRed:1.0f green:1.0f blue:1.0f alpha:1.0f] withBoxColor:[NSColor colorWithDeviceRed:0.5f green:0.5f blue:0.5f alpha:0.5f] withBorderColor:[NSColor colorWithDeviceRed:0.8f green:0.8f blue:0.8f alpha:0.8f]];
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------
|
||||
|
||||
- (void) createHelpString
|
||||
{
|
||||
NSString * string = [NSString stringWithFormat:@"Cmd-I: show info \n'h': toggle help"];
|
||||
helpStringTex = [[GLString alloc] initWithString:string withAttributes:stanStringAttrib withTextColor:[NSColor colorWithDeviceRed:1.0f green:1.0f blue:1.0f alpha:1.0f] withBoxColor:[NSColor colorWithDeviceRed:0.0f green:0.5f blue:0.0f alpha:0.5f] withBorderColor:[NSColor colorWithDeviceRed:0.3f green:0.8f blue:0.3f alpha:0.8f]];
|
||||
}
|
||||
|
||||
// ---------------------------------
|
||||
|
||||
- (void) createMessageString
|
||||
{
|
||||
NSString * string = [NSString stringWithFormat:@"No messages..."];
|
||||
msgStringTex = [[GLString alloc] initWithString:string withAttributes:stanStringAttrib withTextColor:[NSColor colorWithDeviceRed:1.0f green:1.0f blue:1.0f alpha:1.0f] withBoxColor:[NSColor colorWithDeviceRed:0.5f green:0.5f blue:0.5f alpha:0.5f] withBorderColor:[NSColor colorWithDeviceRed:0.8f green:0.8f blue:0.8f alpha:0.8f]];
|
||||
}
|
||||
|
||||
// ---------------------------------
|
||||
|
||||
// draw text info using our GLString class for much more optimized text drawing
|
||||
- (void) drawInfo
|
||||
{
|
||||
GLint matrixMode;
|
||||
GLboolean depthTest = glIsEnabled (GL_DEPTH_TEST);
|
||||
GLfloat height, width, messageTop = 10.0f;
|
||||
|
||||
height = camera.viewHeight;
|
||||
width = camera.viewWidth;
|
||||
|
||||
// set orthograhic 1:1 pixel transform in local view coords
|
||||
glGetIntegerv (GL_MATRIX_MODE, &matrixMode);
|
||||
glMatrixMode (GL_PROJECTION);
|
||||
glPushMatrix();
|
||||
glLoadIdentity ();
|
||||
glMatrixMode (GL_MODELVIEW);
|
||||
glPushMatrix();
|
||||
glLoadIdentity ();
|
||||
glScalef (2.0f / width, -2.0f / height, 1.0f);
|
||||
glTranslatef (-width / 2.0f, -height / 2.0f, 0.0f);
|
||||
|
||||
glColor4f (1.0f, 1.0f, 1.0f, 1.0f);
|
||||
[infoStringTex drawAtPoint:NSMakePoint (10.0f, height - [infoStringTex frameSize].height - 10.0f)];
|
||||
[camStringTex drawAtPoint:NSMakePoint (10.0f, messageTop)];
|
||||
messageTop += [camStringTex frameSize].height + 3.0f;
|
||||
|
||||
if (fDrawHelp)
|
||||
[helpStringTex drawAtPoint:NSMakePoint (floor ((width - [helpStringTex frameSize].width) / 2.0f), floor ((height - [helpStringTex frameSize].height) / 3.0f))];
|
||||
|
||||
// message string
|
||||
float currTime = getElapsedTime ();
|
||||
if ((currTime - msgTime) < gMsgPresistance) {
|
||||
GLfloat comp = (gMsgPresistance - getElapsedTime () + msgTime) * 0.1; // premultiplied fade
|
||||
glColor4f (comp, comp, comp, comp);
|
||||
[msgStringTex drawAtPoint:NSMakePoint (10.0f, messageTop)];
|
||||
messageTop += [msgStringTex frameSize].height + 3.0f;
|
||||
}
|
||||
// global error message
|
||||
if ((currTime - gErrorTime) < gMsgPresistance) {
|
||||
GLfloat comp = (gMsgPresistance - getElapsedTime () + gErrorTime) * 0.1; // premultiplied fade
|
||||
glColor4f (comp, comp, comp, comp);
|
||||
[gErrStringTex drawAtPoint:NSMakePoint (10.0f, messageTop)];
|
||||
}
|
||||
|
||||
// reset orginal martices
|
||||
glPopMatrix(); // GL_MODELVIEW
|
||||
glMatrixMode (GL_PROJECTION);
|
||||
glPopMatrix();
|
||||
glMatrixMode (matrixMode);
|
||||
|
||||
glDisable (GL_TEXTURE_RECTANGLE_EXT);
|
||||
glDisable (GL_BLEND);
|
||||
glReportError ();
|
||||
}
|
||||
|
||||
#pragma mark ---- IB Actions ----
|
||||
|
||||
-(IBAction) animate: (id) sender
|
||||
{
|
||||
fAnimate = 1 - fAnimate;
|
||||
if (fAnimate)
|
||||
[animateMenuItem setState: NSOnState];
|
||||
else
|
||||
[animateMenuItem setState: NSOffState];
|
||||
}
|
||||
|
||||
// ---------------------------------
|
||||
|
||||
-(IBAction) info: (id) sender
|
||||
{
|
||||
fInfo = 1 - fInfo;
|
||||
if (fInfo)
|
||||
[infoMenuItem setState: NSOnState];
|
||||
else
|
||||
[infoMenuItem setState: NSOffState];
|
||||
[self setNeedsDisplay: YES];
|
||||
}
|
||||
|
||||
#pragma mark ---- Method Overrides ----
|
||||
|
||||
-(void)keyDown:(NSEvent *)theEvent
|
||||
{
|
||||
NSString *characters = [theEvent characters];
|
||||
if ([characters length]) {
|
||||
unichar character = [characters characterAtIndex:0];
|
||||
switch (character) {
|
||||
case 'h':
|
||||
// toggle help
|
||||
fDrawHelp = 1 - fDrawHelp;
|
||||
[self setNeedsDisplay: YES];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------
|
||||
|
||||
- (void)mouseDown:(NSEvent *)theEvent // trackball
|
||||
{
|
||||
}
|
||||
|
||||
// ---------------------------------
|
||||
|
||||
- (void)rightMouseDown:(NSEvent *)theEvent // pan
|
||||
{
|
||||
}
|
||||
|
||||
// ---------------------------------
|
||||
|
||||
- (void)otherMouseDown:(NSEvent *)theEvent //dolly
|
||||
{
|
||||
}
|
||||
|
||||
// ---------------------------------
|
||||
|
||||
- (void)mouseUp:(NSEvent *)theEvent
|
||||
{
|
||||
}
|
||||
|
||||
// ---------------------------------
|
||||
|
||||
- (void)rightMouseUp:(NSEvent *)theEvent
|
||||
{
|
||||
}
|
||||
|
||||
// ---------------------------------
|
||||
|
||||
- (void)otherMouseUp:(NSEvent *)theEvent
|
||||
{
|
||||
}
|
||||
|
||||
// ---------------------------------
|
||||
|
||||
- (void)mouseDragged:(NSEvent *)theEvent
|
||||
{
|
||||
}
|
||||
|
||||
// ---------------------------------
|
||||
|
||||
- (void)scrollWheel:(NSEvent *)theEvent
|
||||
{
|
||||
}
|
||||
|
||||
// ---------------------------------
|
||||
|
||||
- (void)rightMouseDragged:(NSEvent *)theEvent
|
||||
{
|
||||
}
|
||||
|
||||
// ---------------------------------
|
||||
|
||||
- (void)otherMouseDragged:(NSEvent *)theEvent
|
||||
{
|
||||
}
|
||||
|
||||
// ---------------------------------
|
||||
|
||||
- (void) drawRect:(NSRect)rect
|
||||
{
|
||||
// setup viewport and prespective
|
||||
[self resizeGL]; // forces projection matrix update (does test for size changes)
|
||||
// clear our drawable
|
||||
glClear (GL_COLOR_BUFFER_BIT);
|
||||
|
||||
// model view and projection matricies already set
|
||||
|
||||
if (fInfo)
|
||||
[self drawInfo];
|
||||
|
||||
if ([self inLiveResize] && !fAnimate)
|
||||
glFlush ();
|
||||
else
|
||||
[[self openGLContext] flushBuffer];
|
||||
glReportError ();
|
||||
}
|
||||
|
||||
// ---------------------------------
|
||||
|
||||
// set initial OpenGL state (current context is set)
|
||||
// called after context is created
|
||||
- (void) prepareOpenGL
|
||||
{
|
||||
long swapInt = 1;
|
||||
|
||||
[[self openGLContext] setValues:&swapInt forParameter:NSOpenGLCPSwapInterval]; // set to vbl sync
|
||||
|
||||
// init GL stuff here
|
||||
glShadeModel(GL_SMOOTH);
|
||||
glEnable(GL_CULL_FACE);
|
||||
glFrontFace(GL_CCW);
|
||||
glPolygonOffset (1.0f, 1.0f);
|
||||
|
||||
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
[self resetCamera];
|
||||
shapeSize = 7.0f; // max radius of of objects
|
||||
|
||||
// init fonts for use with strings
|
||||
NSFont * font =[NSFont fontWithName:@"Helvetica" size:12.0];
|
||||
stanStringAttrib = [[NSMutableDictionary dictionary] retain];
|
||||
[stanStringAttrib setObject:font forKey:NSFontAttributeName];
|
||||
[stanStringAttrib setObject:[NSColor whiteColor] forKey:NSForegroundColorAttributeName];
|
||||
[font release];
|
||||
|
||||
// ensure strings are created
|
||||
[self createHelpString];
|
||||
[self createMessageString];
|
||||
|
||||
}
|
||||
// ---------------------------------
|
||||
|
||||
// this can be a troublesome call to do anything heavyweight, as it is called on window moves, resizes, and display config changes. So be
|
||||
// careful of doing too much here.
|
||||
- (void) update // window resizes, moves and display changes (resize, depth and display config change)
|
||||
{
|
||||
msgTime = getElapsedTime ();
|
||||
[msgStringTex setString:[NSString stringWithFormat:@"update at %0.1f secs", msgTime] withAttributes:stanStringAttrib];
|
||||
[super update];
|
||||
if (![self inLiveResize]) {// if not doing live resize
|
||||
[self updateInfoString]; // to get change in renderers will rebuld string every time (could test for early out)
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------
|
||||
|
||||
-(id) initWithFrame: (NSRect) frameRect
|
||||
{
|
||||
NSOpenGLPixelFormat *pf = [BasicOpenGLView basicPixelFormat];
|
||||
|
||||
self = [super initWithFrame: frameRect pixelFormat: pf];
|
||||
return self;
|
||||
}
|
||||
|
||||
// ---------------------------------
|
||||
|
||||
- (BOOL)acceptsFirstResponder
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
// ---------------------------------
|
||||
|
||||
- (BOOL)becomeFirstResponder
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
// ---------------------------------
|
||||
|
||||
- (BOOL)resignFirstResponder
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
// ---------------------------------
|
||||
|
||||
- (void) awakeFromNib
|
||||
{
|
||||
setStartTime (); // get app start time
|
||||
|
||||
// set start values...
|
||||
fInfo = 1;
|
||||
fAnimate = 1;
|
||||
time = CFAbsoluteTimeGetCurrent (); // set animation time start time
|
||||
fDrawHelp = 1;
|
||||
|
||||
// start animation timer
|
||||
timer = [NSTimer timerWithTimeInterval:(1.0f/60.0f) target:self selector:@selector(animationTimer:) userInfo:nil repeats:YES];
|
||||
[[NSRunLoop currentRunLoop] addTimer:timer forMode:NSDefaultRunLoopMode];
|
||||
[[NSRunLoop currentRunLoop] addTimer:timer forMode:NSEventTrackingRunLoopMode]; // ensure timer fires during resize
|
||||
}
|
||||
|
||||
|
||||
@end
|
13
osx/Credits.rtf
Normal file
13
osx/Credits.rtf
Normal file
@ -0,0 +1,13 @@
|
||||
{\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf390
|
||||
\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
|
||||
{\colortbl;\red255\green255\blue255;}
|
||||
\margl1440\margr1440\vieww9000\viewh8400\viewkind0
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural
|
||||
|
||||
\f0\fs24 \cf0 Authors:\
|
||||
Hans-Kristian Arntzen\
|
||||
Daniel De Matteis\
|
||||
\
|
||||
Website:\
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural
|
||||
{\field{\*\fldinst{HYPERLINK "http://www.libretro.com"}}{\fldrslt \cf0 www.libretro.com}}}
|
BIN
osx/English.lproj/InfoPlist.strings
Normal file
BIN
osx/English.lproj/InfoPlist.strings
Normal file
Binary file not shown.
1152
osx/English.lproj/MainMenu.nib/designable.nib
generated
Normal file
1152
osx/English.lproj/MainMenu.nib/designable.nib
generated
Normal file
File diff suppressed because it is too large
Load Diff
BIN
osx/English.lproj/MainMenu.nib/keyedobjects.nib
generated
Normal file
BIN
osx/English.lproj/MainMenu.nib/keyedobjects.nib
generated
Normal file
Binary file not shown.
127
osx/GLString.h
Executable file
127
osx/GLString.h
Executable file
@ -0,0 +1,127 @@
|
||||
//
|
||||
// File: GLString.h
|
||||
// (Originally StringTexture.h)
|
||||
//
|
||||
// Abstract: Uses Quartz to draw a string into an OpenGL texture
|
||||
//
|
||||
// Version: 1.1 - Minor enhancements and bug fixes.
|
||||
// 1.0 - Original release.
|
||||
//
|
||||
//
|
||||
// Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. ("Apple")
|
||||
// in consideration of your agreement to the following terms, and your use,
|
||||
// installation, modification or redistribution of this Apple software
|
||||
// constitutes acceptance of these terms. If you do not agree with these
|
||||
// terms, please do not use, install, modify or redistribute this Apple
|
||||
// software.
|
||||
//
|
||||
// In consideration of your agreement to abide by the following terms, and
|
||||
// subject to these terms, Apple grants you a personal, non - exclusive
|
||||
// license, under Apple's copyrights in this original Apple software ( the
|
||||
// "Apple Software" ), to use, reproduce, modify and redistribute the Apple
|
||||
// Software, with or without modifications, in source and / or binary forms;
|
||||
// provided that if you redistribute the Apple Software in its entirety and
|
||||
// without modifications, you must retain this notice and the following text
|
||||
// and disclaimers in all such redistributions of the Apple Software. Neither
|
||||
// the name, trademarks, service marks or logos of Apple Inc. may be used to
|
||||
// endorse or promote products derived from the Apple Software without specific
|
||||
// prior written permission from Apple. Except as expressly stated in this
|
||||
// notice, no other rights or licenses, express or implied, are granted by
|
||||
// Apple herein, including but not limited to any patent rights that may be
|
||||
// infringed by your derivative works or by other works in which the Apple
|
||||
// Software may be incorporated.
|
||||
//
|
||||
// The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO
|
||||
// WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
|
||||
// WARRANTIES OF NON - INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A
|
||||
// PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION
|
||||
// ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
|
||||
//
|
||||
// IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
|
||||
// CONSEQUENTIAL DAMAGES ( INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
// INTERRUPTION ) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION
|
||||
// AND / OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER
|
||||
// UNDER THEORY OF CONTRACT, TORT ( INCLUDING NEGLIGENCE ), STRICT LIABILITY OR
|
||||
// OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// Copyright ( C ) 2003-2007 Apple Inc. All Rights Reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <OpenGL/gl.h>
|
||||
#import <OpenGL/glext.h>
|
||||
#import <OpenGL/OpenGL.h>
|
||||
#import <OpenGL/CGLContext.h>
|
||||
|
||||
@interface NSBezierPath (RoundRect)
|
||||
+ (NSBezierPath *)bezierPathWithRoundedRect:(NSRect)rect cornerRadius:(float)radius;
|
||||
|
||||
- (void)appendBezierPathWithRoundedRect:(NSRect)rect cornerRadius:(float)radius;
|
||||
@end
|
||||
|
||||
@interface GLString : NSObject {
|
||||
CGLContextObj cgl_ctx; // current context at time of texture creation
|
||||
GLuint texName;
|
||||
NSSize texSize;
|
||||
|
||||
NSAttributedString * string;
|
||||
NSColor * textColor; // default is opaque white
|
||||
NSColor * boxColor; // default transparent or none
|
||||
NSColor * borderColor; // default transparent or none
|
||||
BOOL staticFrame; // default in NO
|
||||
BOOL antialias; // default to YES
|
||||
NSSize marginSize; // offset or frame size, default is 4 width 2 height
|
||||
NSSize frameSize; // offset or frame size, default is 4 width 2 height
|
||||
float cRadius; // Corner radius, if 0 just a rectangle. Defaults to 4.0f
|
||||
|
||||
BOOL requiresUpdate;
|
||||
}
|
||||
|
||||
// this API requires a current rendering context and all operations will be performed in regards to thar context
|
||||
// the same context should be current for all method calls for a particular object instance
|
||||
|
||||
// designated initializer
|
||||
- (id) initWithAttributedString:(NSAttributedString *)attributedString withTextColor:(NSColor *)color withBoxColor:(NSColor *)color withBorderColor:(NSColor *)color;
|
||||
|
||||
- (id) initWithString:(NSString *)aString withAttributes:(NSDictionary *)attribs withTextColor:(NSColor *)color withBoxColor:(NSColor *)color withBorderColor:(NSColor *)color;
|
||||
|
||||
// basic methods that pick up defaults
|
||||
- (id) initWithString:(NSString *)aString withAttributes:(NSDictionary *)attribs;
|
||||
- (id) initWithAttributedString:(NSAttributedString *)attributedString;
|
||||
|
||||
- (void) dealloc;
|
||||
|
||||
- (GLuint) texName; // 0 if no texture allocated
|
||||
- (NSSize) texSize; // actually size of texture generated in texels, (0, 0) if no texture allocated
|
||||
|
||||
- (NSColor *) textColor; // get the pre-multiplied default text color (includes alpha) string attributes could override this
|
||||
- (NSColor *) boxColor; // get the pre-multiplied box color (includes alpha) alpha of 0.0 means no background box
|
||||
- (NSColor *) borderColor; // get the pre-multiplied border color (includes alpha) alpha of 0.0 means no border
|
||||
- (BOOL) staticFrame; // returns whether or not a static frame will be used
|
||||
|
||||
- (NSSize) frameSize; // returns either dynamc frame (text size + margins) or static frame size (switch with staticFrame)
|
||||
|
||||
- (NSSize) marginSize; // current margins for text offset and pads for dynamic frame
|
||||
|
||||
- (void) genTexture; // generates the texture without drawing texture to current context
|
||||
- (void) drawWithBounds:(NSRect)bounds; // will update the texture if required due to change in settings (note context should be setup to be orthographic scaled to per pixel scale)
|
||||
- (void) drawAtPoint:(NSPoint)point;
|
||||
|
||||
// these will force the texture to be regenerated at the next draw
|
||||
- (void) setMargins:(NSSize)size; // set offset size and size to fit with offset
|
||||
- (void) useStaticFrame:(NSSize)size; // set static frame size and size to frame
|
||||
- (void) useDynamicFrame; // set static frame size and size to frame
|
||||
|
||||
- (void) setString:(NSAttributedString *)attributedString; // set string after initial creation
|
||||
- (void) setString:(NSString *)aString withAttributes:(NSDictionary *)attribs; // set string after initial creation
|
||||
|
||||
- (void) setTextColor:(NSColor *)color; // set default text color
|
||||
- (void) setBoxColor:(NSColor *)color; // set default text color
|
||||
- (void) setBorderColor:(NSColor *)color; // set default text color
|
||||
|
||||
- (BOOL) antialias;
|
||||
- (void) setAntialias:(bool)request;
|
||||
|
||||
@end
|
||||
|
414
osx/GLString.m
Executable file
414
osx/GLString.m
Executable file
@ -0,0 +1,414 @@
|
||||
//
|
||||
// File: GLString.m
|
||||
// (Originally StringTexture.m)
|
||||
//
|
||||
// Abstract: Uses Quartz to draw a string into an OpenGL texture
|
||||
//
|
||||
// Version: 1.1 - Antialiasing option, Rounded Corners to the frame
|
||||
// self contained OpenGL state, performance enhancements,
|
||||
// other bug fixes.
|
||||
// 1.0 - Original release.
|
||||
//
|
||||
//
|
||||
// Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. ("Apple")
|
||||
// in consideration of your agreement to the following terms, and your use,
|
||||
// installation, modification or redistribution of this Apple software
|
||||
// constitutes acceptance of these terms. If you do not agree with these
|
||||
// terms, please do not use, install, modify or redistribute this Apple
|
||||
// software.
|
||||
//
|
||||
// In consideration of your agreement to abide by the following terms, and
|
||||
// subject to these terms, Apple grants you a personal, non - exclusive
|
||||
// license, under Apple's copyrights in this original Apple software ( the
|
||||
// "Apple Software" ), to use, reproduce, modify and redistribute the Apple
|
||||
// Software, with or without modifications, in source and / or binary forms;
|
||||
// provided that if you redistribute the Apple Software in its entirety and
|
||||
// without modifications, you must retain this notice and the following text
|
||||
// and disclaimers in all such redistributions of the Apple Software. Neither
|
||||
// the name, trademarks, service marks or logos of Apple Inc. may be used to
|
||||
// endorse or promote products derived from the Apple Software without specific
|
||||
// prior written permission from Apple. Except as expressly stated in this
|
||||
// notice, no other rights or licenses, express or implied, are granted by
|
||||
// Apple herein, including but not limited to any patent rights that may be
|
||||
// infringed by your derivative works or by other works in which the Apple
|
||||
// Software may be incorporated.
|
||||
//
|
||||
// The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO
|
||||
// WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
|
||||
// WARRANTIES OF NON - INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A
|
||||
// PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION
|
||||
// ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
|
||||
//
|
||||
// IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
|
||||
// CONSEQUENTIAL DAMAGES ( INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
// INTERRUPTION ) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION
|
||||
// AND / OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER
|
||||
// UNDER THEORY OF CONTRACT, TORT ( INCLUDING NEGLIGENCE ), STRICT LIABILITY OR
|
||||
// OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// Copyright ( C ) 2003-2007 Apple Inc. All Rights Reserved.
|
||||
//
|
||||
|
||||
#import "GLString.h"
|
||||
|
||||
// The following is a NSBezierPath category to allow
|
||||
// for rounded corners of the border
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark NSBezierPath Category
|
||||
|
||||
@implementation NSBezierPath (RoundRect)
|
||||
|
||||
+ (NSBezierPath *)bezierPathWithRoundedRect:(NSRect)rect cornerRadius:(float)radius {
|
||||
NSBezierPath *result = [NSBezierPath bezierPath];
|
||||
[result appendBezierPathWithRoundedRect:rect cornerRadius:radius];
|
||||
return result;
|
||||
}
|
||||
|
||||
- (void)appendBezierPathWithRoundedRect:(NSRect)rect cornerRadius:(float)radius {
|
||||
if (!NSIsEmptyRect(rect)) {
|
||||
if (radius > 0.0) {
|
||||
// Clamp radius to be no larger than half the rect's width or height.
|
||||
float clampedRadius = MIN(radius, 0.5 * MIN(rect.size.width, rect.size.height));
|
||||
|
||||
NSPoint topLeft = NSMakePoint(NSMinX(rect), NSMaxY(rect));
|
||||
NSPoint topRight = NSMakePoint(NSMaxX(rect), NSMaxY(rect));
|
||||
NSPoint bottomRight = NSMakePoint(NSMaxX(rect), NSMinY(rect));
|
||||
|
||||
[self moveToPoint:NSMakePoint(NSMidX(rect), NSMaxY(rect))];
|
||||
[self appendBezierPathWithArcFromPoint:topLeft toPoint:rect.origin radius:clampedRadius];
|
||||
[self appendBezierPathWithArcFromPoint:rect.origin toPoint:bottomRight radius:clampedRadius];
|
||||
[self appendBezierPathWithArcFromPoint:bottomRight toPoint:topRight radius:clampedRadius];
|
||||
[self appendBezierPathWithArcFromPoint:topRight toPoint:topLeft radius:clampedRadius];
|
||||
[self closePath];
|
||||
} else {
|
||||
// When radius == 0.0, this degenerates to the simple case of a plain rectangle.
|
||||
[self appendBezierPathWithRect:rect];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark GLString
|
||||
|
||||
// GLString follows
|
||||
|
||||
@implementation GLString
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Deallocs
|
||||
|
||||
- (void) deleteTexture
|
||||
{
|
||||
if (texName && cgl_ctx) {
|
||||
(*cgl_ctx->disp.delete_textures)(cgl_ctx->rend, 1, &texName);
|
||||
texName = 0; // ensure it is zeroed for failure cases
|
||||
cgl_ctx = 0;
|
||||
}
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
[self deleteTexture];
|
||||
[textColor release];
|
||||
[boxColor release];
|
||||
[borderColor release];
|
||||
[string release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Initializers
|
||||
|
||||
// designated initializer
|
||||
- (id) initWithAttributedString:(NSAttributedString *)attributedString withTextColor:(NSColor *)text withBoxColor:(NSColor *)box withBorderColor:(NSColor *)border
|
||||
{
|
||||
[super init];
|
||||
cgl_ctx = NULL;
|
||||
texName = 0;
|
||||
texSize.width = 0.0f;
|
||||
texSize.height = 0.0f;
|
||||
[attributedString retain];
|
||||
string = attributedString;
|
||||
[text retain];
|
||||
[box retain];
|
||||
[border retain];
|
||||
textColor = text;
|
||||
boxColor = box;
|
||||
borderColor = border;
|
||||
staticFrame = NO;
|
||||
antialias = YES;
|
||||
marginSize.width = 4.0f; // standard margins
|
||||
marginSize.height = 2.0f;
|
||||
cRadius = 4.0f;
|
||||
requiresUpdate = YES;
|
||||
// all other variables 0 or NULL
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id) initWithString:(NSString *)aString withAttributes:(NSDictionary *)attribs withTextColor:(NSColor *)text withBoxColor:(NSColor *)box withBorderColor:(NSColor *)border
|
||||
{
|
||||
return [self initWithAttributedString:[[[NSAttributedString alloc] initWithString:aString attributes:attribs] autorelease] withTextColor:text withBoxColor:box withBorderColor:border];
|
||||
}
|
||||
|
||||
// basic methods that pick up defaults
|
||||
- (id) initWithAttributedString:(NSAttributedString *)attributedString;
|
||||
{
|
||||
return [self initWithAttributedString:attributedString withTextColor:[NSColor colorWithDeviceRed:1.0f green:1.0f blue:1.0f alpha:1.0f] withBoxColor:[NSColor colorWithDeviceRed:1.0f green:1.0f blue:1.0f alpha:0.0f] withBorderColor:[NSColor colorWithDeviceRed:1.0f green:1.0f blue:1.0f alpha:0.0f]];
|
||||
}
|
||||
|
||||
- (id) initWithString:(NSString *)aString withAttributes:(NSDictionary *)attribs
|
||||
{
|
||||
return [self initWithAttributedString:[[[NSAttributedString alloc] initWithString:aString attributes:attribs] autorelease] withTextColor:[NSColor colorWithDeviceRed:1.0f green:1.0f blue:1.0f alpha:1.0f] withBoxColor:[NSColor colorWithDeviceRed:1.0f green:1.0f blue:1.0f alpha:0.0f] withBorderColor:[NSColor colorWithDeviceRed:1.0f green:1.0f blue:1.0f alpha:0.0f]];
|
||||
}
|
||||
|
||||
- (void) genTexture; // generates the texture without drawing texture to current context
|
||||
{
|
||||
NSImage * image;
|
||||
NSBitmapImageRep * bitmap;
|
||||
|
||||
NSSize previousSize = texSize;
|
||||
|
||||
if ((NO == staticFrame) && (0.0f == frameSize.width) && (0.0f == frameSize.height)) { // find frame size if we have not already found it
|
||||
frameSize = [string size]; // current string size
|
||||
frameSize.width += marginSize.width * 2.0f; // add padding
|
||||
frameSize.height += marginSize.height * 2.0f;
|
||||
}
|
||||
image = [[NSImage alloc] initWithSize:frameSize];
|
||||
|
||||
[image lockFocus];
|
||||
[[NSGraphicsContext currentContext] setShouldAntialias:antialias];
|
||||
|
||||
if ([boxColor alphaComponent]) { // this should be == 0.0f but need to make sure
|
||||
[boxColor set];
|
||||
NSBezierPath *path = [NSBezierPath bezierPathWithRoundedRect:NSInsetRect(NSMakeRect (0.0f, 0.0f, frameSize.width, frameSize.height) , 0.5, 0.5)
|
||||
cornerRadius:cRadius];
|
||||
[path fill];
|
||||
}
|
||||
|
||||
if ([borderColor alphaComponent]) {
|
||||
[borderColor set];
|
||||
NSBezierPath *path = [NSBezierPath bezierPathWithRoundedRect:NSInsetRect(NSMakeRect (0.0f, 0.0f, frameSize.width, frameSize.height), 0.5, 0.5)
|
||||
cornerRadius:cRadius];
|
||||
[path setLineWidth:1.0f];
|
||||
[path stroke];
|
||||
}
|
||||
|
||||
[textColor set];
|
||||
[string drawAtPoint:NSMakePoint (marginSize.width, marginSize.height)]; // draw at offset position
|
||||
bitmap = [[NSBitmapImageRep alloc] initWithFocusedViewRect:NSMakeRect (0.0f, 0.0f, frameSize.width, frameSize.height)];
|
||||
[image unlockFocus];
|
||||
texSize.width = [bitmap pixelsWide];
|
||||
texSize.height = [bitmap pixelsHigh];
|
||||
|
||||
if (cgl_ctx = CGLGetCurrentContext ()) { // if we successfully retrieve a current context (required)
|
||||
glPushAttrib(GL_TEXTURE_BIT);
|
||||
if (0 == texName) glGenTextures (1, &texName);
|
||||
glBindTexture (GL_TEXTURE_RECTANGLE_EXT, texName);
|
||||
if (NSEqualSizes(previousSize, texSize)) {
|
||||
glTexSubImage2D(GL_TEXTURE_RECTANGLE_EXT,0,0,0,texSize.width,texSize.height,[bitmap hasAlpha] ? GL_RGBA : GL_RGB,GL_UNSIGNED_BYTE,[bitmap bitmapData]);
|
||||
} else {
|
||||
glTexParameteri(GL_TEXTURE_RECTANGLE_EXT, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_RECTANGLE_EXT, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glTexImage2D(GL_TEXTURE_RECTANGLE_EXT, 0, GL_RGBA, texSize.width, texSize.height, 0, [bitmap hasAlpha] ? GL_RGBA : GL_RGB, GL_UNSIGNED_BYTE, [bitmap bitmapData]);
|
||||
}
|
||||
glPopAttrib();
|
||||
} else
|
||||
NSLog (@"StringTexture -genTexture: Failure to get current OpenGL context\n");
|
||||
|
||||
[bitmap release];
|
||||
[image release];
|
||||
|
||||
requiresUpdate = NO;
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Accessors
|
||||
|
||||
- (GLuint) texName
|
||||
{
|
||||
return texName;
|
||||
}
|
||||
|
||||
- (NSSize) texSize
|
||||
{
|
||||
return texSize;
|
||||
}
|
||||
|
||||
#pragma mark Text Color
|
||||
|
||||
- (void) setTextColor:(NSColor *)color // set default text color
|
||||
{
|
||||
[color retain];
|
||||
[textColor release];
|
||||
textColor = color;
|
||||
requiresUpdate = YES;
|
||||
}
|
||||
|
||||
- (NSColor *) textColor
|
||||
{
|
||||
return textColor;
|
||||
}
|
||||
|
||||
#pragma mark Box Color
|
||||
|
||||
- (void) setBoxColor:(NSColor *)color // set default text color
|
||||
{
|
||||
[color retain];
|
||||
[boxColor release];
|
||||
boxColor = color;
|
||||
requiresUpdate = YES;
|
||||
}
|
||||
|
||||
- (NSColor *) boxColor
|
||||
{
|
||||
return boxColor;
|
||||
}
|
||||
|
||||
#pragma mark Border Color
|
||||
|
||||
- (void) setBorderColor:(NSColor *)color // set default text color
|
||||
{
|
||||
[color retain];
|
||||
[borderColor release];
|
||||
borderColor = color;
|
||||
requiresUpdate = YES;
|
||||
}
|
||||
|
||||
- (NSColor *) borderColor
|
||||
{
|
||||
return borderColor;
|
||||
}
|
||||
|
||||
#pragma mark Margin Size
|
||||
|
||||
// these will force the texture to be regenerated at the next draw
|
||||
- (void) setMargins:(NSSize)size // set offset size and size to fit with offset
|
||||
{
|
||||
marginSize = size;
|
||||
if (NO == staticFrame) { // ensure dynamic frame sizes will be recalculated
|
||||
frameSize.width = 0.0f;
|
||||
frameSize.height = 0.0f;
|
||||
}
|
||||
requiresUpdate = YES;
|
||||
}
|
||||
|
||||
- (NSSize) marginSize
|
||||
{
|
||||
return marginSize;
|
||||
}
|
||||
|
||||
#pragma mark Antialiasing
|
||||
- (BOOL) antialias
|
||||
{
|
||||
return antialias;
|
||||
}
|
||||
|
||||
- (void) setAntialias:(bool)request
|
||||
{
|
||||
antialias = request;
|
||||
requiresUpdate = YES;
|
||||
}
|
||||
|
||||
|
||||
#pragma mark Frame
|
||||
|
||||
- (NSSize) frameSize
|
||||
{
|
||||
if ((NO == staticFrame) && (0.0f == frameSize.width) && (0.0f == frameSize.height)) { // find frame size if we have not already found it
|
||||
frameSize = [string size]; // current string size
|
||||
frameSize.width += marginSize.width * 2.0f; // add padding
|
||||
frameSize.height += marginSize.height * 2.0f;
|
||||
}
|
||||
return frameSize;
|
||||
}
|
||||
|
||||
- (BOOL) staticFrame
|
||||
{
|
||||
return staticFrame;
|
||||
}
|
||||
|
||||
- (void) useStaticFrame:(NSSize)size // set static frame size and size to frame
|
||||
{
|
||||
frameSize = size;
|
||||
staticFrame = YES;
|
||||
requiresUpdate = YES;
|
||||
}
|
||||
|
||||
- (void) useDynamicFrame
|
||||
{
|
||||
if (staticFrame) { // set to dynamic frame and set to regen texture
|
||||
staticFrame = NO;
|
||||
frameSize.width = 0.0f; // ensure frame sizes will be recalculated
|
||||
frameSize.height = 0.0f;
|
||||
requiresUpdate = YES;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark String
|
||||
|
||||
- (void) setString:(NSAttributedString *)attributedString // set string after initial creation
|
||||
{
|
||||
[attributedString retain];
|
||||
[string release];
|
||||
string = attributedString;
|
||||
if (NO == staticFrame) { // ensure dynamic frame sizes will be recalculated
|
||||
frameSize.width = 0.0f;
|
||||
frameSize.height = 0.0f;
|
||||
}
|
||||
requiresUpdate = YES;
|
||||
}
|
||||
|
||||
- (void) setString:(NSString *)aString withAttributes:(NSDictionary *)attribs; // set string after initial creation
|
||||
{
|
||||
[self setString:[[[NSAttributedString alloc] initWithString:aString attributes:attribs] autorelease]];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Drawing
|
||||
|
||||
- (void) drawWithBounds:(NSRect)bounds
|
||||
{
|
||||
if (requiresUpdate)
|
||||
[self genTexture];
|
||||
if (texName) {
|
||||
glPushAttrib(GL_ENABLE_BIT | GL_TEXTURE_BIT | GL_COLOR_BUFFER_BIT); // GL_COLOR_BUFFER_BIT for glBlendFunc, GL_ENABLE_BIT for glEnable / glDisable
|
||||
|
||||
glDisable (GL_DEPTH_TEST); // ensure text is not remove by depth buffer test.
|
||||
glEnable (GL_BLEND); // for text fading
|
||||
glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA); // ditto
|
||||
glEnable (GL_TEXTURE_RECTANGLE_EXT);
|
||||
|
||||
glBindTexture (GL_TEXTURE_RECTANGLE_EXT, texName);
|
||||
glBegin (GL_QUADS);
|
||||
glTexCoord2f (0.0f, 0.0f); // draw upper left in world coordinates
|
||||
glVertex2f (bounds.origin.x, bounds.origin.y);
|
||||
|
||||
glTexCoord2f (0.0f, texSize.height); // draw lower left in world coordinates
|
||||
glVertex2f (bounds.origin.x, bounds.origin.y + bounds.size.height);
|
||||
|
||||
glTexCoord2f (texSize.width, texSize.height); // draw upper right in world coordinates
|
||||
glVertex2f (bounds.origin.x + bounds.size.width, bounds.origin.y + bounds.size.height);
|
||||
|
||||
glTexCoord2f (texSize.width, 0.0f); // draw lower right in world coordinates
|
||||
glVertex2f (bounds.origin.x + bounds.size.width, bounds.origin.y);
|
||||
glEnd ();
|
||||
|
||||
glPopAttrib();
|
||||
}
|
||||
}
|
||||
|
||||
- (void) drawAtPoint:(NSPoint)point
|
||||
{
|
||||
if (requiresUpdate)
|
||||
[self genTexture]; // ensure size is calculated for bounds
|
||||
if (texName) // if successful
|
||||
[self drawWithBounds:NSMakeRect (point.x, point.y, texSize.width, texSize.height)];
|
||||
}
|
||||
|
||||
@end
|
28
osx/Info.plist
Normal file
28
osx/Info.plist
Normal file
@ -0,0 +1,28 @@
|
||||
<?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>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>RetroArch</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.retroarch.RetroArch</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.1</string>
|
||||
<key>NSMainNibFile</key>
|
||||
<string>MainMenu</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
</dict>
|
||||
</plist>
|
BIN
osx/ReadMe.rtfd/CocoaGL.jpg
Normal file
BIN
osx/ReadMe.rtfd/CocoaGL.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.2 KiB |
219
osx/ReadMe.rtfd/TXT.rtf
Normal file
219
osx/ReadMe.rtfd/TXT.rtf
Normal file
@ -0,0 +1,219 @@
|
||||
{\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf390
|
||||
\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fnil\fcharset0 Monaco;}
|
||||
{\colortbl;\red255\green255\blue255;}
|
||||
{\*\listtable{\list\listtemplateid1\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid1\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid1}
|
||||
{\list\listtemplateid2\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{hyphen\}}{\leveltext\leveltemplateid101\'01\uc0\u8259 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid102\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li1440\lin1440 }{\listname ;}\listid2}
|
||||
{\list\listtemplateid3\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid201\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid3}
|
||||
{\list\listtemplateid4\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{hyphen\}}{\leveltext\leveltemplateid301\'01\uc0\u8259 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid302\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li1440\lin1440 }{\listname ;}\listid4}
|
||||
{\list\listtemplateid5\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid401\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid5}
|
||||
{\list\listtemplateid6\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{hyphen\}}{\leveltext\leveltemplateid501\'01\uc0\u8259 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid502\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li1440\lin1440 }{\listname ;}\listid6}
|
||||
{\list\listtemplateid7\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid601\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid602\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li1440\lin1440 }{\listname ;}\listid7}
|
||||
{\list\listtemplateid8\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid701\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid8}
|
||||
{\list\listtemplateid9\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{hyphen\}}{\leveltext\leveltemplateid801\'01\uc0\u8259 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid802\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li1440\lin1440 }{\listname ;}\listid9}
|
||||
{\list\listtemplateid10\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid901\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid10}
|
||||
{\list\listtemplateid11\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{hyphen\}}{\leveltext\leveltemplateid1001\'01\uc0\u8259 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid1002\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li1440\lin1440 }{\listname ;}\listid11}
|
||||
{\list\listtemplateid12\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid1101\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid12}
|
||||
{\list\listtemplateid13\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{hyphen\}}{\leveltext\leveltemplateid1201\'01\uc0\u8259 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid1202\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li1440\lin1440 }{\listname ;}\listid13}
|
||||
{\list\listtemplateid14\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid1301\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid14}
|
||||
{\list\listtemplateid15\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid1401\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid15}
|
||||
{\list\listtemplateid16\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid1501\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid16}
|
||||
{\list\listtemplateid17\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid1601\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid17}}
|
||||
{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}{\listoverride\listid2\listoverridecount0\ls2}{\listoverride\listid3\listoverridecount0\ls3}{\listoverride\listid4\listoverridecount0\ls4}{\listoverride\listid5\listoverridecount0\ls5}{\listoverride\listid6\listoverridecount0\ls6}{\listoverride\listid7\listoverridecount0\ls7}{\listoverride\listid8\listoverridecount0\ls8}{\listoverride\listid9\listoverridecount0\ls9}{\listoverride\listid10\listoverridecount0\ls10}{\listoverride\listid11\listoverridecount0\ls11}{\listoverride\listid12\listoverridecount0\ls12}{\listoverride\listid13\listoverridecount0\ls13}{\listoverride\listid14\listoverridecount0\ls14}{\listoverride\listid15\listoverridecount0\ls15}{\listoverride\listid16\listoverridecount0\ls16}{\listoverride\listid17\listoverridecount0\ls17}}
|
||||
\margl1440\margr1440\vieww17320\viewh12200\viewkind0
|
||||
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural
|
||||
|
||||
\f0\fs24 \cf0 {{\NeXTGraphic CocoaGL.jpg \width3080 \height2460 \noorient
|
||||
}¬}\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural
|
||||
\cf0
|
||||
\b RetroArch CocoaGL
|
||||
\b0 \
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural
|
||||
\cf0 \
|
||||
This sample application shows the basics of rendering with OpenGL using the Cocoa interface. The
|
||||
\f1 BasicOpenGLView
|
||||
\f0 class is the highlight of this sample application.\
|
||||
\
|
||||
|
||||
\b The BasicOpenGLView Class:\
|
||||
|
||||
\b0 \
|
||||
The
|
||||
\f1 BasicOpenGLView
|
||||
\f0 class a subclass of
|
||||
\f1 NSOpenGLView
|
||||
\f0 , which is instantiated on the main window in the nib file, manages the content, input and events of a colorful cube which rotates over time. \
|
||||
\
|
||||
Here are 4 distinct areas of the class:\
|
||||
\
|
||||
\pard\tx220\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li720\fi-720\pardirnatural
|
||||
\ls1\ilvl0
|
||||
\b \cf0 {\listtext \'95 }Initialization\
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural
|
||||
|
||||
\i\b0 \cf0 \
|
||||
\pard\tx940\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li1440\fi-1440\pardirnatural
|
||||
\ls2\ilvl1\cf0 {\listtext \'95 }
|
||||
\i0 The
|
||||
\f1 initWithFrame
|
||||
\f0\i
|
||||
\i0 method, which is overridden from the default
|
||||
\f1 NSOpenGLView
|
||||
\f0\i class
|
||||
\i0 , creates a
|
||||
\f1 NSOpenGLPixelformat
|
||||
\f0 by calling the
|
||||
\f1 BasicOpenGLView's
|
||||
\f0\i
|
||||
\f1\i0 basicPixelFormat
|
||||
\f0\i
|
||||
\i0 which will request a double buffer color buffer, and a 16 bits wide depth buffer. A call is made to the super class (
|
||||
\f1 NSOpenGLView
|
||||
\f0\i )
|
||||
\i0 to create an OpenGL context using the requested pixel format .\
|
||||
{\listtext \'95 }The
|
||||
\f1 awakeFromNib
|
||||
\f0\i
|
||||
\i0 method is then called to initialize some variables, check the OpenGL capabilities (extensions present, limits, etc), and sets a
|
||||
\f1 NSTimer
|
||||
\f0\i
|
||||
\i0 which will call the
|
||||
\f1 animationTimer
|
||||
\f0\i
|
||||
\i0 every 1/60 of a second\
|
||||
{\listtext \'95 }The
|
||||
\f1 prepareOpenGL
|
||||
\f0 method is then called before rendering starts. This method first sets the OpenGL context's swaps of the color buffers to be synchronized to the vertical retrace period of the display. It sets some initial OpenGL state, initializes our camera, the font to be used for our
|
||||
\f1 GLString
|
||||
\f0 textures, and finally creates the initial strings. \
|
||||
{\listtext \'95 }\
|
||||
\pard\tx220\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li720\fi-720\pardirnatural
|
||||
\ls3\ilvl0
|
||||
\b \cf0 {\listtext \'95 }Rendering Loop\
|
||||
\pard\tx220\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li720\fi-720\pardirnatural
|
||||
\ls3\ilvl0
|
||||
\b0 \cf0 \
|
||||
\pard\tx940\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li1440\fi-1440\pardirnatural
|
||||
\ls4\ilvl1\cf0 {\listtext \'95 }The
|
||||
\f1 drawRect
|
||||
\f0 method is called for the first time. This method is where the rendering actually happens. The viewport, projection, camera,
|
||||
\f1 modelview
|
||||
\f0 , matrices and strings are adjusted the cube and information string are rendered. Finally the time is checked and possible OpenGL errors are checked and reported if needed. If multiple OpenGL contexts were present on your application, the OpenGL context would have to be made the current context as well.\
|
||||
{\listtext \'95 }As the
|
||||
\f1 NSTimer
|
||||
\f0 fires, the
|
||||
\f1 animationTimer
|
||||
\f0 gets executed which updates the rotation based on elapsed time and calls the
|
||||
\f1 drawRect
|
||||
\f0 method to render again.\
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural
|
||||
\cf0 \
|
||||
\pard\tx220\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li720\fi-720\pardirnatural
|
||||
\ls5\ilvl0
|
||||
\b \cf0 {\listtext \'95 }Event Handling\
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural
|
||||
|
||||
\b0 \cf0 \
|
||||
\pard\tx940\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li1440\fi-1440\pardirnatural
|
||||
\ls6\ilvl1\cf0 {\listtext \'95 }The
|
||||
\f1 acceptsFirstResponder
|
||||
\f0 and
|
||||
\f1 becomeFirstResponder
|
||||
\f0 methods returning YES allow
|
||||
\f1 BasicOpenGLView
|
||||
\f0\i
|
||||
\i0 to receive events.\
|
||||
{\listtext \'95 }Several methods of the
|
||||
\f1 BasicOpenGLView
|
||||
\f0 are dedicated to receiving events from the mouse or keyboard:
|
||||
\f1 \CocoaLigature0 keyDown, mouseDown, rightMouseDown, otherMouseDown, mouseUp, rightMouseUp, otherMouseUp, mouseDragged, scrollWheel, rightMouseDragged
|
||||
\f0 \CocoaLigature1 and
|
||||
\f1 \CocoaLigature0 otherMouseDragged.\
|
||||
\pard\tx940\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li1440\fi-1440\pardirnatural
|
||||
|
||||
\f0 \cf0 \CocoaLigature1 \'95 This methods act on what their name describe to update the camera which affect the projection and modelview matrices. \
|
||||
\pard\tx220\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li720\fi-720\pardirnatural
|
||||
\ls7\ilvl0
|
||||
\b \cf0 {\listtext \'95 }Main Menu Interaction\
|
||||
\pard\tx220\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li720\fi-720\pardirnatural
|
||||
\ls7\ilvl0
|
||||
\b0 \cf0 \
|
||||
\pard\tx940\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li1440\fi-1440\pardirnatural
|
||||
\ls7\ilvl1\cf0 {\listtext \'95 }The
|
||||
\f1 \CocoaLigature0 animate
|
||||
\f0 \CocoaLigature1 and
|
||||
\f1 \CocoaLigature0 info
|
||||
\f0 \CocoaLigature1 methods are called from the Main menu Animate and Info choices. The menu choices are "wired" to these methods with Interface Builder and this information is stored and restored from the MainMenu.nib file.\
|
||||
\
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural
|
||||
|
||||
\b \cf0 The GL Utilities group:\
|
||||
|
||||
\b0 \
|
||||
\pard\tx220\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li720\fi-720\pardirnatural
|
||||
\ls8\ilvl0
|
||||
\b \cf0 {\listtext \'95 }GLString.m\
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural
|
||||
|
||||
\i\b0 \cf0 \
|
||||
\pard\tx940\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li1440\fi-1440\pardirnatural
|
||||
\ls9\ilvl1\cf0 {\listtext \'95 }
|
||||
\i0 This class manages string textures generated with Quartz. A particular string can be initialized via
|
||||
\f1 \CocoaLigature0 initWithString:withAttributes:withTextColor:withBoxColor:withBorderColor:
|
||||
\f0 \CocoaLigature1 and can be drawn using
|
||||
\f1 \CocoaLigature0 drawAtPoint:
|
||||
\f0 \CocoaLigature1 which takes a single 2D point as the origin of the quad that contains the texture\
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural
|
||||
\cf0 \
|
||||
\pard\tx220\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li720\fi-720\pardirnatural
|
||||
\ls10\ilvl0
|
||||
\b \cf0 {\listtext \'95 }GLCheck.c\
|
||||
\
|
||||
\pard\tx940\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li1440\fi-1440\pardirnatural
|
||||
\ls11\ilvl1
|
||||
\i\b0 \cf0 {\listtext \'95 }
|
||||
\i0 \CocoaLigature0 GLCheck allows developer to check the hardware capabilities of all GPU's returning an array of records reflecting the attached hardware. This list can be regenerated on Display Manager notifications to keep the client update to on capabilities and setup changes. This is provided as sample to allow developers the freedom to check as few or as many conditions and capabilities as they would like or add their own checks\
|
||||
\pard\tx220\tx720\tx1120\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li720\fi-720\pardirnatural
|
||||
\ls11\ilvl0\cf0 \CocoaLigature1 \
|
||||
\pard\tx220\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li720\fi-720\pardirnatural
|
||||
\ls12\ilvl0
|
||||
\b \cf0 {\listtext \'95 }drawInfo.m\
|
||||
\
|
||||
\pard\tx940\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li1440\fi-1440\pardirnatural
|
||||
\ls13\ilvl1
|
||||
\i\b0 \cf0 {\listtext \'95 }
|
||||
\i0 \CocoaLigature0 This class makes use of both GLCheck and GLString to creates and maintain a texture with the strings describing the capabilities of the graphics card.\
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural
|
||||
\cf0 \CocoaLigature1 \
|
||||
|
||||
\b References:\
|
||||
\
|
||||
\pard\tx220\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li720\fi-720\pardirnatural
|
||||
\ls14\ilvl0\cf0 OpenGL and Cocoa:\
|
||||
\
|
||||
{\listtext \'95 }{\field{\*\fldinst{HYPERLINK "http://developer.apple.com/documentation/GraphicsImaging/Conceptual/OpenGL-MacProgGuide/"}}{\fldrslt OpenGL Programming Guide for Mac OS X}}\
|
||||
\pard\tx220\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li720\fi-720\pardirnatural
|
||||
\ls14\ilvl0
|
||||
\b0 \cf0 {\listtext \'95 }{\field{\*\fldinst{HYPERLINK "http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSOpenGLView_Class/index.html"}}{\fldrslt NSOpenGLView Class Reference}}\
|
||||
{\listtext \'95 }{\field{\*\fldinst{HYPERLINK "http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSOpenGLPixelFormat_Class/index.html"}}{\fldrslt NSOpenGLPixelFormat Class Reference}}\
|
||||
{\listtext \'95 }{\field{\*\fldinst{HYPERLINK "http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSOpenGLContext_Class/index.html"}}{\fldrslt NSOpenGLContext Class Reference}}\
|
||||
\
|
||||
\pard\tx220\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li720\fi-720\pardirnatural
|
||||
\ls14\ilvl0
|
||||
\b \cf0 Events and the Run Loop:
|
||||
\b0 \
|
||||
\
|
||||
\pard\tx220\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li720\fi-720\pardirnatural
|
||||
\ls15\ilvl0\cf0 {\listtext \'95 }{\field{\*\fldinst{HYPERLINK "http://developer.apple.com/documentation/Cocoa/Conceptual/EventOverview/index.html"}}{\fldrslt Cocoa Event-Handling Guide}}\
|
||||
{\listtext \'95 }{\field{\*\fldinst{HYPERLINK "http://developer.apple.com/documentation/Cocoa/Conceptual/InputControl/index.html"}}{\fldrslt Run Loops}}\
|
||||
\
|
||||
\pard\tx220\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li720\fi-720\pardirnatural
|
||||
\ls16\ilvl0
|
||||
\b \cf0 Objective-C:
|
||||
\b0 \
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural
|
||||
\cf0 \
|
||||
\pard\tx220\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li720\fi-720\pardirnatural
|
||||
\ls17\ilvl0\cf0 {\listtext \'95 }{\field{\*\fldinst{HYPERLINK "http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/index.html"}}{\fldrslt The Objective-C Programming Language}}\
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural
|
||||
\cf0 \
|
||||
}
|
BIN
osx/RetroArch.icns
Normal file
BIN
osx/RetroArch.icns
Normal file
Binary file not shown.
306
osx/RetroArch.xcodeproj/project.pbxproj
Normal file
306
osx/RetroArch.xcodeproj/project.pbxproj
Normal file
@ -0,0 +1,306 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
5014454A17858BE60072A543 /* RetroArch.icns in Resources */ = {isa = PBXBuildFile; fileRef = 5014454917858BE60072A543 /* RetroArch.icns */; };
|
||||
7409592A0CC826D800261DBF /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 740959290CC826D800261DBF /* Credits.rtf */; };
|
||||
745217950CA98A790067AF41 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 745217940CA98A790067AF41 /* OpenGL.framework */; };
|
||||
745217CD0CA98B160067AF41 /* GLString.m in Sources */ = {isa = PBXBuildFile; fileRef = 74F0EC690CA98A30009E924F /* GLString.m */; };
|
||||
74F0EC5D0CA989F9009E924F /* BasicOpenGLView.m in Sources */ = {isa = PBXBuildFile; fileRef = 74F0EC5B0CA989F9009E924F /* BasicOpenGLView.m */; };
|
||||
8D11072A0486CEB800E47090 /* MainMenu.nib in Resources */ = {isa = PBXBuildFile; fileRef = 29B97318FDCFA39411CA2CEA /* MainMenu.nib */; };
|
||||
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
|
||||
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
|
||||
29B97319FDCFA39411CA2CEA /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/MainMenu.nib; sourceTree = "<group>"; };
|
||||
5014454917858BE60072A543 /* RetroArch.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = RetroArch.icns; sourceTree = "<group>"; };
|
||||
740959290CC826D800261DBF /* Credits.rtf */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; path = Credits.rtf; sourceTree = "<group>"; };
|
||||
7439218A0CC944C3009BCC59 /* ReadMe.rtfd */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; path = ReadMe.rtfd; sourceTree = "<group>"; };
|
||||
745217940CA98A790067AF41 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = "<absolute>"; };
|
||||
74F0EC5B0CA989F9009E924F /* BasicOpenGLView.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = BasicOpenGLView.m; sourceTree = "<group>"; };
|
||||
74F0EC5C0CA989F9009E924F /* BasicOpenGLView.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = BasicOpenGLView.h; sourceTree = "<group>"; };
|
||||
74F0EC690CA98A30009E924F /* GLString.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GLString.m; sourceTree = "<group>"; };
|
||||
74F0EC6A0CA98A30009E924F /* GLString.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GLString.h; sourceTree = "<group>"; };
|
||||
8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
|
||||
8D1107320486CEB800E47090 /* RetroArch.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RetroArch.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
8D11072E0486CEB800E47090 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */,
|
||||
745217950CA98A790067AF41 /* OpenGL.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
080E96DDFE201D6D7F000001 /* Classes */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
74F0EC6A0CA98A30009E924F /* GLString.h */,
|
||||
74F0EC690CA98A30009E924F /* GLString.m */,
|
||||
74F0EC5B0CA989F9009E924F /* BasicOpenGLView.m */,
|
||||
74F0EC5C0CA989F9009E924F /* BasicOpenGLView.h */,
|
||||
);
|
||||
name = Classes;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
745217940CA98A790067AF41 /* OpenGL.framework */,
|
||||
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
|
||||
);
|
||||
name = "Linked Frameworks";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
);
|
||||
name = "Other Frameworks";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
19C28FACFE9D520D11CA2CBB /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8D1107320486CEB800E47090 /* RetroArch.app */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
29B97314FDCFA39411CA2CEA /* RetroArch CocoaGL */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
7439218A0CC944C3009BCC59 /* ReadMe.rtfd */,
|
||||
080E96DDFE201D6D7F000001 /* Classes */,
|
||||
29B97317FDCFA39411CA2CEA /* Resources */,
|
||||
29B97323FDCFA39411CA2CEA /* Frameworks */,
|
||||
19C28FACFE9D520D11CA2CBB /* Products */,
|
||||
);
|
||||
name = "RetroArch CocoaGL";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
29B97317FDCFA39411CA2CEA /* Resources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
5014454917858BE60072A543 /* RetroArch.icns */,
|
||||
740959290CC826D800261DBF /* Credits.rtf */,
|
||||
8D1107310486CEB800E47090 /* Info.plist */,
|
||||
089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
|
||||
29B97318FDCFA39411CA2CEA /* MainMenu.nib */,
|
||||
);
|
||||
name = Resources;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */,
|
||||
1058C7A2FEA54F0111CA2CBB /* Other Frameworks */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
8D1107260486CEB800E47090 /* RetroArch */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "RetroArch" */;
|
||||
buildPhases = (
|
||||
8D1107290486CEB800E47090 /* Resources */,
|
||||
8D11072C0486CEB800E47090 /* Sources */,
|
||||
8D11072E0486CEB800E47090 /* Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = RetroArch;
|
||||
productInstallPath = "$(HOME)/Applications";
|
||||
productName = "RetroArch CocoaGL";
|
||||
productReference = 8D1107320486CEB800E47090 /* RetroArch.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
29B97313FDCFA39411CA2CEA /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0460;
|
||||
};
|
||||
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "RetroArch" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 1;
|
||||
knownRegions = (
|
||||
en,
|
||||
);
|
||||
mainGroup = 29B97314FDCFA39411CA2CEA /* RetroArch CocoaGL */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
8D1107260486CEB800E47090 /* RetroArch */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
8D1107290486CEB800E47090 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8D11072A0486CEB800E47090 /* MainMenu.nib in Resources */,
|
||||
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */,
|
||||
7409592A0CC826D800261DBF /* Credits.rtf in Resources */,
|
||||
5014454A17858BE60072A543 /* RetroArch.icns in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
8D11072C0486CEB800E47090 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
745217CD0CA98B160067AF41 /* GLString.m in Sources */,
|
||||
74F0EC5D0CA989F9009E924F /* BasicOpenGLView.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
089C165DFE840E0CC02AAC07 /* English */,
|
||||
);
|
||||
name = InfoPlist.strings;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
29B97318FDCFA39411CA2CEA /* MainMenu.nib */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
29B97319FDCFA39411CA2CEA /* English */,
|
||||
);
|
||||
name = MainMenu.nib;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
C01FCF4B08A954540054247B /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_MODEL_TUNING = G5;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
INFOPLIST_FILE = Info.plist;
|
||||
INSTALL_PATH = "$(HOME)/Applications";
|
||||
PRODUCT_NAME = RetroArch;
|
||||
SDKROOT = "";
|
||||
WRAPPER_EXTENSION = app;
|
||||
ZERO_LINK = YES;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
C01FCF4C08A954540054247B /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
|
||||
GCC_MODEL_TUNING = G5;
|
||||
INFOPLIST_FILE = Info.plist;
|
||||
INSTALL_PATH = "$(HOME)/Applications";
|
||||
PRODUCT_NAME = RetroArch;
|
||||
SDKROOT = "";
|
||||
WRAPPER_EXTENSION = app;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
C01FCF4F08A954540054247B /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = NO;
|
||||
GCC_WARN_MISSING_PARENTHESES = NO;
|
||||
GCC_WARN_PEDANTIC = NO;
|
||||
GCC_WARN_SHADOW = NO;
|
||||
GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNKNOWN_PRAGMAS = YES;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_LABEL = YES;
|
||||
GCC_WARN_UNUSED_PARAMETER = NO;
|
||||
GCC_WARN_UNUSED_VALUE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = NO;
|
||||
SDKROOT = "";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
C01FCF5008A954540054247B /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = NO;
|
||||
GCC_WARN_MISSING_PARENTHESES = NO;
|
||||
GCC_WARN_PEDANTIC = NO;
|
||||
GCC_WARN_SHADOW = NO;
|
||||
GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNKNOWN_PRAGMAS = YES;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_LABEL = YES;
|
||||
GCC_WARN_UNUSED_PARAMETER = NO;
|
||||
GCC_WARN_UNUSED_VALUE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = NO;
|
||||
SDKROOT = "";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "RetroArch" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
C01FCF4B08A954540054247B /* Debug */,
|
||||
C01FCF4C08A954540054247B /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
C01FCF4E08A954540054247B /* Build configuration list for PBXProject "RetroArch" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
C01FCF4F08A954540054247B /* Debug */,
|
||||
C01FCF5008A954540054247B /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
|
||||
}
|
7
osx/RetroArch.xcodeproj/project.xcworkspace/contents.xcworkspacedata
generated
Normal file
7
osx/RetroArch.xcodeproj/project.xcworkspace/contents.xcworkspacedata
generated
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:RetroArch.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
Loading…
x
Reference in New Issue
Block a user