Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: SFML2 V8 JavaScript Binding  (Read 24512 times)

0 Members and 1 Guest are viewing this topic.

StevenC

  • Newbie
  • *
  • Posts: 40
    • View Profile
    • Corona Soft Development Blog
Re: SFML2 V8 JavaScript Binding
« Reply #15 on: June 18, 2012, 03:03:35 am »
On second thought Rogof, don't waste time on this. I just realized I should be able to fix these issues without a complete toolchain.. I just need to be able to compile not link. I'll go work on it.

-Steven

StevenC

  • Newbie
  • *
  • Posts: 40
    • View Profile
    • Corona Soft Development Blog
Now compiling under GCC 4.6.3
« Reply #16 on: June 18, 2012, 04:10:46 am »
Hello Rogof,

I found the problem. Apparently GCC is sensitive to the order of overloaded functions. I reorganized the code to make it happy and it now compiles.

Let me know if you find any bugs.

-Steven

Rogof

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: SFML2 V8 JavaScript Binding
« Reply #17 on: June 18, 2012, 07:08:01 am »
Yes, it builds with mingw now, however apart from the v8 and the sfml libs, it needs to be linked against winmm and ws2_32, I don't know if this is also true for msvc though.

I think a 32bit linux binary can be compiled without problems, but I can't check it right now since I have a 64bit installation and compiling 32bit binaries is a pain (need to compile the 32bit libraries first).

A 64bit binary can't be compiled yet since both gcc and clang complains about ambiguous overloaded functions.

I will report more about the linux builds later since right now is night and don't have much caffeine left.
« Last Edit: June 18, 2012, 07:10:05 am by Rogof »

Rogof

  • Newbie
  • *
  • Posts: 24
    • View Profile
Linux builds
« Reply #18 on: June 19, 2012, 03:58:59 am »
I confirmed it, 32bit linux binaries can build without problems.

The error log is longer of what pastebin allows me to paste, so should I email it to you?

StevenC

  • Newbie
  • *
  • Posts: 40
    • View Profile
    • Corona Soft Development Blog
Re: SFML2 V8 JavaScript Binding
« Reply #19 on: June 19, 2012, 06:05:22 am »
Hello Rogof,

Is the error log for the 64-bit Linux? I am downloading a 64-bit Linux iso now so hopefully can do a few test compiles and figure out what is incompatible. I am committed to getting this working on Linux even if I have to redesign it... Though I hope it is not necessary.

Also, I've added a few pages to the GitHub wiki and will try and work on documentation a bit more before the next minor release.

-Steven


Rogof

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: SFML2 V8 JavaScript Binding
« Reply #20 on: June 19, 2012, 06:30:52 am »
Yes, the bindings build in linux 32bit but not in linux 64bit.

StevenC

  • Newbie
  • *
  • Posts: 40
    • View Profile
    • Corona Soft Development Blog
Re: SFML2 V8 JavaScript Binding
« Reply #21 on: June 19, 2012, 08:05:59 am »
Hello Rogof,

The binding should compile on 64-bit Linux now.

-Steven

Rogof

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: SFML2 V8 JavaScript Binding
« Reply #22 on: June 19, 2012, 08:11:27 pm »
Indeed, no issues found this time, but then I've only tested it with a hello world project.

By the way, you can add mingw to the windows supported platforms since it does compiles in it (and I'm able to test it to some extend). Also, the bindings compile with clang, so you might want to include it.

You might want to specify the versions which are reported to work. In my case is gcc 4.7 and clang 3.1.

StevenC

  • Newbie
  • *
  • Posts: 40
    • View Profile
    • Corona Soft Development Blog
Re: SFML2 V8 JavaScript Binding
« Reply #23 on: June 20, 2012, 11:50:20 am »
I've posted a new update to the binding. The binding is getting really close to being feature complete. The next project I am working on is a fully moddable JavaScript game engine using SFML. It will be open source, but it is not yet even close to being ready for the first release.

greeniekin

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
Re: SFML2 V8 JavaScript Binding
« Reply #24 on: June 24, 2012, 07:34:44 am »
Rogof I am interested to hear how you managed to get V8 built on mingw. I have tried before but the new v8 build system doesn't seem to support it. I tried a hack someone suggested for the old build system but it would not build either.

Any chance of a compiled version of this project being available? would love to test it but I am just a bit buisy to be trying to compile and link things.
« Last Edit: June 24, 2012, 07:40:00 am by greeniekin »

StevenC

  • Newbie
  • *
  • Posts: 40
    • View Profile
    • Corona Soft Development Blog
Re: SFML2 V8 JavaScript Binding
« Reply #25 on: June 24, 2012, 08:13:08 am »
Hello greeniekin,

What you would need is my GitHub project JSGameClient. It will be a few weeks before it is supports most of the core feature set but I could get you some windows binaries to play with. You should be able to build it for Visual Studio using CMake.

Regarding v8 libs for mingw, you may be able to obtain them indirectly from building JSGameClient or the project it was derived from HammerJS (https://github.com/hatsuseno/hammerjs). (Static libs of a slightly older version v8 are created as part of these two project's build process.)

-Steven
« Last Edit: June 24, 2012, 08:22:24 am by StevenC »

StevenC

  • Newbie
  • *
  • Posts: 40
    • View Profile
    • Corona Soft Development Blog
Re: SFML2 V8 JavaScript Binding
« Reply #26 on: June 24, 2012, 08:20:25 am »
The binding has been updated to version 0.5.1. I've added a JavaScript file called sf_v8.js which when linked to your Eclipse JavaScript project can give you context sensitive help for the SFML JavaScript classes.

Rogof

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: SFML2 V8 JavaScript Binding
« Reply #27 on: June 24, 2012, 09:54:26 am »
Hello greeniekin

This are the instructions I followed to build an (slightly) outdated version of the library (v3.9.9).

First you need to have:
  • A working mingw gcc compiler
  • A working scons installation
  • An svn client

Then get the source code using the svn client from this url: http://v8.googlecode.com/svn/tags/3.9.9

For this version, you need to comment, or remove the line 888 of the file 'src/platform-win32.cc':
void* address = 0;
otherwise the compiler will complain about an unused variable and stop the compilation.

Once you edited the code, open a console in the directory where the source code is and issue this command:
scons mode=release library=static arch=ia32 os=win32

This should build a static library 'libv8.a'.


I know this are a somewhat vague instructions, so ask me if you don't understand something or need more details.

Rogof

  • Newbie
  • *
  • Posts: 24
    • View Profile
Missing includes
« Reply #28 on: July 01, 2012, 05:41:14 am »
Hi

An `#include <cstring>` is missing from the v8wrap.h header in the latest version (v0.6.0 according to the changelog). Without it, gcc complains about the missing declarations of ‘strlen` and `strcmp`.

StevenC

  • Newbie
  • *
  • Posts: 40
    • View Profile
    • Corona Soft Development Blog
Re: SFML2 V8 JavaScript Binding
« Reply #29 on: July 01, 2012, 07:43:26 am »
Thanks Rogof, I'll get it updated. I'll have to remember to test with Linux.. I tested with MinGW but didn't encounter the problem. Those functions must be included by including windows.h. I'll make sure to start testing it with Linux again.

Have you had any luck using the binding with node?
« Last Edit: July 01, 2012, 07:55:05 am by StevenC »