-
Notifications
You must be signed in to change notification settings - Fork 44
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
How to fix problem when function pointer is not loaded #103
Comments
If you're getting the wrong version of OpenGL with SDL2, make sure you're setting the version and profile attributes as seen here.
|
I'm using glutin and getting this error:
I've only openGL 1.1 installed on windows 7. However, this is a virtual machine and I'm not seeing a way to update openGL. Also I'm using glutin instead of SDL2 or GLFW. This is the relevant code: fn main() {
let opengl = OpenGL::_3_2;
let mut windowSettings = WindowSettings::new(
"spinning-square",
[200, 200])
.opengl(opengl)
.exit_on_esc(true);
// Create an Glutin window.
let window = Window::new(windowSettings);
// Create a new game and run it.
let mut app = App {
gl: GlGraphics::new(opengl),
rotation: 0.0
};
... In the code, you'll see openGL version _3_2, but this is because I'm not seeing _1_1 as an option. Is there any way to get my application running on this VM? Thanks! |
Which VM software are you using? |
Actually, this is a VM hosted by my employer. Regrettably, I'm not sure what software is running it, and I doubt I have much capability to have them modify my instance. |
The problem is, you're getting WGL which is the software implementation of OpenGL 1.1 that comes with Windows. It only supports the old fixed pipeline and doesn't work with modern OpenGL applications. It is likely that you have to install the guest OS additions package for your VM software to enable graphics acceleration. You'll probably need to consult your VM server's sysadmin because it depends highly on which VM suite you're running and how it's set up. |
Ok, this is sort of what I was expecting. Thanks! |
This also happens when you try to create a |
Hi, I updated to
And then:
This panics with the message:
I only updated my
to:
|
Have this issue as well. Can't get my game to work after updating Cargo.toml dependencies. There seems to be a mismatch between the different crates. For example: |
OpenGL uses a function pointer loader system to enable the API for use in applications. This means you need to call
gl::load_with(|s| window.get_proc_address(s));
or similar.The SDL2 and GLFW back-ends for Piston loads the functions when initializing a new window. You are most likely getting this error because you attempt to call an OpenGL function before the window is created, or you are working directly against the back-end. It might also be the case that you are using another back-end where what is happening is uncertain. In any case, the problem is that the gl-rs library must load the function pointers before you can use it.
Try to initialize the window first, or load the function pointers manually.
For SDL2 you call:
For GLFW you call:
Running an old version of OpenGL
It might be the case that you are loading an old version of OpenGL that does not support shaders. In that case, you can not use opengl_graphics because it requires GLSL shader support to work. You can fork opengl_graphics and modify the source to use the old fixed rendering pipeline. If there is a way to make this work with opengl_graphics, then contributions are welcome.
Setting the wrong version of OpenGL
If you pass a
shader_version::OpenGL
to the constructor, the window must be initialized with the same version, as seen here. The major and minor version must match the ones that is used to pick the compatible shader. Make sure that the sameshader_version::OpenGL
is passed to the window.The text was updated successfully, but these errors were encountered: