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

Lists

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