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

Author Topic: rbSFML  (Read 155367 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 #150 on: April 19, 2012, 09:47:08 pm »
Ok, then count on me for at least next two mounths, im going to work on rbSFML and i will report almost everything (found) :)

Great!

I've noticed that exception errors are not controlled, i will report them too
What do you mean?

And no it wasn't a typo...... It was my keyboard which was too slow.. See it says so in the commitment message so it must be true!
« Last Edit: April 19, 2012, 09:51:52 pm by Groogy »
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

vivo

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
    • Email
Re: rbSFML
« Reply #151 on: April 19, 2012, 10:08:39 pm »
With exception error I wanted to mean handling exceptions, for instance, when you try to load music from a file that doesn't exist (same occurs with texture, and probably but not tested Sprites, Images, etc).

when trying:
texture = Texture.new('non_existent.jpg')
 
the konsole output is:
vivo@ubuntu:~/Escritorio/proyectoAG/primer_juego$ ruby juego.rb
juego.rb:19:in `initialize': Failed to load image "non_existent.jpg". Reason : Unable to open file (SFML::Error)
        from juego.rb:19:in `
new'
        from juego.rb:19:in `<main>'

XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server "xU
X&#65533;&#65533;       "

      after 119 requests (118 known processed) with 0 events remaining.
*** glibc detected *** ruby: free(): invalid pointer: 0x0a29d620 ***
======= Backtrace: =========
/lib/libc.so.6(+0x6c0c1)[0x3f20c1]
/lib/libc.so.6(+0x6d930)[0x3f3930]
/lib/libc.so.6(cfree+0x6d)[0x3f6a1d]
/usr/lib/libstdc++.so.6(_ZdlPv+0x21)[0x595441]
/usr/lib/libstdc++.so.6(_ZNSs4_Rep10_M_destroyERKSaIcE+0x1d)[0x577acd]
/usr/lib/libstdc++.so.6(_ZNSt18basic_stringstreamIcSt11char_traitsIcESaIcEED1Ev+0xe8)[0x5701d8]
/lib/libc.so.6(+0x2f69e)[0x3b569e]
/lib/libc.so.6(+0x2f70f)[0x3b570f]
/usr/lib/libX11.so.6(_XDefaultIOError+0xb0)[0x671bb0]
/usr/lib/libX11.so.6(_XIOError+0x56)[0x671c36]
/usr/lib/libX11.so.6(+0x41a8a)[0x679a8a]
/usr/lib/libX11.so.6(_XReply+0x106)[0x67a036]
/usr/lib/libX11.so.6(XQueryExtension+0xa2)[0x6673c2]
/usr/lib/libX11.so.6(XInitExtension+0x3b)[0x65b9bb]
/usr/lib/libXext.so.6(XextAddDisplay+0x4c)[0x76ec5c]
/usr/lib/fglrx/libGL.so.1(AtiCallFGLComposite+0x213)[0x872df9]
======= Memory map: ========
00110000-00338000 r-xp 00000000 07:00 1151702    /usr/local/lib/libruby.so.1.9.1
00338000-00339000 r--p 00227000 07:00 1151702    /usr/local/lib/libruby.so.1.9.1
00339000-0033a000 rw-p 00228000 07:00 1151702    /usr/local/lib/libruby.so.1.9.1
0033a000-00347000 rw-p 00000000 00:00 0
00347000-0034e000 r-xp 00000000 07:00 724171     /lib/librt-2.12.1.so
0034e000-0034f000 r--p 00006000 07:00 724171     /lib/librt-2.12.1.so
0034f000-00350000 rw-p 00007000 07:00 724171     /lib/librt-2.12.1.so
00350000-00352000 r-xp 00000000 07:00 724086     /lib/libdl-2.12.1.so
00352000-00353000 r--p 00001000 07:00 724086     /lib/libdl-2.12.1.so
00353000-00354000 rw-p 00002000 07:00 724086     /lib/libdl-2.12.1.so
00354000-0035d000 r-xp 00000000 07:00 724071     /lib/libcrypt-2.12.1.so
0035d000-0035e000 r--p 00008000 07:00 724071     /lib/libcrypt-2.12.1.so
0035e000-0035f000 rw-p 00009000 07:00 724071     /lib/libcrypt-2.12.1.so
0035f000-00386000 rw-p 00000000 00:00 0
00386000-004dd000 r-xp 00000000 07:00 724508     /lib/libc-2.12.1.so
004dd000-004df000 r--p 00157000 07:00 724508     /lib/libc-2.12.1.so
004df000-004e0000 rw-p 00159000 07:00 724508     /lib/libc-2.12.1.so
004e0000-004e3000 rw-p 00000000 00:00 0
004e3000-004e5000 r-xp 00000000 07:00 1135415    /usr/local/lib/ruby/1.9.1/i686-linux/enc/encdb.so
004e5000-004e6000 r--p 00001000 07:00 1135415    /usr/local/lib/ruby/1.9.1/i686-linux/enc/encdb.so
004e6000-004e7000 rw-p 00002000 07:00 1135415    /usr/local/lib/ruby/1.9.1/i686-linux/enc/encdb.so
004e7000-004e9000 r-xp 00000000 07:00 1135417    /usr/local/lib/ruby/1.9.1/i686-linux/enc/trans/transdb.so
004e9000-004ea000 r--p 00001000 07:00 1135417    /usr/local/lib/ruby/1.9.1/i686-linux/enc/trans/transdb.so
004ea000-004eb000 rw-p 00002000 07:00 1135417    /usr/local/lib/ruby/1.9.1/i686-linux/enc/trans/transdb.so
004eb000-005ca000 r-xp 00000000 07:00 789602     /usr/lib/libstdc++.so.6.0.14
005ca000-005ce000 r--p 000de000 07:00 789602     /usr/lib/libstdc++.so.6.0.14
005ce000-005cf000 rw-p 000e2000 07:00 789602     /usr/lib/libstdc++.so.6.0.14
005cf000-005d6000 rw-p 00000000 00:00 0
005d6000-005dc000 r-xp 00000000 07:00 788783     /usr/lib/libXrandr.so.2.2.0
005dc000-005dd000 r--p 00005000 07:00 788783     /usr/lib/libXrandr.so.2.2.0
005dd000-005de000 rw-p 00006000 07:00 788783     /usr/lib/libXrandr.so.2.2.0
005de000-005df000 r-xp 00000000 07:00 1151037    /usr/local/lib/ruby/site_ruby/1.9.1/i686-linux/sfml/all.so
005df000-005e0000 r--p 00000000 07:00 1151037    /usr/local/lib/ruby/site_ruby/1.9.1/i686-linux/sfml/all.so
005e0000-005e1000 rw-p 00001000 07:00 1151037    /usr/local/lib/ruby/site_ruby/1.9.1/i686-linux/sfml/all.so
005e1000-005fb000 r-xp 00000000 07:00 654160     /lib/libgcc_s.so.1
005fb000-005fc000 r--p 00019000 07:00 654160     /lib/libgcc_s.so.1
005fc000-005fd000 rw-p 0001a000 07:00 654160     /lib/libgcc_s.so.1
005fd000-00606000 r-xp 00000000 07:00 1135353    /usr/local/lib/libsfml-system.so.2.0
00606000-00607000 r--p 00008000 07:00 1135353    /usr/local/lib/libsfml-system.so.2.0
00607000-00608000 rw-p 00009000 07:00 1135353    /usr/local/lib/libsfml-system.so.2.0
00608000-00620000 r-xp 00000000 07:00 1151035    /usr/local/lib/ruby/site_ruby/1.9.1/i686-linux/sfml/window.so
00620000-00621000 r--p 00017000 07:00 1151035    /usr/local/lib/ruby/site_ruby/1.9.1/i686-linux/sfml/window.so
00621000-00622000 rw-p 00018000 07:00 1151035    /usr/local/lib/ruby/site_ruby/1.9.1/i686-linux/sfml/window.so
00622000-00636000 r-xp 00000000 07:00 1135355    /usr/local/lib/libsfml-window.so.2.0
00636000-00637000 r--p 00013000 07:00 1135355    /usr/local/lib/libsfml-window.so.2.0
00637000-00638000 rw-p 00014000 07:00 1135355    /usr/local/lib/libsfml-window.so.2.0
00638000-00751000 r-xp 00000000 07:00 788746     /usr/lib/libX11.so.6.3.0
00751000-00752000 r--p 00118000 07:00 788746     /usr/lib/libX11.so.6.3.0
00752000-00754000 rw-p 00119000 07:00 788746     /usr/lib/libX11.so.6.3.0
00754000-00755000 rw-p 00000000 00:00 0
00755000-0075c000 r-xp 00000000 07:00 785634     /usr/lib/fglrx/libatiuki.so.1.0
0075c000-0075d000 rw-p 00006000 07:00 785634     /usr/lib/fglrx/libatiuki.so.1.0
0075d000-0075f000 r-xp 00000000 07:00 788750     /usr/lib/libXau.so.6.0.0
0075f000-00760000 r--p 00001000 07:00 788750     /usr/lib/libXau.so.6.0.0
00760000-00761000 rw-p 00002000 07:00 788750     /usr/lib/libXau.so.6.0.0
00762000-00770000 r-xp 00000000 07:00 788763     /usr/lib/libXext.so.6.4.0
00770000-00771000 r--p 0000d000 07:00 788763     /usr/lib/libXext.so.6.4.0
00771000-00772000 rw-p 0000e000 07:00 788763     /usr/lib/libXext.so.6.4.0
00772000-0077a000 r-xp 00000000 07:00 788785     /usr/lib/libXrender.so.1.3.0
0077a000-0077b000 r--p 00007000 07:00 788785     /usr/lib/libXrender.so.1.3.0
0077b000-0077c000 rw-p 00008000 07:00 788785     /usr/lib/libXrender.so.1.3.0
0077c000-007b1000 r-xp 00000000 07:00 848703     /usr/lib/libjpeg.so.8.0.2
007b1000-007b2000 r--p 00034000 07:00 848703     /usr/lib/libjpeg.so.8.0.2
007b2000-007b3000 rw-p 00035000 07:00 848703     /usr/lib/libjpeg.so.8.0.2
007b3000-007b6000 r-xp 00000000 07:00 662016     /lib/libuuid.so.1.3.0
007b6000-007b7000 r--p 00002000 07:00 662016     /lib/libuuid.so.1.3.0
007b7000-007b8000 rw-p 00003000 07:00 662016     /lib/libuuid.so.1.3.0
007bb000-007d7000 r-xp 00000000 07:00 724038     /lib/ld-2.12.1.so
007d7000-007d8000 r--p 0001b000 07:00 724038     /lib/ld-2.12.1.so
007d8000-007d9000 rw-p 0001c000 07:00 724038     /lib/ld-2.12.1.so
007d9000-007e0000 r-xp 00000000 07:00 788742     /usr/lib/libSM.so.6.0.1
007e0000-007e1000 r--p 00006000 07:00 788742     /usr/lib/libSM.so.6.0.1
007e1000-007e2000 rw-p 00007000 07:00 788742     /usr/lib/libSM.so.6.0.1
007e2000-007f7000 r-xp 00000000 07:00 788721     /usr/lib/libICE.so.6.3.0
007f7000-007f8000 r--p 00014000 07:00 788721     /usr/lib/libICE.so.6.3.0
007f8000-007f9000 rw-p 00015000 07:00 788721     /usr/lib/libICE.so.6.3.0Abortado
 

As far as my newbie knowledge lets me, I see an SFM::Error message, so it looks controlled. But Ruby crashes (or it seems to me, maybe it's normal, i'm newbie with Ruby, sorry):
« Last Edit: April 19, 2012, 10:10:18 pm by vivo »

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
Re: rbSFML
« Reply #152 on: April 19, 2012, 10:17:47 pm »
Hmm no that's not right, can you give me your source? Cause it looks very odd. You should get a SFML::Error but it shouldn't crash like that.

Also what version of Ruby are you using?
« Last Edit: April 19, 2012, 10:29:42 pm by Groogy »
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

vivo

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
    • Email
Re: rbSFML
« Reply #153 on: April 19, 2012, 10:48:03 pm »
I've tried to handle the exception and now works properly
sample:
def create_texture_from_file file
        begin
                texture = Texture.new(file)
                return texture
        rescue
                #texture = Texture.new(100,100)
                puts("Error loading texture from file #{file}")
                return false
        end
end

if(!texture = create_texture_from_file('non_exist.jpg'))
        exit!
 

Now the output is simply:
Error loading texture from file non_exist.jpg
 

Do you mean could be a problem with my installation?
I'm using ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux]

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
Re: rbSFML
« Reply #154 on: April 19, 2012, 10:55:49 pm »
Something is up... It works perfectly for me with just throwing the exception though I am on Windows. (Should work exactly the same on Linux as well)

It could be that the X windowing system doesn't like Ruby exceptions. What if you throw an exception manually? Also what graphics card are you sitting on? If it is a integrated intel card then I already know what's wrong ^^

Update: Actually I am thinking about reporting this to the Ruby issue tracker. So can you run the test with ruby -v and give me all information you get from that run.  I also want the machine configuration(Architecture, Graphics card and what Linux you are running on).

Also make sure you have the latest Ruby, latest drivers, latest everything :P
« Last Edit: April 20, 2012, 12:11:46 am by Groogy »
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

vivo

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
    • Email
Re: rbSFML
« Reply #155 on: April 20, 2012, 12:22:27 am »
Throwing by my self an exception
with:
raise "I throw an exception"
 
console:
vivo@ubuntu:~/Escritorio/proyectoAG/primer_juego$ ruby juego.rb
juego.rb:32:in `<main>': I throw an exception (RuntimeError)
XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server "&#65533;&#65533;XG"

My laptop:
intel core i5
ATI Mobility RADEON
Ubuntu 10.10

ruby -v prog.rb:  (almost the same output)
vivo@ubuntu:~/Escritorio/proyectoAG/primer_juego$ ruby -v juego.rb
ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux]
juego.rb:38: warning: mismatched indentations at 'end' with 'if' at 36
juego.rb:59: warning: mismatched indentations at 'end' with 'if' at 57
juego.rb:72: warning: mismatched indentations at 'end' with 'if' at 70
juego.rb:73: warning: mismatched indentations at 'end' with 'while' at 68
juego.rb:85: warning: mismatched indentations at 'end' with 'while' at 64
/usr/local/lib/ruby/site_ruby/1.9.1/i686-linux/sfml/graphics.so: warning: method redefined; discarding old (null)
juego.rb:30:in `initialize': Failed to load image "inexistent.jpg". Reason : Unable to open file (SFML::Error)
        from juego.rb:30:in `
new'
        from juego.rb:30:in `<main>'

XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server "&#65533;&#65533;&#65533;        &#65533;&#65533;
"

      after 119 requests (118 known processed) with 0 events remaining.
*** glibc detected *** ruby: free(): invalid pointer: 0x0a168388 ***
======= Backtrace: =========
/lib/libc.so.6(+0x6c0c1)[0x3060c1]
/lib/libc.so.6(+0x6d930)[0x307930]
/lib/libc.so.6(cfree+0x6d)[0x30aa1d]
/usr/lib/libstdc++.so.6(_ZdlPv+0x21)[0x4a1441]
/usr/lib/libstdc++.so.6(_ZNSs4_Rep10_M_destroyERKSaIcE+0x1d)[0x483acd]
/usr/lib/libstdc++.so.6(_ZNSt18basic_stringstreamIcSt11char_traitsIcESaIcEED1Ev+0xe8)[0x47c1d8]
/lib/libc.so.6(+0x2f69e)[0x2c969e]
/lib/libc.so.6(+0x2f70f)[0x2c970f]
/usr/lib/libX11.so.6(_XDefaultIOError+0xb0)[0xac4bb0]
/usr/lib/libX11.so.6(_XIOError+0x56)[0xac4c36]
/usr/lib/libX11.so.6(+0x41a8a)[0xacca8a]
/usr/lib/libX11.so.6(_XReply+0x106)[0xacd036]
/usr/lib/libX11.so.6(XQueryExtension+0xa2)[0xaba3c2]
/usr/lib/libX11.so.6(XInitExtension+0x3b)[0xaae9bb]
/usr/lib/libXext.so.6(XextAddDisplay+0x4c)[0x15bc5c]
/usr/lib/fglrx/libGL.so.1(AtiCallFGLComposite+0x213)[0x20fdf9]
======= Memory map: ========
00110000-00112000 r-xp 00000000 07:00 1135417    /usr/local/lib/ruby/1.9.1/i686-linux/enc/trans/transdb.so
00112000-00113000 r--p 00001000 07:00 1135417    /usr/local/lib/ruby/1.9.1/i686-linux/enc/trans/transdb.so
00113000-00114000 rw-p 00002000 07:00 1135417    /usr/local/lib/ruby/1.9.1/i686-linux/enc/trans/transdb.so
00114000-0012e000 r-xp 00000000 07:00 654160     /lib/libgcc_s.so.1
0012e000-0012f000 r--p 00019000 07:00 654160     /lib/libgcc_s.so.1
0012f000-00130000 rw-p 0001a000 07:00 654160     /lib/libgcc_s.so.1
00130000-0013c000 r-xp 00000000 07:00 1151036    /usr/local/lib/ruby/site_ruby/1.9.1/i686-linux/sfml/system.so
0013c000-0013d000 r--p 0000b000 07:00 1151036    /usr/local/lib/ruby/site_ruby/1.9.1/i686-linux/sfml/system.so
0013d000-0013e000 rw-p 0000c000 07:00 1151036    /usr/local/lib/ruby/site_ruby/1.9.1/i686-linux/sfml/system.so
0013e000-00147000 r-xp 00000000 07:00 1135353    /usr/local/lib/libsfml-system.so.2.0
00147000-00148000 r--p 00008000 07:00 1135353    /usr/local/lib/libsfml-system.so.2.0
00148000-00149000 rw-p 00009000 07:00 1135353    /usr/local/lib/libsfml-system.so.2.0
00149000-0014b000 r-xp 00000000 07:00 788750     /usr/lib/libXau.so.6.0.0
0014b000-0014c000 r--p 00001000 07:00 788750     /usr/lib/libXau.so.6.0.0
0014c000-0014d000 rw-p 00002000 07:00 788750     /usr/lib/libXau.so.6.0.0
0014f000-0015d000 r-xp 00000000 07:00 788763     /usr/lib/libXext.so.6.4.0
0015d000-0015e000 r--p 0000d000 07:00 788763     /usr/lib/libXext.so.6.4.0
0015e000-0015f000 rw-p 0000e000 07:00 788763     /usr/lib/libXext.so.6.4.0
0015f000-00166000 r-xp 00000000 07:00 785634     /usr/lib/fglrx/libatiuki.so.1.0
00166000-00167000 rw-p 00006000 07:00 785634     /usr/lib/fglrx/libatiuki.so.1.0
00167000-0017f000 r-xp 00000000 07:00 789712     /usr/lib/libxcb.so.1.1.0
0017f000-00180000 r--p 00017000 07:00 789712     /usr/lib/libxcb.so.1.1.0
00180000-00181000 rw-p 00018000 07:00 789712     /usr/lib/libxcb.so.1.1.0
00181000-00185000 r-xp 00000000 07:00 788761     /usr/lib/libXdmcp.so.6.0.0
00185000-00186000 r--p 00003000 07:00 788761     /usr/lib/libXdmcp.so.6.0.0
00186000-00187000 rw-p 00004000 07:00 788761     /usr/lib/libXdmcp.so.6.0.0
00187000-0018e000 r-xp 00000000 07:00 788742     /usr/lib/libSM.so.6.0.1
0018e000-0018f000 r--p 00006000 07:00 788742     /usr/lib/libSM.so.6.0.1
0018f000-00190000 rw-p 00007000 07:00 788742     /usr/lib/libSM.so.6.0.1
00190000-00193000 r-xp 00000000 07:00 662016     /lib/libuuid.so.1.3.0
00193000-00194000 r--p 00002000 07:00 662016     /lib/libuuid.so.1.3.0
00194000-00195000 rw-p 00003000 07:00 662016     /lib/libuuid.so.1.3.0
00195000-00197000 r-xp 00000000 07:00 788773     /usr/lib/libXinerama.so.1.0.0
00197000-00198000 r--p 00001000 07:00 788773     /usr/lib/libXinerama.so.1.0.0
00198000-00199000 rw-p 00002000 07:00 788773     /usr/lib/libXinerama.so.1.0.0
00199000-001a0000 r-xp 00000000 07:00 724171     /lib/librt-2.12.1.so
001a0000-001a1000 r--p 00006000 07:00 724171     /lib/librt-2.12.1.so
001a1000-001a2000 rw-p 00007000 07:00 724171     /lib/librt-2.12.1.so
001a2000-00256000 r-xp 00000000 07:00 785638     /usr/lib/fglrx/libGL.so.1.2
00256000-00261000 rwxp 000b3000 07:00 785638     /usr/lib/fglrx/libGL.so.1.2
00261000-00266000 rwxp 00000000 00:00 0
00266000-0026b000 r-xp 00000000 07:00 789433     /usr/lib/libogg.so.0.7.0
0026b000-0026c000 r--p 00004000 07:00 789433     /usr/lib/libogg.so.0.7.0
0026c000-0026d000 rw-p 00005000 07:00 789433     /usr/lib/libogg.so.0.7.0
0026d000-00271000 r-xp 00000000 07:00 788765     /usr/lib/libXfixes.so.3.1.0
00271000-00272000 r--p 00003000 07:00 788765     /usr/lib/libXfixes.so.3.1.0
00272000-00273000 rw-p 00004000 07:00 788765     /usr/lib/libXfixes.so.3.1.0
00274000-00298000 r-xp 00000000 07:00 724364     /lib/libm-2.12.1.so
00298000-00299000 r--p 00023000 07:00 724364     /lib/libm-2.12.1.so
00299000-0029a000 rw-p 00024000 07:00 724364     /lib/libm-2.12.1.so
0029a000-003f1000 r-xp 00000000 07:00 724508     /lib/libc-2.12.1.so
003f1000-003f3000 r--p 00157000 07:00 724508     /lib/libc-2.12.1.so
003f3000-003f4000 rw-p 00159000 07:00 724508     /lib/libc-2.12.1.so
003f4000-003f7000 rw-p 00000000 00:00 0
003f7000-004d6000 r-xp 00000000 07:00 789602     /usr/lib/libstdc++.so.6.0.14
004d6000-004da000 r--p 000de000 07:00 789602     /usr/lib/libstdc++.so.6.0.14
004da000-004db000 rw-p 000e2000 07:00 789602     /usr/lib/libstdc++.so.6.0.14
004db000-004e2000 rw-p 00000000 00:00 0
004e2000-00523000 r-xp 00000000 07:00 1151034    /usr/local/lib/ruby/site_ruby/1.9.1/i686-linux/sfml/graphics.so
00523000-00524000 r--p 00040000 07:00 1151034    /usr/local/lib/ruby/site_ruby/1.9.1/i686-linux/sfml/graphics.so
00524000-00525000 rw-p 00041000 07:00 1151034    /usr/local/lib/ruby/site_ruby/1.9.1/i686-linux/sfml/graphics.so
00525000-00534000 r-xp 00000000 07:00 1151033    /usr/local/lib/ruby/site_ruby/1.9.1/i686-linux/sfml/audio.so
00534000-00535000 r--p 0000e000 07:00 1151033    /usr/local/lib/ruby/site_ruby/1.9.1/i686-linux/sfml/audio.so
00535000-00536000 rw-p 0000f000 07:00 1151033    /usr/local/lib/ruby/site_ruby/1.9.1/i686-linux/sfml/audio.so
00536000-0053c000 r-xp 00000000 07:00 788783     /usr/lib/libXrandr.so.2.2.0
0053c000-0053d000 r--p 00005000 07:00 788783     /usr/lib/libXrandr.so.2.2.0
0053d000-0053e000 rw-p 00006000 07:00 788783     /usr/lib/libXrandr.so.2.2.0
0053e000-005d2000 r-xp 00000000 07:00 1135359    /usr/local/lib/libsfml-graphics.so.2.0
005d2000-005d3000 r--p 00093000 07:00 1135359    /usr/local/lib/libsfml-graphics.so.2.0
005d3000-005d4000 rw-p 00094000 07:00 1135359    /usr/local/lib/libsfml-graphics.so.2.0
005d4000-005e9000 r-xp 00000000 07:00 788721     /usr/lib/libICE.so.6.3.0
005e9000-005ea000 r--p 00014000 07:00 788721     /usr/lib/libICE.so.6.3.0
005ea000-005eb000 rw-p 00015000 07:00 788721     /usr/lib/libICE.so.6.3.0Abortado
 

vivo

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
    • Email
Re: rbSFML
« Reply #156 on: April 20, 2012, 12:28:55 am »
Also make sure you have the latest Ruby, latest drivers, latest everything :P
I have the latest Ruby, never updated my graphics card (lazy but I will  :P), my SFML lib is the same that you recommend in your "how to install", and also my rbSFML (the commit version you sugested). May I update rbSFML to your last commit?

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
Re: rbSFML
« Reply #157 on: April 20, 2012, 12:42:29 am »
Don't think it will solve it. Though you should.

Anyway I will wait with providing the bug report until you have updated your drivers. Also try this code:
require 'sfml/graphics'
texture = SFML::Texture.new( "someFileThatExist.png" )
raise "Whatever"

It might be that when the exception is raised something breaks if there is OpenGL resources.
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

vivo

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
    • Email
Re: rbSFML
« Reply #158 on: April 20, 2012, 12:57:23 am »
well, i just tried that code and no problem, raises the exception without crashing
groogy_prueba.rb:3:in `<main>': Whatever (RuntimeError)

vivo

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
    • Email
Re: rbSFML
« Reply #159 on: April 20, 2012, 01:07:05 am »
As far as I know when you boot a ruby script you start a process, does rbSFML kill the process itself when catching an exception? I mean, uses rbSFML the Kernel.exit or Kernel.abort after (or while) using SFML::Error?

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
Re: rbSFML
« Reply #160 on: April 20, 2012, 02:07:46 am »
Nope it doesn't... It does none of the things. It simply calls ruby's built in C function for raising an exception. And this function in turn does a longjmp call to somewhere in Ruby where it handles the exceptions.

Can you test and see what happens in C++? Write a C++ program that attempts to load a texture that doesn't exist and then exit's the application. If nothing happens then try raising a C++ exception and see what happens there. I just want to see if it is specific to Ruby or to SFML.

You can also try turning of exceptions by writing:
SFML.raise_exceptions = false

And looking at the backtrace more closely it actually looks like the crash comes from the X system trying to output an error(which it did) and something failed in there. So check also if the C++ version outputs something from X server. If not I have no idea what's wrong. Does the output come every-time you run a script that includes rbSFML code? Will it come up for every texture you create or just once no matter what? Etc. etc.
« Last Edit: April 20, 2012, 02:17:14 am by Groogy »
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 #161 on: April 20, 2012, 02:24:06 am »
http://en.sfml-dev.org/forums/index.php?topic=3879.msg33533#msg33533

After some quick searching in Google for a solution to the problem I actually got a good link back to SFML here ^^
Seems it is a driver issue and probably upgrading will help you out. If that doesn't fix it I guess you can still work with this as long as your application don't crash :)
Or well until the window is closed. It seems the error is triggered by that.
« Last Edit: April 20, 2012, 02:25:44 am by Groogy »
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

vivo

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
    • Email
Re: rbSFML
« Reply #162 on: April 20, 2012, 11:29:33 am »
Ok, now I have to go, but I will try in a few hours to update my drivers and the C test you sugested

Lupinius

  • Jr. Member
  • **
  • Posts: 85
    • View Profile
Re: rbSFML
« Reply #163 on: April 20, 2012, 05:05:20 pm »
I've been playing around with rbSFML a bit more and seem to have problems with number types (never thought I'd see that in ruby). When using this test code:
require "sfml/graphics"

foo = SFML::Rect.new(0, 0, 1, 1)
bar = SFML::Rect.new(0.5, 0.5, 1, 1)
puts foo.intersects?(bar)
I get an error:
Code: [Select]
sh.exe"-3.1$ ruby test.rb
test.rb:4:in `initialize': Did not receive expected types ( 'Fixnum', 'Float' ) (TypeError)
        from test.rb:4:in `new'
        from test.rb:4:in `<main>'

What am I doing wrong?

vivo

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
    • Email
Re: rbSFML
« Reply #164 on: April 20, 2012, 06:04:32 pm »
from doc:
sf::Rect is a template and may be used with any numeric type, but for simplicity the instanciations used by SFML are typedefed:

    sf::Rect<int> is sf::IntRect
    sf::Rect<float> is sf::FloatRect

make a try with SFML::FloatRect instead of SFML::Rect

 

anything