sinesc / radiant-rs Goto Github PK
View Code? Open in Web Editor NEWRust sprite rendering engine
Rust sprite rendering engine
Should probably be Font::clone_with_size() to be in line with Layer::with_program() vs. Layer::clone_with_program()
Seems broken.
Currently required at draw time since the frame offset is not fixed and depends on the number of frames in the sprite.
To move this to Renderer::draw_layer(), Sprite::draw() would have to save the frame- and component count to the AVec. The absolute offset could be computed in the shader.
Step-by-step approach.
Lookup some common blendmodes and see if they can be approximated with opengl blendfuncs.
Also look into KHR_blend_equation_advanced.
Currently fonts are created with a color and size.
There are various methods to write text. These could be streamlined with a builder like draw_rect() was with RectBuilder.
Some backend methods accept backend types instead of radiant types. This should be changed, e.g. backend::Texture2d::new should accept a core::Display instead of a backend::Display.
Currently everything goes through shaders. Add an API to blit from one rendertarget to another.
Needs to be mostly drop-in and be easy to use.
Scene needs a simple means to perform an operation once.
As an alternative, support the builder pattern for Display, Font, Texture and possibly Sprite (which currently doesn't use the Info struct either)
Layer blendmodes should be configurable per layer component.
It is confirmed that radiant-rs suffers from an use-after-free vulnerablity within the target_frame
public function, a possible panic thrown by draw_func
would cause an uninitialized memory to be freed, which is equivalent to use-after-free
(which is constantly exploitable).
pub fn target_frame<F>(renderer: &core::Renderer, frame: &mut glium::Frame, draw_func: F) where F: FnMut() {
let wrapper = {
let owned_frame = mem::replace(frame, unsafe { mem::uninitialized() });
let backend_frame = super::Frame(owned_frame);
Rc::new(RefCell::new(Some(backend_frame)))
};
renderer.render_to(&core::RenderTarget::frame(&wrapper), draw_func);
let backend_frame = mem::replace(&mut *wrapper.borrow_mut(), None).unwrap();
let owned_frame = backend_frame.into_inner();
let uninitialized = mem::replace(frame, owned_frame);
mem::forget(uninitialized);
}
Currently the shader can only access the selected sprite component and frame. It could be useful to be able to access any component and/or frame.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.