remove the KDE dependency
This commit is contained in:
parent
1d433dc13b
commit
7afb7b2f20
|
|
@ -9,11 +9,6 @@ find_package(Qt6 REQUIRED COMPONENTS Gui Widgets)
|
||||||
find_program(CARGO cargo REQUIRED)
|
find_program(CARGO cargo REQUIRED)
|
||||||
set(CARGO_TARGET_DIR "${CMAKE_BINARY_DIR}/cargo")
|
set(CARGO_TARGET_DIR "${CMAKE_BINARY_DIR}/cargo")
|
||||||
|
|
||||||
# KDE-specific
|
|
||||||
find_package(ECM REQUIRED NO_MODULE)
|
|
||||||
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
|
|
||||||
find_package(KF6 REQUIRED COMPONENTS WidgetsAddons)
|
|
||||||
|
|
||||||
qt_standard_project_setup()
|
qt_standard_project_setup()
|
||||||
|
|
||||||
add_subdirectory(ui)
|
add_subdirectory(ui)
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,11 @@ use glam::{Mat4, UVec2, Vec3, Vec4, vec3, vec4};
|
||||||
mod camera;
|
mod camera;
|
||||||
mod render;
|
mod render;
|
||||||
|
|
||||||
|
const BACKGROUND: Vec4 = vec4(0.00, 0.39, 0.52, 1.00);
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy)]
|
#[derive(Debug, Clone, Copy)]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub struct RedrawArgs {
|
pub struct RedrawArgs {
|
||||||
pub background: Vec4,
|
|
||||||
pub cam_yaw: f32,
|
pub cam_yaw: f32,
|
||||||
pub cam_pitch: f32,
|
pub cam_pitch: f32,
|
||||||
pub cam_distance: f32,
|
pub cam_distance: f32,
|
||||||
|
|
@ -18,7 +19,6 @@ pub struct RedrawArgs {
|
||||||
impl Default for RedrawArgs {
|
impl Default for RedrawArgs {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Self {
|
Self {
|
||||||
background: vec4(0.25, 0.49, 0.93, 1.00),
|
|
||||||
cam_yaw: 3. * std::f32::consts::FRAC_PI_4,
|
cam_yaw: 3. * std::f32::consts::FRAC_PI_4,
|
||||||
cam_pitch: std::f32::consts::FRAC_PI_6,
|
cam_pitch: std::f32::consts::FRAC_PI_6,
|
||||||
cam_distance: 3.,
|
cam_distance: 3.,
|
||||||
|
|
@ -158,7 +158,7 @@ impl Core {
|
||||||
depth_slice: None,
|
depth_slice: None,
|
||||||
resolve_target: None,
|
resolve_target: None,
|
||||||
ops: wgpu::Operations {
|
ops: wgpu::Operations {
|
||||||
load: wgpu::LoadOp::Clear(color_to_wgpu(srgba_to_linear(args.background))),
|
load: wgpu::LoadOp::Clear(color_to_wgpu(srgba_to_linear(BACKGROUND))),
|
||||||
store: wgpu::StoreOp::Store,
|
store: wgpu::StoreOp::Store,
|
||||||
},
|
},
|
||||||
})],
|
})],
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,5 @@ qt_add_executable(PROJECT-NAME
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(PROJECT-NAME PRIVATE Qt6::Gui Qt6::Widgets)
|
target_link_libraries(PROJECT-NAME PRIVATE Qt6::Gui Qt6::Widgets)
|
||||||
target_link_libraries(PROJECT-NAME PRIVATE KF6::WidgetsAddons)
|
|
||||||
target_link_libraries(PROJECT-NAME PRIVATE PROJECT_NAME_impl)
|
target_link_libraries(PROJECT-NAME PRIVATE PROJECT_NAME_impl)
|
||||||
target_include_directories(PROJECT-NAME PRIVATE src)
|
target_include_directories(PROJECT-NAME PRIVATE src)
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@ namespace ffi {
|
||||||
struct Core;
|
struct Core;
|
||||||
|
|
||||||
struct RedrawArgs {
|
struct RedrawArgs {
|
||||||
Vec4 background;
|
|
||||||
float cam_yaw;
|
float cam_yaw;
|
||||||
float cam_pitch;
|
float cam_pitch;
|
||||||
float cam_distance;
|
float cam_distance;
|
||||||
|
|
|
||||||
|
|
@ -12,9 +12,7 @@ PROJECTNAME::PROJECTNAME(QWidget* parent)
|
||||||
PROJECTNAME::~PROJECTNAME() = default;
|
PROJECTNAME::~PROJECTNAME() = default;
|
||||||
|
|
||||||
void PROJECTNAME::updateView() {
|
void PROJECTNAME::updateView() {
|
||||||
const auto color = m_ui->inBackground->color();
|
|
||||||
RedrawArgs args{
|
RedrawArgs args{
|
||||||
.background = { color.redF(), color.greenF(), color.blueF(), 1.00 },
|
|
||||||
.cam_yaw = qDegreesToRadians((float)m_ui->camYaw->value()),
|
.cam_yaw = qDegreesToRadians((float)m_ui->camYaw->value()),
|
||||||
.cam_pitch = qDegreesToRadians((float)m_ui->camPitch->value()),
|
.cam_pitch = qDegreesToRadians((float)m_ui->camPitch->value()),
|
||||||
.cam_distance = (float)m_ui->camDistance->value(),
|
.cam_distance = (float)m_ui->camDistance->value(),
|
||||||
|
|
|
||||||
|
|
@ -156,24 +156,6 @@
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label">
|
|
||||||
<property name="text">
|
|
||||||
<string>Background color</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="KColorCombo" name="inBackground">
|
|
||||||
<property name="color">
|
|
||||||
<color>
|
|
||||||
<red>0</red>
|
|
||||||
<green>99</green>
|
|
||||||
<blue>133</blue>
|
|
||||||
</color>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<spacer name="verticalSpacer">
|
<spacer name="verticalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
|
|
@ -192,11 +174,6 @@
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
<customwidget>
|
|
||||||
<class>KColorCombo</class>
|
|
||||||
<extends>QComboBox</extends>
|
|
||||||
<header>kcolorcombo.h</header>
|
|
||||||
</customwidget>
|
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>Viewport</class>
|
<class>Viewport</class>
|
||||||
<extends>QWidget</extends>
|
<extends>QWidget</extends>
|
||||||
|
|
@ -206,22 +183,6 @@
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections>
|
<connections>
|
||||||
<connection>
|
|
||||||
<sender>inBackground</sender>
|
|
||||||
<signal>highlighted(QColor)</signal>
|
|
||||||
<receiver>MainWindow</receiver>
|
|
||||||
<slot>updateView()</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel">
|
|
||||||
<x>1531</x>
|
|
||||||
<y>115</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel">
|
|
||||||
<x>799</x>
|
|
||||||
<y>599</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
<connection>
|
<connection>
|
||||||
<sender>camYaw</sender>
|
<sender>camYaw</sender>
|
||||||
<signal>valueChanged(double)</signal>
|
<signal>valueChanged(double)</signal>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user