Skip to content

Commit

Permalink
Add buffer to toolbar & minor improvements to UpdateChecker
Browse files Browse the repository at this point in the history
  • Loading branch information
dfranx committed Sep 11, 2019
1 parent 5cb0386 commit 0af050c
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 23 deletions.
17 changes: 13 additions & 4 deletions GUIManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ namespace ed
*/
ImGui::Columns(4);
ImGui::SetColumnWidth(0, (5*(TOOLBAR_HEIGHT) + 5*2*ImGui::GetStyle().FramePadding.x) * Settings::Instance().DPIScale);
ImGui::SetColumnWidth(1, (5*(TOOLBAR_HEIGHT) + 5*2*ImGui::GetStyle().FramePadding.x) * Settings::Instance().DPIScale);
ImGui::SetColumnWidth(1, (6*(TOOLBAR_HEIGHT) + 6*2*ImGui::GetStyle().FramePadding.x) * Settings::Instance().DPIScale);
ImGui::SetColumnWidth(2, (4*(TOOLBAR_HEIGHT) + 4*2*ImGui::GetStyle().FramePadding.x) * Settings::Instance().DPIScale);
ImGui::PushFont(m_iconFontLarge);
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 0));
Expand All @@ -244,7 +244,7 @@ namespace ed
}
m_tooltip("Save project");
ImGui::SameLine();
if (ImGui::Button(UI_ICON_FILE_FILE)) { // EMPTY PROJECT
if (ImGui::Button(UI_ICON_FILE_FILE)) { // EMPTY PROJECT
m_selectedTemplate = "?empty";
m_isNewProjectPopupOpened = true;
}
Expand Down Expand Up @@ -290,6 +290,9 @@ namespace ed
ImGui::SameLine();
if (ImGui::Button(UI_ICON_CUBE)) this->CreateNewCubemap();
m_tooltip("New cubemap");
ImGui::SameLine();
if (ImGui::Button(UI_ICON_FILE_TEXT)) this->CreateNewBuffer();
m_tooltip("New buffer");
ImGui::NextColumn();

if (ImGui::Button(UI_ICON_REFRESH)) { // REBUILD PROJECT
Expand Down Expand Up @@ -793,7 +796,8 @@ namespace ed
ImGui::SetNextWindowSize(ImVec2(270 * Settings::Instance().DPIScale, 150 * Settings::Instance().DPIScale), ImGuiCond_Once);
if (ImGui::BeginPopupModal("About##main_about")) {
ImGui::TextWrapped("(C) 2019 dfranx");
ImGui::TextWrapped("Version 1.0");
ImGui::TextWrapped("Version 1.1.4");
ImGui::TextWrapped("Internal version: %d", UpdateChecker::MyVersion);
ImGui::NewLine();
ImGui::TextWrapped("This app is open sourced: ");
ImGui::SameLine();
Expand Down Expand Up @@ -989,6 +993,7 @@ namespace ed
ImGui::EndPopup();
}

// update notification
if (m_isUpdateNotificationOpened) {
const float DISTANCE = 15.0f;
ImGuiIO& io = ImGui::GetIO();
Expand All @@ -1002,7 +1007,10 @@ namespace ed
ImGui::PushStyleColor(ImGuiCol_Text, windowClr);
if (ImGui::Begin("##updateNotification", &m_isUpdateNotificationOpened, ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoNav))
{
ImGui::Text("A new version of SHADERed is available! Download now!");
if (ImGui::IsWindowHovered())
m_updateNotifyClock.restart();

ImGui::Text("A new version of SHADERed is available!");
ImGui::SameLine();
if (ImGui::Button("UPDATE")) {
#if defined(__APPLE__)
Expand All @@ -1012,6 +1020,7 @@ namespace ed
#elif defined(_WIN32)
ShellExecuteW(NULL, L"open", L"https://github.com/dfranx/SHADERed/releases", NULL, NULL, SW_SHOWNORMAL);
#endif
m_isUpdateNotificationOpened = false;
}
}
ImGui::PopStyleColor(2);
Expand Down
2 changes: 1 addition & 1 deletion Objects/UpdateChecker.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace ed
class UpdateChecker
{
public:
static const int MyVersion = 1;
static const int MyVersion = 2;

UpdateChecker();
~UpdateChecker();
Expand Down
1 change: 0 additions & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ List of features I want to implement:
- "Export as DirectX/OpenGL application" option (.cpp file)
- compute shaders
- render your shader to a video file
- buffers read from file or built using in-app buffer editor
- pixel inspector
- audio shaders
- debugger
Expand Down
4 changes: 2 additions & 2 deletions bin/data/settings.ini
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ gizmosnaptrans=0
gizmosnapscale=0
gizmosnaprota=0
propertypick=1
statusbar=1
statusbar=0
fpslimit=-1
fpslimitwholeapp=0
fpslimitlostfocus=0
Expand All @@ -41,7 +41,7 @@ whitespace=0
highlightline=1
linenumbers=1
horizscroll=1
statusbar=1
statusbar=0
autobrace=1
smartindent=1
insertspace=0
Expand Down
1 change: 1 addition & 0 deletions bin/data/shortcuts.kb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Preview.ToggleStatusbar CTRL SHIFT F3
Preview.Unselect CTRL SHIFT Delete
Project.New CTRL N N
Project.NewAudio CTRL N A
Project.NewBuffer CTRL N B
Project.NewCubeMap CTRL N C
Project.NewRenderTexture CTRL N R
Project.NewShaderPass CTRL N P
Expand Down
30 changes: 15 additions & 15 deletions bin/data/workspace.dat
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,37 @@ Collapsed=0

[Window][Pinned]
Pos=0,469
Size=355,546
Size=287,546
Collapsed=0
DockId=0x00000004,1

[Window][Preview]
Pos=357,22
Size=1493,813
Pos=289,22
Size=1561,813
Collapsed=0
DockId=0x00000014,0

[Window][Output]
Pos=357,837
Size=1493,178
Pos=289,837
Size=1561,178
Collapsed=0
DockId=0x00000006,0

[Window][Objects]
Pos=0,22
Size=355,445
Size=287,445
Collapsed=0
DockId=0x00000003,1

[Window][Pipeline]
Pos=0,22
Size=355,445
Size=287,445
Collapsed=0
DockId=0x00000003,0

[Window][Properties]
Pos=0,469
Size=355,546
Size=287,546
Collapsed=0
DockId=0x00000004,0

Expand All @@ -50,14 +50,14 @@ Size=1170,690
Collapsed=0

[Window][###code_viewVS0]
Pos=357,22
Size=636,560
Pos=289,22
Size=665,560
Collapsed=0
DockId=0x00000009,0

[Window][###code_viewPS0]
Pos=357,584
Size=636,431
Pos=289,22
Size=665,993
Collapsed=0
DockId=0x0000000A,0

Expand Down Expand Up @@ -104,10 +104,10 @@ DockId=0x00000017,0

[Docking][Data]
DockSpace ID=0x160B189F Pos=0,22 Size=1850,993 Split=X
DockNode ID=0x00000001 Parent=0x160B189F SizeRef=355,997 Split=Y SelectedTab=0xC89E3217
DockNode ID=0x00000003 Parent=0x00000001 SizeRef=239,445 SelectedTab=0x7DA7F56F
DockNode ID=0x00000001 Parent=0x160B189F SizeRef=287,997 Split=Y SelectedTab=0xC89E3217
DockNode ID=0x00000003 Parent=0x00000001 SizeRef=239,445 SelectedTab=0x848ABB8F
DockNode ID=0x00000004 Parent=0x00000001 SizeRef=239,546 SelectedTab=0xC89E3217
DockNode ID=0x00000002 Parent=0x160B189F SizeRef=1493,997 Split=X
DockNode ID=0x00000002 Parent=0x160B189F SizeRef=1561,997 Split=X
DockNode ID=0x00000007 Parent=0x00000002 SizeRef=636,915 Split=Y SelectedTab=0xF34EBBA5
DockNode ID=0x00000009 Parent=0x00000007 SizeRef=399,561 SelectedTab=0xF7C3C717
DockNode ID=0x0000000A Parent=0x00000007 SizeRef=399,432 SelectedTab=0xF34EBBA5
Expand Down

0 comments on commit 0af050c

Please sign in to comment.