Qt: Initial shader editor support

This commit is contained in:
wheremyfoodat 2024-07-14 15:32:26 +03:00
parent e608436315
commit d87477832b
9 changed files with 130 additions and 24 deletions

View file

@ -0,0 +1,28 @@
#pragma once
#include <QApplication>
#include <QDialog>
#include <QWidget>
#include <string>
#include "zep.h"
#include "zep/mode_repl.h"
#include "zep/regress.h"
class ShaderEditorWindow : public QDialog {
Q_OBJECT
private:
Zep::ZepWidget_Qt zepWidget;
Zep::IZepReplProvider replProvider;
static constexpr float fontSize = 14.0f;
// Whether this backend supports shader editor
bool shaderEditorSupported = true;
public:
ShaderEditorWindow(QWidget* parent, const std::string& filename, const std::string& initialText);
void setText(const std::string& text) { zepWidget.GetEditor().GetMRUBuffer()->SetText(text); }
void setEnable(bool enable);
};