gosu / ashton

Special graphical effects and other extensions for the Ruby/Gosu game library (⚠️ unmaintained)
MIT License
44 stars 10 forks source link

OpenGL not supported #29

Open joseairosa opened 10 years ago

joseairosa commented 10 years ago

Hello,

Trying to build a shader and started getting this error:

ashton/lib/ashton/mixins/version_checking.rb:9:in `check_opengl_version': OpenGL 2.0 required to utilise Ashton::Shader (Ashton::NotSupportedError)
    from /Users/jairosa/projects/joseairosa/ashton/lib/ashton/shader.rb:40:in `initialize'

I'm, running on a mac machine and got OpenGL installed.

Any ideas?

bil-bas commented 10 years ago

That's odd; I'll look into it. GL2.0 is quite old, so there shouldn't be any issues unless you are running in a VM or netbook level of machine.

joseairosa commented 10 years ago

I'm prying into that line of code.

[1] pry(#<Ashton::Shader>)> GL.version_supported? 1.0
=> false
[2] pry(#<Ashton::Shader>)> GL.version_supported? 2.0
=> false
[3] pry(#<Ashton::Shader>)> GL.version_supported? 2.2
=> false
[4] pry(#<Ashton::Shader>)> GL.version_supported? 2.3
=> false
[5] pry(#<Ashton::Shader>)> GL.version_supported? 3.3
=> false
[6] pry(#<Ashton::Shader>)> GL.version_supported? 3.2
=> false
[7] pry(#<Ashton::Shader>)> GL.version_supported? 4.1
=> false
[8] pry(#<Ashton::Shader>)> GL.version_supported? 4.0
=> false

Nothing appears to work :(

bil-bas commented 10 years ago

Mmmm :confused:

p.s. I've just updated the gem to 0.1.1 bringing it up to date with master.

bil-bas commented 10 years ago

Try faking out the check code (ashton/mixins/version_checking.rb) and see if GL is there and supports shaders? May just be that it is lying to you.

joseairosa commented 10 years ago

Ah great! :)

Do you have any ideas of other things I can try? - How can I find the version of OpenGL that I'm running?

joseairosa commented 10 years ago

I tried it but it complains about ashton/lib/ashton/shader.rb:302:inglCreateShader': OpenGL version 2.0 is not available on this system (NotImplementedError)`.

I guess it's not picking it up for some reason. I'm running on mavericks.

bil-bas commented 10 years ago

No, I mean to fake it with:

module Ashton
  module Mixins
    module VersionChecking
      # Check if a specific OpenGL version is supported on this machine.
      #
      # @raise NotSupportedError
      def check_opengl_version(version)
        nil
      end

      # Check if a specific OpenGL extension is supported on this machine.
      #
      # @raise NotSupportedError
      def check_opengl_extension(extension)
        nil
      end
    end
  end
end
bil-bas commented 10 years ago

Oh, I see, sorry. Right, you've done that. Odd. I'll try building on my mac and publishing a binary gem - best chance you have unless someone else has any wisdom ;)

joseairosa commented 10 years ago

I'm trying a couple of things as well. Ugh!

Thanks for the help.

joseairosa commented 10 years ago

Hey @Spooner, did you manage to find anything?

I've tried to run a couple other libraries and this one appears to work.

Do you think it could have to do with the fact that my computer has OpenGL ES?

bil-bas commented 10 years ago

Sorry, I didn't get sorted on my Mac. Busy with other things (work).

What sort of machine do you have that runs gl es? Should only get that on mobiles and tablets... But yes, it would make a difference. On 14 Feb 2014 11:44, "José P. Airosa" notifications@github.com wrote:

Hey @Spooner https://github.com/Spooner, did you manage to find anything?

I've tried to run a couple other libraries and this onehttps://github.com/vaiorabbit/ruby-openglappears to work.

Do you think it could have to do with the fact that my computer has OpenGL ES?

Reply to this email directly or view it on GitHubhttps://github.com/Spooner/ashton/issues/29#issuecomment-35076791 .

bil-bas commented 10 years ago

The library you link uses ffi, not a native module, so that is a bit different. It also intentionally supports open gl es, which I don't.

joseairosa commented 10 years ago

I'm trying to look into the source code of the version check to understand if there's something I'm missing. At this point I'm clueless.

Do you know where I can see what version of OpenGL I'm running?

Thanks.

bil-bas commented 10 years ago

No idea, sorry.

joseairosa commented 10 years ago

After a long long long down-the-rabbit-hole I think I found the issue, https://github.com/larskanis/opengl/pull/12.

joseairosa commented 10 years ago

@Spooner I managed to get everything working, but something strange is happening.

Take a look at the image.

screenshot 2014-02-14 21 35 31

Can you see those artefacts around the letters?

bil-bas commented 10 years ago

Very strange. Any problems with the other demos?

joseairosa commented 10 years ago

@Spooner they are all generally quite dark, but I think this is the only with this problem.

bil-bas commented 10 years ago

Well, I know I've seen issues with the shaders with Gosu font rendering before. Unless you need shaders with fonts, I wouldn't worry too much - the problem might well be as much with my ad hoc outline shader implementation, rather than the opengl used.

joseairosa commented 10 years ago

I just need font with outline. Basically white font with black outline.

Thanks for the help @Spooner