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

creating window failed: VersionUnavailable: WGL: OpenGL profile requested but WGL_ARB_create_context_profile is unavailable #26

Open
silbinarywolf opened this issue May 26, 2017 · 15 comments

Comments

@silbinarywolf
Copy link

silbinarywolf commented May 26, 2017

Hello,

My understanding of this error from a quick Google is that it means my graphics card and/or its drivers are outdated. (ie. not supporting above OpenGL 3.1)

Was keen to use this but if it wont run at all on slightly older machines makes it a non-starter.

Also worth noting that the Engo engine runs fine on this machine, looking at the imports... seems it's using "github.com/go-gl/glfw/v3.1/glfw".

Any plans to support older versions of OpenGL or similar?

System:

  • Windows 10
  • Intel Graphics HD 3000

Error from running platformer example:

panic: creating window failed: VersionUnavailable: WGL: OpenGL profile requested but WGL_ARB_create_context_profile is unavailable

goroutine 5 [running]:
main.run()
        C:/GoProjects/src/github.com/faiface/pixel/examples/platformer/main.go:283 +0x12a0
github.com/faiface/mainthread.Run.func1(0x593040, 0xc04201a240)
        C:/GoProjects/src/github.com/faiface/mainthread/mainthread.go:39 +0x2e
created by github.com/faiface/mainthread.Run
        C:/GoProjects/src/github.com/faiface/mainthread/mainthread.go:41 +0xec
@faiface
Copy link
Owner

faiface commented May 26, 2017

Hi!

So I've experimented a bit and tried using OpenGL 3.1 in glhf, which Pixel uses for OpenGL. The trouble is, that go-gl only supports gles2 in version 3.1, which lacks several important OpenGL functions which I use (such as glGetBufferSubData or glGetTexImage).

So, I'm sorry, but right now, I won't be able to use a lower version of OpenGL.

However, your graphics card is perfectly capable of doing OpenGL 3.3, it's just that Intel was lazy enough not to make proper drivers. But in Linux, everything should work from what I googled.

I'd also like to note, that except for Intel HD 2000 and Intel HD 3000 on Windows, pretty much all GPUs manufactured <10 years ago support OpenGL 3.3, so I don't think it's a very big deal or a non-starter.

And one more note, Engo actually uses OpenGL 2.1, which is even older and worse.

@silbinarywolf
Copy link
Author

I guess ultimately my concern would be for users running old hardware not being able to play my game.

In what ways is OpenGL 2.1 older/worse? ie. what features / potential performance gains are lost?

@faiface
Copy link
Owner

faiface commented May 27, 2017

Ok, so I was experimenting again and figured out, that even though OpenGL 2.1 lack several important features itself (such as vertex arrays), it supports numerous standard extensions that make it forward-compatible.

I've added the branch gl2.1 to Pixel and GLHF. Would you please switch to both of them (Pixel uses GLHF) and test whether it works on Intel HD 3000? In case it does, I'll consider including these changes.

@silbinarywolf
Copy link
Author

Laptop is physically elsewhere at the moment, but should be able to get back to you in 2 or 3 days.
Thanks!

@silbinarywolf
Copy link
Author

@faiface FYI, looks like you haven't pushed up the gl2.1 branch code yet.

@faiface
Copy link
Owner

faiface commented May 27, 2017

Correct, pushed now. Thanks.

@silbinarywolf
Copy link
Author

silbinarywolf commented May 29, 2017

image
image
image

Working without issues now!
If there's any specific examples/ behaviour you want me to test, let me know.

@faiface
Copy link
Owner

faiface commented May 29, 2017

Ok, cool. I would like you to also try switching the glhf branch to master, but leaving Pixel at gl2.1. This will cause OpenGL imports to be 3.3 and thus not allowing to use non-modern OpenGL. Will you test this please?

@silbinarywolf
Copy link
Author

Fails to run.

Platformer Example:

$ ./platformer.exe
panic: glGetBufferParameteri64v

