summaryrefslogtreecommitdiff
path: root/macosx/plugins/PeopsXgl/macsrc/PluginGLView.m
diff options
context:
space:
mode:
authorSND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2013-08-17 20:06:59 +0000
committerSND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2013-08-17 20:06:59 +0000
commit37ba81a540460a7d34a33c23d2353ac84f887576 (patch)
tree64490fe788c3efbc894bc4e418e098e8696a8040 /macosx/plugins/PeopsXgl/macsrc/PluginGLView.m
parent30195666f40ca64b0bdf34ed783215d27f000cd7 (diff)
downloadpcsxr-37ba81a540460a7d34a33c23d2353ac84f887576.tar.gz
Make more plug-ins use and implement RunOnMainThreadSync.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@86706 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'macosx/plugins/PeopsXgl/macsrc/PluginGLView.m')
-rwxr-xr-xmacosx/plugins/PeopsXgl/macsrc/PluginGLView.m64
1 files changed, 35 insertions, 29 deletions
diff --git a/macosx/plugins/PeopsXgl/macsrc/PluginGLView.m b/macosx/plugins/PeopsXgl/macsrc/PluginGLView.m
index 4e8b8c67..b2ec911a 100755
--- a/macosx/plugins/PeopsXgl/macsrc/PluginGLView.m
+++ b/macosx/plugins/PeopsXgl/macsrc/PluginGLView.m
@@ -33,33 +33,39 @@
@implementation PluginGLView
-- (BOOL)isOpaque { return YES; }
-- (BOOL)acceptsFirstResponder { return NO; }
+- (BOOL)isOpaque
+{
+ return YES;
+}
+- (BOOL)acceptsFirstResponder
+{
+ return NO;
+}
- (id) initWithCoder: (NSCoder *) coder
{
- // Set up pixel format on creation
- // and, well, that's about it.
- if ((self = [super initWithCoder:coder]) == nil)
+ // Set up pixel format on creation
+ // and, well, that's about it.
+ if ((self = [super initWithCoder:coder]) == nil)
return nil;
-
+
glLock = [[NSLock alloc] init];
if (nil == glLock) {
AUTORELEASEOBJNORETURN(self);
return nil;
}
-
+
// Init pixel format attribs
NSOpenGLPixelFormatAttribute attrs[] =
{
NSOpenGLPFAAccelerated,
NSOpenGLPFANoRecovery,
NSOpenGLPFADoubleBuffer,
-// NSOpenGLPFASampleBuffers, 1, // For full screen AA when implemented
-// NSOpenGLPFASamples, 2,
+ //NSOpenGLPFASampleBuffers, 1, // For full screen AA when implemented
+ //NSOpenGLPFASamples, 2,
0
};
-
+
// Get pixel format from OpenGL
NSOpenGLPixelFormat* pixFmt = [[NSOpenGLPixelFormat alloc] initWithAttributes:attrs];
if (!pixFmt)
@@ -71,7 +77,7 @@
NSOpenGLPFANoRecovery,
0
};
-
+
// Get pixel format from OpenGL
pixFmt = [[NSOpenGLPixelFormat alloc] initWithAttributes:attrs2];
if (!pixFmt) {
@@ -83,11 +89,11 @@
}
[self setPixelFormat:AUTORELEASEOBJ(pixFmt)];
-
+
[[self openGLContext] makeCurrentContext];
-
- // we're done, dude.
-
+
+ // we're done, dude.
+
// Call for a redisplay
noDisplay = YES; // hm, this can be deleted I think
PSXDisplay.Disabled = 1;
@@ -109,21 +115,21 @@
- (void)reshape // scrolled, moved or resized
{
[super reshape];
-
- [glLock lock]; // not sure if needed, but hey
- [[self openGLContext] makeCurrentContext];
-
- NSRect rect = [self bounds];
- rect.size = [self convertSize:rect.size toView:nil];
- glViewport(0.0, 0.0, NSWidth(rect), NSHeight(rect));
-
- glClearColor (1.0, 0.5, 0.0, 0.0);
+
+ [glLock lock]; // not sure if needed, but hey
+ [[self openGLContext] makeCurrentContext];
+
+ NSRect rect = [self bounds];
+ rect.size = [self convertSize:rect.size toView:nil];
+ glViewport(0.0, 0.0, NSWidth(rect), NSHeight(rect));
+
+ glClearColor (1.0, 0.5, 0.0, 0.0);
glClear(GL_COLOR_BUFFER_BIT);
- [[self openGLContext] flushBuffer];
-
-// [NSOpenGLContext clearCurrentContext]; // this makes bad things happen, so screw it.
+ [[self openGLContext] flushBuffer];
+
+ //[NSOpenGLContext clearCurrentContext]; // this makes bad things happen, so screw it.
[glLock unlock];
- return;
+ return;
}
- (void)swapBuffer
@@ -142,7 +148,7 @@
//[self loadTextures:NO];
} else {
noDisplay = YES;
- // [self setNeedsDisplay:true];
+ // [self setNeedsDisplay:true];
}
}