From 44349618b1faba10bcdbbb0d28ae16c71abaafc1 Mon Sep 17 00:00:00 2001 From: Daniel Robertson Date: Thu, 12 May 2016 11:20:56 -0400 Subject: [PATCH] Add max texture size members to GLLimits Add max_tex_size and max_cube_map_size to GLLimits --- Cargo.toml | 2 +- src/gl_limits.rs | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 74908aa..c4f24c5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "offscreen_gl_context" license = "MIT / Apache-2.0" -version = "0.1.4" +version = "0.1.5" authors = ["ecoal95 ", "The Servo Project Developers"] description = "Creation and manipulation of HW accelerated offscreen rendering contexts in multiple platforms. Originally intended for the Servo project's WebGL implementation." repository = "https://github.com/ecoal95/rust-offscreen-rendering-context" diff --git a/src/gl_limits.rs b/src/gl_limits.rs index bfed80e..471421e 100644 --- a/src/gl_limits.rs +++ b/src/gl_limits.rs @@ -4,12 +4,16 @@ use gleam::gl; #[cfg_attr(feature="serde_serialization", derive(Serialize, Deserialize))] pub struct GLLimits { pub max_vertex_attribs: u32, + pub max_tex_size: u32, + pub max_cube_map_tex_size: u32 } impl GLLimits { pub fn detect() -> GLLimits { GLLimits { max_vertex_attribs: gl::get_integer_v(gl::MAX_VERTEX_ATTRIBS) as u32, + max_tex_size: gl::get_integer_v(gl::MAX_TEXTURE_SIZE) as u32, + max_cube_map_tex_size: gl::get_integer_v(gl::MAX_CUBE_MAP_TEXTURE_SIZE) as u32 } } }