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

Add more gl functions #317

Merged
merged 19 commits into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,16 @@ pub trait HasContext: __private::Sealed {

unsafe fn link_program(&self, program: Self::Program);

unsafe fn validate_program(&self, program: Self::Program);

unsafe fn get_program_completion_status(&self, program: Self::Program) -> bool;

unsafe fn get_program_validate_status(&self, program: Self::Program) -> bool;

unsafe fn get_program_link_status(&self, program: Self::Program) -> bool;

unsafe fn get_program_parameter_i32(&self, program: Self::Program, parameter: u32) -> i32;

unsafe fn get_program_info_log(&self, program: Self::Program) -> String;

unsafe fn get_program_resource_i32(
Expand Down Expand Up @@ -457,6 +463,14 @@ pub trait HasContext: __private::Sealed {

unsafe fn get_active_uniforms(&self, program: Self::Program) -> u32;

#[doc(alias = "GetActiveUniformsiv")]
unsafe fn get_active_uniforms_parameter(
&self,
program: Self::Program,
uniforms: &[u32],
pname: u32,
) -> Vec<i32>;

unsafe fn get_active_uniform(
&self,
program: Self::Program,
Expand Down Expand Up @@ -554,6 +568,8 @@ pub trait HasContext: __private::Sealed {

unsafe fn pixel_store_bool(&self, parameter: u32, value: bool);

unsafe fn get_frag_data_location(&self, program: Self::Program, name: &str) -> i32;

unsafe fn bind_frag_data_location(&self, program: Self::Program, color_number: u32, name: &str);

unsafe fn buffer_data_size(&self, target: u32, size: i32, usage: u32);
Expand Down Expand Up @@ -633,6 +649,9 @@ pub trait HasContext: __private::Sealed {
);

unsafe fn client_wait_sync(&self, fence: Self::Fence, flags: u32, timeout: i32) -> u32;

unsafe fn get_sync_parameter_i32(&self, fence: Self::Fence, parameter: u32) -> i32;

unsafe fn wait_sync(&self, fence: Self::Fence, flags: u32, timeout: u64);

unsafe fn copy_buffer_sub_data(
Expand Down Expand Up @@ -885,6 +904,8 @@ pub trait HasContext: __private::Sealed {

unsafe fn get_tex_parameter_i32(&self, target: u32, parameter: u32) -> i32;

unsafe fn get_tex_parameter_f32(&self, target: u32, parameter: u32) -> f32;

unsafe fn get_buffer_parameter_i32(&self, target: u32, parameter: u32) -> i32;

#[doc(alias = "glGetBooleanv")]
Expand Down Expand Up @@ -942,6 +963,8 @@ pub trait HasContext: __private::Sealed {

unsafe fn get_parameter_vertex_array(&self, parameter: u32) -> Option<Self::VertexArray>;

unsafe fn get_renderbuffer_parameter_i32(&self, target: u32, parameter: u32) -> i32;

unsafe fn get_framebuffer_parameter_i32(&self, target: u32, parameter: u32) -> i32;

unsafe fn get_named_framebuffer_parameter_i32(
Expand Down Expand Up @@ -1030,6 +1053,10 @@ pub trait HasContext: __private::Sealed {

unsafe fn sampler_parameter_i32(&self, sampler: Self::Sampler, name: u32, value: i32);

unsafe fn get_sampler_parameter_i32(&self, sampler: Self::Sampler, name: u32) -> i32;

unsafe fn get_sampler_parameter_f32(&self, sampler: Self::Sampler, name: u32) -> f32;

unsafe fn generate_mipmap(&self, target: u32);

unsafe fn generate_texture_mipmap(&self, texture: Self::Texture);
Expand Down Expand Up @@ -1176,6 +1203,13 @@ pub trait HasContext: __private::Sealed {
v: &mut [i32],
);

unsafe fn get_uniform_u32(
&self,
program: Self::Program,
location: &Self::UniformLocation,
v: &mut [u32],
);

unsafe fn get_uniform_f32(
&self,
program: Self::Program,
Expand Down Expand Up @@ -1368,6 +1402,16 @@ pub trait HasContext: __private::Sealed {

unsafe fn invalidate_framebuffer(&self, target: u32, attachments: &[u32]);

unsafe fn invalidate_sub_framebuffer(
&self,
target: u32,
attachments: &[u32],
x: i32,
y: i32,
width: i32,
height: i32,
);

unsafe fn polygon_offset(&self, factor: f32, units: f32);

unsafe fn polygon_mode(&self, face: u32, mode: u32);
Expand Down Expand Up @@ -1542,6 +1586,13 @@ pub trait HasContext: __private::Sealed {

unsafe fn vertex_attrib_divisor(&self, index: u32, divisor: u32);

unsafe fn get_vertex_attrib_parameter_f32_slice(
&self,
index: u32,
pname: u32,
result: &mut [f32],
);

unsafe fn vertex_attrib_pointer_f32(
&self,
index: u32,
Expand Down Expand Up @@ -1603,6 +1654,10 @@ pub trait HasContext: __private::Sealed {

unsafe fn vertex_attrib_4_f32(&self, index: u32, x: f32, y: f32, z: f32, w: f32);

unsafe fn vertex_attrib_4_i32(&self, index: u32, x: i32, y: i32, z: i32, w: i32);

unsafe fn vertex_attrib_4_u32(&self, index: u32, x: u32, y: u32, z: u32, w: u32);

unsafe fn vertex_attrib_1_f32_slice(&self, index: u32, v: &[f32]);

unsafe fn vertex_attrib_2_f32_slice(&self, index: u32, v: &[f32]);
Expand Down Expand Up @@ -1710,6 +1765,12 @@ pub trait HasContext: __private::Sealed {

unsafe fn get_uniform_block_index(&self, program: Self::Program, name: &str) -> Option<u32>;

unsafe fn get_uniform_indices(
&self,
program: Self::Program,
names: &[&str],
) -> Vec<Option<u32>>;

unsafe fn uniform_block_binding(&self, program: Self::Program, index: u32, binding: u32);

unsafe fn get_shader_storage_block_index(
Expand Down Expand Up @@ -1756,6 +1817,8 @@ pub trait HasContext: __private::Sealed {

unsafe fn delete_transform_feedback(&self, transform_feedback: Self::TransformFeedback);

unsafe fn is_transform_feedback(&self, transform_feedback: Self::TransformFeedback) -> bool;

unsafe fn create_transform_feedback(&self) -> Result<Self::TransformFeedback, String>;

unsafe fn bind_transform_feedback(
Expand Down Expand Up @@ -1801,6 +1864,18 @@ pub trait HasContext: __private::Sealed {
);

unsafe fn max_shader_compiler_threads(&self, count: u32);

unsafe fn hint(&self, target: u32, mode: u32);

unsafe fn sample_coverage(&self, value: f32, invert: bool);

unsafe fn get_internal_format_i32_slice(
&self,
target: u32,
internal_format: u32,
pname: u32,
result: &mut [i32],
);
}

pub const ACTIVE_ATOMIC_COUNTER_BUFFERS: u32 = 0x92D9;
Expand Down
Loading
Loading