Skip to content
This repository has been archived by the owner on Aug 24, 2022. It is now read-only.

Unimplemented XNA / LINQ Methods #259

Open
BrainSlugs83 opened this issue Aug 30, 2013 · 4 comments
Open

Unimplemented XNA / LINQ Methods #259

BrainSlugs83 opened this issue Aug 30, 2013 · 4 comments

Comments

@BrainSlugs83
Copy link
Contributor

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
Copy link
Member

kg commented Aug 30, 2013

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:
#259

@BrainSlugs83
Copy link
Contributor Author

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:

  • Download the "Source (newer)" file -- the older one has unneccessary stuff in it that freaked out JSIL a little bit "(newer)" has specific mods in it to work better with JSIL.
  • It's a Visual Studio 2012, XNA 4.0 project -- this is not something that normally works -- to get it to open you have to copy your XNA 4.0 2010 project template to the 2012 folder and add a node that says Visual Studio 2012 is supported. [ It's pretty easy to do this. See this SO article for details: http://stackoverflow.com/questions/10881005/how-to-install-xna-game-studio-on-visual-studio-2012 ]
  • The solution contains a fully integrated setup.exe project -- I tried to tell JSILc to ignore it in my .jsilconfig -- but it still crashes (did I do it wrong?). If you remove the two WiX setup projects, it will get past this point. -- (I have modified my own version of JSILc with a minor code change to make it ignore non-.net .exe/.dll files -- I have no idea how to make or submit a patch though -- I'm more of a TFS person than a GIT person. -- I was planning on looking into figuring out patch-creation/submittal this weekend.) -- [ submitted a pull request with the fix for this one, see Fixed an issue where non-CLR assemblies (such as "Setup.exe" files) were not ignored. ... #261 ]
  • The solution contains an ASP.NET web project for the JSILc output as well. This also causes JSIL to choke, because it finds two instances of the XNA assets and considers that ambiguous -- you can remove this project from the solution as well, and JSILc should just work. (again, I've modified my version to work with this -- if it finds more than one asset location, it checks to see if any of them are in the same directory as the output directory and removes those ones from the array.) -- [ submitted a pull request with the fix for this one, see Fixes an "AmbiguousMatchException" where the extra matches really aren't all that Ambiguous... #262 ]

@kg
Copy link
Member

kg commented Sep 3, 2013

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
Copy link
Contributor Author

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. :-)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants