Not logged inGosu Forums
Forum back to libgosu.org Help Search Register Login
Up Forum
Search
Topic Screen goes black. By onnoowl Date 2013-05-16 21:18
The draw function does not seem to be throwing any sort of exception. When the screen goes black, the rescue function does not trigger.
However, I can prove that the rescue function is in fact doing it's job, because if I try to interrupt the program (ctrl C) it prints the interruption error message and then just keeps on going.
The draw function is not throwing any sort of error. What else could be causing the blackness?
Topic Screen goes black. By onnoowl Date 2013-05-16 14:16
I tried that, but it made no difference.
The rescue block is never running.
Here's the new draw block I tried:
  def draw
    begin
      coord = vec2(0, 0) - @drawOffset
      coord = vec2(coord.x % $size.x, coord.y % $size.y)
      @img.draw(coord.x, coord.y, 0, @imgScale.x, @imgScale.y)
      coord2 = coord - vec2($size.x, 0)
      @img.draw(coord2.x, coord2.y, 0, @imgScale.x, @imgScale.y)
      # c = 0xff333333
      # draw_quad(0, 0, c, $size.x, 0, c, $size.x, $size.y, c, 0, $size.y, c, 0)
      @creature.draw(self, @drawOffset)
    rescue
      puts "Error"
      puts $!.backtrace
    end
  end
Topic Screen goes black. By onnoowl Date 2013-05-15 14:39
The update function and the draw functions are still called. I did notice that if I comment out @creature.draw(self) it does not turn black anymore. The weird thing is even if I comment out anything in the draw function for Creature, so the function does nothing, I still get the bug.
Topic Screen goes black. By onnoowl Date 2013-05-15 13:04
Hi,
I've worked with Gosu for a while without this happening, and I don't know what's causing it. I'm trying to simulate evolution. This program creates lots of little creatures and breeds them together, kills off the slow ones, keeps the fast moving ones, and eventually they should evolve into well designed fast travelling creatures.
As the program evaluates the speed of each creature, it opens up a gosu window, and runs it for about 3 seconds to see how far the creature goes. The problem I'm having is that occasionally/randomly, the entire window goes black and shows nothing.
If you guys could figure out what's causing this, that would be great.
(Note: My window class is called Simulation and is towards the bottom of the evolvingCreatures.rb file)
Attachment: evolutionAI.rb (3k)
Attachment: evolvingCreatures.rb (8k)
Topic Out of focus By onnoowl Date 2013-02-11 19:47
That looks promising, but how do I use it in ruby?
Topic Out of focus By onnoowl Date 2013-02-07 16:48
Ah.
Does anybody maybe know of another library that continuously monitors keyboard inputs?
Topic Out of focus By onnoowl Date 2013-02-07 14:19
Surely I can make a background program that can watch to see if you press F7 or something, right?
I've seen plenty of applications that do it.
Topic Out of focus By onnoowl Date 2013-02-06 19:48
Hello,
Is there a way i can monitor keyboard inputs while the window is out of focus?
Topic Help with Jruby By onnoowl Date 2013-01-24 00:38
Rather unfortunately, i got quite a similar error when trying to install texplay...
Is there something wrong with my jruby installation?
I got the windows installer, ran it, and added it to my path.
The only odd thing is i followed some advice that one of the errors gave me...
It told me to run something like this:
set JRUBY_OPTS=-Xcext.enabled=true

Anyways, this is what i got from installing texplay:
jgem install texplay
Building native extensions.  This could take a while...
ERROR:  Error installing texplay:
        ERROR: Failed to build gem native extension.

        c:/jruby-1.7.2/bin/jruby.exe extconf.rb
The Gosu gem requires some libraries to be installed system-wide.
See the following site for a list:
https://github.com/jlnr/gosu/wiki/Getting-Started-on-Linux

c:/jruby-1.7.2/lib/ruby/shared/mkmf.rb:14: Use RbConfig instead of obsolete and
deprecated Config.
Errno::ENOENT: No such file or directory - uname
       at file:/C:/jruby-1.7.2/lib/jruby.jar!/jruby/kernel/jruby/process_manag
er.rb:24
      
at file:/C:/jruby-1.7.2/lib/jruby.jar!/jruby/kernel/jruby/process_manag
er.rb:49
  (root) at extconf.rb:66
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=c:/jruby-1.7.2/bin/jruby

Gem files will remain installed in c:/jruby-1.7.2/lib/ruby/gems/shared/gems/gosu
-0.7.45 for inspection.
Results logged to c:/jruby-1.7.2/lib/ruby/gems/shared/gems/gosu-0.7.45/linux/gem
_make.out
Topic Help with Jruby By onnoowl Date 2013-01-23 13:12
Hello, I'm trying to get gosu working on jruby. It does not seem to be working.
This is what happens:

I run the command: jgem install gosu

Building native extensions.  This could take a while...
ERROR:  Error installing gosu:
        ERROR: Failed to build gem native extension.

        c:/jruby-1.7.2/bin/jruby.exe extconf.rb
The Gosu gem requires some libraries to be installed system-wide.
See the following site for a list:
https://github.com/jlnr/gosu/wiki/Getting-Started-on-Linux

c:/jruby-1.7.2/lib/ruby/shared/mkmf.rb:14: Use RbConfig instead of obsolete and
deprecated Config.
Errno::ENOENT: No such file or directory - uname
       at file:/C:/jruby-1.7.2/lib/jruby.jar!/jruby/kernel/jruby/process_manag
er.rb:24
      
at file:/C:/jruby-1.7.2/lib/jruby.jar!/jruby/kernel/jruby/process_manag
er.rb:49
  (root) at extconf.rb:66
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=c:/jruby-1.7.2/bin/jruby

Gem files will remain installed in c:/jruby-1.7.2/lib/ruby/gems/shared/gems/gosu
-0.7.45 for inspection.
Results logged to c:/jruby-1.7.2/lib/ruby/gems/shared/gems/gosu-0.7.45/linux/gem
_make.out

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill