sq / JSIL

CIL to Javascript Compiler
http://jsil.org/
Other
1.73k stars 241 forks source link

Unimplemented XNA / LINQ Methods #259

Open BrainSlugs83 opened 10 years ago

BrainSlugs83 commented 10 years ago

Hey, I found a closed issue from a while back issue #128 -- I put a comment there since the discussion seemed related, but since it's old and closed I'm not sure if you'll ever see it or not.

(I'm new to GitHub, and I feel a little bad submitting all these new issues in serial, but I legitimately want to help and also to make JSIL work for me, this project is awesome. I might also be able to take a crack at some of this myself and submit patches if you want to give me some guidance on that...)

Specifically, I'm running into the following unimplemented methods (but from what I can tell of the conversation on issue #128 it sounds like a couple of them should be implemented? I'm not sure. Specific the "get_PreferredBackBufferWidth" and "get_PreferredBackBufferHeight" ones...)

Anyway, a couple of them can probably be ignored like the set_PreferredBackBufferFormat, but a couple of them are causing some major issues for my project (the LINQ one especially).

Error: The external method 'System.Int32 get_PreferredBackBufferWidth()' of type 'Microsoft.Xna.Framework.GraphicsDeviceManager' has not been implemented.

Error: The external method 'System.Int32 get_PreferredBackBufferHeight()' of type 'Microsoft.Xna.Framework.GraphicsDeviceManager' has not been implemented.

Error: The external method 'void set_PreferredBackBufferFormat(Microsoft.Xna.Framework.Graphics.SurfaceFormat)' of type 'Microsoft.Xna.Framework.GraphicsDeviceManager' has not been implemented.

Error: The external method 'void set_SynchronizeWithVerticalRetrace(System.Boolean)' of type 'Microsoft.Xna.Framework.GraphicsDeviceManager' has not been implemented.

Error: The external method 'void set_PreferMultiSampling(System.Boolean)' of type 'Microsoft.Xna.Framework.GraphicsDeviceManager' has not been implemented.

Error: The external method 'void .ctor(Microsoft.Xna.Framework.Graphics.EffectParameter, Microsoft.Xna.Framework.Graphics.EffectParameter, Microsoft.Xna.Framework.Graphics.EffectParameter, Microsoft.Xna.Framework.Graphics.DirectionalLight)' of type 'Microsoft.Xna.Framework.Graphics.DirectionalLight' has not been implemented.

Error: The external method 'void .ctor(Microsoft.Xna.Framework.Graphics.EffectParameter, Microsoft.Xna.Framework.Graphics.EffectParameter, Microsoft.Xna.Framework.Graphics.EffectParameter, Microsoft.Xna.Framework.Graphics.DirectionalLight)' of type 'Microsoft.Xna.Framework.Graphics.DirectionalLight' has not been implemented.

Error: The external method 'void .ctor(Microsoft.Xna.Framework.Graphics.EffectParameter, Microsoft.Xna.Framework.Graphics.EffectParameter, Microsoft.Xna.Framework.Graphics.EffectParameter, Microsoft.Xna.Framework.Graphics.DirectionalLight)' of type 'Microsoft.Xna.Framework.Graphics.DirectionalLight' has not been implemented.

The external method 'void .ctor()' of type 'System.IO.Stream' has not been implemented; calling inherited method. JSIL.Browser.js:196

The external method 'void .ctor()' of type 'System.MarshalByRefObject' has not been implemented; calling inherited method. JSIL.Browser.js:196

The external method 'System.Int32 ReadByte()' of type 'System.IO.MemoryStream' has not been implemented; calling inherited method. JSIL.Browser.js:196

The external method 'System.Single ReadSingle()' of type 'Microsoft.Xna.Framework.Content.ContentReader' has not been implemented; calling inherited method. JSIL.Browser.js:196

Error: The external method 'void ToggleFullScreen()' of type 'Microsoft.Xna.Framework.GraphicsDeviceManager' has not been implemented.

Error: The external method '!!0 FirstOrDefault (System.Collections.Generic.IEnumerable`1[!!0])' of type 'System.Linq.Enumerable' has not been implemented.

Uncaught TypeError: Cannot read property 'Controller' of undefined ClickClickBoom,%20Version=1.0.0.0,%20Culture=neutral,%20PublicKeyToken=null.js:6702
kg commented 10 years ago

Most of those don't look like a problem - I'll look into the others.

Does your game use 3d? JSIL doesn't support 3d yet. -kg (mobile)

BrainSlugs83 notifications@github.com wrote:

Hey, I found a closed issue from a while back issue #128 -- I put a comment there since the discussion seemed related, but since it's old and closed I'm not sure if you'll ever see it or not.

(I'm new to GitHub, and I feel a little bad submitting all these new issues in serial, but I legitimately want to help and also to make JSIL work for me, this project is awesome. I might also be able to take a crack at some of this myself and submit patches if you want to give me some guidance on that...)

Specifically, I'm running into the following unimplemented methods (but from what I can tell of the conversation on issue #128 it sounds like a couple of them should be implemented? I'm not sure. Specific the "get_PreferredBackBufferWidth" and "get_PreferredBackBufferHeight" ones...)

