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

Author Topic: rbSFML  (Read 159476 times)

0 Members and 1 Guest are viewing this topic.

Zerralin

  • Newbie
  • *
  • Posts: 5
    • View Profile
rbSFML
« Reply #120 on: September 20, 2011, 08:57:31 pm »
Ok, i have reinstalled sfml2, ruby/rbsfml and mingw like 3 times, but always the same error. It's happen only to me or i'm the only one windows user ? :lol:

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
rbSFML
« Reply #121 on: September 20, 2011, 09:29:32 pm »
You've done nothing wrong, everyone get it but Laurent have fixed it now so just download latest SFML and try again(you don't have to reinstall ruby or mingw).

Here's the issue on SFML: https://github.com/SFML/SFML/issues/100

The error would occur for any SFML users that compiled with MinGW, not only ruby developers ;)

Let me know what you think about the bindings and if you need more help I'm here. The documentation is quite out of date(will be fixed when SFML2 is officially released) but I've tried to mimic SFML as much as possible without breaking Ruby all too much.
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

Rukiri

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • Email
rbSFML
« Reply #122 on: October 01, 2011, 07:44:39 pm »
The issue is still there, wonder if she'll post the update soon.. really want to use rbsfml.

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
rbSFML
« Reply #123 on: October 01, 2011, 07:56:15 pm »
Are you a 100% sure you got the latest SFML2 and rbSFML? Everything compiles fine for me.
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

Rukiri

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • Email
rbSFML
« Reply #124 on: October 01, 2011, 07:58:32 pm »
Downloaded SMFL-2 directly from github this morning, and RBSFML from Github an hr ago.

Redownloaded RBSFML to make sure and I get the same error..


Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
rbSFML
« Reply #125 on: October 01, 2011, 08:12:16 pm »
Make sure that you really have the most recent version of SFML, and try a complete rebuild ("make clean").
Laurent Gomila - SFML developer

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
rbSFML
« Reply #126 on: October 01, 2011, 08:23:50 pm »
Ah crap forgot that. Do first a "rake clobber" to be sure that EVERYTHING is gone before compiling. And a mingw32-make clean on SFML. And of course follow the normal procedure as laid out in the readme file. (You know the pathing thing because Windows is a bitch :P)

The obj files might not be updated and so when they are being linked this error would appear again.
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

Rukiri

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • Email
rbSFML
« Reply #127 on: October 01, 2011, 08:39:38 pm »
Looks like it is the obj file, got any ideas?

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
rbSFML
« Reply #128 on: October 01, 2011, 09:04:18 pm »
You got the latest SFML2 version? You have a fresh version, compiled it and installed it? You have copied the new SFML include and lib files into the rbSFML folder as it says you should in the readme? You have done all of these steps?
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

Rukiri

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • Email
rbSFML
« Reply #129 on: October 02, 2011, 01:11:51 am »
Lol, that was it :oops:

But now it's giving me a load error when I try to require 'sfml/system' and I placed everything in the correct folders.

Edit: I got it running a hello world program, only problem is I have to have the dlls where the projects main.rb file is.

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
rbSFML
« Reply #130 on: October 02, 2011, 01:44:44 am »
Place them in system32 or anywhere in the PATH environment variable. I manually added C:\Program Files\SFML\bin to my PATH variable so that I don't have to do that.

Windows is a bitch when it comes to these things  :lol:
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
rbSFML
« Reply #131 on: January 22, 2012, 12:29:26 am »
Alright for those few that might be interested in the progress of rbSFML I would just like to let you guys know that since Laurent is nearing the end of SFML2 development the development of rbSFML will pick up. LB has been working on a complete remake to make maintenance easier and really use C++ to what it was meant for. I am right now sitting on his code and coding away ^^

Anyway lately I have been looking just quick glances at other implementations of Ruby. Our main goal will of course at all times be the MRI Ruby 1.9 branch. But since Rubinus is also starting/finishing with Ruby 1.9 and they say they will work with almost all MRI Ruby extensions I hope they work for us too. And when SFML2 comes to a close I would like to look at the possibilities to also support other implementations like JRuby and Rubinus. Especially Rubinus as it delivers more power for the buck.

