| 1 | /* |
| 2 | # 076 License |
| 3 | |
| 4 | Copyright (c) 076 Studio LLC |
| 5 | |
| 6 | Permission is hereby granted to any person obtaining a copy of the software |
| 7 | Shader Playground (the "Software") to use, modify, merge, copy, publish, distribute, |
| 8 | sublicense, and/or sell copies of the Software, subject to the following conditions: |
| 9 | |
| 10 | 1. **Origin Attribution**: |
| 11 | - You must not misrepresent the origin of the Software; you must not claim |
| 12 | you created the original Software. |
| 13 | - If the Software is used in a product, you must either: |
| 14 | a. Provide clear attribution in the product's documentation, user interface, |
| 15 | or other visible areas, **OR** |
| 16 | b. Pay the original developers a fee they specify in writing. |
| 17 | 2. **Usage Restriction**: |
| 18 | - The Software, or any derivative works, dependencies, or libraries |
| 19 | incorporating it, must not be used for censorship or to suppress freedom of |
| 20 | speech, expression, or creativity. Prohibited uses include, but are not |
| 21 | limited to: |
| 22 | - Censorship of so-called "hate speech", visuals, non-mainstream opinions, |
| 23 | ideas, or objective reality. |
| 24 | - Tools or systems designed to restrict access to information or |
| 25 | artistic works. |
| 26 | 3. **Notice Preservation**: |
| 27 | - This license and the above copyright notice must remain intact in all copies |
| 28 | of the source code. |
| 29 | |
| 30 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, |
| 31 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A |
| 32 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
| 33 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF |
| 34 | CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE |
| 35 | OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 36 | */ |
| 37 | #pragma once |
| 38 | |
| 39 | #include <util/glfwpp.hh> |
| 40 | #include <util/vector.hh> |
| 41 | #include <version.hh> |
| 42 | #include <functional> |
| 43 | #include <string> |
| 44 | #include <cstdint> |
| 45 | #include <database/shaderdata.hh> |
| 46 | #include <TextEditor.h> |
| 47 | |
| 48 | namespace gui { |
| 49 | class ConsoleLog; |
| 50 | } // namespace gui |
| 51 | |
| 52 | namespace db { |
| 53 | class Locale; |
| 54 | struct CodeData; |
| 55 | } // namespace db |
| 56 | |
| 57 | struct Info { |
| 58 | glfwpp::Instance *instance; |
| 59 | glfwpp::Window *window; |
| 60 | |
| 61 | bool isRunning = true; |
| 62 | bool isAbout = false; |
| 63 | bool isManual = false; |
| 64 | bool isSettings = false; |
| 65 | bool isLangChange = false; |
| 66 | |
| 67 | bool showNewShaderPopup = false; |
| 68 | bool showOpenShaderPopup = false; |
| 69 | bool showSaveAsShaderPopup = false; |
| 70 | bool viewportFocused = false; |
| 71 | bool editorFocused = false; |
| 72 | bool pendingCompile = false; |
| 73 | |
| 74 | std::string version = version::full; |
| 75 | uint32_t shaderId = 0; |
| 76 | std::string shaderName = ""; |
| 77 | db::CodeData VERT = {}; |
| 78 | db::CodeData FRAG = {}; |
| 79 | db::CodeData LUA = {}; |
| 80 | std::string currentFile = ""; |
| 81 | Vector4 sceneClearColor = {}; |
| 82 | vector<TextEditor *> textEditors; |
| 83 | TextEditor *activeEditor; |
| 84 | |
| 85 | gui::ConsoleLog *cmd; |
| 86 | db::Locale *i18n; |
| 87 | |
| 88 | std::function<void()> compile; |
| 89 | std::function<void()> save; |
| 90 | std::function<void()> create; |
| 91 | std::function<void()> open; |
| 92 | std::function<void()> saveAs; |
| 93 | }; |