Fix style errors in iPhoneOS project

This commit is contained in:
Fraser Waters 2017-08-26 13:43:22 +01:00
parent ee7f578253
commit fd4871aa87
2 changed files with 83 additions and 83 deletions

View file

@ -82,7 +82,7 @@ namespace OpenTK.Platform.iPhoneOS
GetInteger = (All n, out int v) => ES11.GL.GetInteger(n, out v), GetInteger = (All n, out int v) => ES11.GL.GetInteger(n, out v),
Scissor = (x, y, w, h) => ES11.GL.Scissor(x, y, w, h), Scissor = (x, y, w, h) => ES11.GL.Scissor(x, y, w, h),
Viewport = (x, y, w, h) => ES11.GL.Viewport(x, y, w, h), Viewport = (x, y, w, h) => ES11.GL.Viewport(x, y, w, h),
GetRenderbufferParameter= (All t, All p, out int a) => ES11.GL.Oes.GetRenderbufferParameter (t, p, out a), GetRenderbufferParameter = (All t, All p, out int a) => ES11.GL.Oes.GetRenderbufferParameter (t, p, out a),
PixelStore = (n, p) => ES11.GL.PixelStore(n, p), PixelStore = (n, p) => ES11.GL.PixelStore(n, p),
ReadPixels = (x, y, w, h, f, t, d) => ES11.GL.ReadPixels(x, y, w, h, f, t, d), ReadPixels = (x, y, w, h, f, t, d) => ES11.GL.ReadPixels(x, y, w, h, f, t, d),
}; };
@ -91,38 +91,38 @@ namespace OpenTK.Platform.iPhoneOS
private static GLCalls CreateES2() private static GLCalls CreateES2()
{ {
return new GLCalls() { return new GLCalls() {
BindFramebuffer = (t, f) => ES20.GL.BindFramebuffer((ES20.FramebufferTarget) t, f), BindFramebuffer = (t, f) => ES20.GL.BindFramebuffer((ES20.FramebufferTarget)t, f),
BindRenderbuffer = (t, r) => ES20.GL.BindRenderbuffer((ES20.RenderbufferTarget) t, r), BindRenderbuffer = (t, r) => ES20.GL.BindRenderbuffer((ES20.RenderbufferTarget)t, r),
DeleteFramebuffers = (int n, ref int f) => ES20.GL.DeleteFramebuffers(n, ref f), DeleteFramebuffers = (int n, ref int f) => ES20.GL.DeleteFramebuffers(n, ref f),
DeleteRenderbuffers = (int n, ref int r) => ES20.GL.DeleteRenderbuffers(n, ref r), DeleteRenderbuffers = (int n, ref int r) => ES20.GL.DeleteRenderbuffers(n, ref r),
FramebufferRenderbuffer = (t, a, rt, rb) => ES20.GL.FramebufferRenderbuffer((ES20.FramebufferTarget) t, (ES20.FramebufferSlot) a, (ES20.RenderbufferTarget) rt, rb), FramebufferRenderbuffer = (t, a, rt, rb) => ES20.GL.FramebufferRenderbuffer((ES20.FramebufferTarget)t, (ES20.FramebufferSlot)a, (ES20.RenderbufferTarget)rt, rb),
GenFramebuffers = (int n, out int f) => ES20.GL.GenFramebuffers(n, out f), GenFramebuffers = (int n, out int f) => ES20.GL.GenFramebuffers(n, out f),
GenRenderbuffers = (int n, out int r) => ES20.GL.GenRenderbuffers(n, out r), GenRenderbuffers = (int n, out int r) => ES20.GL.GenRenderbuffers(n, out r),
GetInteger = (All n, out int v) => ES20.GL.GetInteger((ES20.GetPName) n, out v), GetInteger = (All n, out int v) => ES20.GL.GetInteger((ES20.GetPName)n, out v),
Scissor = (x, y, w, h) => ES20.GL.Scissor(x, y, w, h), Scissor = (x, y, w, h) => ES20.GL.Scissor(x, y, w, h),
Viewport = (x, y, w, h) => ES20.GL.Viewport(x, y, w, h), Viewport = (x, y, w, h) => ES20.GL.Viewport(x, y, w, h),
GetRenderbufferParameter= (All t, All p, out int a) => ES20.GL.GetRenderbufferParameter ((ES20.RenderbufferTarget) t, (ES20.RenderbufferParameterName) p, out a), GetRenderbufferParameter = (All t, All p, out int a) => ES20.GL.GetRenderbufferParameter ((ES20.RenderbufferTarget)t, (ES20.RenderbufferParameterName)p, out a),
PixelStore = (n, p) => ES20.GL.PixelStore((ES20.PixelStoreParameter) n, p), PixelStore = (n, p) => ES20.GL.PixelStore((ES20.PixelStoreParameter)n, p),
ReadPixels = (x, y, w, h, f, t, d) => ES20.GL.ReadPixels(x, y, w, h, (ES20.PixelFormat) f, (ES20.PixelType) t, d), ReadPixels = (x, y, w, h, f, t, d) => ES20.GL.ReadPixels(x, y, w, h, (ES20.PixelFormat)f, (ES20.PixelType)t, d),
}; };
} }
private static GLCalls CreateES3() private static GLCalls CreateES3()
{ {
return new GLCalls() { return new GLCalls() {
BindFramebuffer = (t, f) => ES30.GL.BindFramebuffer((ES30.FramebufferTarget) t, f), BindFramebuffer = (t, f) => ES30.GL.BindFramebuffer((ES30.FramebufferTarget)t, f),
BindRenderbuffer = (t, r) => ES30.GL.BindRenderbuffer((ES30.RenderbufferTarget) t, r), BindRenderbuffer = (t, r) => ES30.GL.BindRenderbuffer((ES30.RenderbufferTarget)t, r),
DeleteFramebuffers = (int n, ref int f) => ES30.GL.DeleteFramebuffers(n, ref f), DeleteFramebuffers = (int n, ref int f) => ES30.GL.DeleteFramebuffers(n, ref f),
DeleteRenderbuffers = (int n, ref int r) => ES30.GL.DeleteRenderbuffers(n, ref r), DeleteRenderbuffers = (int n, ref int r) => ES30.GL.DeleteRenderbuffers(n, ref r),
FramebufferRenderbuffer = (t, a, rt, rb) => ES30.GL.FramebufferRenderbuffer((ES30.FramebufferTarget) t, (ES30.FramebufferAttachment) a, (ES30.RenderbufferTarget) rt, rb), FramebufferRenderbuffer = (t, a, rt, rb) => ES30.GL.FramebufferRenderbuffer((ES30.FramebufferTarget)t, (ES30.FramebufferAttachment)a, (ES30.RenderbufferTarget)rt, rb),
GenFramebuffers = (int n, out int f) => ES30.GL.GenFramebuffers(n, out f), GenFramebuffers = (int n, out int f) => ES30.GL.GenFramebuffers(n, out f),
GenRenderbuffers = (int n, out int r) => ES30.GL.GenRenderbuffers(n, out r), GenRenderbuffers = (int n, out int r) => ES30.GL.GenRenderbuffers(n, out r),
GetInteger = (All n, out int v) => ES30.GL.GetInteger((ES30.GetPName) n, out v), GetInteger = (All n, out int v) => ES30.GL.GetInteger((ES30.GetPName)n, out v),
Scissor = (x, y, w, h) => ES30.GL.Scissor(x, y, w, h), Scissor = (x, y, w, h) => ES30.GL.Scissor(x, y, w, h),
Viewport = (x, y, w, h) => ES30.GL.Viewport(x, y, w, h), Viewport = (x, y, w, h) => ES30.GL.Viewport(x, y, w, h),
GetRenderbufferParameter= (All t, All p, out int a) => ES30.GL.GetRenderbufferParameter ((ES30.RenderbufferTarget) t, (ES30.RenderbufferParameterName) p, out a), GetRenderbufferParameter = (All t, All p, out int a) => ES30.GL.GetRenderbufferParameter ((ES30.RenderbufferTarget)t, (ES30.RenderbufferParameterName)p, out a),
PixelStore = (n, p) => ES30.GL.PixelStore((ES30.PixelStoreParameter) n, p), PixelStore = (n, p) => ES30.GL.PixelStore((ES30.PixelStoreParameter)n, p),
ReadPixels = (x, y, w, h, f, t, d) => ES30.GL.ReadPixels(x, y, w, h, (ES30.PixelFormat) f, (ES30.PixelType) t, d), ReadPixels = (x, y, w, h, f, t, d) => ES30.GL.ReadPixels(x, y, w, h, (ES30.PixelFormat)f, (ES30.PixelType)t, d),
}; };
} }
} }
@ -196,7 +196,7 @@ namespace OpenTK.Platform.iPhoneOS
// Can't use TimeSpan.FromSeconds() as that only has 1ms // Can't use TimeSpan.FromSeconds() as that only has 1ms
// resolution, and we need better (e.g. 60fps doesn't fit nicely // resolution, and we need better (e.g. 60fps doesn't fit nicely
// in 1ms resolution, but does in ticks). // in 1ms resolution, but does in ticks).
timeout = new TimeSpan ((long) (((1.0 * TimeSpan.TicksPerSecond) / updatesPerSecond) + 0.5)); timeout = new TimeSpan ((long)(((1.0 * TimeSpan.TicksPerSecond) / updatesPerSecond) + 0.5));
} }
public void Suspend () public void Suspend ()
@ -292,7 +292,7 @@ namespace OpenTK.Platform.iPhoneOS
} }
} }
public IGraphicsContext GraphicsContext {get; set;} public IGraphicsContext GraphicsContext {get; set; }
public EAGLContext EAGLContext { public EAGLContext EAGLContext {
get { get {
AssertValid(); AssertValid();
@ -347,14 +347,14 @@ namespace OpenTK.Platform.iPhoneOS
} }
public int Framebuffer { public int Framebuffer {
get {return framebuffer;} get {return framebuffer; }
} }
public int Renderbuffer { public int Renderbuffer {
get {return renderbuffer;} get {return renderbuffer; }
} }
public bool AutoResize {get; set;} public bool AutoResize {get; set; }
private UIViewController GetViewController() private UIViewController GetViewController()
{ {
@ -406,7 +406,7 @@ namespace OpenTK.Platform.iPhoneOS
} }
bool INativeWindow.Focused { bool INativeWindow.Focused {
get {throw new NotImplementedException();} get {throw new NotImplementedException(); }
} }
public virtual bool Visible { public virtual bool Visible {
@ -433,7 +433,7 @@ namespace OpenTK.Platform.iPhoneOS
} }
bool INativeWindow.Exists { bool INativeWindow.Exists {
get {throw new NotImplementedException();} get {throw new NotImplementedException(); }
} }
public virtual IWindowInfo WindowInfo { public virtual IWindowInfo WindowInfo {
@ -495,13 +495,13 @@ namespace OpenTK.Platform.iPhoneOS
} }
Rectangle INativeWindow.Bounds { Rectangle INativeWindow.Bounds {
get {throw new NotSupportedException();} get {throw new NotSupportedException(); }
set {throw new NotSupportedException();} set {throw new NotSupportedException(); }
} }
Point INativeWindow.Location { Point INativeWindow.Location {
get {throw new NotSupportedException();} get {throw new NotSupportedException(); }
set {throw new NotSupportedException();} set {throw new NotSupportedException(); }
} }
private Size size; private Size size;
@ -529,33 +529,33 @@ namespace OpenTK.Platform.iPhoneOS
} }
int INativeWindow.X { int INativeWindow.X {
get {throw new NotSupportedException();} get {throw new NotSupportedException(); }
set {throw new NotSupportedException();} set {throw new NotSupportedException(); }
} }
int INativeWindow.Y { int INativeWindow.Y {
get {throw new NotSupportedException();} get {throw new NotSupportedException(); }
set {throw new NotSupportedException();} set {throw new NotSupportedException(); }
} }
int INativeWindow.Width { int INativeWindow.Width {
get {throw new NotSupportedException();} get {throw new NotSupportedException(); }
set {throw new NotSupportedException();} set {throw new NotSupportedException(); }
} }
int INativeWindow.Height { int INativeWindow.Height {
get {throw new NotSupportedException();} get {throw new NotSupportedException(); }
set {throw new NotSupportedException();} set {throw new NotSupportedException(); }
} }
Rectangle INativeWindow.ClientRectangle { Rectangle INativeWindow.ClientRectangle {
get {throw new NotSupportedException();} get {throw new NotSupportedException(); }
set {throw new NotSupportedException();} set {throw new NotSupportedException(); }
} }
Size INativeWindow.ClientSize { Size INativeWindow.ClientSize {
get {throw new NotSupportedException();} get {throw new NotSupportedException(); }
set {throw new NotSupportedException();} set {throw new NotSupportedException(); }
} }
protected virtual void CreateFrameBuffer() protected virtual void CreateFrameBuffer()
@ -566,7 +566,7 @@ namespace OpenTK.Platform.iPhoneOS
throw new InvalidOperationException("Set the LayerColorFormat property to an EAGLColorFormat value before calling Run()."); throw new InvalidOperationException("Set the LayerColorFormat property to an EAGLColorFormat value before calling Run().");
} }
CAEAGLLayer eaglLayer = (CAEAGLLayer) Layer; CAEAGLLayer eaglLayer = (CAEAGLLayer)Layer;
eaglLayer.DrawableProperties = NSDictionary.FromObjectsAndKeys ( eaglLayer.DrawableProperties = NSDictionary.FromObjectsAndKeys (
new NSObject [] {NSNumber.FromBoolean(LayerRetainsBacking), LayerColorFormat}, new NSObject [] {NSNumber.FromBoolean(LayerRetainsBacking), LayerColorFormat},
new NSObject [] {EAGLDrawableProperty.RetainedBacking, EAGLDrawableProperty.ColorFormat} new NSObject [] {EAGLDrawableProperty.RetainedBacking, EAGLDrawableProperty.ColorFormat}
@ -899,15 +899,15 @@ namespace OpenTK.Platform.iPhoneOS
using (var data_provider = new CGDataProvider (data, 0, data.Length)) { using (var data_provider = new CGDataProvider (data, 0, data.Length)) {
using (var colorspace = CGColorSpace.CreateDeviceRGB ()) { using (var colorspace = CGColorSpace.CreateDeviceRGB ()) {
using (var iref = new CGImage (width, height, 8, 32, width * 4, colorspace, using (var iref = new CGImage (width, height, 8, 32, width * 4, colorspace,
(CGImageAlphaInfo) ((int) CGBitmapFlags.ByteOrder32Big | (int) CGImageAlphaInfo.PremultipliedLast), (CGImageAlphaInfo)((int)CGBitmapFlags.ByteOrder32Big | (int)CGImageAlphaInfo.PremultipliedLast),
data_provider, null, true, CGColorRenderingIntent.Default)) { data_provider, null, true, CGColorRenderingIntent.Default)) {
// OpenGL ES measures data in PIXELS // OpenGL ES measures data in PIXELS
// Create a graphics context with the target size measured in POINTS // Create a graphics context with the target size measured in POINTS
int widthInPoints, heightInPoints; int widthInPoints, heightInPoints;
float scale = (float) ContentScaleFactor; float scale = (float)ContentScaleFactor;
widthInPoints = (int) (width / scale); widthInPoints = (int)(width / scale);
heightInPoints = (int) (height / scale); heightInPoints = (int)(height / scale);
UIGraphics.BeginImageContextWithOptions (new System.Drawing.SizeF (widthInPoints, heightInPoints), false, scale); UIGraphics.BeginImageContextWithOptions (new System.Drawing.SizeF (widthInPoints, heightInPoints), false, scale);
try { try {
@ -1011,30 +1011,30 @@ namespace OpenTK.Platform.iPhoneOS
} }
event EventHandler<EventArgs> INativeWindow.Move { event EventHandler<EventArgs> INativeWindow.Move {
add {throw new NotSupportedException();} add {throw new NotSupportedException(); }
remove {throw new NotSupportedException();} remove {throw new NotSupportedException(); }
} }
public event EventHandler<EventArgs> Resize; public event EventHandler<EventArgs> Resize;
event EventHandler<CancelEventArgs> INativeWindow.Closing { event EventHandler<CancelEventArgs> INativeWindow.Closing {
add {throw new NotSupportedException();} add {throw new NotSupportedException(); }
remove {throw new NotSupportedException();} remove {throw new NotSupportedException(); }
} }
public event EventHandler<EventArgs> Closed; public event EventHandler<EventArgs> Closed;
public event EventHandler<EventArgs> Disposed; public event EventHandler<EventArgs> Disposed;
public event EventHandler<EventArgs> TitleChanged; public event EventHandler<EventArgs> TitleChanged;
public event EventHandler<EventArgs> VisibleChanged; public event EventHandler<EventArgs> VisibleChanged;
event EventHandler<EventArgs> INativeWindow.FocusedChanged { event EventHandler<EventArgs> INativeWindow.FocusedChanged {
add {throw new NotSupportedException();} add {throw new NotSupportedException(); }
remove {throw new NotSupportedException();} remove {throw new NotSupportedException(); }
} }
event EventHandler<EventArgs> INativeWindow.WindowBorderChanged { event EventHandler<EventArgs> INativeWindow.WindowBorderChanged {
add {throw new NotSupportedException();} add {throw new NotSupportedException(); }
remove {throw new NotSupportedException();} remove {throw new NotSupportedException(); }
} }
public event EventHandler<EventArgs> WindowStateChanged; public event EventHandler<EventArgs> WindowStateChanged;
event EventHandler<KeyPressEventArgs> INativeWindow.KeyPress { event EventHandler<KeyPressEventArgs> INativeWindow.KeyPress {
add {throw new NotSupportedException();} add {throw new NotSupportedException(); }
remove {throw new NotSupportedException();} remove {throw new NotSupportedException(); }
} }
public event EventHandler<EventArgs> Load; public event EventHandler<EventArgs> Load;

View file

@ -15,11 +15,11 @@ using OpenTK.Graphics;
namespace OpenTK.Platform.iPhoneOS { namespace OpenTK.Platform.iPhoneOS {
internal class iPhoneOSGraphicsContext : EmbeddedGraphicsContext internal class iPhoneOSGraphicsContext : EmbeddedGraphicsContext
{ {
public EAGLContext EAGLContext {get; private set;} public EAGLContext EAGLContext {get; private set; }
internal iPhoneOSGraphicsContext(ContextHandle h) internal iPhoneOSGraphicsContext(ContextHandle h)
{ {
EAGLContext = (EAGLContext) Runtime.GetNSObject(h.Handle); EAGLContext = (EAGLContext)Runtime.GetNSObject(h.Handle);
} }
internal iPhoneOSGraphicsContext(ContextHandle handle, IWindowInfo window, IGraphicsContext sharedContext, int major, int minor, GraphicsContextFlags flags) internal iPhoneOSGraphicsContext(ContextHandle handle, IWindowInfo window, IGraphicsContext sharedContext, int major, int minor, GraphicsContextFlags flags)
@ -52,7 +52,7 @@ namespace OpenTK.Platform.iPhoneOS {
: new EAGLContext(version); : new EAGLContext(version);
Handle = new ContextHandle(EAGLContext.Handle); Handle = new ContextHandle(EAGLContext.Handle);
} else { } else {
EAGLContext = (EAGLContext) Runtime.GetNSObject (handle.Handle); EAGLContext = (EAGLContext)Runtime.GetNSObject (handle.Handle);
Handle = handle; Handle = handle;
} }
} }
@ -89,7 +89,7 @@ namespace OpenTK.Platform.iPhoneOS {
public override void SwapBuffers() public override void SwapBuffers()
{ {
if (!EAGLContext.PresentRenderBuffer((uint) OpenTK.Graphics.ES11.All.RenderbufferOes)) if (!EAGLContext.PresentRenderBuffer((uint)OpenTK.Graphics.ES11.All.RenderbufferOes))
{ {
throw new InvalidOperationException ("EAGLContext.PresentRenderbuffer failed."); throw new InvalidOperationException ("EAGLContext.PresentRenderbuffer failed.");
} }
@ -105,7 +105,7 @@ namespace OpenTK.Platform.iPhoneOS {
public override bool IsCurrent public override bool IsCurrent
{ {
get {return EAGLContext.CurrentContext == EAGLContext;} get {return EAGLContext.CurrentContext == EAGLContext; }
} }
public override int SwapInterval public override int SwapInterval
@ -119,7 +119,7 @@ namespace OpenTK.Platform.iPhoneOS {
return IntPtr.Zero; return IntPtr.Zero;
} }
public GraphicsMode GraphicsMode {get; private set;} public GraphicsMode GraphicsMode {get; private set; }
protected override void Dispose(bool disposing) protected override void Dispose(bool disposing)
{ {