Factor out more resources.

+ Use QOpenGLShader to get compiled shader code in TreeView.
+ Remove last remaining Qt resources dependency in libqtk.
+ shaders.h in libqtk to define default GLSL shader programs.
This commit is contained in:
2025-03-16 20:06:27 -04:00
parent f7b807d3a5
commit 51643c4019
25 changed files with 256 additions and 144 deletions

View File

@@ -26,7 +26,17 @@ else()
)
endif()
if(QTK_GUI_SCENE)
qt6_add_big_resources(QTK_GUI_SOURCES "${QTK_RESOURCES}/resources.qrc")
else()
qt6_add_big_resources(
QTK_GUI_SOURCES
"${QTK_RESOURCES}/minimal_resources.qrc"
)
endif()
qt_add_executable(qtk_gui ${QTK_GUI_SOURCES})
target_link_libraries(qtk_gui PRIVATE qtk_plugin_library)
if (QTK_GUI_SCENE)

View File

@@ -10,17 +10,9 @@
#include "qtkmainwindow.h"
#ifdef QTK_GUI_SCENE
#include "qtkscene.h"
using AppScene = QtkScene;
#else
using AppScene = EmptyScene;
#endif
int main(int argc, char * argv[])
{
Q_INIT_RESOURCE(resources);
initResources();
QApplication a(argc, argv);
auto window = MainWindow::getMainWindow();

View File

@@ -16,6 +16,21 @@
#include "designer-plugins/debugconsole.h"
#ifdef QTK_GUI_SCENE
#include "qtkscene.h"
using AppScene = QtkScene;
inline void initResources()
{
Q_INIT_RESOURCE(resources);
}
#else
using AppScene = EmptyScene;
inline void initResources()
{
Q_INIT_RESOURCE(minimal_resources);
}
#endif
namespace Ui
{
class MainWindow;

View File

@@ -42,8 +42,8 @@ void QtkScene::init()
// Clone qtk-resources if it doesn't already exist.
QDir repoDir("resources/");
if (!repoDir.exists()) {
qDebug() << "Cloning qtk-resources repository to '"
<< repoDir.absolutePath() << "'...";
qDebug() << "Cloning qtk-resources repository to " << repoDir.absolutePath()
<< "...";
// Run git clone
QProcess gitProcess;