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

clarify imports of miniquad types disguised as crate types #834

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
12 changes: 6 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
//! }
//!```

use miniquad::*;
use miniquad::{date, EventHandler, FilterMode, KeyCode, KeyMods, MouseButton, TouchPhase};

use std::collections::{HashMap, HashSet};
use std::future::Future;
Expand Down Expand Up @@ -214,7 +214,7 @@
last_frame_time: f64,
frame_time: f64,

#[cfg(one_screenshot)]

Check warning on line 217 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Cross-compile (ubuntu-latest, wasm32-unknown-unknown)

unexpected `cfg` condition name: `one_screenshot`

Check warning on line 217 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Cross-compile (macos-latest, x86_64-apple-darwin)

unexpected `cfg` condition name: `one_screenshot`

Check warning on line 217 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Cross-compile (ubuntu-latest, x86_64-pc-windows-gnu)

unexpected `cfg` condition name: `one_screenshot`

Check warning on line 217 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Cross-compile (ubuntu-latest, x86_64-unknown-linux-gnu)

unexpected `cfg` condition name: `one_screenshot`

Check warning on line 217 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Cross-compile (windows-latest, x86_64-pc-windows-msvc)

unexpected `cfg` condition name: `one_screenshot`
counter: usize,

camera_stack: Vec<camera::CameraState>,
Expand Down Expand Up @@ -301,7 +301,7 @@

fn new(
update_on: conf::UpdateTrigger,
default_filter_mode: crate::FilterMode,
default_filter_mode: FilterMode,
draw_call_vertex_capacity: usize,
draw_call_index_capacity: usize,
) -> Context {
Expand Down Expand Up @@ -356,7 +356,7 @@
last_frame_time: miniquad::date::now(),
frame_time: 1. / 60.,

#[cfg(one_screenshot)]

Check warning on line 359 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Cross-compile (ubuntu-latest, wasm32-unknown-unknown)

unexpected `cfg` condition name: `one_screenshot`

Check warning on line 359 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Cross-compile (macos-latest, x86_64-apple-darwin)

unexpected `cfg` condition name: `one_screenshot`

Check warning on line 359 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Cross-compile (ubuntu-latest, x86_64-pc-windows-gnu)

unexpected `cfg` condition name: `one_screenshot`

Check warning on line 359 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Cross-compile (ubuntu-latest, x86_64-unknown-linux-gnu)

unexpected `cfg` condition name: `one_screenshot`

Check warning on line 359 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Cross-compile (windows-latest, x86_64-pc-windows-msvc)

unexpected `cfg` condition name: `one_screenshot`
counter: 0,
unwind: false,
recovery_future: None,
Expand Down Expand Up @@ -406,7 +406,7 @@

get_quad_context().commit_frame();

#[cfg(one_screenshot)]

Check warning on line 409 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Cross-compile (ubuntu-latest, wasm32-unknown-unknown)

unexpected `cfg` condition name: `one_screenshot`

Check warning on line 409 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Cross-compile (macos-latest, x86_64-apple-darwin)

unexpected `cfg` condition name: `one_screenshot`

Check warning on line 409 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Cross-compile (ubuntu-latest, x86_64-pc-windows-gnu)

unexpected `cfg` condition name: `one_screenshot`

Check warning on line 409 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Cross-compile (ubuntu-latest, x86_64-unknown-linux-gnu)

unexpected `cfg` condition name: `one_screenshot`

Check warning on line 409 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Cross-compile (windows-latest, x86_64-pc-windows-msvc)

unexpected `cfg` condition name: `one_screenshot`
{
get_context().counter += 1;
if get_context().counter == 3 {
Expand Down Expand Up @@ -802,7 +802,7 @@
pub mouse_up: bool,
pub mouse_motion: bool,
pub mouse_wheel: bool,
pub specific_key: Option<Vec<crate::KeyCode>>,
pub specific_key: Option<Vec<miniquad::KeyCode>>,
pub touch: bool,
}

Expand All @@ -814,7 +814,7 @@
/// zero CPU usage.
/// update_on will tell macroquad when to proceed with the event loop.
pub update_on: Option<UpdateTrigger>,
pub default_filter_mode: crate::FilterMode,
pub default_filter_mode: miniquad::FilterMode,
/// Macroquad performs automatic and static batching for each
/// draw_* call. For each draw call, it pre-allocate a huge cpu/gpu
/// buffer to add vertices to. When it exceeds the buffer, it allocates the
Expand All @@ -834,7 +834,7 @@
Self {
miniquad_conf: miniquad::conf::Conf::default(),
update_on: Some(UpdateTrigger::default()),
default_filter_mode: crate::FilterMode::Linear,
default_filter_mode: miniquad::FilterMode::Linear,
draw_call_vertex_capacity: 10000,
draw_call_index_capacity: 5000,
}
Expand All @@ -847,7 +847,7 @@
conf::Conf {
miniquad_conf: conf,
update_on: None,
default_filter_mode: crate::FilterMode::Linear,
default_filter_mode: FilterMode::Linear,
draw_call_vertex_capacity: 10000,
draw_call_index_capacity: 5000,
}
Expand Down
7 changes: 2 additions & 5 deletions src/material.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Custom materials - shaders, uniforms.

use crate::{get_context, quad_gl::GlPipeline, texture::Texture2D, tobytes::ToBytes, Error};
use miniquad::{PipelineParams, UniformDesc};
use miniquad::{PipelineParams, ShaderSource, UniformDesc};
use std::sync::Arc;

#[derive(PartialEq)]
Expand Down Expand Up @@ -60,10 +60,7 @@ pub struct MaterialParams {
pub textures: Vec<String>,
}

pub fn load_material(
shader: crate::ShaderSource,
params: MaterialParams,
) -> Result<Material, Error> {
pub fn load_material(shader: ShaderSource, params: MaterialParams) -> Result<Material, Error> {
let context = &mut get_context();

let pipeline = context.gl.make_pipeline(
Expand Down
Loading