Code Monkey home page Code Monkey logo

gosu's Introduction

Welcome to Gosu!

Gosu is a 2D game development library for Ruby and C++.

The main website is www.libgosu.org. The source code, wiki, issue tracker and change log are all hosted on GitHub.

Gosu is released under the MIT license.

Getting Started

The best entry point into Gosu's documentation is the wiki home page. Try doing the tutorials there if you don't know how to get started, or look at existing projects in the Gosu Showcase.

Community

  • There is a lively Discord community.
  • If you want to discuss or announce something in a more permanent place than a chat room, we also have a message board.
  • Please file bugs and feature requests on GitHub.

gosu's People

Contributors

bkmgit avatar chamblin avatar chase4926 avatar cyberarm avatar deltar9a2 avatar erisdev avatar fanquake avatar hanmac avatar hmans avatar improbable-valy avatar jackorp avatar jimtng avatar jlnr avatar jsb avatar kjarrigan avatar littlelightlittlefire avatar longlene avatar myokoym avatar oli-obk avatar pmer avatar psde avatar pusewicz avatar quit avatar ragesoss avatar shawn42 avatar spajus avatar voidexp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gosu's Issues

50 - char_to_button_id("a") crash on switching input language.

What steps will reproduce the problem?
Open CptnRuby.rb example.
Go to 213 line number.
Change line from:
    move_x -= 5 if button_down? Button::KbLeft
to:
    move_x -= 5 if button_down? char_to_button_id("a")

Change language input method (Ctrl-Shift --  English/Russian on my PC)
Crash! Runtime Error!

What is the expected output? What do you see instead?

What operating system are you using?
WinXP

Please provide any additional information below.


Original link: http://code.google.com/p/gosu/issues/detail?id=50

4 - Ruby Deployment on Mac

What steps will reproduce the problem?
1. Drag my .rb file into the Resouces dir in the deployment template
2. Drag the media dir in there, too.
3. Double-click on the red icon

What is the expected output? What do you see instead?
I expected to see the app run, but a window opened for a fraction of a
second, then vanished.  I tried with and without the Gosu.framework dir. 
Am I missing something else?

What version of the product are you using? On what operating system?
Mac OS X 10.4.10


Original link: http://code.google.com/p/gosu/issues/detail?id=4

41 - Figure out what to do with MIDI files

Since MIDI is still a popular format, and one where free music ought to be readily available, it would 
be cool to find out how to make them work on all platforms again. First check: Does FMOD4/FMOD 
Ex help with that?

Original link: http://code.google.com/p/gosu/issues/detail?id=41

39 - Windows: Gosu is eating a full CPU

What steps will reproduce the problem?
Launch a gosu-window-based program under windows.

What is the expected output? What do you see instead?
taskmsgr: 50% cpu usage by this program.

What operating system are you using?
Windows XP SP2. [01:46:22] <survivor> and it will be the same on all
windows systems

Please provide any additional information below.
See IRC Logs..!

Original link: http://code.google.com/p/gosu/issues/detail?id=39

7 - Char/button-id conversion methods should be static

Currently (in Gosu/Ruby), one may only call char_to_button_id and its inverse on an instance of 
Gosu::Window.  From what I know, this functionality is not specific to a single Window.  These 
should probably be class methods in order to allow consolidation/encapsulation of keybindings, 
as in this example:

class GameWindow < Gosu::Window
  LEFT = [Gosu::KbLeft, char_to_button_id('a'), Gosu::GpLeft]
  RIGHT = [Gosu::KbRight, char_to_button_id('d'), Gosu::GpRight]
  # ...

  def button_down(id)
    case id
    when *LEFT
        @player.go_left
    when *RIGHT
        @player.explode # heehee.
    # ...
    end
  end
end

If it's a concern, this is also backwards-compatible with any sane use of the methods.

Original link: http://code.google.com/p/gosu/issues/detail?id=7

17 - 64-bit

Trying to compile on a 64-bit system. (using make and autoconf)

Produces:

if [ ! -d RubyGosu ]; then mkdir RubyGosu; fi
if [ ! -d OpenGL ]; then mkdir OpenGL; fi
if [ ! -d Graphics ]; then mkdir Graphics; fi
if [ ! -d Sockets ]; then mkdir Sockets; fi
g++ ../GosuImpl/Math.cpp -o Math.o -I.. -I/usr/include/SDL -D_GNU_SOURCE=1
-D_REENTRANT -Wall -I/usr/include/pango-1.0 -I/usr/include/freetype2
-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
-I/usr/lib/ruby/1.8/x86_64-linux -fPIC -DNDEBUG -march=amd64 -O2 -pipe
-fomit-frame-pointer -c
../GosuImpl/Math.cpp:1: error: bad value (amd64) for -march= switch
../GosuImpl/Math.cpp:1: error: bad value (amd64) for -mtune= switch
make: **\* [Math.o] Error 1

Ubuntu 64-bit

I corrected the problem by removing the -march=pentium-m from the Makefile.


