rust-windowing/glutin

OpenGL ES 1.1 context created by android-examples

zbx1425 opened this issue · 3 comments

I used the code in the android-examples branch, and it seems that an OpenGL ES 1.1 context is created.
I'm trying to use a context of a higher API version instead, the highest available if possible. I searched on the internet and cannot find instructions regarding glutin setups required to achieve that.
On the other hand, the example on desktop platform does give me the highest available API version.
Sorry for that I have poor understandings on the internals of glutin, and any help would be appreciated.
image

If you look at the context creation attributes you may find the ContextAttributes(use cargo doc) struct. And just by looking through it you may find that you can explicitly specify the version of the context you want.

pub fn with_context_api(mut self, api: ContextApi) -> Self {

That's what you need here. Pass the version you need there. Like Gles(3, 0) or something like that.

Thanks for the speedy response! Missed that completely.
Though is there a way to utilize the highest available version on the system?
It seems that on Windows when with_context_api is not specified, the highest available version is used.

That's the behavior depending on the system, I guess. Since on Wayland + EGL it also picks the maximum value. I don't see any way to request the maximum value. Maybe the difference that we pick OpenGL and not ES on desktop platforms by default and ES does that.

In general you can pick some very big value and fallback to lower one on failure.

This is all platform defendant in the end, if we had a way to request a max we'd have that implemented...