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

Author Topic: rbSFML  (Read 143654 times)

0 Members and 2 Guests are viewing this topic.

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
Re: rbSFML
« Reply #270 on: May 20, 2012, 01:49:48 pm »
That's because the method doesn't exist   ;)
You will have to create a clock yourself now in order to get the frame time. If you have trouble with that I can give a code example for you.
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

vivo

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
    • Email
Re: rbSFML
« Reply #271 on: May 20, 2012, 07:57:52 pm »
hehe, that's how i'm doing it now. A clock wich restarts each window.display. The only problem I see is that i'll have to control it when user pauses the game. But it won't be a problem, thanks

vivo

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
    • Email
Re: rbSFML
« Reply #272 on: May 22, 2012, 09:35:26 pm »
Could you help me?
When I try to pull your project and exec rake I get:

vivo@ubuntu:~/Escritorio/proyectoAG/rbSFML/Groogy_def/rbSFML$ git pull git@github.com:Groogy/rbSFML.git masterFrom github.com:Groogy/rbSFML
 * branch            master     -> FETCH_HEAD
Already up-to-date.

vivo@ubuntu:~/Escritorio/proyectoAG/rbSFML/Groogy_def/rbSFML$ rake
Creating sfml/system.so
Compiling ext/Window/Window.cpp
ext/Window/Window.cpp: In function ‘VALUE rbWindow::SetIcon(VALUE, VALUE, VALUE, VALUE)’:
ext/Window/Window.cpp:391: warning: comparison between signed and unsigned integer expressions
ext/Window/Window.cpp: In function ‘VALUE rbWindow::GetSystemHandle(VALUE)’:
ext/Window/Window.cpp:472: error: invalid cast from type ‘sf::WindowHandle’ to type ‘long unsigned int’
rake aborted!
Command failed with status (1): [g++  -O3 -ggdb -Wextra -Wno-unused-paramet...]

Tasks: TOP => default => all => window
(See full trace by running task with --trace)
vivo@ubuntu:~/Escritorio/proyectoAG/rbSFML/Groogy_def/rbSFML$
 
I'm completely lost at this point  :-[

vivo

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
    • Email
Re: rbSFML
« Reply #273 on: May 22, 2012, 09:38:08 pm »
This is the last update:

vivo@ubuntu:~/Escritorio/proyectoAG/rbSFML/Groogy_def/rbSFML$ git pull git@github.com:Groogy/rbSFML.git masterFrom github.com:Groogy/rbSFML
 * branch            master     -> FETCH_HEAD
Updating 3c07a96..979f32c
Fast-forward
 Rakefile                       |   16 ++++++++--------
 ext/Audio/Music.cpp            |    2 +-
 ext/Audio/SoundBuffer.cpp      |    4 ++--
 ext/Graphics/Font.cpp          |    6 +++---
 ext/Graphics/RenderTarget.cpp  |    4 ++--
 ext/Graphics/RenderTexture.cpp |   16 ++++++++++++++++
 ext/Graphics/RenderTexture.hpp |    5 +++++
 ext/Graphics/Shader.cpp        |    1 +
 ext/System/Vector3.cpp         |    2 +-
 ext/Window/Window.cpp          |    8 ++++----
 ext/rbSFML.hpp                 |   29 ++++++++++++++++++++++++++++-
 11 files changed, 71 insertions(+), 22 deletions(-)

 

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
Re: rbSFML
« Reply #274 on: May 22, 2012, 10:03:55 pm »
That's weird, haven't changed that in a long time. Try now and see if it works.
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

vivo

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
    • Email
Re: rbSFML
« Reply #275 on: May 23, 2012, 09:31:56 am »
thanks Groogy, now it works!

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
Re: rbSFML
« Reply #276 on: May 26, 2012, 03:46:22 pm »
I've just set up my Twitter account and a facebook page where updates on rbSFML will be posted and anything that happens for instance projects you guys work on.

It will probably be quite silent but might be a good thing to follow and show support to the project :)
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

vivo

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
    • Email
Re: rbSFML
« Reply #277 on: May 28, 2012, 06:58:41 pm »
Hi there, seems that there is no method Texture:loadFromImage
/home/vivo/Escritorio/proyectoAG/proyecto/SceneChar.rb:57:in `block (2 levels) in load_animation': undefined method `loadFromImage' for SFML::Texture:Class (NoMethodError)

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
Re: rbSFML
« Reply #278 on: May 29, 2012, 09:18:01 am »
That's weird, the method is there. Are you sure you are running on the latest version?
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
Re: rbSFML
« Reply #279 on: May 29, 2012, 06:30:07 pm »
sure... maybe it's because of the alias? I've done a "grep -R alias * | grep loadFromImage" on the ext folder and nothing appeared

https://github.com/Groogy/rbSFML/blob/master/ext/Graphics/Texture.cpp @ line 69.

As you can clearly see, the alias is there.
Try to take a clean fresh copy of rbSFML and see if it works then.
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

vivo

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
    • Email
Re: rbSFML
« Reply #280 on: May 29, 2012, 06:57:25 pm »
sorry, as you can see I deleted my message as soon as I noticed it.
BTW, I still can't use the method... does it works on your installation?

vivo

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
    • Email
Re: rbSFML
« Reply #281 on: May 29, 2012, 07:14:07 pm »
oooooppssss... now I know whats happening here

I'm trying
texture = Texture.loadFromImage(image, area)
 
but the message is that there is no method for Texture:Class
whereas if I try the method in an object
texture = Texture.new
texture.loadFromImage(image,area)
 
then it works

(weird... sprite = Sprite.loadFromImage works :P)
either works...ok, sorry for my missunderstanding
« Last Edit: May 29, 2012, 07:18:09 pm by vivo »

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
Re: rbSFML
« Reply #282 on: May 29, 2012, 07:18:16 pm »
That's weird, should not work for sprites either. Though I am wondering if I should add construction methods to the classes as well. It makes sense to have them.
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: rbSFML
« Reply #283 on: May 29, 2012, 07:33:23 pm »
I don't know how Ruby handles that, but I guess it's similar to .Net, Python and all interpreted/dynamic languages. For these languages, I think it's ok (and better) to transform load functions to constructors, since "empty" objects are basically useless. That's what I do in SFML.Net, and even in CSFML actually.
Laurent Gomila - SFML developer

vivo

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
    • Email
Re: rbSFML
« Reply #284 on: May 29, 2012, 07:41:45 pm »
yes... seems more intuitive that way

 

anything