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

Shader program error with OpenGL 2.1 #218

Open
gendx opened this issue Dec 29, 2017 · 0 comments
Open

Shader program error with OpenGL 2.1 #218

gendx opened this issue Dec 29, 2017 · 0 comments

Comments

@gendx
Copy link

gendx commented Dec 29, 2017

I wanted to try piston_window on a computer that only supports OpenGL 2.1. I adapted the hello world code to use OpenGL 2.1, but I get the following error.

thread 'main' panicked at 'Error InvalidValue creating program: Simple(VertexShader(Shader(1)), PixelShader(Shader(2)))', /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/gfx_device_gl-0.14.6/src/factory.rs:233:12

main.rs

extern crate piston_window;
extern crate sdl2_window;

use piston_window::*;
use sdl2_window::Sdl2Window;

fn main() {
    let mut window: PistonWindow<Sdl2Window> =
        WindowSettings::new("Test", [500; 500])
            .opengl(OpenGL::V2_1)
            .build()
            .unwrap();
    println!("Hello world!");

    while let Some(e) = window.next() {
        window.draw_2d(&e, |c, g| {
            clear([0.5, 0.5, 0.5, 1.0], g);
        });
    }
}

Cargo.toml

[dependencies]
piston_window = "0.74.0"
pistoncore-sdl2_window = "0.47.0"
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

1 participant