Original link: http://code.google.com/p/gosu/issues/detail?id=17

Gosu::Font has too simple letterspacing

What steps will reproduce the problem?
1. Use font 'Monaco' to draw the letters a-z.
2. Notice the broken rendering of u, the gap between f and g, r and s, w and x etc.

What version of the product are you using? 0.7.5 
On what operating system? OS X

It would be nice to be able to bundle fonts in a platform independent manner.


Original link: http://code.google.com/p/gosu/issues/detail?id=11

15 - Blurring with rapid animation

What steps will reproduce the problem?
  Move an animation rapdily across the screen.

What is the expected output? What do you see instead?
  The animation begins to blur. The animation slowly goes back to normal 
once the movement stops.

What operating system are you using?
  Windows

Please provide any additional information below.
  For an example, donwload the attached project, launch game.bat, and 
press Ctrl and an arrow key to make the character run. (I apologize, the 
file is a bit large.)


Original link: http://code.google.com/p/gosu/issues/detail?id=15

6 - ruby memory management

What steps will reproduce the problem?
1. open a window
2. load a new image , show it for 10 seconds ,  then repeat
3. and check the memory usage

What is the expected output? What do you see instead?
well the memory usage should not grow, currently just keeps growing until 
the kernels kills the script

What version of the product are you using? On what operating system?
SVN #210, debian unstable


Original link: http://code.google.com/p/gosu/issues/detail?id=6

21 - Linux: Fullscreen misplaced.

Hi,

defect report to self or other possible contributors:

