Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jjmartinodev/kopki
https://github.com/jjmartinodev/kopki
Last synced: 15 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/jjmartinodev/kopki
- Owner: jjmartinodev
- License: mit
- Created: 2024-02-12T20:04:15.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-02-27T13:25:49.000Z (4 months ago)
- Last Synced: 2024-05-30T11:44:36.717Z (29 days ago)
- Language: Rust
- Size: 57.6 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- awesome-stars - jjmartinodev/kopki - (Rust)
README
# kopki
Simple graphical engine, based on wgpu and winit.# Minimal Example
```
use kopki::{
wgpu, winit, core::context::Context
};use winit::{
event::{Event, WindowEvent},
event_loop::EventLoop,
window::WindowBuilder
};use kopki::{
wgpu, winit, Context
};use winit::{
event::{Event, WindowEvent},
event_loop::EventLoop,
window::WindowBuilder
};fn main() {
let ctx = Context::blocked_new();
let event_loop = EventLoop::new().unwrap();
let window = WindowBuilder::new()
.build(&event_loop).expect("failed to build");
let mut surface = ctx.create_surface(&window);_ = event_loop.run(move |event,elwt| {
match event {
Event::AboutToWait => {
window.request_redraw();
}
Event::WindowEvent { event, .. } => {
match event {
WindowEvent::CloseRequested => elwt.exit(),
WindowEvent::RedrawRequested => {
ctx.render(
&surface,&[],&[],
wgpu::Color {
r: 0.0,
g: 0.0,
b: 0.0,
a: 0.0,
}
)
}
WindowEvent::Resized(size) => {
surface.resize(&ctx, size)
}
_ => ()
}
}
_ => ()
}
})
}
```for more examples look for the examples folder in the github repo