Anyway, a couple of them can probably be ignored like the set_PreferredBackBufferFormat, but a couple of them are causing some major issues for my project (the LINQ one especially).

Error: The external method 'System.Int32 get_PreferredBackBufferWidth()' of type 'Microsoft.Xna.Framework.GraphicsDeviceManager' has not been implemented.

Error: The external method 'System.Int32 get_PreferredBackBufferHeight()' of type 'Microsoft.Xna.Framework.GraphicsDeviceManager' has not been implemented.

Error: The external method 'void set_PreferredBackBufferFormat(Microsoft.Xna.Framework.Graphics.SurfaceFormat)' of type 'Microsoft.Xna.Framework.GraphicsDeviceManager' has not been implemented.

Error: The external method 'void set_SynchronizeWithVerticalRetrace(System.Boolean)' of type 'Microsoft.Xna.Framework.GraphicsDeviceManager' has not been implemented.

Error: The external method 'void set_PreferMultiSampling(System.Boolean)' of type 'Microsoft.Xna.Framework.GraphicsDeviceManager' has not been implemented.

Error: The external method 'void .ctor(Microsoft.Xna.Framework.Graphics.EffectParameter, Microsoft.Xna.Framework.Graphics.EffectParameter, Microsoft.Xna.Framework.Graphics.EffectParameter, Microsoft.Xna.Framework.Graphics.DirectionalLight)' of type 'Microsoft.Xna.Framework.Graphics.DirectionalLight' has not been implemented.

Error: The external method 'void .ctor(Microsoft.Xna.Framework.Graphics.EffectParameter, Microsoft.Xna.Framework.Graphics.EffectParameter, Microsoft.Xna.Framework.Graphics.EffectParameter, Microsoft.Xna.Framework.Graphics.DirectionalLight)' of type 'Microsoft.Xna.Framework.Graphics.DirectionalLight' has not been implemented.

Error: The external method 'void .ctor(Microsoft.Xna.Framework.Graphics.EffectParameter, Microsoft.Xna.Framework.Graphics.EffectParameter, Microsoft.Xna.Framework.Graphics.EffectParameter, Microsoft.Xna.Framework.Graphics.DirectionalLight)' of type 'Microsoft.Xna.Framework.Graphics.DirectionalLight' has not been implemented.

The external method 'void .ctor()' of type 'System.IO.Stream' has not been implemented; calling inherited method. JSIL.Browser.js:196

The external method 'void .ctor()' of type 'System.MarshalByRefObject' has not been implemented; calling inherited method. JSIL.Browser.js:196

The external method 'System.Int32 ReadByte()' of type 'System.IO.MemoryStream' has not been implemented; calling inherited method. JSIL.Browser.js:196

The external method 'System.Single ReadSingle()' of type 'Microsoft.Xna.Framework.Content.ContentReader' has not been implemented; calling inherited method. JSIL.Browser.js:196

Error: The external method 'void ToggleFullScreen()' of type 'Microsoft.Xna.Framework.GraphicsDeviceManager' has not been implemented.

Error: The external method '!!0 FirstOrDefault (System.Collections.Generic.IEnumerable`1[!!0])' of type 'System.Linq.Enumerable' has not been implemented.

Uncaught TypeError: Cannot read property 'Controller' of undefined ClickClickBoom,%20Version=1.0.0.0,%20Culture=neutral,%20PublicKeyToken=null.js:6702


Reply to this email directly or view it on GitHub: https://github.com/sq/JSIL/issues/259

BrainSlugs83 commented 10 years ago

Well, it's pretty much all 2D, I do do some line/triangle drawing with BasicEffect after I do my SpriteBatch stuff, but I could try to find another way to implement those -- or again, with guidance (I'm not sure where your javascript implementations live, I haven't really looked around yet) I could just go learn 3D WebGL and start implementing some of that stuff and I could submit some patches for it, maybe?

As for my game, the source is online [see below], it's not even close to finished yet (it's more like an unfinished engine at this point) -- but I was hoping to make JSIL the target platform -- that way, on PC, you wouldn't have to install it, and on mac/linux you wouldn't have to worry about mono-game, etc...

Also, I was thinking... JSIL supports SilverLight, right? Some people have done some demos where they write code in a hidden SilverLight control which then renders to an HTML canvas element... maybe I could look into porting my game to SilverLight if you think that would work better with JSIL. (Again, the idea being that end users wouldn't have to download / install anything -- or grant permission to SilverLight for 3D rendering, etc..)

[Source:] As for the "game" itself, it was an unfinished LudumDare 27 entry that I'm kind of excited about continuing in my spare time going forward -- again, it's super unfinished, and more like a barebones demo, atm, but you can see some screenshots, download the bins / source files here: http://www.ludumdare.com/compo/ludum-dare-27/?action=preview&uid=22701

If you want to build the source, here are a few things you'll need:

kg commented 10 years ago

This should get your game past those errors.

FYI, JSIL does not have any built in Silverlight support. A contributor was experimenting with that but I don't think anything ever came of it.

BrainSlugs83 commented 10 years ago

Nice. Thanks for putting those in! I put in some temp fixes to get around those issues, I'll roll those back out and see what happens. :-)