Not logged inGosu Forums
Forum back to libgosu.org Help Search Register Login
Up Forum
Search
Topic Raspberry Ruby - Could not initialize OpenGL By PeterWAWood Date 2015-08-10 06:23
Being an optimist, I hope that in the not so distant future Raspian will include a decent SDL 2 implementation. In the meantime, I will enjoy learning about Gosu on my Mac.

Thanks for taking a look into the issue.
Topic Raspberry Ruby - Could not initialize OpenGL By PeterWAWood Date 2015-07-07 02:25
Thanks for the reply. I'm afraid I don't know any C++ and only a little C. I found from the compiler that SDL_CreateContext returns a pseudonym for void. I printed this value as an integer, it contained 1. (I'm not sure if this is what you needed or any use).

Please let me know what I can do to help (given my limitations).

This is the line of code that I inserted:

   printf("SDL_GL_CreateContext returns %d\n", int(SDL_GL_CreateContext(window)));

I put that immediately after:

   SDL_Window* window = SDL_CreateWindow("Test SDL 2", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
                                        800, 600, SDL_WINDOW_SHOWN | SDL_WINDOW_OPENGL);
   check_error_sdl(window == nullptr, "Unable to create window");


This is the output:

  ~/SDL2test $ ./sdl2_test
SDL_GL_CreateContext returns 1
~/SDL2test $
Topic Raspberry Ruby - Could not initialize OpenGL By PeterWAWood Date 2015-07-05 07:18
It took me a little longer than I had hoped. I wasn't able to get any of the SDL2 test programs working but that was probably because I was making mistakes.

However, by following these instructions - https://solarianprogrammer.com/2015/01/22/raspberry-pi-raspbian-getting-started-sdl-2/ - I was able to compile and run the simple test program at the end of the blog.

I installed gosu 0.9.2 again using the command from the Gosu wiki but still got the "Could not initialize OpenGL / GLES library message" when I ran the tutorial.

(By the way, it seems that the examples don't get installed with 0.9.2)
Topic Raspberry Ruby - Could not initialize OpenGL By PeterWAWood Date 2015-06-23 02:34
I'll try to do that over the next few days. If I'm able I'll let you know how I got on.
Topic Raspberry Ruby - Could not initialize OpenGL By PeterWAWood Date 2015-06-22 13:52
I tried with Gosu 0.8.7.2 and got a similar error when I tried to run the tutorial program:


pi@raspibplus /usr/local/lib/ruby/gems/2.2.0/gems/gosu-0.8.7.2/examples $ gem list gosu

*** LOCAL GEMS ***

gosu (0.8.7.2)
pi@raspibplus /usr/local/lib/ruby/gems/2.2.0/gems/gosu-0.8.7.2/examples $ ruby Tutorial.rb
Tutorial.rb:84:in initialize': Could not open window: Could not initialize OpenGL / GLES library (RuntimeError)
  from Tutorial.rb:84:in
initialize'
  from Tutorial.rb:130:in new'
  from Tutorial.rb:130:in
<main>'
Topic Raspberry Ruby - Could not initialize OpenGL By PeterWAWood Date 2015-06-22 07:14
I followed the very thorough instructions on https://github.com/gosu/gosu/wiki/Getting-Started-on-Raspbian-(Raspberry-Pi). I'm pretty sure that I got everything correct as I copied all the commands from the wiki page into the command line.

When I run a very simple test program, I get this error:


pi@raspibplus ~/Code/Ruby/Gosu $ ruby test.rb
/usr/local/lib/ruby/gems/2.2.0/gems/gosu-0.9.2/lib/gosu/swig_patches.rb:19:in initialize': Could not create window: Could not initialize OpenGL / GLES library (RuntimeError)
  from /usr/local/lib/ruby/gems/2.2.0/gems/gosu-0.9.2/lib/gosu/swig_patches.rb:19:in
initialize'
  from test.rb:4:in initialize'
  from test.rb:15:in
new'
  from test.rb:15:in `<main>'
terminate called after throwing an instance of 'std::runtime_error'
  what():  Could not create window: Could not initialize OpenGL / GLES library
Aborted


Any suggestions as to what I may have done incorrectly?

Thanks in advance

Peter

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill