在src/lib.rs我有以下
extern crate opal_core;
mod functions;
mod context;
mod shader;
Run Code Online (Sandbox Code Playgroud)
然后src/context.rs我有这样的东西,它试图从src/shader.rs以下方面导入符号:
use opal_core::shader::Stage;
use opal_core::shader::Shader as ShaderTrait;
use opal_core::GraphicsContext as GraphicsContextTrait;
use functions::*; // this import works fine
use shader::*; // this one doesn't
pub struct GraphicsContext {
functions: Gl
}
fn shader_stage_to_int(stage: &Stage) -> u32 {
match stage {
&Stage::Vertex => VERTEX_SHADER,
&Stage::Geometry => GEOMETRY_SHADER,
&Stage::Fragment => FRAGMENT_SHADER,
}
}
impl GraphicsContextTrait for GraphicsContext {
/// Creates a shader object
fn create_shader(&self, stage: …Run Code Online (Sandbox Code Playgroud)