Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenGL not supported #29

Open
joseairosa opened this issue Feb 13, 2014 · 20 comments
Open

OpenGL not supported #29

joseairosa opened this issue Feb 13, 2014 · 20 comments
Assignees
Labels

Comments

@joseairosa
Copy link

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?

@ghost ghost assigned bil-bas Feb 13, 2014
@bil-bas
Copy link
Collaborator

bil-bas commented Feb 13, 2014

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
Copy link
Author

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
Copy link
Collaborator

bil-bas commented Feb 13, 2014

Mmmm 😕

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

@bil-bas
Copy link
Collaborator

bil-bas commented Feb 13, 2014

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
Copy link
Author

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?

@bil-bas bil-bas added the bug label Feb 13, 2014
@joseairosa
Copy link
Author

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
Copy link
Collaborator

bil-bas commented Feb 13, 2014

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
Copy link
Collaborator

bil-bas commented Feb 13, 2014

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
Copy link
Author

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

Thanks for the help.

@joseairosa
Copy link
Author

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
Copy link
Collaborator

bil-bas commented Feb 14, 2014

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" [email protected] 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//issues/29#issuecomment-35076791
.

@bil-bas
Copy link
Collaborator

bil-bas commented Feb 14, 2014

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
Copy link
Author

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
Copy link
Collaborator

bil-bas commented Feb 14, 2014

No idea, sorry.

@joseairosa
Copy link
Author

After a long long long down-the-rabbit-hole I think I found the issue, larskanis/opengl#12.

@joseairosa
Copy link
Author

@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
Copy link
Collaborator

bil-bas commented Feb 15, 2014

Very strange. Any problems with the other demos?

@joseairosa
Copy link
Author

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

@bil-bas
Copy link
Collaborator

bil-bas commented Feb 17, 2014

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
Copy link
Author

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

Thanks for the help @spooner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants