|
|
@ -5,7 +5,7 @@ use ctru::services::apt::Apt; |
|
|
|
use ctru::services::hid::{Hid, KeyPad}; |
|
|
|
use ctru::services::hid::{Hid, KeyPad}; |
|
|
|
use ctru::services::soc::Soc; |
|
|
|
use ctru::services::soc::Soc; |
|
|
|
|
|
|
|
|
|
|
|
use citro3d::render::{ClearFlags, DepthFormat}; |
|
|
|
use citro3d::render::ClearFlags; |
|
|
|
|
|
|
|
|
|
|
|
use std::ffi::CStr; |
|
|
|
use std::ffi::CStr; |
|
|
|
use std::mem::MaybeUninit; |
|
|
|
use std::mem::MaybeUninit; |
|
|
@ -29,7 +29,7 @@ struct Vertex { |
|
|
|
color: Vec3, |
|
|
|
color: Vec3, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const VERTICES: &[Vertex] = &[ |
|
|
|
static VERTICES: &[Vertex] = &[ |
|
|
|
Vertex { |
|
|
|
Vertex { |
|
|
|
pos: Vec3::new(0.0, 0.5, 0.5), |
|
|
|
pos: Vec3::new(0.0, 0.5, 0.5), |
|
|
|
color: Vec3::new(1.0, 0.0, 0.0), |
|
|
|
color: Vec3::new(1.0, 0.0, 0.0), |
|
|
@ -44,7 +44,7 @@ const VERTICES: &[Vertex] = &[ |
|
|
|
}, |
|
|
|
}, |
|
|
|
]; |
|
|
|
]; |
|
|
|
|
|
|
|
|
|
|
|
const SHADER_BYTES: &[u8] = |
|
|
|
static SHADER_BYTES: &[u8] = |
|
|
|
include_aligned_bytes!(concat!(env!("OUT_DIR"), "/examples/assets/vshader.shbin")); |
|
|
|
include_aligned_bytes!(concat!(env!("OUT_DIR"), "/examples/assets/vshader.shbin")); |
|
|
|
|
|
|
|
|
|
|
|
fn main() { |
|
|
|
fn main() { |
|
|
@ -63,26 +63,17 @@ fn main() { |
|
|
|
|
|
|
|
|
|
|
|
let mut instance = citro3d::Instance::new().expect("failed to initialize Citro3D"); |
|
|
|
let mut instance = citro3d::Instance::new().expect("failed to initialize Citro3D"); |
|
|
|
|
|
|
|
|
|
|
|
let mut render_target = citro3d::render::Target::new( |
|
|
|
let mut render_target = citro3d::render::Target::new(width, height, top_screen, None) |
|
|
|
width, |
|
|
|
|
|
|
|
height, |
|
|
|
|
|
|
|
&mut *top_screen, |
|
|
|
|
|
|
|
DepthFormat::Depth24Stencil8, |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
.expect("failed to create render target"); |
|
|
|
.expect("failed to create render target"); |
|
|
|
|
|
|
|
|
|
|
|
render_target.set_output(Side::Left); |
|
|
|
render_target.set_output(Side::Left); |
|
|
|
|
|
|
|
render_target.set_output(Side::Right); |
|
|
|
|
|
|
|
|
|
|
|
let mut bottom_screen = gfx.bottom_screen.borrow_mut(); |
|
|
|
let mut bottom_screen = gfx.bottom_screen.borrow_mut(); |
|
|
|
let frame_buffer = bottom_screen.get_raw_framebuffer(); |
|
|
|
let frame_buffer = bottom_screen.get_raw_framebuffer(); |
|
|
|
let (width, height) = (frame_buffer.width, frame_buffer.height); |
|
|
|
let (width, height) = (frame_buffer.width, frame_buffer.height); |
|
|
|
|
|
|
|
|
|
|
|
let mut bottom_target = citro3d::render::Target::new( |
|
|
|
let mut bottom_target = citro3d::render::Target::new(width, height, bottom_screen, None) |
|
|
|
width, |
|
|
|
|
|
|
|
height, |
|
|
|
|
|
|
|
&mut *bottom_screen, |
|
|
|
|
|
|
|
DepthFormat::Depth24Stencil8, |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
.expect("failed to create bottom screen render target"); |
|
|
|
.expect("failed to create bottom screen render target"); |
|
|
|
|
|
|
|
|
|
|
|
bottom_target.set_output(Side::Left); |
|
|
|
bottom_target.set_output(Side::Left); |
|
|
|