goroutine 1 [running, locked to thread]:
github.com/faiface/glhf.Init()
        C:/GoProjects/src/github.com/faiface/glhf/orphan.go:14 +0x79
github.com/faiface/pixel/pixelgl.(*Window).begin(0xc042092a80)
        C:/GoProjects/src/github.com/faiface/pixel/pixelgl/window.go:340 +0x50
github.com/faiface/pixel/pixelgl.NewWindow.func1(0xc042039e60, 0x439c85)
        C:/GoProjects/src/github.com/faiface/pixel/pixelgl/window.go:116 +0x1f3
github.com/faiface/mainthread.CallErr.func1()
        C:/GoProjects/src/github.com/faiface/mainthread/mainthread.go:74 +0x2d
github.com/faiface/mainthread.Run(0x593038)
        C:/GoProjects/src/github.com/faiface/mainthread/mainthread.go:46 +0x166
github.com/faiface/pixel/pixelgl.Run(0x593038)
        C:/GoProjects/src/github.com/faiface/pixel/pixelgl/run.go:32 +0x65
main.main()
        C:/GoProjects/src/github.com/faiface/pixel/examples/platformer/main.go:393 +0x34

Batch Example:

$ ./05_drawing_efficiently_with_batch.exe
panic: glGetBufferParameteri64v

goroutine 1 [running, locked to thread]:
github.com/faiface/glhf.Init()
        C:/GoProjects/src/github.com/faiface/glhf/orphan.go:14 +0x79
github.com/faiface/pixel/pixelgl.(*Window).begin(0xc04208e000)
        C:/GoProjects/src/github.com/faiface/pixel/pixelgl/window.go:340 +0x50
github.com/faiface/pixel/pixelgl.NewWindow.func1(0xc042039e60, 0x439c85)
        C:/GoProjects/src/github.com/faiface/pixel/pixelgl/window.go:116 +0x1f3
github.com/faiface/mainthread.CallErr.func1()
        C:/GoProjects/src/github.com/faiface/mainthread/mainthread.go:74 +0x2d
github.com/faiface/mainthread.Run(0x5851b8)
        C:/GoProjects/src/github.com/faiface/mainthread/mainthread.go:46 +0x166
github.com/faiface/pixel/pixelgl.Run(0x5851b8)
        C:/GoProjects/src/github.com/faiface/pixel/pixelgl/run.go:32 +0x65
main.main()
        C:/GoProjects/src/github.com/faiface/pixel/examples/guide/05_drawing_efficiently_with_batch/main.go:109 +0x34

@silbinarywolf
Copy link
Author

@faiface Pinging you on this one so it's not forgotten :)

@faiface
Copy link
Owner

faiface commented Jun 3, 2017

@silbinarywolf Since the OpenGL 2.1 support proven to be non-problematic, I will merge it to the master when I have time. I've been quite busy recently, I expect to do it in 2 or 3 days. But thanks for reminding anyway :)

@silbinarywolf
Copy link
Author

Yeah no worries. Thanks for your work on this, love the simplicity of this library :)

@faiface
Copy link
Owner

faiface commented Jun 9, 2017

Ok, I just switched Pixel and GLHF to OpenGL 2.1. Sorry for the delay, I was really busy. Does it work for you?

@faiface
Copy link
Owner

faiface commented Jun 10, 2017

But now it introduced an issue here #37, which seems to be related to this. I might need to revert this change, since it seems to be causing severe problems on OS X. I guess there are more OS X users than users of 10 years old GPUs.

@faiface
Copy link
Owner

faiface commented Jun 10, 2017

Unfortunately, I had to switch back to OpenGL 3.3, because this doesn't seem to be able to work on OS X (sort of mixing new and old OpenGL). If I figure this out later, I'll let you know.

mewmew added a commit to mewpull/pixel that referenced this issue Mar 24, 2018
This change mirrors the change done in the master branch
(see faiface#78) for users of gl2.1, to provide access to polling
of events without rendering the screen.

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

No branches or pull requests

2 participants