well, heres is the output for a test.cpp and linking with audio and graphics
Any error, besides the expected "could'nt find the file"
gcc graph.o -o test -lsfml-graphics -lsfml-audio -lsfml-window -lsfml-system
vivo@ubuntu:~/Escritorio/proyectoAG/primer_juego$ ./test
Failed to load image "cute_image". Reason : Unable to open file
This takes me to thing that the problem comes for an unhandled exception in ruby (maybe in windows doesn't mather this, but x-konsole shows the error). If you remember, when I handled the exception the program didn't crash.
Kernel.require( 'sfml/all' )
include SFML
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('cute_image2.jpg'))
# raise "I throw an exception"
# return -1
Kernel.exit!
end
if I uncomment raise line-> crashes
if I uncomment return line-> crashes
if I uncomment exit line-> exit is: Error loading texture from file
The return line in mi mind represents whats happening now at now, letting the c++ SFML behabior for handle the exception, probably returning some value