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

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

0 Members and 1 Guest are viewing this topic.

minirop

  • Sr. Member
  • ****
  • Posts: 254
    • View Profile
    • http://dev.peyj.com
Re: SFML2 V8 JavaScript Binding
« Reply #30 on: July 01, 2012, 10:49:39 am »
I tested with MinGW but didn't encounter the problem.
mingw is very permissive. do you use options ? you should use some like :
Quote
-Wall -Wextra -Wwrite-strings -Wstrict-prototypes
and you can try the "paranoiac" mode (it can trigger errors/warning in the standard headers) :
Quote
-ansi -O2 -Wchar-subscripts -Wcomment -Wformat=2 -Wimplicit-int -Werror-implicit-function-declaration -Wmain -Wparentheses -Wsequence-point -Wreturn-type -Wswitch -Wtrigraphs -Wunused -Wuninitialized -Wunknown-pragmas -Wfloat-equal -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wwrite-strings -Wconversion -Wsign-compare -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wmissing-noreturn -Wformat -Wmissing-format-attribute -Wno-deprecated-declarations -Wpacked -Wredundant-decls -Wnested-externs -Winline -Wlong-long -Wunreachable-code

Rogof

  • Newbie
  • *
  • Posts: 24
    • View Profile
SFML2 V8 Bindings and Node.js
« Reply #31 on: July 01, 2012, 08:45:52 pm »
I have successfully build a Node Addon whit your bindings. However I'm not using the `sf::Init` but the individual `InitP*` functions.

I'm doing this because:
  • The `sf::Init` returns an already constructed object, however node modules are expected to set the properties to a given object, see http://nodejs.org/api/addons.html
  • I only need a subset of the functionality provided with sfml, by using the individual init functions I only include what I need.

Btw, here is a list of some of the gcc invocation flags and their descriptions http://gcc.gnu.org/onlinedocs/gcc-4.6.3/cpp/Invocation.html

StevenC

  • Newbie
  • *
  • Posts: 40
    • View Profile
    • Corona Soft Development Blog
Re: SFML2 V8 JavaScript Binding
« Reply #32 on: July 01, 2012, 10:24:03 pm »
I have successfully build a Node Addon whit your bindings. However I'm not using the `sf::Init` but the individual `InitP*` functions.

Yes, that makes sense. You don't need any of the networking code as node.js already has it all.


Rogof

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: SFML2 V8 JavaScript Binding
« Reply #33 on: July 01, 2012, 10:39:14 pm »
Quote from: StevenC
Yes, that makes sense. You don't need any of the networking code as node.js already has it all.

About that, I would like a more "decoupled" bindings, I still have to link the network library even if I don't use it.

EDIT: I have disabled the bindings for the classes listed here: http://www.sfml-dev.org/documentation/2.0/group__network.php. Does something else depends on the network library?
« Last Edit: July 01, 2012, 10:44:50 pm by Rogof »

StevenC

  • Newbie
  • *
  • Posts: 40
    • View Profile
    • Corona Soft Development Blog
Re: SFML2 V8 JavaScript Binding
« Reply #34 on: July 01, 2012, 10:48:43 pm »
Regarding node.js, wouldn't something like this work?

void Init( v8::Handle<v8::Object> target ) {
   target->SetPrototype(sf_v8::sf::Init());
}

StevenC

  • Newbie
  • *
  • Posts: 40
    • View Profile
    • Corona Soft Development Blog
Re: SFML2 V8 JavaScript Binding
« Reply #35 on: July 01, 2012, 10:52:10 pm »
About that, I would like a more "decoupled" bindings, I still have to link the network library even if I don't use it.

The issue is that the linker needs it because the compiler said the linker needs it. If you remove #include <SFML/Network.hpp> and delete all the classes that need stuff declared there then your linker problems would go away..

If you would like I can wrap all the network stuff with #ifndef NO_SFML_NETWORK so that you can exclude it through a define.

-Steven

Rogof

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: SFML2 V8 JavaScript Binding
« Reply #36 on: July 01, 2012, 11:03:13 pm »
Regarding node.js, wouldn't something like this work?

void Init( v8::Handle<v8::Object> target ) {
   target->SetPrototype(sf_v8::sf::Init());
}

That is my current solution (but using the individual init functions).

Quote from: StevenC
If you would like I can wrap all the network stuff with #ifndef NO_SFML_NETWORK so that you can exclude it through a define.

That would be good.

StevenC

  • Newbie
  • *
  • Posts: 40
    • View Profile
    • Corona Soft Development Blog
Re: SFML2 V8 JavaScript Binding
« Reply #37 on: July 02, 2012, 01:29:31 am »
Helllo Rogof,

I've updated the binding to version 0.6.2. Now when you add -DNO_SFML_NETWORK the network library will not be used.

-Steven

 

anything