mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2025-01-11 05:21:31 +11:00
Use GLES
This commit is contained in:
parent
a5de084856
commit
db074dc32f
4
build.rs
4
build.rs
|
@ -180,8 +180,8 @@ fn main() {
|
||||||
|
|
||||||
let mut file = File::create(&dest.join("test_gl_bindings.rs")).unwrap();
|
let mut file = File::create(&dest.join("test_gl_bindings.rs")).unwrap();
|
||||||
gl_generator::generate_bindings(gl_generator::StructGenerator,
|
gl_generator::generate_bindings(gl_generator::StructGenerator,
|
||||||
gl_generator::registry::Ns::Gl,
|
gl_generator::registry::Ns::Gles2,
|
||||||
gl_generator::Fallbacks::All,
|
gl_generator::Fallbacks::All,
|
||||||
khronos_api::GL_XML, vec![],
|
khronos_api::GL_XML, vec![],
|
||||||
"3.3", "core", &mut file).unwrap();
|
"3.0", "core", &mut file).unwrap();
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@ use std::ptr;
|
||||||
use glutin;
|
use glutin;
|
||||||
|
|
||||||
mod gl {
|
mod gl {
|
||||||
|
pub use self::Gles2 as Gl;
|
||||||
include!(concat!(env!("OUT_DIR"), "/test_gl_bindings.rs"));
|
include!(concat!(env!("OUT_DIR"), "/test_gl_bindings.rs"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@ use glutin::*;
|
||||||
use std::ptr;
|
use std::ptr;
|
||||||
|
|
||||||
mod gl {
|
mod gl {
|
||||||
|
pub use self::Gles2 as Gl;
|
||||||
include!(concat!(env!("OUT_DIR"), "/test_gl_bindings.rs"));
|
include!(concat!(env!("OUT_DIR"), "/test_gl_bindings.rs"));
|
||||||
}
|
}
|
||||||
use gl::types::*;
|
use gl::types::*;
|
||||||
|
@ -31,7 +32,7 @@ fn test_headless() {
|
||||||
gl.TexParameteri(gl::TEXTURE_2D, gl::TEXTURE_MIN_FILTER, gl::LINEAR as i32);
|
gl.TexParameteri(gl::TEXTURE_2D, gl::TEXTURE_MIN_FILTER, gl::LINEAR as i32);
|
||||||
gl.TexImage2D(gl::TEXTURE_2D, 0, gl::RGBA as i32, width, height,
|
gl.TexImage2D(gl::TEXTURE_2D, 0, gl::RGBA as i32, width, height,
|
||||||
0, gl::RGBA, gl::UNSIGNED_BYTE, ptr::null());
|
0, gl::RGBA, gl::UNSIGNED_BYTE, ptr::null());
|
||||||
gl.FramebufferTexture(gl::FRAMEBUFFER, gl::COLOR_ATTACHMENT0, texture, 0);
|
gl.FramebufferTexture2D(gl::FRAMEBUFFER, gl::COLOR_ATTACHMENT0, gl::TEXTURE_2D, texture, 0);
|
||||||
let status = gl.CheckFramebufferStatus(gl::FRAMEBUFFER);
|
let status = gl.CheckFramebufferStatus(gl::FRAMEBUFFER);
|
||||||
if status != gl::FRAMEBUFFER_COMPLETE {
|
if status != gl::FRAMEBUFFER_COMPLETE {
|
||||||
panic!("Error while creating the framebuffer");
|
panic!("Error while creating the framebuffer");
|
||||||
|
|
Loading…
Reference in a new issue