Skip to content

Commit 61b4788

Browse files
Removed comments
1 parent c1a2d2b commit 61b4788

File tree

3 files changed

+5
-55
lines changed

3 files changed

+5
-55
lines changed

examples_tests/61.UI/UI_System.cpp

Lines changed: 4 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,6 @@ namespace UI_System
122122
0x00010038
123123
};
124124

125-
//static VkDeviceSize g_BufferMemoryAlignment = 256;
126-
127125
struct State
128126
{
129127
smart_refctd_ptr<ILogicalDevice> device{};
@@ -138,15 +136,13 @@ namespace UI_System
138136
std::vector<smart_refctd_ptr<IGPUBuffer>> vertexBuffers{};
139137
std::vector<smart_refctd_ptr<IGPUBuffer>> indexBuffers{};
140138
bool hasFocus = false;
141-
//Signal<> UIRecordSignal{};
139+
140+
// TODO: Use a signal class instead.//Signal<> UIRecordSignal{};
142141
struct Subscriber {
143142
int id = -1;
144143
std::function<void()> listener = nullptr;
145144
};
146145
std::vector<Subscriber> subscribers{};
147-
148-
// TODO: Mouse and keyboard events
149-
// TODO: Resize events
150146
};
151147

152148
static State* state = nullptr;
@@ -159,30 +155,6 @@ namespace UI_System
159155

160156
//-------------------------------------------------------------------------------------------------
161157

162-
//static void onResize(float screenWidth, float screenHeight)
163-
//{
164-
// ImGuiIO& io = ImGui::GetIO();
165-
// assert(io.Fonts->IsBuilt() && "Font atlas not built! It is generally built by the renderer backend. Missing call to renderer _NewFrame() function? e.g. ImGui_ImplOpenGL3_NewFrame().");
166-
167-
// Setup display size (every frame to accommodate for window resizing)
168-
//int32_t window_width, window_height;
169-
//int32_t drawable_width, drawable_height;
170-
//
171-
//RF::GetDrawableSize(window_width, window_height);
172-
173-
//if (RF::GetWindowFlags() & MSDL::SDL_WINDOW_MINIMIZED)
174-
//{
175-
// window_width = window_height = 0;
176-
//}
177-
178-
//RF::GetDrawableSize(drawable_width, drawable_height);
179-
180-
//io.DisplaySize = ImVec2(screenWidth, screenHeight);
181-
//io.DisplayFramebufferScale = ImVec2(1.0f, 1.0f);
182-
//}
183-
184-
//-------------------------------------------------------------------------------------------------
185-
186158
static smart_refctd_ptr<IGPUDescriptorSetLayout> createDescriptorSetLayout()
187159
{
188160
static constexpr int Count = 1;
@@ -418,6 +390,7 @@ namespace UI_System
418390
void prepareKeyMapForDesktop()
419391
{
420392
ImGuiIO& io = ImGui::GetIO();
393+
// TODO:
421394
// Keyboard mapping. ImGui will use those indices to peek into the io.KeysDown[] array.
422395
//io.KeyMap[ImGuiKey_Tab] = MSDL::SDL_SCANCODE_TAB;
423396
//io.KeyMap[ImGuiKey_LeftArrow] = MSDL::SDL_SCANCODE_LEFT;
@@ -552,19 +525,12 @@ namespace UI_System
552525

553526
updateDescriptorSets();
554527

555-
// TODO: Register to resize event
556-
557-
//onResize(window->getWidth(), window->getHeight());
558528
auto & io = ImGui::GetIO();
559529
io.DisplaySize = ImVec2(window->getWidth(), window->getHeight());
560530
io.DisplayFramebufferScale = ImVec2(1.0f, 1.0f);
561531

562532
state->vertexBuffers.resize(maxFramesInFlight);
563-
state->indexBuffers.resize(maxFramesInFlight);
564-
565-
//smart_refctd_ptr<IWindow::IEventCallback> eventCallback {};
566-
//window->setEventCallback(std::move(eventCallback));
567-
}
533+
state->indexBuffers.resize(maxFramesInFlight);}
568534

569535
//-------------------------------------------------------------------------------------------------
570536

examples_tests/61.UI/UI_System.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,6 @@ namespace UI_System
105105

106106
void TreePop();
107107

108-
//#ifdef __ANDROID__
109-
// void SetAndroidApp(android_app * pApp);
110-
//#endif
111-
112108
}
113109

114110
namespace UI = UI_System;

examples_tests/61.UI/main.cpp

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,7 @@
66
#include <nabla.h>
77

88

9-
//#include <iostream>
10-
//#include <cstdio>
11-
//#include <random>
12-
//
13-
//#include <nabla.h>
14-
//
15-
//#include "../common/Camera.hpp"
169
#include "../common/CommonAPI.h"
17-
//#include "nbl/ext/ScreenShot/ScreenShot.h"
1810

1911
#include "UI_System.hpp"
2012

@@ -135,12 +127,11 @@ class UIApp : public ApplicationBase
135127

136128
UI::Register([]()->void{
137129
UI::BeginWindow("Test window");
138-
//UI::SetWindowSize(1000.0f, 200.0f);
139130
UI::SetNextItemWidth(100);
140131
UI::Text("Hi");
141132
UI::SetNextItemWidth(100);
142133
UI::Button("Button", []()->void {
143-
134+
printf("Button pressed!\n");
144135
});
145136
UI::EndWindow();
146137
});
@@ -265,9 +256,6 @@ class UIApp : public ApplicationBase
265256
nbl::video::IGPUObjectFromAssetConverter::SParams cpu2gpuParams;
266257
nbl::core::smart_refctd_ptr<nbl::video::IUtilities> utilities;
267258

268-
//CommonAPI::InputSystem::ChannelReader<IMouseEventChannel> mouse;
269-
//CommonAPI::InputSystem::ChannelReader<IKeyboardEventChannel> keyboard;
270-
271259
core::smart_refctd_ptr<video::IGPUCommandBuffer> commandBuffers[FRAMES_IN_FLIGHT];
272260
core::smart_refctd_ptr<video::IGPUFence> frameComplete[FRAMES_IN_FLIGHT] = { nullptr };
273261
core::smart_refctd_ptr<video::IGPUSemaphore> imageAcquire[FRAMES_IN_FLIGHT] = { nullptr };

0 commit comments

Comments
 (0)