mirror of
https://github.com/SFML/SFML.git
synced 2024-11-25 04:41:05 +08:00
Added sfPriv prefix to forgotten Objective-C classes to prevent conflicts with user classes.
git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/trunk@1423 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
parent
9354d3adba
commit
d7496629e3
@ -32,7 +32,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Window independant OpenGL context class
|
||||
////////////////////////////////////////////////////////////
|
||||
@interface GLContext : NSOpenGLContext
|
||||
@interface sfPrivGLContext : NSOpenGLContext
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Return the shared OpenGL context instance (making one if needed)
|
||||
@ -44,7 +44,7 @@
|
||||
/// and the shared context @context
|
||||
////////////////////////////////////////////////////////////
|
||||
- (id)initWithAttributes:(sf::WindowSettings&)attribs
|
||||
sharedContext:(GLContext *)context;
|
||||
sharedContext:(sfPrivGLContext *)context;
|
||||
|
||||
@end
|
||||
|
||||
@ -52,10 +52,10 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Customized Cocoa OpenGL view
|
||||
////////////////////////////////////////////////////////////
|
||||
@interface GLView : NSOpenGLView
|
||||
@interface sfPrivGLView : NSOpenGLView
|
||||
{
|
||||
sf::priv::WindowImplCocoa *myDelegate;
|
||||
GLContext *myGLContext;
|
||||
sfPrivGLContext *myGLContext;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
@ -107,7 +107,7 @@
|
||||
{
|
||||
@private
|
||||
NSWindow *myWindow;
|
||||
GLView *myView;
|
||||
sfPrivGLView *myView;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
@ -118,7 +118,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Return a reference to the internal Cocoa OpenGL view
|
||||
////////////////////////////////////////////////////////////
|
||||
- (GLView *)view;
|
||||
- (sfPrivGLView *)view;
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Sets @aDelegate as the window delegate
|
||||
|
@ -43,12 +43,12 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Registers the the OpenGL view and adds it to its parent container
|
||||
////////////////////////////////////////////////////////////
|
||||
- (void)putOpenGLView:(GLView *)aView;
|
||||
- (void)putOpenGLView:(sfPrivGLView *)aView;
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Registers a reference to the internal Cocoa OpenGL view
|
||||
////////////////////////////////////////////////////////////
|
||||
- (void)setView:(GLView *)aView;
|
||||
- (void)setView:(sfPrivGLView *)aView;
|
||||
|
||||
@end
|
||||
|
||||
@ -65,7 +65,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Window independant OpenGL context class
|
||||
////////////////////////////////////////////////////////////
|
||||
@implementation GLContext
|
||||
@implementation sfPrivGLContext
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
@ -75,13 +75,13 @@
|
||||
{
|
||||
// Make a new context with the default parameters
|
||||
sf::WindowSettings params;
|
||||
static GLContext *sharedCtx = [[GLContext alloc] initWithAttributes:params sharedContext:nil];
|
||||
static sfPrivGLContext *sharedCtx = [[sfPrivGLContext alloc] initWithAttributes:params sharedContext:nil];
|
||||
return sharedCtx;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[[GLContext sharedContext] release];
|
||||
[[sfPrivGLContext sharedContext] release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@ -89,7 +89,7 @@
|
||||
/// Make a new OpenGL context according to the @attribs settings
|
||||
/// and the shared context @context
|
||||
////////////////////////////////////////////////////////////
|
||||
- (id)initWithAttributes:(sf::WindowSettings&)attribs sharedContext:(GLContext *)sharedContext
|
||||
- (id)initWithAttributes:(sf::WindowSettings&)attribs sharedContext:(sfPrivGLContext *)sharedContext
|
||||
{
|
||||
// Note about antialiasing and other context attributes :
|
||||
// OpenGL context sharing does not allow the shared contexts to use different attributes.
|
||||
@ -175,7 +175,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Customized Cocoa OpenGL view
|
||||
////////////////////////////////////////////////////////////
|
||||
@implementation GLView
|
||||
@implementation sfPrivGLView
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Make a new view according the the rect @frame,
|
||||
@ -196,8 +196,8 @@
|
||||
[self setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
|
||||
|
||||
// make the OpenGL context
|
||||
myGLContext = [[GLContext alloc] initWithAttributes:settings
|
||||
sharedContext:[GLContext sharedContext]];
|
||||
myGLContext = [[sfPrivGLContext alloc] initWithAttributes:settings
|
||||
sharedContext:[sfPrivGLContext sharedContext]];
|
||||
|
||||
if (!myGLContext) {
|
||||
[self release];
|
||||
@ -560,7 +560,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Registers the the OpenGL view and adds it to its parent container
|
||||
////////////////////////////////////////////////////////////
|
||||
- (void)putOpenGLView:(GLView *)aView
|
||||
- (void)putOpenGLView:(sfPrivGLView *)aView
|
||||
{
|
||||
[self setView:aView];
|
||||
|
||||
@ -573,7 +573,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Registers a reference to the internal Cocoa OpenGL view
|
||||
////////////////////////////////////////////////////////////
|
||||
- (void)setView:(GLView *)aView
|
||||
- (void)setView:(sfPrivGLView *)aView
|
||||
{
|
||||
if (myView != aView)
|
||||
{
|
||||
@ -585,7 +585,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Return a reference to the internal Cocoa OpenGL view
|
||||
////////////////////////////////////////////////////////////
|
||||
- (GLView *)view
|
||||
- (sfPrivGLView *)view
|
||||
{
|
||||
return [[myView retain] autorelease];
|
||||
}
|
||||
@ -849,7 +849,7 @@
|
||||
[[self window] center];
|
||||
|
||||
// Make the OpenGL view
|
||||
GLView *newView = [[GLView alloc]
|
||||
sfPrivGLView *newView = [[sfPrivGLView alloc]
|
||||
initWithFrame:[[[self window] contentView] frame]
|
||||
mode:aMode
|
||||
settings:someSettings];
|
||||
@ -990,7 +990,7 @@
|
||||
// Make the OpenGL view
|
||||
sf::VideoMode mode([[[self window] contentView] frame].size.width,
|
||||
[[[self window] contentView] frame].size.height);
|
||||
GLView *newView = [[GLView alloc]
|
||||
sfPrivGLView *newView = [[sfPrivGLView alloc]
|
||||
initWithFrame:[[[self window] contentView] frame]
|
||||
mode:mode
|
||||
settings:someSettings];
|
||||
@ -1025,7 +1025,7 @@
|
||||
// Make the OpenGL view
|
||||
sf::VideoMode mode([parentView bounds].size.width,
|
||||
[parentView bounds].size.height);
|
||||
GLView *newView = [[GLView alloc]
|
||||
sfPrivGLView *newView = [[sfPrivGLView alloc]
|
||||
initWithFrame:[parentView bounds]
|
||||
mode:mode
|
||||
settings:someSettings];
|
||||
@ -1051,7 +1051,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Registers the the OpenGL view and adds it to its parent container
|
||||
////////////////////////////////////////////////////////////
|
||||
- (void)putOpenGLView:(GLView *)aView
|
||||
- (void)putOpenGLView:(sfPrivGLView *)aView
|
||||
{
|
||||
[self setView:aView];
|
||||
|
||||
|
@ -70,7 +70,7 @@ myWheelStatus(0.0f)
|
||||
[sfPrivAppController sharedController];
|
||||
|
||||
// Create the shared OpenGL context
|
||||
if ([GLContext sharedContext]) {
|
||||
if ([sfPrivGLContext sharedContext]) {
|
||||
// Then we make it the current active OpenGL context
|
||||
SetActive();
|
||||
} else {
|
||||
@ -569,10 +569,10 @@ void WindowImplCocoa::SetActive(bool Active) const
|
||||
else {
|
||||
// Or directly activate the shared OpenGL context if we're not using a window
|
||||
if (Active) {
|
||||
if ([NSOpenGLContext currentContext] != [GLContext sharedContext])
|
||||
[[GLContext sharedContext] makeCurrentContext];
|
||||
if ([NSOpenGLContext currentContext] != [sfPrivGLContext sharedContext])
|
||||
[[sfPrivGLContext sharedContext] makeCurrentContext];
|
||||
} else {
|
||||
if ([NSOpenGLContext currentContext] == [GLContext sharedContext])
|
||||
if ([NSOpenGLContext currentContext] == [sfPrivGLContext sharedContext])
|
||||
[NSOpenGLContext clearCurrentContext];
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user