Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
4451972
[add] egui to lambda-rs-platform.
vmarcella Feb 4, 2023
b34b843
[update] readme for lambda-rs-platform, simplify Runtime, and prepare…
vmarcella Feb 4, 2023
5982be0
[update] winit event qualification.
vmarcella Feb 4, 2023
d8cf273
[update] mouse input event handler, add cursor position to egui context.
vmarcella Feb 5, 2023
a8fa01e
[fix] constructor & update event implementations for egui.
vmarcella Feb 5, 2023
7efa007
[add] event handling for window focusing.
vmarcella Feb 5, 2023
6fd55b3
[update] mouse input.
vmarcella Feb 5, 2023
532e8d7
[add] logic for cursor leaving the window.
vmarcella Feb 5, 2023
092ffcf
[add] input translations for egui/winit.
vmarcella Feb 5, 2023
c6af410
[add] egui file opeartions.
vmarcella Feb 5, 2023
1cd12b0
[update] process mouse input and refactor winit mouse button conversi…
vmarcella Feb 5, 2023
03d75e4
[update] naming for egui input & context.
vmarcella Feb 5, 2023
3f0db01
[update] winit cursor icon.
vmarcella Feb 6, 2023
28ed67e
[update] virtual key code.
vmarcella Feb 6, 2023
c26be16
[update] input handler references.
vmarcella Feb 6, 2023
81b7735
[update] context references.
vmarcella Feb 6, 2023
1b8bdf7
[fix] references for internal variables.
vmarcella Feb 12, 2023
0235873
[update] pipeline to not manually call the webhook.
vmarcella Feb 12, 2023
f3a0576
[add] high level ui context & elements to use for rendering from user…
vmarcella Feb 18, 2023
a41934a
[add] touch event processing for egui.
vmarcella Apr 9, 2023
2f2f7d9
[add] touch event handling to event loop.
vmarcella Apr 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 1 addition & 15 deletions .github/workflows/compile_lambda_rs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,5 @@ jobs:
rustup toolchain install ${{ matrix.rustup-toolchain }}
rustup default ${{ matrix.rustup-toolchain }}

- name: Build Lambda & other default workspace members.
- name: Build Lambda using platform specific features.
run: cargo test --all --features ${{ matrix.features }} --no-default-features

- uses: actions/setup-ruby@v1
- name: Send Webhook Notification for build status.
if: ${{ github.ref == 'refs/heads/main' }}
env:
JOB_STATUS: ${{ job.status }}
WEBHOOK_URL: ${{ secrets.LAMBDA_BUILD_WEBHOOK }}
HOOK_OS_NAME: ${{ runner.os }}
WORKFLOW_NAME: ${{ github.workflow }}
JOB_ID: ${{ github.job }}
run: |
git clone https://github.com/dhinakg/github-actions-discord-webhook.git webhook
bash webhook/send.sh $JOB_STATUS $WEBHOOK_URL
shell: bash
99 changes: 96 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion crates/lambda-rs-platform/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "lambda-rs-platform"
description = "Platform implementations for lambda-rs"
version = "2023.1.30"
version = "2023.2.4"
edition = "2021"
resolver = "2"
license = "MIT"
Expand All @@ -18,6 +18,7 @@ cfg-if = "=1.0.0"
rand = "=0.8.5"
obj-rs = "=0.7.0"
gfx-backend-empty = "=0.9.0"
egui = "0.20.1"

lambda-rs-logging = { path = "../lambda-rs-logging", version = "2023.1.30" }

Expand Down
25 changes: 15 additions & 10 deletions crates/lambda-rs-platform/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,18 @@ Platform implementations for lambda-rs. This crate is not intended to be used di

## Platforms
The following platforms are currently supported:
* Windows
* Vulkan
* DirectX 11
* DirectX 12
* Linux
* Vulkan
* OpenGL
* MacOS
* Metal
* Vulkan
* Rendering & Compute support
* Windows
* Vulkan
* DirectX 11
* DirectX 12
* Linux
* Vulkan
* OpenGL
* MacOS
* Metal
* Vulkan
* Window support
* winit
* UI support
* egui (via winit)
52 changes: 52 additions & 0 deletions crates/lambda-rs-platform/src/egui/gfx/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
//! Support module for rendering `egui` elements within our rendering
//! infrastructure.
pub enum GridDirection {
Horizontal,
Vertical,
}

pub enum UIElement {
Button {
text: String,
width: f32,
height: f32,
on_click: Option<fn()>,
},
Grid {
rows: usize,
columns: usize,
width: f32,
height: f32,
direction: GridDirection,
children: Vec<UIElement>,
},
}

impl UIElement {
/// Renders the UI element
pub(crate) fn render(&mut self, ui_for_frame: &mut egui::Ui) {
match self {
UIElement::Button {
text,
width,
height,
on_click,
} => {
if ui_for_frame.button(text.as_str()).clicked() {
match on_click {
Some(on_click) => on_click(),
None => {}
}
}
}
UIElement::Grid {
rows,
columns,
width,
height,
direction,
children,
} => todo!(),
}
}
}
20 changes: 20 additions & 0 deletions crates/lambda-rs-platform/src/egui/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
use egui::{
Context,
Pos2,
RawInput,
TouchDeviceId,
};

pub mod gfx;
pub mod winit;

/// A context for managing egui input & rendering.
pub struct EguiContext {
input_handler: RawInput,
context: Context,
mouse_position: Option<Pos2>,
mouse_button_active: bool,
current_pixels_per_point: f32,
emulate_touch_screen: bool,
active_touch_device: Option<TouchDeviceId>,
}
Loading