On Ubuntu 6.10 Gutsy Gibbon, fullscreen mode didn't really work. The window
size was correct, but offset to some place outside the screen. :(

Original link: http://code.google.com/p/gosu/issues/detail?id=21

42 - Transparency PNG error (with palettes)

What steps will reproduce the problem?

Load a PNG image (background tile)
Load a PNG image with transparency (sprite image, with transparent
background around it)
Draw the background PNG image, and the sprite image at the same location 
( in both cases i.draw(x,y, ZOrder::UI) )

What is the expected output? What do you see instead?

The sprite should show, with the background title surrounding it. Instead,
the sprite is surrounded by black pixels.

What operating system are you using?

Ubuntu linux (2.6.24-19-generic)

Please provide any additional information below.

Gosu 0.7.9.2 
Sprite is attached, I might have simply boltched the PNG :( , not a GIMP
expert ... 

Regards
PHT 


Original link: http://code.google.com/p/gosu/issues/detail?id=42

30 - Linux: sharedResourcePrefix and resourcePrefix return empty wstrings

sharedResourcePrefix and resourcePrefix should both be the current folder
under Linux (maybe this should be extracted at window startup so if the
user changes directories in the c++ source that value will still return its
original value)

Original link: http://code.google.com/p/gosu/issues/detail?id=30

47 - gosu gem not found in any repository

What steps will reproduce the problem?

sudo gem install -V gosu

What is the expected output? What do you see instead?

I would expect gosu to install.

Instead, I get:

sebastian@c-48fde155 ~ % sudo gem install -V gosu

HEAD 200 OK: http://gems.rubyforge.org/latest_specs.4.8
GET 200 OK: http://gems.rubyforge.org/latest_specs.4.8.gz
ERROR:  could not find gem gosu locally or in a repository

What operating system are you using?

Please provide any additional information below.

sebastian@c-48fde155 ~ % gem -v
1.2.0

sebastian@c-48fde155 ~ % uname -a
Linux c-48fde155.911-11-64736c12.cust.bredbandsbolaget.se 2.6.24-gentoo-r8
#2 SMP Sat Jun 21 17:20:45 CEST 2008 i686 Genuine Intel(R) CPU T2500 @

2.00GHz GenuineIntel GNU/Linux

sebastian@c-48fde155 ~ % ruby -v
ruby 1.8.6 (2008-08-11 patchlevel 287) [i686-linux]

Scheiße.

Original link: http://code.google.com/p/gosu/issues/detail?id=47

1 - Linux/C++: SDL_mixer fallback doesn't support loading music from memory.

This is stubbed out because SDL_mixer 1.2.6 (which is what's in Debian
unstable) has the Mix_LoadMUS_RW API call commented out. This is fixed in
SDL_mixer 1.2.7, I hear, but it's something that needs to be investigated
and possibly worked around.

Original link: http://code.google.com/p/gosu/issues/detail?id=1

45 - Gosu::Window#close does not do anything until the next event happen

OVERVIEW

Gosu::Window#close does not do anything until the next event happens.

STEPS TO REPRODUCE
1. Get the attached gosu_window_close_test.rb script.
2. Run the script.
3. Move the mouse cursor to the center of the window.
4. Press the mouse button, but do not release it.
5. Wait a few seconds.
6. Release the mouse button.

ACTUAL RESULTS

After step 4, the window does not close.
After step 6, the window closes immediately.

EXPECTED RESULTS

After step 4, the window should close immediately.

AFFECTED PLATFORMS AND VERSIONS

Tested on Mac OS X. Not tested on other platforms.
Tested with the Ruby bindings of Gosu.
Tested with the latest public release of Gosu, as well as the latest Subversion build.

NOTES

When the second event arrives, neither button_up nor button_down are called. The window closes 
immediately without notifying about the second event.

EXAMPLES

An example of where this broken behaviour is troublesome, is when implementing buttons. A 
button's action should only be called when the button is released, but calling Gosu::Window#close 
when the button is released will cause the application to wait until the next event arrives.


Original link: http://code.google.com/p/gosu/issues/detail?id=45

5 - UTF8 : Could not convert from string to wstring

What steps will reproduce the problem?
1. compile gosu on linux (debian unstable/experimental)
2. render text with UTF8 string (in my case i tested with "")
3. Liberté, Égalité, Fraternité

What is the expected output? What do you see instead?
To render the proper text, it exited with error message:
"
terminate called after throwing an instance of 'std::runtime_error'
  what():  Could not convert from string to wstring
Aborted

"

What version of the product are you using? On what operating system?
SVN version, debian unstable/experimental

Please provide any additional information below.
well nothing more ... 


Original link: http://code.google.com/p/gosu/issues/detail?id=5

2 - mouse_x and mouse_y unavailable in Gosu::Window (Ruby)

when i try to access mouse_x or mouse_y on my Gosu::Window subclass object, i get this error:
./engine/engine.rb:50:in `button_down': undefined local variable or method`mouse_x' for 
# <Adventure::EngineWindow:0x33ab18> (NameError)

here is an output of Adventure::EngineWindow.methods.inspect(). as you can see, the mouse_\* 
methods are missing:
["method", "send", "caption", "object_id", "toggle_console", "singleton_methods", "**send**", 
"equal?", "taint", "caption=", "draw_quad", "frozen?", "instance_variable_get", "to_yaml_type", 
"kind_of?", "to_a", "instance_eval", "show", "button_down", "type", "protected_methods", "extend", 
"eql?", "display", "instance_variable_set", "is_complex_yaml?", "hash", "update", 
"to_yaml_properties", "is_a?", "to_s", "to_yaml", "button_up", "class", "button_down?", "close", 
"tainted?", "private_methods", "draw", "char_to_button_id", "untaint", "id", "inspect", "==", "===", 
"draw_line", "clone", "public_methods", "respond_to?", "button_id_to_char", "freeze", "**id**", 
"=~", "methods", "draw_triangle", "nil?", "dup", "instance_variables", "instance_of?"]


Original link: http://code.google.com/p/gosu/issues/detail?id=2

46 - Better full-screen support for small/weird resolutions

If a non-standard or smaller resolution is used in a game, Gosu renders it and draw the 
background in black color. The problem is that the "game window" inside this black background 
isn't centered (most libraries do center it) and does not perform image clipping; i.e if you draw 
something beyond "game window" bounds, it does get rendered in the black background.

I'm using Leopard 10.5.4


Original link: http://code.google.com/p/gosu/issues/detail?id=46

20 - TextInput should use IMs

This issue exists to sum up the various answers I gave about better text input methods in wiki 
comments, mails, and issues.

Basically, the problem is that Gosu is not well-suited for entering any text beyond lower-caps 
highscore entries. While keys can be translated into characters, this translation does not respect 
modifier keys.

Now it seems obvious to either add a better translation function, or to pass the character code 
given from the operating system into Input::onButtonDown (Window#button_down in Ruby). 
However, this does not even address dead keys. So it is not possible to fit modern operating 
system's interfaces into a small addition to Gosu::Input, and trying to write the functionality on 
our own would be doomed to fail:

http://blogs.msdn.com/oldnewthing/archive/2007/10/22/5586861.aspx

A more comprehensive solution is the TextInput class that I have planned to implement for the 
last three versions or so, and which will not be in 0.7.8 either, as I need a very stable release 
right now (hello Ludum Dare 10). It will probably look like the following, though (in Ruby for 
brevity):

class TextInput
  def initialize(parent_input) ... end
  def text ... end
  def caret_pos ... end
  def sel_start_pos ... end
  def feed_event(private_event) ... end
end

The Input object (or Window in Ruby) could then be told to forward operating system messages 
to at most one TextInput object at a time, which would build the text from the commands it 
receives. How this text would be represented in the game's UI is completely up to the developer, 
allowing for GUI libraries to be built upon this later.

It would also be totally awesome if that could be extended to be used with the Kotoeri input 
manager on OS X. ;)

*

Suggestions on the interface and APIs that could help to implement this (esp. on Linux) very 
welcome.

Original link: http://code.google.com/p/gosu/issues/detail?id=20

10 - Not possible to keep the mouse pointer visible in Ruby Gosu

What steps will reproduce the problem?
1.  Open a Gosu window.
2. Move the pointer over the window
3. The pointer disappears.

What version of the product are you using? Ruby, Gosu 0.7.5 
On what operating system? OS X

Please provide any additional information below.
Having the pointer is essential for any point-and-click game. It is possible to simulate it using a 
sprite, but is seems a bit unnecessary.


Original link: http://code.google.com/p/gosu/issues/detail?id=10

16 - .draw_line horizontal excludes last pixel with some drivers

When drawing a line using:

class window < Gosu::Window
  def test_line
    draw_line(100, 100, 0xFFFFFFFF, 200, 100, 0xFFFFFFFF, 1)
  end
end

The line seems to be drawn from x=100 to x=199... In previous versions
(0.7.6 and earlier), the line drew from x=101 to x=200, but now seems to be
one pixel short in the other direction.

-Warren

Original link: http://code.google.com/p/gosu/issues/detail?id=16

38 - Can't compile gosu.so in Linux, amd64 architecture

While compiling gosu 0.7.9.2 on debian linux, amd64 architecture, g++ 4.3.1:

leoboiko@karasu ~/desktop/src/gosu-source-0.7.9.2/linux$ make
if [ ! -d RubyGosu ]; then mkdir RubyGosu; fi
if [ ! -d OpenGL ]; then mkdir OpenGL; fi
if [ ! -d Graphics ]; then mkdir Graphics; fi
if [ ! -d Sockets ]; then mkdir Sockets; fi
g++ -shared -o gosu.so -L/usr/lib -lSDL -lSDL_mixer -L -lX11 -lpangoft2-1.0
-lpango-1.0 -lfreetype -lz -lfontconfig -lgobject-2.0 -lgmodule-2.0 -ldl
-lglib-2.0   -lpng -lGL -lGLU -lglut -lXxf86vm  Math.o Utility.o IO.o
FileUnix.o TimingUnix.o WindowX.o Graphics/Bitmap.o InputX.o TextInputX.o
Graphics/BitmapUtils.o Graphics/Color.o Graphics/TexChunk.o
Graphics/Graphics.o Graphics/Image.o Graphics/RotFlip.o
Graphics/BlockAllocator.o Graphics/Texture.o Graphics/LargeImageData.o
Graphics/BitmapPNG.o Graphics/Font.o Graphics/BitmapBMP.o
Graphics/TextPangoFT.o Graphics/Text.o Graphics/BitmapColorKey.o
DirectoriesUnix.o Sockets/CommSocket.o Sockets/ListenerSocket.o
Sockets/Socket.o Sockets/MessageSocket.o AudioSDL.o
/usr/bin/ld: Math.o: relocation R_X86_64_32 against `__gxx_personality_v0'
can not be used when making a shared object; recompile with -fPIC
Math.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: **\* [gosu.so] Error 1

From the log it seems Math.o was, in fact, compiled with -fPIC.

Original link: http://code.google.com/p/gosu/issues/detail?id=38

34 - Linux: Configuring Gosu may fail while Ruby 1.9 is installed

Thanks to qubodup for reporting this. When building Ruby/Gosu with Ruby 1.8 and running any 
Ruby/Gosu game, this error occurs:

$ ruby1.8 Main.rb
./StateWindow.rb:10:in `caption=': in method 'setCaption', argument 1 of type 'Gosu::Window *' 
(TypeError)
        from ./StateWindow.rb:10:in`initialize'
        from /usr/lib/ruby/1.8/singleton.rb:95:in `new'
        from /usr/lib/ruby/1.8/singleton.rb:95:in`instance'
        from Main.rb:78

Maybe it's the use of Mixins (the Window subclass in question included Singleton) that prevents 
SWIG from casting it to Gosu::Window?

Original link: http://code.google.com/p/gosu/issues/detail?id=34

36 - Fullscreen mode should make less use of resolution switching

Gosu has the ability to do just that, so it should! Side note: OS X already is clever enough to do 
exactly that in fullscreen mode.

Thanks to the Caribbean Onslaught team again for inspiring me to report this ;)

Original link: http://code.google.com/p/gosu/issues/detail?id=36

12 - Gosu::Color.initialize(a, r, g, b) not found in 0.7.6

Create a new color using:

color_test = Gosu::Color(0xFF, 0xCC, 0xCC, 0xCC)

Color should be same as Gosu::Color(0xFFCCCCCC), but fails at runtime

Running on WindowsXP, Ruby 1.8.6, Gosu 0.7.6.

Also, would be nice to know how to properly use the color.red=, .blue=,
etc. These throw type errors at assignment-time (looking for Channel type).

-Warren W
[email protected]


Original link: http://code.google.com/p/gosu/issues/detail?id=12

22 - Linux: getting "undefined symbol: Init_gosu" when trying to "require 'gosu'

Ruby bails with the following error when trying to execute the line
"require 'gosu'":

LoadError: /usr/lib/ruby/1.8/i486-linux/gosu.so: undefined symbol:
Init_gosu - /usr/lib/ruby/1.8/i486-linux/gosu.so
        from /usr/lib/ruby/1.8/i486-linux/gosu.so
        from (irb):1

This happens whether the line is run from a ruby file or stright through irb.

I am on Ubuntu 7.04, running Ruby 1.8.5.  I've tried this with 0.7.8,
0.7.8.5, and the latest from the read-only repository, all with the same
results.


Original link: http://code.google.com/p/gosu/issues/detail?id=22

33 - Support for a GUI system like CEGUI

Hi,
It'll be nice to have CEGUI integrated with ruby/gosu
I can provide some help with that if needed

Original link: http://code.google.com/p/gosu/issues/detail?id=33

31 - Audio should degrade gracefully when no sound device is available

ALSA lib pcm_dmix.c:874:(snd_pcm_dmix_open) unable to open slave
terminate called after throwing an instance of 'std::runtime_error'
  what():  No available audio device

This happens if e.g. firefox with youtube is running while one tries to
launch gosu
I think it would make more sense to simply disable all sound features
(simply do nothing) and write to console the error above but use try/catch
to go around it


Original link: http://code.google.com/p/gosu/issues/detail?id=31

29 - SDLmixer audio: Sample::playPan() not working and SampleInstance::changePan() not working correctly

What steps will reproduce the problem?

Gosu::Sample mySample(audio(), "Beep.wav");
mySample.playPan(-1.0); // does a normal sound (like play())
mySample.playPan(1.0); // same as above
mySample.play().changePan(-1.0); // left speaker only
mySample.play().changePan(1.0); // both speakers, not as loud as play() (as
documented)

What is the expected output? What do you see instead?

playPan() should actually do sth else than play()
changePan(1.0) should only play sound on the right box/headphone

What operating system are you using?

linux, stereo sound, right and left speakers working just fine with other
programs (only left and only right sound works in other programs)

Please provide any additional information below.

Original link: http://code.google.com/p/gosu/issues/detail?id=29

19 - Linux/Compiz: Gosu::Window has no title bar, leaves artefacts, behaves weirdly

Note to self or possible Linux contributors:

At least in my quick tests on Ubuntu, non-fullscreen Windows never had a
title bar. Even worse, they didn't clear themselves up when hitting Ctrl-C
from the command line. No idea what's up with that as I don't know the X11
API or the whole WM architecture. Did I mention the X man pages are the
worst I've ever seen? :)

Original link: http://code.google.com/p/gosu/issues/detail?id=19

25 - RubyGems 1.1.0 installs wrong Gem again

What steps will reproduce the problem?
1. sudo gem install gosu
2. copy and paste this code into textmate

require 'rubygems'
require 'gosu'
class MyWindow < Gosu::Window
end
1. Press Cmd + R to execute the script

What is the expected output?

The script should execute without error.

What do you see instead?

NameError: uninitialized constant Gosu
at top level    in gosu.rb at line 3

What operating system are you using?

OS X 10.5.2
ruby 1.8.6
gems 1.1.0 
gosu 0.7.7.1

Please provide any additional information below.

I can comment out line "require 'rubygems' " in the examples and they still will execute.  So that 
leads me to believe that it's not loading the gem correctly.

Original link: http://code.google.com/p/gosu/issues/detail?id=25

26 - make: *** [IO.o] Error 1

if [ ! -d RubyGosu ]; then mkdir RubyGosu; fi
if [ ! -d OpenGL ]; then mkdir OpenGL; fi
if [ ! -d Graphics ]; then mkdir Graphics; fi
if [ ! -d Sockets ]; then mkdir Sockets; fi
g++ ../GosuImpl/Math.cpp -o Math.o -I.. -I/usr/local/include/SDL
-D_GNU_SOURCE=1 -D_REENTRANT -Wall -I/usr/include/pango-1.0
-I/usr/include/freetype2 -I/usr/include/glib-2.0
-I/usr/lib/glib-2.0/include    -DHAVE_SYS_STAT_H
-I/usr/local/include/ruby-1.9.0
-I/usr/local/include/ruby-1.9.0/x86_64-linux -fPIC -DNDEBUG -O3 -pipe
-fomit-frame-pointer -c
g++ ../GosuImpl/Utility.cpp -o Utility.o -I.. -I/usr/local/include/SDL
-D_GNU_SOURCE=1 -D_REENTRANT -Wall -I/usr/include/pango-1.0
-I/usr/include/freetype2 -I/usr/include/glib-2.0
-I/usr/lib/glib-2.0/include    -DHAVE_SYS_STAT_H
-I/usr/local/include/ruby-1.9.0
-I/usr/local/include/ruby-1.9.0/x86_64-linux -fPIC -DNDEBUG -O3 -pipe
-fomit-frame-pointer -c
g++ ../GosuImpl/IO.cpp -o IO.o -I.. -I/usr/local/include/SDL
-D_GNU_SOURCE=1 -D_REENTRANT -Wall -I/usr/include/pango-1.0
-I/usr/include/freetype2 -I/usr/include/glib-2.0
-I/usr/lib/glib-2.0/include    -DHAVE_SYS_STAT_H
-I/usr/local/include/ruby-1.9.0
-I/usr/local/include/ruby-1.9.0/x86_64-linux -fPIC -DNDEBUG -O3 -pipe
-fomit-frame-pointer -c
In file included from ../GosuImpl/IO.cpp:1:
../Gosu/IO.hpp:7:29: error: boost/utility.hpp: Nie ma takiego pliku ani
katalogu
../Gosu/IO.hpp:8:32: error: boost/scoped_ptr.hpp: Nie ma takiego pliku ani
katalogu
In file included from ../GosuImpl/IO.cpp:1:
../Gosu/IO.hpp:138: error: ‘boost’ has not been declared
../Gosu/IO.hpp:138: error: expected `{' before ‘noncopyable’
../Gosu/IO.hpp:138: error: function definition does not declare parameters
../Gosu/IO.hpp:172: error: invalid use of incomplete type ‘class
Gosu::Resource’
../Gosu/IO.hpp:16: error: forward declaration of ‘class Gosu::Resource’
../Gosu/IO.hpp:233: error: invalid use of incomplete type ‘class
Gosu::Resource’
../Gosu/IO.hpp:16: error: forward declaration of ‘class Gosu::Resource’
../Gosu/IO.hpp:235: error: ‘boost’ has not been declared
../Gosu/IO.hpp:235: error: ISO C++ forbids declaration of ‘scoped_ptr’ with
no type
../Gosu/IO.hpp:235: error: expected ‘;’ before ‘<’ token
../GosuImpl/IO.cpp: In member function ‘void Gosu::Reader::read(void_,
size_t)’:
../GosuImpl/IO.cpp:7: error: invalid use of incomplete type ‘const class
Gosu::Resource’
../Gosu/IO.hpp:16: error: forward declaration of ‘const class Gosu::Resource’
../GosuImpl/IO.cpp: In member function ‘void Gosu::Writer::write(const
void_, size_t)’:
../GosuImpl/IO.cpp:14: error: invalid use of incomplete type ‘class
Gosu::Resource’
../Gosu/IO.hpp:16: error: forward declaration of ‘class Gosu::Resource’
../GosuImpl/IO.cpp:15: error: invalid use of incomplete type ‘class
Gosu::Resource’
../Gosu/IO.hpp:16: error: forward declaration of ‘class Gosu::Resource’
../GosuImpl/IO.cpp:17: error: invalid use of incomplete type ‘class
Gosu::Resource’
../Gosu/IO.hpp:16: error: forward declaration of ‘class Gosu::Resource’
make: **\* [IO.o] Error 1

---

I can't MAKE gosu. 

I have:

Debian AMD64
gosu-source-0.7.9.2
GNU Make 3.81
ruby 1.9.0 (2008-03-01 revision 15664) [x86_64-linux]

Original link: http://code.google.com/p/gosu/issues/detail?id=26

8 - add draw_oval and draw_arc

Feature request to add draw_oval and draw_arc to window.  These routines would be used for UI and 
simple game objects where actual images are not needed.


Original link: http://code.google.com/p/gosu/issues/detail?id=8

23 - Mouse wheel activity always results in MsWheelDown, never MsWheelUp

I'm using button_down in a Gosu::Window to detect mouse wheel activity. I
always get a Gosu::Button::MsWheelDown (160) result, and never a
Gosu::Button::MsWheelUp (159) whenever the mouse-wheel is rotated, either way.

Tested with a variety of mice using gem gosu-0.8.8.5.

Original link: http://code.google.com/p/gosu/issues/detail?id=23

48 - Dragging Windows

I don't know exactly what is going on, but I have included the code
using MacOS

sometimes it doesn't happen, sometimes it happens. I've tried to find it methodically but no luck, 
it will happen when the window is being dragged or not.
#### This is the Error I get in Textmate

/Users/cooperking/Developer/Ruby/gosu/Experiments/Play/Buttons Etc/Window.rb:53: [BUG] 
Bus Error
ruby 1.8.6 (2008-03-03) [universal-darwin9.0]
#### This is the code that causes the error, line 53 is @window.draw_line call in the

Window.draw class

require 'rubygems'
require 'gosu'

class Screen
  WIDTH = 1024
  HEIGHT = 800

  LAYERS = {:inactive_plane => 20, :active_plane => 25, :mouse => 100}

end

class Editor < Gosu::Window

  def initialize
    super(Screen::WIDTH, Screen::HEIGHT, false)
    @tools = Tools.new(self)
    @mouse = Mouse.new(self)
  end

  def update
    @tools.update
    @mouse.update
  end

  def draw
    @tools.draw
    @mouse.draw
  end  

end

class Window

  ACTIVE_COLOUR = Gosu::red
  INACTIVE_COLOUR = Gosu::blue
  HEADER = 15
  PADDING = 5

  attr_accessor :x, :y, :length, :width

  def initialize(title, length = 300, width = 100, x = 100, y = 100)
    @x, @y = x, y
    @length, @width = length, width
    @font = Gosu::Font.new(@window, 'Arial', 12)
    @title = title
    @mouse_lock = false
    @locked_at = []
  end

  def draw
    @font.draw(@title, self.x + PADDING, self.y + 1, @layer + 1, 1, 1, 0xffffffff)
    @window.draw_line(self.x + PADDING, self.y + HEADER, Gosu::white, self.x + self.width - 
PADDING, self.y + HEADER, Gosu::white, @layer + 1)
    @window.draw_quad(@x, @y, @colour, @x + @width, @y, @colour, @x, @y + @length, 
@colour, @x + @width, @y + @length, @colour, @layer)
  end

  def update
    is_active? ? (@colour, @layer = ACTIVE_COLOUR, Screen::LAYERS[:active_plane]) : (@colour, 
@layer = INACTIVE_COLOUR, Screen::LAYERS[:inactive_plane])
    drag
  end

  def drag
    if @window.button_down? Gosu::Button::MsLeft
      if is_active_header? || @mouse_lock
        @locked_at = [@window.mouse_x - self.x, @window.mouse_y - self.y] if @locked_at.empty?
        self.x = @window.mouse_x - @locked_at[0]
        self.y = @window.mouse_y - @locked_at[1]
        check_coords
        @mouse_lock = true
      end
    else
      @mouse_lock = false
      @locked_at = []
    end
  end

  private
  def is_active?
    if (((@window.mouse_x > self.x) && (@window.mouse_x < self.x + self.width)) && 
((@window.mouse_y > self.y) && (@window.mouse_y < self.y + self.length))) || @mouse_lock
      true
    else
      false
    end
  end

  def is_active_header?
    if (((@window.mouse_x > self.x) && (@window.mouse_x < self.x + self.width)) && 
((@window.mouse_y > self.y) && (@window.mouse_y < self.y + HEADER))) || @mouse_lock
      true
    else
      false
    end
  end

  def check_coords
    if self.x + self.width > Screen::WIDTH
      self.x = Screen::WIDTH - self.width
    elsif self.x < 0
      self.x = 0
    end

```
if self.y + self.length > Screen::HEIGHT
  self.y = Screen::HEIGHT - self.length
elsif self.y < 0
  self.y = 0
end
```

  end

end

class Tools < Window

  def initialize(window)
    @window = window
    super('TOOLS')
  end

end

class Mouse

  def initialize(window)
    @window = window
  end

  def update
  end

  def draw
    @window.draw_line(@window.mouse_x, @window.mouse_y, Gosu::white, @window.mouse_x + 
5, @window.mouse_y + 5, Gosu::white, Screen::LAYERS[:mouse])
  end

end

Editor.new.show


Original link: http://code.google.com/p/gosu/issues/detail?id=48

24 - Z-fighting problem

On Mac OS X Leopard 10.5.1, I am running gosu 0.7.8.5.

I am drawing a simple cube using a gl block, and have a z-fighting problem.  I have played with 
adjusting the glDepthFunc, clearing the z-buffer with different values, pushed the near clipping 
plane out from 0.0 and brought the far clipping plane in close to the near clipping plane, and I 
just can't seem to get it to go away.

I see the back of the cube over the front of the cube.

Could it be the gosu environment causing me problems?

Here is some simplified code illustrating the problem and the attached file is a screenshot:

require 'rubygems'
require 'gosu'
require 'gl'
require 'glu'

include Gl
include Glu

class GameWindow < Gosu::Window
  def initialize
    super(800, 600, false)
    self.caption = "oglt3"
  end

  def draw
    gl do
            glClearColor(0.0, 0.2, 0.5, 1.0)
            glClearDepth(0)
            glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
            glDepthFunc(GL_GEQUAL)
            glEnable(GL_DEPTH_TEST)

```
        glMatrixMode(GL_PROJECTION)
        glLoadIdentity
        gluPerspective(45.0, 1.2, 1.0, 15.0)
        glTranslate(0.0, 0.0, -10.0)

        glBegin(GL_TRIANGLES)
            glColor3f(1.0, 0.0, 0.0)
            glVertex3f(2.5, -2.5, -2.5)
            glColor3f(0.0, 1.0, 0.0)
            glVertex3f(2.5, -2.5, 2.5)
            glColor3f(0.0, 0.0, 1.0)
            glVertex3f(-2.5, -2.5, 2.5)

            glColor3f(1.0, 0.0, 0.0)
            glVertex3f(-2.5, -2.5, 2.5)
            glColor3f(0.0, 1.0, 0.0)
            glVertex3f(-2.5, -2.5, -2.5)
            glColor3f(0.0, 0.0, 1.0)
            glVertex3f(2.5, -2.5, -2.5)

            glColor3f(1.0, 0.0, 0.0)
            glVertex3f(-2.5, -2.5, -2.5)
            glColor3f(0.0, 1.0, 0.0)
            glVertex3f(-2.5, -2.5, 2.5)
            glColor3f(0.0, 0.0, 1.0)
            glVertex3f(-2.5, 2.5, 2.5)

            glColor3f(1.0, 0.0, 0.0)
            glVertex3f(-2.5, 2.5, 2.5)
            glColor3f(0.0, 1.0, 0.0)
            glVertex3f(-2.5, 2.5, -2.5)
            glColor3f(0.0, 0.0, 1.0)
            glVertex3f(-2.5, -2.5, -2.5)

            glColor3f(1.0, 0.0, 0.0)
            glVertex3f(-2.5, 2.5, -2.5)
            glColor3f(0.0, 1.0, 0.0)
            glVertex3f(-2.5, 2.5, 2.5)
            glColor3f(0.0, 0.0, 1.0)
            glVertex3f(2.5, 2.5, 2.5)

            glColor3f(1.0, 0.0, 0.0)
            glVertex3f(2.5, 2.5, 2.5)
            glColor3f(0.0, 1.0, 0.0)
            glVertex3f(2.5, 2.5, -2.5)
            glColor3f(0.0, 0.0, 1.0)
            glVertex3f(-2.5, 2.5, -2.5)

            glColor3f(1.0, 0.0, 0.0)
            glVertex3f(2.5, 2.5, -2.5)
            glColor3f(0.0, 1.0, 0.0)
            glVertex3f(2.5, 2.5, 2.5)
            glColor3f(0.0, 0.0, 1.0)
            glVertex3f(2.5, -2.5, 2.5)

            glColor3f(1.0, 0.0, 0.0)
            glVertex3f(2.5, -2.5, 2.5)
            glColor3f(0.0, 1.0, 0.0)
            glVertex3f(2.5, -2.5, -2.5)
            glColor3f(0.0, 0.0, 1.0)
            glVertex3f(2.5, 2.5, -2.5)

            glColor3f(1.0, 0.0, 0.0)
            glVertex3f(-2.5, -2.5, 2.5)
            glColor3f(0.0, 1.0, 0.0)
            glVertex3f(2.5, -2.5, 2.5)
            glColor3f(0.0, 0.0, 1.0)
            glVertex3f(2.5, 2.5, 2.5)

            glColor3f(1.0, 0.0, 0.0)
            glVertex3f(2.5, 2.5, 2.5)
            glColor3f(0.0, 1.0, 0.0)
            glVertex3f(-2.5, 2.5, 2.5)
            glColor3f(0.0, 0.0, 1.0)
            glVertex3f(-2.5, -2.5, 2.5)

            glColor3f(1.0, 0.0, 0.0)
            glVertex3f(2.5, -2.5, -2.5)
            glColor3f(0.0, 1.0, 0.0)
            glVertex3f(-2.5, -2.5, -2.5)
            glColor3f(0.0, 0.0, 1.0)
            glVertex3f(-2.5, 2.5, -2.5)

            glColor3f(1.0, 0.0, 0.0)
            glVertex3f(-2.5, 2.5, -2.5)
            glColor3f(0.0, 1.0, 0.0)
            glVertex3f(2.5, 2.5, -2.5)
            glColor3f(0.0, 0.0, 1.0)
            glVertex3f(2.5, -2.5, -2.5)
        glEnd
    end
```

  end

  def button_down(id)
    if Gosu::Button::KbEscape == id
      close
    end
  end
end

window = GameWindow.new
window.show


Original link: http://code.google.com/p/gosu/issues/detail?id=24

9 - Keyboard mapping using button_id_to_char(id) produces the wrong characters on mac os x for non alpha-numerics

What steps will reproduce the problem?
1. Write this short test program: 

require 'gosu'
class Test < Gosu::Window

  def initialize 
    super(300, 200, false, 20)
  end

  def button_down(id)  
    puts self.button_id_to_char(id)
  end

end

test = Test.new

test.show  
1. Run the program with on Mac OS X with american keyboard layout
2. Press ';'

What is the expected output? ';'
What do you see instead? 'Š'

What version of the product are you using? Gosu 0.7.5

On what operating system? Mac OSX 10.4.10 (Intel)

Please provide any additional information below.

It would be nice to have a function to get the actual character for the keyboard layout given all 
buttons currently pressed (shift, alt etc) taken into account.


Original link: http://code.google.com/p/gosu/issues/detail?id=9

14 - Gosu 0.7.6 on Windows has non-optional update_interval

In the code for the tutorial as well as tutorial.rb and CptnRuby.rb is
incorrect. the call to the super class reads:

class GameWindow < Gosu::Window
  def initialize
    super(640, 480, false)   #<-- This Line Here
    ...

it should read (or something similar to):

class GameWindow < Gosu::Window
  def initialize
    super(640, 480, false, 20)

Not sure if this is supposed to be an optional parameter or not but it
caused me a bit of grief before I found the answer. Just thought Id report
it as a bug in case the forth parameter should be optional. Listed my
platform info below if you need it:

Ruby 1.8.6
Gosu 0.7.6
Windows XP


Original link: http://code.google.com/p/gosu/issues/detail?id=14

27 - Linux: Exceptions result in SIGSEGV

See summary, also it is actually unlikely that this is all there is to it. I expect that it's actually an 
error somewhere during stack unwinding.

(Thanks morgajel for reporting this in #gosu)

Original link: http://code.google.com/p/gosu/issues/detail?id=27

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.