init
This commit is contained in:
commit
f09192ad3c
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
/build
|
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
[submodule "AronaCore"]
|
||||
path = AronaCore
|
||||
url = http://192.168.1.219:3000/Nanako/AronaCore.git
|
10
Arona/CMakeLists.txt
Normal file
10
Arona/CMakeLists.txt
Normal file
@ -0,0 +1,10 @@
|
||||
project(arona)
|
||||
set(CMAKE_CXX_STANDARD 23)
|
||||
|
||||
set(ALL_FILES "")
|
||||
retrieve_files(ALL_FILES)
|
||||
|
||||
add_executable(${PROJECT_NAME} ${ALL_FILES})
|
||||
|
||||
target_link_libraries(${PROJECT_NAME} arona_core)
|
||||
target_include_directories(${PROJECT_NAME} PRIVATE arona_core)
|
95
Arona/entry/windows/main.cpp
Normal file
95
Arona/entry/windows/main.cpp
Normal file
@ -0,0 +1,95 @@
|
||||
#include "imgui.h"
|
||||
#include "application/application.h"
|
||||
#include "rhi/renderer.h"
|
||||
#include "rhi/texture.h"
|
||||
|
||||
#include "ShaderWriter/ShaderWriterPrerequisites.hpp"
|
||||
#include "ShaderWriter/VertexWriter.hpp"
|
||||
#include "ShaderWriter/CompositeTypes/MixedStructHelper.hpp"
|
||||
#include "ShaderWriter/CompositeTypes/IOStructInstanceHelper.hpp"
|
||||
|
||||
template< sdw::var::Flag FlagT >
|
||||
using PosColStructT = sdw::IOStructInstanceHelperT<FlagT
|
||||
, "PosCol"
|
||||
, sdw::IOStructFieldT< sdw::Vec4, "position", 0u>
|
||||
, sdw::IOStructFieldT< sdw::Vec4, "colour", 1u>>;
|
||||
|
||||
template< sdw::var::Flag FlagT >
|
||||
struct PosColT : public PosColStructT<FlagT>
|
||||
{
|
||||
PosColT(sdw::ShaderWriter& writer, sdw::expr::ExprPtr expr, bool enabled = true) : PosColStructT<FlagT>{ writer, std::move(expr), enabled }
|
||||
{
|
||||
}
|
||||
|
||||
auto position()const { return this->getMember<"position">(); }
|
||||
auto colour()const { return this->getMember<"colour">(); }
|
||||
};
|
||||
|
||||
class arona_application : public application
|
||||
{
|
||||
public:
|
||||
~arona_application() override
|
||||
{
|
||||
delete texture_;
|
||||
}
|
||||
void draw_gui() override
|
||||
{
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
{
|
||||
static float f = 0.0f;
|
||||
static int counter = 0;
|
||||
|
||||
ImGui::Begin("Hello, world!"); // Create a window called "Hello, world!" and append into it.
|
||||
|
||||
ImGui::Text("This is some useful text."); // Display some text (you can use a format strings too)
|
||||
ImGui::Checkbox("Another Window", &show_another_window_);
|
||||
|
||||
ImGui::SliderFloat("float", &f, 0.0f, 1.0f); // Edit 1 float using a slider from 0.0f to 1.0f
|
||||
|
||||
if (ImGui::Button("按钮")) // Buttons return true when clicked (most widgets return true when edited/activated)
|
||||
counter++;
|
||||
ImGui::SameLine();
|
||||
ImGui::Text("counter = %d", counter);
|
||||
|
||||
ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / io.Framerate, io.Framerate);
|
||||
texture_->draw();
|
||||
ImGui::End();
|
||||
}
|
||||
}
|
||||
void init_imgui(ImGuiContext* in_context) override
|
||||
{
|
||||
ImGui::SetCurrentContext(in_context);
|
||||
}
|
||||
|
||||
void post_init()
|
||||
{
|
||||
texture_ = load_texture(R"(\\192.168.1.104\nas\NanakoDisk\可爱二次元\61280855_p9_waifu2x_art_noise2_scale.png)");
|
||||
|
||||
using namespace sdw;
|
||||
VertexWriter writer;
|
||||
writer.implementMainT<PosColT, PosColT>( [&](VertexInT<PosColT> in, VertexOutT<PosColT> out)
|
||||
{
|
||||
out.colour() = in.colour();
|
||||
out.position() = in.position();
|
||||
out.vtx.position = in.position();
|
||||
} );
|
||||
renderer_->compile_shader(&writer);
|
||||
}
|
||||
private:
|
||||
bool show_another_window_ = true;
|
||||
texture* texture_ = nullptr;
|
||||
};
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
arona_application app;
|
||||
window_params params = {};
|
||||
params.title = "Hello World";
|
||||
params.width = 1280;
|
||||
params.height = 720;
|
||||
params.hi_dpi = true;
|
||||
params.resizable = true;
|
||||
app.init(params, argc, argv);
|
||||
app.post_init();
|
||||
return app.run();
|
||||
}
|
1
AronaCore
Submodule
1
AronaCore
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 5b26fa38f2d5dc7f1ad4cdef6c76d977c7b8a15a
|
8
CMakeLists.txt
Normal file
8
CMakeLists.txt
Normal file
@ -0,0 +1,8 @@
|
||||
cmake_minimum_required(VERSION 3.27)
|
||||
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||
|
||||
add_subdirectory(AronaCore)
|
||||
add_subdirectory(Arona)
|
Loading…
x
Reference in New Issue
Block a user