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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - prchakal

Pages: 1 2 3 [4] 5 6 ... 10
46
Graphics / Re: Sprite as attribute doesnt Draw but local sprite Draw
« on: September 16, 2012, 06:44:57 pm »
Humm...ok.

I think that texture is store in the sprite and the object is not destroyed.

Quote
And don't dynmically allocate the exceptions that you throw.

I dont understand it ^

47
Graphics / Re: Sprite as attribute doesnt Draw but local sprite Draw
« on: September 15, 2012, 02:24:41 am »
Hi,

o.o

The problem is here:

Quote
window.clear(sf::Color(255, 255, 255));
        window.draw(*robot1->getSprite());  // it dont display
        window.draw(*sprite);   // it display
        window.display();

I think it is not related, because the sprite in another class out of v8.

https://github.com/prsolucoes/sfml-cmake/blob/master/main.cpp
and
https://github.com/prsolucoes/sfml-cmake/blob/master/Character.cpp

Look only this two files, is a short piece of code.

48
Graphics / Re: Sprite as attribute doesnt Draw but local sprite Draw
« on: September 14, 2012, 11:59:33 pm »
I need implement that methods for cast on every class that i send to v8? Example:

Quote
namespace v8wrap {
    v8::Handle<v8::Value> CastToJS(const Character &JS);
    v8::Handle<v8::Value> CastToJS2(const Character &JS);
    void AutoCastToCPP(v8::Handle<v8::Value> Value, Character &CPP);
    v8::Handle<v8::Value> CastToJS(Character *JS);
    v8::Handle<v8::Value> CastToJS2(const Character *JS);
    void AutoCastToCPP(v8::Handle<v8::Value> Value, Character *&CPP);
}

49
Graphics / Sprite as attribute doesnt Draw but local sprite Draw
« on: September 14, 2012, 10:50:25 pm »
Hi,

Im with a small problem here that my sprite that is in my class "Character" doesnt "draw" with "window.draw", but if i create a local sprite (the same sprite code and image) it draw.

You can see here (have both sprite - local and as attribute):
https://github.com/prsolucoes/sfml-cmake

I got no error and when debug, all sprite attributes is fine :(

50
General / Re: SFML and V8 - Send custom classes and objects to V8 vm
« on: September 14, 2012, 09:14:22 pm »
PROBEM SOLVED!!!! URRRULLLLLL!!!!

GDB IS THE BEST!!!!!

I need initialize the null attribute "POT":

Quote
JSCharacter::InitPOT(JSCharacter::POT);
v8::Handle<v8::Object> Result = JSCharacter::POT->NewInstance();

Ty.

51
General / Re: SFML and V8 - Send custom classes and objects to V8 vm
« on: September 14, 2012, 07:45:29 pm »
One thing i discover, that the errori got here:

Quote
v8::Handle<v8::Object> Result = Character::POT->NewInstance();

I have commited a working version with custom class commented and working with a simple sprite, while i discover how exchange c++ classes to v8.


---------------

UPDATED:

More specific here:

Quote
Character::POT->NewInstance();

---------------

UPDATED - ANOTHER CLUE:

GDB ERROR FROM COMMAND-LINE

Quote
Starting program: /Users/paulo/Pessoal/workspaces/qt/sfml-cmake/build/sfml-project.app/Contents/MacOS/sfml-project
Reading symbols for shared libraries .++++++++++.............................................................................................. done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000000
0x000000010012ec25 in v8::internal::Execution::InstantiateObject ()

--------------------

UPDATED - FULL DETAILED

Now i know where is the problem, but dont know how to solve it :(


Quote
Reading symbols for shared libraries . done

Breakpoint 1, main () at /Users/paulo/Pessoal/workspaces/qt/sfml-cmake/main.cpp:82
82       v8::Handle<v8::Object> Result = JSCharacter::POT->NewInstance();
(gdb) step
v8::Handle<v8::ObjectTemplate>::operator-> (this=0x10051bb88) at v8.h:216
216     inline T* operator->() const { return val_; }
(gdb) step

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000000
0x000000010012ec25 in v8::internal::Execution::InstantiateObject ()

It is acessing a NULL value but, why?

If we "print" the property "val_", we have a NULL object:

Quote
(gdb) print val_
$1 = ('v8::ObjectTemplate' *) 0x0

52
General / Re: SFML and V8 - Send custom classes and objects to V8 vm
« on: September 14, 2012, 06:22:39 pm »
I like debug - step by step :)

I like know whats happen and have full control.

I will search for it, but if you have a light, i will be grateful :)

I think that it is simple and i forgot something, because i copy a sample class in "sf_v8".

Thanks.

53
General / SFML and V8 - Send custom classes and objects to V8 vm
« on: September 14, 2012, 05:14:02 pm »
Hi,

I made a project that use V8 integration with SFML, but my problem is with custom class/objects that i want that V8 can see.

I created a class "Character" like the same of others "sf_v8" classes. But my application open and close,and the default error "Segment fault".

I can use my project with sf::Sprite class, it is working perfect. But now i want custom classes.

Can anyone help me?

