-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(iOS) OpenTK vs OpenTK-1.0 #1091
Comments
will it allow us to implement Texture2D.GetData ??? :) |
@totallyeviljake - Don't quote me on this, but I don't think it's impossible to implement Texture2D.GetData with the current OpenTK assembly we're using. Although it looks like a huge pain since the "easy" gl call for this doesn't exist in GLES: http://stackoverflow.com/questions/11863416/read-texture-bytes-with-glreadpixels. A lot of the FBO code is pretty fragile as it is. |
I had done the same changes a while back, but it was the same time as we Android implements the Texture2D.GetData work-around. Though it is |
ah, okay, so that's likely why our sprite collision code is so slow. We pull GetData on the sprites, do the intersection and then do the alpha check on the collision rectangle. This is fast in Win7, warp speed on Win8, but hiccupy on android. Can't say on iOS yet as we can't run it there... I would take hiccupy on iOS over not working though ... do you think the GetData from Android would work on iOS? |
It may work. It is using regular OpenGL ES 2.0 calls. You will have to I would definitely recommend storing collision data in a separate data |
well,my first attempt failed: [ERROR] FATAL UNHANDLED EXCEPTION: Microsoft.Xna.Framework.Graphics.MonoGameGLException: GL.GetError() returned InvalidOperation DrawManager line 326: graphicsDevice.Clear(color.Black) |
I think this might be related to npot textures. It only happens when we are drawing text to a RenderTarget2D. ... the other screens work fine for me. At least it's working in the GetData call now. :) progress ... |
Getting farther. I was able to actually play the game, but during the GetData() for sprite collisions, I got a GLError(): [ERROR] FATAL UNHANDLED EXCEPTION: Microsoft.Xna.Framework.Graphics.MonoGameGLException: GL.GetError() returned InvalidOperation I've hijacked Ray's issue report. Sorry. There is a CodePlex discussion for this missing GetData() method. |
I think it's time to move to OpenTK-1.0. |
Agreed. I think @dellis1972 has a branch with an initial conversion started, but we found that while it is better there are some differences between OpenTK on iOS vs Android:
Which is really annoying. We're following up with Xamarin to figure out why this is occurring, but I think we could work around this too and at least reduce the places where we have differences. |
Actually it is @slygamer that has the OpenTK1.0 code. |
On iOS, I only had to replace a couple of refs with outs. |
There are quite a few inconsistencies between OpenTK-1.0 on Android and iOS |
I don't think updating would have any serious benefits we need ASAP, so I agree. |
One year on, and OpenTK-1.0 on Android and iOS are still very different and a mess of inconsistencies between use of the All enum and specific enums, and parameter types of functions. I've just spent a while trying to get iOS and Android on OpenTK-1.0 and I'm giving up. As an example, Android has a PixelType enum that only contains three 16-bit formats (4444, 5551, 565), leaving out UnsignedByte. There are many other issues that it's just not worth it yet. |
Apparently, mono/opentk for Android and iOS are pulling OpenGL ES definitions from different sources (Android and Apple ES headers, respectively), hence the API differences. This is in contrast to upstream opentk/opentk, which has historically relied on the official Khronos specification. I do not know why Novell/Xamarin decided to switch from the Khronos spec to downstream headers. It may be that the fragmentation danger was not visible at the point when OpenTK was forked. In any case, the process of merging mono/opentk and opentk/opentk is currently underway, so this issue might be worth revisiting in a few weeks. |
A "few weeks" have passed now... Is this still an issue? |
So more than a year later... what is the state of the merge between mono/opentk and opentk/opentk ? When can we unify our OpenTK code paths on mobile and desktop? |
I think this is superseded by #4399. |
Yes. It has been using 1.0 for a while now. Closing. |
On iOS, is there a specific reason that we're using the older OpenTK assembly?
http://docs.xamarin.com/ios/releases/MonoTouch_5/MonoTouch_5.3#OpenTK
The docs say that the API isn't backwards compatible, but with us moving fully to GLES 2.0 I don't see a reason not to make the switch. Moving to this new OpenTK-1.0 will allow us access to some newer Oes extensions that should allow us to make some more optimizations. (Such as glGenVertexArrays).
Locally I tested swapping the two out and making the necessary API changes to match the new assembly. I didn't notice any differences in a couple of test scenes I ran, but wanted to run it by everyone else before making a PR.
The text was updated successfully, but these errors were encountered: