This site requires JavaScript, please enable it in your browser!
Greenfoot back
SPower
SPower wrote ...

2013/10/20

Native methods in Greenfoot

SPower SPower

2013/10/20

#
Hi all, Would it be possible to use native methods in a greenfoot scenario? Thanks for the help!
danpost danpost

2013/10/20

#
How do you define 'native' (in this case)?
SPower SPower

2013/10/20

#
Something like this:
public native float[][] multiplyMatrices(float[][] m1, float[][] m2);
although I'm really not an expert at using native methods, so it might be a lot more complex than I'm thinking right now.
danpost danpost

2013/10/20

#
I would guess that you could do so locally; but, probably not on the site (I could be wrong, however).
davmac davmac

2013/10/21

#
Nothing in Greenfoot stops you from using native methods. Consider the Gamepad library. However if you want to use your own native methods you will actually need to write them (in C or C++), compile then and link them into a dynamic library.
SPower SPower

2013/10/21

#
@davmac Ok, thanks for making it clear that I can use them. I have some experience with C (not C++), but I think that C will be good enough for the job. If I have some trouble using them (not the C coding, but linking the methods with greenfoot), may I ask here?
davmac davmac

2013/10/21

#
You are welcome to ask, though I'm not sure how much help you'll get of course! Your best bet is to look for other examples.
SPower SPower

2013/10/21

#
I'll do so, thanks!
You need to login to post a reply.