Not logged inGosu Forums
Forum back to libgosu.org Help Search Register Login
Up Topic Gosu / Gosu News / Gosu 0.11.1 released
- - By jlnr (dev) Date 2017-01-18 02:52
A hotfix release for some regressions in Gosu 0.11.0:

• Window: Fix UTF-8 Text rendering (#373)
• All: Fix loading of 4-bit PNG files (#375)
• All: Fix window placement when starting in fullscreen mode and then switching to windowed (#369)
• All: Add default shortcuts to toggle between fullscreen and windowed mode (alt+enter/cmd+F) (#361)
• Linux: Fix compilation of Color.cpp (#371)

Links to GitHub issues and precompiled libraries for MSVC: https://github.com/gosu/gosu/releases/tag/v0.11.1
Reply
Parent - - By bestguigui Date 2017-01-22 18:18
Hi Jlnr !

The shortcut doesn't work on my side (using Windows Seven 64 bits). A strange (and kinda scary, I must say...) thing I discovered trying to test this new feature : when running on fullscreen mode, I only have my textures displayed one frame, and then OpenGL will not display them anymore. The quads are then mapped in black. Never saw that before because I was always running my scripts in window mode.
Reply
Parent - - By jlnr (dev) Date 2017-01-23 10:29
Ouch. It worked fine for me in a VM (also Windows 7, 64-bit). I think what's happening is that the OpenGL context gets destroyed when changing between fullscreen and windowed modes:

http://www.bytehazard.com/articles/sdlres.html

In Gosu 0.11.1, every window is created as windowed first, and then goes into fullscreen mode. (This is a workaround for a window placement bug.) That's why windows that start in fullscreen mode are also broken.

Not sure if I can fix this in the next days, but I'll try to reserve a day on the weekend.
Parent - - By bestguigui Date 2017-01-23 19:07
There is no rush, I can go on using windowed mode for now.

But I cannot see why the shortcut doesn't work ?
Reply
Parent - - By jlnr (dev) Date 2017-01-28 05:56
As for the shortcut: Your game needs to call super when overriding Window#button_down(id). The base implementation of button_down(id) is where the magic happens: https://github.com/gosu/gosu/blob/master/src/Window.cpp#L279-L303

Do you load your textures with custom OpenGL? Do pure Gosu games also have problems with textures on your machine? For example: Does gem install gosu-examples and then gosu-examples or gosu-examples --fullscreen work?

The way I'm using fullscreen mode with SDL 2 should not affect OpenGL textures, so I still have hope that I can avoid refactoring my OpenGL context management.
Parent - - By bestguigui Date 2017-01-29 13:53 Edited 2017-01-29 14:12
So :

adding "super" to my custom overloading of the Gosu#button_down(id) method works like a charm ! Now, it's possible to go from windowed to fullscreen mode using alt + enter without any problem.

Testing the gosu-examples works great. In fullscreen or windowed mode, the textures will display correctly.

All that leaves is that I did a mistake somewhere in my own code. Because if I use the shortcut, I'll go to fullscreen mode but without displayed textures. And then, if I go to windowed mode again, same thing : its displays without textures.

For the current project, I'm not using custom texture class, only Gosu::Image. So I just don't get it.

Example of project that doesn't work properly :

http://paste.awesom.eu/Hb5m&ln
http://bestguigui.free.fr/gosu/cube.rar

At first, no problem, it displays the texture. But then, it will just dissappear.
Reply
Parent - - By RunnerPack Date 2017-01-29 16:20
I tried to test your code, but there's something wrong with the opengl gem on my (Windows 7 64-bit) PC. When I try to require it, it attempts to load a different library based on the version of Ruby, as follows:
begin
  RUBY_VERSION =~ /(\d+.\d+)/
  require "opengl/#{$1}/opengl"
rescue LoadError
  require 'opengl/opengl'
end


At first, I thought it was failing because I'm running 2.3.3 (from rubyinstaller.org), and there's no 2.3 folder inside the gem. I copied the 2.2 folder and renamed it to 2.3, and it still didn't work. I tested the regex in opengl.rb, and it's working fine. I disabled the rescue clause, and the backtrace says Ruby's looking for: "C:/Ruby/lib/ruby/gems/2.3.0/gems/opengl-0.9.2-x86-mingw32/lib/opengl/2.3/opengl.so" and that's exactly where the file is. This is the only gem that fails like this. Is it a problem with my setup, or a problem with the gem?
Reply
Parent - - By bestguigui Date 2017-01-29 20:58
I would love to help you out. But since I only have issues with gems when using Ruby 2. something, I'm still on 1.9 that works in every situation.
Reply
Parent - - By jlnr (dev) Date 2017-01-30 02:16
=( I wasn't even aware that Ruby on Windows was so broken until I tried to run gosu-examples with Ruby 2.3 last week. I couldn't get OpenGL to install, and Chipmunk was extremely crashy. I wonder if it'll get worse now that Rails developers can use the Ubuntu subsystem on Windows 10 instead of Ruby-Installer.
Parent - - By RunnerPack Date 2017-02-01 03:03
At least they still have a 1.9.3 installer (although you have to go into the "archive" to get it). I installed it, the devkit, and the "standard" Gosu-related gems, and the crate demo (with the patch to fix the black screen issue) is working fine.

Ashton is having problems, but that's getting too far off-topic...
Reply
Parent - - By jlnr (dev) Date 2017-02-01 06:25
Ashton now lives in the Gosu organisation on GitHub, so it's something I can and will fix at some point (possibly by moving functionality into Gosu proper).

ocra is another gem that seems to be mostly dormant, and which Gosu relies on...

But it's good news that Ruby 1.9.3 is still around, and I'll take extra care not to break compatibility with Ruby 1.9.x. (It seems safe to kick out Ruby 1.8 support, though.)
Parent - By RunnerPack Date 2017-02-02 01:45
+1 for fixing/integrating Ashton (or fragment shaders in some form).
Reply
Parent - - By jlnr (dev) Date 2017-01-30 02:22
Well, the good news is, the texture is definitely not being purged. You can check by calling @texture.save("test.png"), which will use OpenGL internally to download the texture data before saving it to a file.

And I just managed to find the bug. When you use fullscreen mode, Gosu uses black bars to preserve the window's aspect ratio. Since you do not reset it, all vertices will appear black as well. It works if you add glColor4f(1, 1, 1, 1) in CubeModel#draw.

Yay, no Gosu bug :) - which is great because I won't have time for a release in February.
Parent - - By bestguigui Date 2017-01-30 07:50
Hey, thank you so much !

I kinda never set the glColor value when I want it to be white, because I assume that in a clean brand new environment, it is by default set to white. But the correction of aspect ratio makes it black, that makes sense.
So now I'll set it to white every time, thanks again for you time !
Reply
Parent - By jlnr (dev) Date 2017-01-30 12:30
np!

> because I assume that in a clean brand new environment, it is by default set to white


I was thinking about that too after posting my reply. gl blocks are supposed to give you a clean environment, so I think that was a bug (or at least unintuitive). Gosu 0.11.2+ will automatically reset the colour before running a gl block; not sure when that version will be out, though.
Parent - - By bestguigui Date 2017-02-10 17:51
Hi jlnr,

did you remove the Gosu::Window#mouse_x= and Gosu::Window#mouse_y= methods ?

They don't work anymore ("undefined method...") and I cannot find them defined inside the Rdoc anymore.
Reply
Parent - - By jlnr (dev) Date 2017-02-11 13:43
Ouch! They might have disappeared when I renamed the C++ equivalents. I'll investigate in the next weeks, life is busy right now :)
Parent - - By bestguigui Date 2017-02-11 18:41
I was pretty sure that was something related, no problem. I just downgraded to previous version until then.
Reply
Parent - - By shawn42 Date 2017-02-14 03:34
I think you can use set_mouse_x and set_mouse_y in the meantime. I'd recommend adding a couple of aliases that can easily be pulled out once jlnr adds them back in.
Reply
Parent - - By bestguigui Date 2017-02-15 09:00
Thanks for the trick ! I though the set_mouse methods were deprecated. It works great !
Reply
Parent - - By shawn42 Date 2017-02-16 14:18
Oh, I think they are supposed to be deprecated, but at least you can keep working. Also, this might be a fairly straight forward bug to try to fix in Gosu yourself and submit a pull request. Since Mr jlnr is getting married soon.  ;)
Reply
Parent - - By bestguigui Date 2017-02-17 11:47
Good news and congrats, M. JLNR !

I'm far from being able to do that myself, so your own trick will do it for now ;)
Reply
Parent - - By jlnr (dev) Date 2017-02-26 10:55
Thanks :) I've just release version 0.11.2 to fix the issue.
Parent - By bestguigui Date 2017-03-01 09:56
Thank you, but really, there was no rush ;)
Reply
Up Topic Gosu / Gosu News / Gosu 0.11.1 released

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill