proper modules on renderer

This commit is contained in:
Alex Janka 2024-02-07 15:51:37 +11:00
parent 0ae8697eb8
commit 80850d3405
6 changed files with 16 additions and 12 deletions

View file

@ -8,10 +8,11 @@ use std::{
}; };
use cpal::Stream; use cpal::Stream;
use gb_emu_lib::{ use gb_emu_lib::connect::{EmulatorMessage, JoypadState, RendererMessage, ResolutionData};
connect::{EmulatorMessage, JoypadState, RendererMessage, ResolutionData}, #[cfg(feature = "pixels")]
renderer::{RendererBackend, RendererBackendManager, WindowOptions}, use gb_emu_lib::renderer::pixels::{RendererBackend, RendererBackendManager, WindowOptions};
}; #[cfg(feature = "vulkan")]
use gb_emu_lib::renderer::vulkan::{RendererBackend, RendererBackendManager, WindowOptions};
use gilrs::{Button, Gilrs}; use gilrs::{Button, Gilrs};
use image::ImageBuffer; use image::ImageBuffer;
#[cfg(feature = "vulkan")] #[cfg(feature = "vulkan")]

View file

@ -3,10 +3,13 @@ use std::sync::{Arc, Mutex};
use baseview::{ use baseview::{
Event, EventStatus, Size, Window, WindowEvent, WindowHandle, WindowHandler, WindowOpenOptions, Event, EventStatus, Size, Window, WindowEvent, WindowHandle, WindowHandler, WindowOpenOptions,
}; };
use gb_emu_lib::{ use gb_emu_lib::connect::{
connect::{JoypadButtons, JoypadState, RendererMessage, ResolutionData, HEIGHT, WIDTH}, JoypadButtons, JoypadState, RendererMessage, ResolutionData, HEIGHT, WIDTH,
renderer::{RendererBackend, RendererBackendManager, WindowOptions},
}; };
#[cfg(feature = "pixels")]
use gb_emu_lib::renderer::pixels::{RendererBackend, RendererBackendManager, WindowOptions};
#[cfg(feature = "vulkan")]
use gb_emu_lib::renderer::vulkan::{RendererBackend, RendererBackendManager, WindowOptions};
use keyboard_types::{Code, KeyState}; use keyboard_types::{Code, KeyState};
use nih_plug::prelude::*; use nih_plug::prelude::*;

View file

@ -24,7 +24,7 @@ use frontend_common::{
}; };
use gb_emu_lib::{ use gb_emu_lib::{
connect::{EmulatorMessage, JoypadButtons, JoypadState, RendererMessage, ResolutionData}, connect::{EmulatorMessage, JoypadButtons, JoypadState, RendererMessage, ResolutionData},
renderer::{RendererBackend, RendererBackendManager, WindowOptions}, renderer::vulkan::{RendererBackend, RendererBackendManager, WindowOptions},
}; };
use objc::{ use objc::{
class, msg_send, msg_send_id, class, msg_send, msg_send_id,

View file

@ -11,10 +11,6 @@ use std::sync::mpsc::Receiver;
#[cfg(all(feature = "vulkan", feature = "pixels"))] #[cfg(all(feature = "vulkan", feature = "pixels"))]
compile_error!("select only one rendering backend!"); compile_error!("select only one rendering backend!");
#[allow(unused_attributes)]
#[cfg(any(feature = "vulkan-renderer", feature = "pixels-renderer"))]
#[cfg_attr(feature = "pixels-renderer", path = "renderer/pixels.rs")]
#[cfg_attr(feature = "vulkan-renderer", path = "renderer/vulkan/vulkan.rs")]
pub mod renderer; pub mod renderer;
#[cfg(feature = "config")] #[cfg(feature = "config")]

4
lib/src/renderer/mod.rs Normal file
View file

@ -0,0 +1,4 @@
#[cfg(feature = "pixels-renderer")]
pub mod pixels;
#[cfg(feature = "vulkan-renderer")]
pub mod vulkan;