[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 2 questions about Application Services, 1 about backend
From: |
David Ayers |
Subject: |
Re: 2 questions about Application Services, 1 about backend |
Date: |
Fri, 20 Feb 2009 11:32:54 +0100 |
Am Freitag, den 20.02.2009, 11:18 +0100 schrieb Xavier Glattard:
> > ** 3. How can I check at runtime if a function is implemented by the
> > platform backend ?
> > For example "setValues" is not implemented on win32:
> > [[self openGLContext] setValues:&swapInterval
> > forParameter:NSOpenGLCPSwapInterval];
>
> A call to a non-implemented method raises an exception. You may catch
> it. As it's only implemented by Apple a compile time check should do the
> job. But is this what you need ?
-resondsToSelector: is the canonical run time check.
id ctx = [self openGLContext];
if ([ctx respondsToSelector:@selector(setValues:forParameter:)])
{
[ctx setValues:&swapInterval forParameter:NSOpenGLCPSwapInterval];
}
Cheers,
David