Fixed minimum cmake version, added licence headers and formatted example + xoverlay

This commit is contained in:
Rebekah 2022-04-04 16:42:29 -04:00
parent 289cba707a
commit c05ca050e7
Signed by: oneechanhax
GPG Key ID: 183EB7902964DAE5
3 changed files with 67 additions and 40 deletions

View File

@ -16,7 +16,7 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# libpdraw
cmake_minimum_required (VERSION 3.0.2)
cmake_minimum_required (VERSION 3.20)
project (libpdraw VERSION 1.0.0 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)

View File

@ -1,12 +1,30 @@
/*
* Libpdraw: A Versitile GUI for use with a primitive drawing system!
* Copyright (C) 2022 Rebekah Rowe
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include <iostream>
#include <embed_resources.hpp>
#include "lib/xoverlay.h"
#include "libpdraw/gui/gui.hpp"
#include <embed_resources.hpp>
#include <glez/detail/render.hpp>
#include <glez/draw.hpp>
#include <glez/glez.hpp>
#include <glez/detail/render.hpp>
#include "libpdraw/gui/gui.hpp"
// xorg conflict
#undef RootWindow
@ -14,18 +32,18 @@
#include "libpdraw/gui/widgets/slider.hpp"
#include "libpdraw/gui/widgets/titlebar.hpp"
//#include "gui/csplitcontainer.hpp"
#include "libpdraw/gui/widgets/textinput.hpp"
#include "libpdraw/gui/canvas.hpp"
#include "libpdraw/gui/widgets/basebutton.hpp"
#include "libpdraw/gui/widgets/basewindow.hpp"
#include "libpdraw/gui/widgets/checkbox.hpp"
#include "libpdraw/gui/widgets/dropdown.hpp"
#include "libpdraw/gui/widgets/keyinput.hpp"
#include "libpdraw/gui/widgets/basebutton.hpp"
#include "libpdraw/gui/widgets/checkbox.hpp"
#include "libpdraw/gui/widgets/basewindow.hpp"
#include "libpdraw/gui/widgets/textinput.hpp"
#include "libpdraw/gui/listmenu/list.hpp"
#include "libpdraw/gui/listmenu/itemvariable.hpp"
#include "libpdraw/gui/listmenu/itemsublist.hpp"
#include "libpdraw/gui/listmenu/itemtitle.hpp"
#include "libpdraw/gui/listmenu/itemvariable.hpp"
#include "libpdraw/gui/listmenu/list.hpp"
#include "libpdraw/gui/tabbedmenu/cvarcontainer.hpp"
#include "libpdraw/gui/tabbedmenu/menucontainer.hpp"
#include "libpdraw/gui/tabbedmenu/menuwindow.hpp"
@ -36,7 +54,8 @@ static ui::Var<int> text({"nonya"}, "Editable Text", 1);
class TestWindow : public CBaseWindow {
public:
TestWindow() : CBaseWindow("root_test", nullptr) {
TestWindow()
: CBaseWindow("root_test", nullptr) {
Props()->SetBool("always_visible", false);
Props()->SetBool("hover", false);
SetMaxSize(1270, 1000);
@ -77,9 +96,6 @@ public:
auto key_input = new CKeyInput("key_input");
key_input->SetSize(78, 10);
AddChild(key_input);
}
virtual void Update() override {
this->CBaseWindow::Update();
@ -129,7 +145,6 @@ int main() {
glez::end();
xoverlay_draw_end();
}
auto test_window = new TestWindow();
@ -145,7 +160,6 @@ int main() {
list_menu->Show();
g_pGUI->m_pRootWindow->AddChild(list_menu);
auto* tabbedmenu = new CMenuWindow("menu_window", g_pGUI->m_pRootWindow);
tabbedmenu->SetMaxSize(912, 410);
@ -167,7 +181,8 @@ int main() {
input::RefreshInput();
// Must be called in that order.
xoverlay_draw_begin();
glez::begin(); {
glez::begin();
{
// glez::draw::rect(100, 300, 200, 100, glez::rgba(255, 0, 128));
// auto mouse = input::GetMouse();
@ -186,7 +201,8 @@ int main() {
} else if (!pressed) {
click = false;
}*/
} glez::end();
}
glez::end();
xoverlay_draw_end();
}
return 0;

View File

@ -1,8 +1,19 @@
/*
* overlay.hpp
* Copyright (C) 2017 nullifiedcat
*
* Created on: Nov 8, 2017
* Author: nullifiedcat
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#pragma once