You can see where i stop here:
https://github.com/prsolucoes/sfml-cmake

Thanks.

54
General / Re: Resources like images are not found by Application
« on: September 14, 2012, 05:09:20 pm »
Hi,

Problem solved and commited to repository.

Ty.

55
General / Re: CMake doesn't link with SFML libaries
« on: September 14, 2012, 05:08:38 pm »
This is done. Can close the topic.

56
General / Resources like images are not found by Application
« on: September 14, 2012, 11:21:34 am »
Hi,

Resources add not recognized by my Application here:
https://github.com/prsolucoes/sfml-cmake

The "images" are in the path "sfml-project.app/Contents/Resources/images" but i get error:

Quote
Failed to load image "images/robot1.png". Reason : Unable to open file

Can anyone help me?

57
General / Re: CMake doesn't link with SFML libaries
« on: September 14, 2012, 05:38:26 am »
Hi,

I have a small problem on compile in two different macs.

In my "work mac" it is compiling without problem:

Quote
MacBook-Pro-de-Paulo-Coutinho-2:build paulo$ ./rebuild.sh
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag - yes
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Check for working CXX compiler: /usr/bin/g++
-- Check for working CXX compiler: /usr/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
Found SFML: /Users/paulo/Pessoal/workspaces/qt/sfml-cmake/library/sfml/mac/include
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/paulo/Pessoal/workspaces/qt/sfml-cmake/build
Scanning dependencies of target sfml-project
[ 33%] Building CXX object CMakeFiles/sfml-project.dir/main.cpp.o
[ 66%] Building CXX object CMakeFiles/sfml-project.dir/sf_v8.cpp.o
[100%] Building CXX object CMakeFiles/sfml-project.dir/v8wrap.cpp.o
Linking CXX executable sfml-project.app/Contents/MacOS/sfml-project
[100%] Built target sfml-project

In my "home mac" the library SNDFILE is not working:

Quote
server:build paulo$ ./rebuild.sh
-- The C compiler identification is GNU 4.2.1
-- The CXX compiler identification is GNU 4.2.1
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag - yes
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Check for working CXX compiler: /usr/bin/g++
-- Check for working CXX compiler: /usr/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
Found SFML: /Users/paulo/Pessoal/workspaces/qt/sfml-cmake/library/sfml/mac/include
CMake Error at /Applications/CMake 2.8-9.app/Contents/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:97 (MESSAGE):
  Could NOT find SNDFILE (missing: SNDFILE_LIBRARY)
Call Stack (most recent call first):
  /Applications/CMake 2.8-9.app/Contents/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:288 (_FPHSA_FAILURE_MESSAGE)
  build/cmake/modules/FindSNDFILE.cmake:20 (find_package_handle_standard_args)
  CMakeLists.txt:44 (find_package)


-- Configuring incomplete, errors occurred!
make: *** No targets specified and no makefile found.  Stop.

I see one difference in compiler name, but i dont know if is it. In the cmake project file i forced both to use "g++".

Can anyone help me?

Project is here:
https://github.com/prsolucoes/sfml-cmake

58
General / Re: CMake doesn't link with SFML libaries
« on: September 12, 2012, 08:49:10 pm »
I made a poor implementation of copy required files and the project is working now.

If anyone want help make it better and more "cmake" style, please contact me or send message here with suggestions.

Ty.

59
General / Re: CMake doesn't link with SFML libaries
« on: September 12, 2012, 08:14:05 pm »
Now, im copying the libraries to framework directory. But only the libraries without ".2" and ".2.0", example:

libsfml-audio.2.0.dylib (not copied)
libsfml-audio.2.dylib (not copied)
libsfml-audio.dylib (copied)

Result:

Quote
Scanning dependencies of target sfml-project
[100%] Building CXX object CMakeFiles/sfml-project.dir/main.cpp.o
Linking CXX executable sfml-project.app/Contents/MacOS/sfml-project
Copying OS X content sfml-project.app/Contents/Frameworks/libsfml-audio.dylib
Copying OS X content sfml-project.app/Contents/Frameworks/libsfml-graphics.dylib
Copying OS X content sfml-project.app/Contents/Frameworks/libsfml-network.dylib
Copying OS X content sfml-project.app/Contents/Frameworks/libsfml-system.dylib
Copying OS X content sfml-project.app/Contents/Frameworks/libsfml-window.dylib
[100%] Built target sfml-project


Please, help me :(

The changes are commited on actual state

60
General / Re: CMake doesn't link with SFML libaries
« on: September 12, 2012, 07:26:02 pm »
The error receive is what i think:

Quote
MacBook-Pro-de-Paulo-Coutinho-2:build paulo$ ./sfml-project.app/Contents/MacOS/sfml-project
dyld: Library not loaded: @executable_path/../Frameworks/libsfml-system.2.dylib
  Referenced from: /Users/paulo/Pessoal/workspaces/qt/sfml-cmake/build/./sfml-project.app/Contents/MacOS/sfml-project
  Reason: image not found
Trace/BPT trap


Pages: 1 2 3 [4] 5 6 ... 10
anything