Opinions wanted and possible testers who are used to these alternative implementations.
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
rbSFML
« Reply #132 on: February 26, 2012, 10:09:57 pm »
Alright getting some work done on rbSFML. I and LBg have hacked up an "unmaintainable" version of the modules (except for graphics) so far. After SFML2.0 is released we will slowly start to move to LBg's C++ to Ruby wrapper to make it easier and faster to change the API according to the C++ version. So if Laurent decided to re-write the whole API it should only take us about a day to comply instead of an entire month.

Currently working on the graphics module. But since these are "just-in-time" code so that you can do basic SFML stuff with it some things will not be supported. Like inheriting from Drawable and define your own and stuff like that. These will come instead with the new wrapper LBg is writing.
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 #133 on: March 28, 2012, 12:30:58 am »
Alright I just uploaded the Sprite implementation. Did a quick test, fixed some bugs that appeared and then I could render graphics to the window :D

Anyway I got shapes and text left. Other than that the library is expected to work like it should. If not please let me know and I'll fix it. I've used SFML as a layout blueprint for the whole library so it's not that ruby-like. Some parts have been "rubyfied" but there's probably a lot left. If you find something that you feel should use some ruby language specific feature then let me know. Or if there is anything else you think I should change to make it easier to work with don't be afraid to tell me.
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 #134 on: April 01, 2012, 01:04:15 am »
IT IS FINALLY DONE!

Took some time and a lot of effort but rbSFML is finally up to date with Laurent/SFML @ Github.
With time documentation and Rspec's will be put up to complete the binding.

Getting started steps are available in the readme and if you have programmed before with SFML but in any other language it should be really easy to get started as every method has an alias method which mimics the C++ Documentation so you can more or less both write Ruby-style code and C++-style code with the binding to make it as easy as possible to get started with rbSFML.

Example:
text = SFML::Text.new( "Hello World!" )
text.color = [ 255, 0, 255 ]
text.position = [ 10, 10 ]
image = SFML::Image.new( 100, 100, SFML::Color::White )
texture = SFML::Texture.new( 100, 100 )
sprite = SFML::Sprite.new( texture )
sprite.origin = [ 50, 50 ]
texture.update( image )
Is the same as
text = SFML::Text.new( "Hello World!" )
text.setColor( SFML::Color.new( 255, 0, 255 ) )
text.setPosition( SFML::Vector2.new( 10, 10 ) )
image = SFML::Image.new( 100, 100, SFML::Color::White )
texture = SFML::Texture.new( 100, 100 )
sprite = SFML::Sprite.new( texture )
sprite.setOrigin( SFML::Vector2.new( 50, 50 ) )
texture.update( image )

As you can also see we have provided an implicit way to define the common SFML structures to make it easier and faster to use. So instead of having to write the code to create a vector object you can just provide an equivalent array and rbSFML will construct a vector object from it.

I hope my previous users like the bindings and if they have opinions on how to improve it and make it more Ruby-like I would love to hear them. And I hope I will get more users and I hope they as well will have opinions and give them to me :)

Until I get going with Rspec and documentation here is a working example you can play around with:
require 'sfml/system'
require 'sfml/window'
require 'sfml/graphics'

window = SFML::RenderWindow.new( [ 800, 600 ], "Test" )

text = SFML::Text.new( "Hello World!" )
text.color = [ 255, 0, 255 ]
text.position = [ 10, 10 ]
image = SFML::Image.new( 100, 100, SFML::Color::White )
texture = SFML::Texture.new( 100, 100 )
sprite = SFML::Sprite.new( texture )
sprite.origin = [ 50, 50 ]
texture.update( image )

while window.open?
  window.clear
  window.draw text
  window.draw sprite
  window.display
 
  sprite.position = SFML::Mouse.position( window )
 
  window.each_event do |event|
    if event.type == SFML::Event::Closed
      window.close
    end
  end
end

Have fun!
« Last Edit: April 19, 2012, 06:15:36 pm by Groogy »
Developer and Maker of rbSFML and Programmer at Paradox Development Studio