refactored imgui in core, applayer working and drawing with imgui
This commit is contained in:
@@ -1 +1,19 @@
|
|||||||
#include "AppLayer.h"
|
#include "AppLayer.h"
|
||||||
|
#include "Application.h"
|
||||||
|
#include "Layer.h"
|
||||||
|
#include "imgui.h"
|
||||||
|
|
||||||
|
AppLayer::AppLayer() : Layer("AppLayer", true) {}
|
||||||
|
|
||||||
|
void AppLayer::OnImGuiRender() {
|
||||||
|
ImGuiIO &io = ImGui::GetIO();
|
||||||
|
bool demoWindow = true;
|
||||||
|
ImGui::Begin("Framerate");
|
||||||
|
ImGui::ShowDemoWindow(&demoWindow);
|
||||||
|
ImGui::Text("Application avg %.3f ms/frame (%.1f FPS)", 1000.0f / io.Framerate, io.Framerate);
|
||||||
|
|
||||||
|
if (ImGui::Button("Quit")) {
|
||||||
|
Application::Get().SetRunningState(false);
|
||||||
|
}
|
||||||
|
ImGui::End();
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
#include "Layer.h"
|
#include "Layer.h"
|
||||||
|
|
||||||
class AppLayer : SakuraVNE::Layer {
|
class AppLayer : public SakuraVNE::Layer {
|
||||||
|
public:
|
||||||
AppLayer();
|
AppLayer();
|
||||||
virtual ~AppLayer();
|
virtual ~AppLayer() = default;
|
||||||
|
virtual void OnImGuiRender() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// bool OnMouseButtonPressed(Core::MouseButtonPressedEvent &event);
|
// bool OnMouseButtonPressed(Core::MouseButtonPressedEvent &event);
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#include "AppLayer.h"
|
||||||
#include "Application.h"
|
#include "Application.h"
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
@@ -8,7 +9,7 @@ int main(int argc, char *argv[]) {
|
|||||||
appData.windowdata.height = 720;
|
appData.windowdata.height = 720;
|
||||||
|
|
||||||
Application app(appData);
|
Application app(appData);
|
||||||
// app.PushLayer<AppLayer>();
|
app.PushLayer<AppLayer>();
|
||||||
app.Run();
|
app.Run();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Submodule libs/SakuraCore updated: da3ad2ed61...d58ddf6c35
Reference in New Issue
Block a user