rename from example
This commit is contained in:
parent
3e713b13a8
commit
1b2c1a387a
|
|
@ -1,6 +1,6 @@
|
|||
cmake_minimum_required(VERSION 3.18)
|
||||
|
||||
project(PROJECT-NAME VERSION 1.0.0 LANGUAGES CXX)
|
||||
project(particle_matter VERSION 1.0.0 LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
|
|
|||
42
Cargo.lock
generated
42
Cargo.lock
generated
|
|
@ -2,27 +2,6 @@
|
|||
# It is not intended for manual editing.
|
||||
version = 4
|
||||
|
||||
[[package]]
|
||||
name = "PROJECT-NAME"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"glam",
|
||||
"pollster",
|
||||
"wgpu",
|
||||
"winit",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "PROJECT-NAME-impl"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"PROJECT-NAME",
|
||||
"glam",
|
||||
"pollster",
|
||||
"raw-window-handle",
|
||||
"wgpu",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ab_glyph"
|
||||
version = "0.2.32"
|
||||
|
|
@ -1172,6 +1151,27 @@ dependencies = [
|
|||
"windows-link",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "particle_matter"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"glam",
|
||||
"pollster",
|
||||
"wgpu",
|
||||
"winit",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "particle_matter-impl"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"glam",
|
||||
"particle_matter",
|
||||
"pollster",
|
||||
"raw-window-handle",
|
||||
"wgpu",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "paste"
|
||||
version = "1.0.15"
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
members = ["ui"]
|
||||
|
||||
[package]
|
||||
name = "PROJECT-NAME"
|
||||
name = "particle_matter"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use std::sync::Arc;
|
||||
|
||||
use PROJECT_NAME::{Core, RedrawArgs, init_gpu_inner};
|
||||
use particle_matter::{Core, RedrawArgs, init_gpu_inner};
|
||||
use glam::{uvec2, vec4};
|
||||
use winit::{
|
||||
application::ApplicationHandler,
|
||||
|
|
@ -9,7 +9,7 @@ use winit::{
|
|||
window::Window,
|
||||
};
|
||||
|
||||
const TITLE: &str = "PROJECT NAME";
|
||||
const TITLE: &str = "Particle Matter";
|
||||
|
||||
struct MainWindow {
|
||||
window: Arc<Window>,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
include(impl.cmake)
|
||||
|
||||
qt_add_executable(PROJECT-NAME
|
||||
qt_add_executable(particle_matter
|
||||
src/api.cxx
|
||||
src/main.cxx
|
||||
src/main_window.cxx
|
||||
|
|
@ -8,7 +8,7 @@ qt_add_executable(PROJECT-NAME
|
|||
src/viewport.cxx
|
||||
)
|
||||
|
||||
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_include_directories(PROJECT-NAME PRIVATE src)
|
||||
target_link_libraries(particle_matter PRIVATE Qt6::Gui Qt6::Widgets)
|
||||
target_link_libraries(particle_matter PRIVATE KF6::WidgetsAddons)
|
||||
target_link_libraries(particle_matter PRIVATE particle_matter_impl)
|
||||
target_include_directories(particle_matter PRIVATE src)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
[package]
|
||||
name = "PROJECT-NAME-impl"
|
||||
name = "particle_matter-impl"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
|
|
@ -7,7 +7,7 @@ edition = "2024"
|
|||
crate-type = ["staticlib"]
|
||||
|
||||
[dependencies]
|
||||
PROJECT-NAME = {path = "../"}
|
||||
particle_matter = {path = "../"}
|
||||
|
||||
glam = { version = "0.30" }
|
||||
pollster = "0.4.0"
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
set(impl_basename "${CARGO_TARGET_DIR}/release/libPROJECT_NAME_impl")
|
||||
set(impl_basename "${CARGO_TARGET_DIR}/release/libparticle_matter_impl")
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${impl_basename}.a
|
||||
COMMAND env CARGO_TARGET_DIR=${CARGO_TARGET_DIR} ${CARGO} build --release --package PROJECT-NAME-impl
|
||||
COMMAND env CARGO_TARGET_DIR=${CARGO_TARGET_DIR} ${CARGO} build --release --package particle_matter-impl
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
DEPFILE ${impl_basename}.d
|
||||
USES_TERMINAL
|
||||
|
|
@ -15,8 +15,8 @@ add_custom_target(build_impl
|
|||
DEPENDS ${impl_basename}.a
|
||||
)
|
||||
|
||||
add_library(PROJECT_NAME_impl STATIC IMPORTED)
|
||||
add_library(particle_matter_impl STATIC IMPORTED)
|
||||
|
||||
set_target_properties(PROJECT_NAME_impl PROPERTIES
|
||||
set_target_properties(particle_matter_impl PROPERTIES
|
||||
IMPORTED_LOCATION ${impl_basename}.a
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use std::{ffi::c_void, num::NonZero, ptr::NonNull};
|
||||
|
||||
use PROJECT_NAME::{Core, RedrawArgs, init_gpu_inner};
|
||||
use particle_matter::{Core, RedrawArgs, init_gpu_inner};
|
||||
use glam::{UVec2, uvec2};
|
||||
use raw_window_handle::{RawDisplayHandle, RawWindowHandle, XcbDisplayHandle, XcbWindowHandle};
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ int main(int argc, char* argv[]) {
|
|||
|
||||
QApplication app(argc, argv);
|
||||
|
||||
auto w = new PROJECTNAME;
|
||||
auto w = new ParticleMatter;
|
||||
w->show();
|
||||
|
||||
return app.exec();
|
||||
|
|
|
|||
|
|
@ -2,16 +2,16 @@
|
|||
|
||||
#include "ui_main_window.h"
|
||||
|
||||
PROJECTNAME::PROJECTNAME(QWidget* parent)
|
||||
ParticleMatter::ParticleMatter(QWidget* parent)
|
||||
: QMainWindow(parent),
|
||||
m_ui(new Ui::MainWindow) {
|
||||
m_ui->setupUi(this);
|
||||
updateView();
|
||||
}
|
||||
|
||||
PROJECTNAME::~PROJECTNAME() = default;
|
||||
ParticleMatter::~ParticleMatter() = default;
|
||||
|
||||
void PROJECTNAME::updateView() {
|
||||
void ParticleMatter::updateView() {
|
||||
const auto color = m_ui->inBackground->color();
|
||||
RedrawArgs args{
|
||||
.background = { color.redF(), color.greenF(), color.blueF(), 1.00 },
|
||||
|
|
@ -19,7 +19,7 @@ void PROJECTNAME::updateView() {
|
|||
m_ui->viewport->setView(args);
|
||||
}
|
||||
|
||||
void PROJECTNAME::updateViewIf(bool update) {
|
||||
void ParticleMatter::updateViewIf(bool update) {
|
||||
if (update)
|
||||
updateView();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,12 +7,12 @@ namespace Ui {
|
|||
class MainWindow;
|
||||
}
|
||||
|
||||
class PROJECTNAME : public QMainWindow {
|
||||
class ParticleMatter : public QMainWindow {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit PROJECTNAME(QWidget* parent = nullptr);
|
||||
~PROJECTNAME() override;
|
||||
explicit ParticleMatter(QWidget* parent = nullptr);
|
||||
~ParticleMatter() override;
|
||||
|
||||
public slots:
|
||||
void updateView();
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>PROJECT NAME</string>
|
||||
<string>Particle Matter</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user