--- /dev/null
+<RCC>
+ <qresource prefix="gl/">
+ <file>mesh.frag</file>
+ <file>mesh.vert</file>
+ <file>quad.frag</file>
+ <file>quad.vert</file>
+ </qresource>
+</RCC>
--- /dev/null
+#version 120
+
+varying vec3 ec_pos;
+
+void main() {
+ vec3 base3 = vec3(0.99, 0.96, 0.89);
+ vec3 base2 = vec3(0.92, 0.91, 0.83);
+ vec3 base00 = vec3(0.40, 0.48, 0.51);
+ vec3 ec_normal = normalize(cross(dFdx(ec_pos), dFdy(ec_pos)));
+ float a = dot(ec_normal, vec3(0.0, 0.0, 1.0));
+ float b = dot(ec_normal, vec3(-0.57, -0.57, 0.57));
+
+ gl_FragColor = vec4((a*base2 + (1-a)*base00)*0.5 +
+ (b*base3 + (1-b)*base00)*0.5, 1.0);
+}
--- /dev/null
+#version 120
+attribute vec3 vertex_position;
+
+uniform mat4 transform_matrix;
+uniform mat4 view_matrix;
+
+varying vec3 ec_pos;
+
+void main() {
+ gl_Position = view_matrix*transform_matrix*
+ vec4(vertex_position, 1.0);
+ ec_pos = gl_Position.xyz;
+}
--- /dev/null
+#version 120
+
+varying vec3 frag_color;
+
+void main() {
+ gl_FragColor = vec4(frag_color, 1.0);
+}
--- /dev/null
+#version 120
+attribute vec2 vertex_position;
+attribute vec3 vertex_color;
+
+varying vec3 frag_color;
+
+void main() {
+ gl_Position = vec4(vertex_position, 0.9, 1.0);
+ frag_color = vertex_color;
+}
--- /dev/null
+QT += core gui opengl widgets
+
+TARGET = fstl
+TEMPLATE = app
+
+SOURCES += \
+ ../src/main.cpp\
+ ../src/canvas.cpp \
+ ../src/mesh.cpp \
+ ../src/glmesh.cpp \
+ ../src/loader.cpp \
+ ../src/window.cpp \
+ ../src/backdrop.cpp
+
+HEADERS += \
+ ../src/canvas.h \
+ ../src/mesh.h \
+ ../src/glmesh.h \
+ ../src/loader.h \
+ ../src/window.h \
+ ../src/backdrop.h
+
+CONFIG += c++11
+
+RESOURCES += \
+ qt.qrc \
+ ../gl/gl.qrc
+
+QMAKE_INFO_PLIST = ../misc/Info.plist
+
+ICON = ../misc/fstl.icns
--- /dev/null
+<RCC>
+ <qresource prefix="qt/">
+ <file>style.qss</file>
+ </qresource>
+</RCC>
--- /dev/null
+QWidget {
+ background-color: #fdf6e3;
+ color: #839496;
+}
+
+QPushButton {
+ background-color: #eee8d5;
+ border-top-width: 5px;
+ border-bottom-width: 5px;
+ border-left-width: 30px;
+ border-right-width: 30px;
+ border-style: flat;
+ margin: 0px;
+ color: #839496;
+}
+
+QPushButton:pressed {
+ background-color: #ddd7d4;
+}
+++ /dev/null
-QT += core gui opengl widgets
-
-TARGET = fstl
-TEMPLATE = app
-
-SOURCES += \
- main.cpp\
- canvas.cpp \
- mesh.cpp \
- glmesh.cpp \
- loader.cpp \
- window.cpp \
- backdrop.cpp
-
-HEADERS += \
- canvas.h \
- mesh.h \
- glmesh.h \
- loader.h \
- window.h \
- backdrop.h
-
-CONFIG += c++11
-
-RESOURCES += \
- resources.qrc
-
-QMAKE_INFO_PLIST = ../misc/Info.plist
-
-ICON = ../misc/fstl.icns
+++ /dev/null
-#version 120
-
-varying vec3 ec_pos;
-
-void main() {
- vec3 base3 = vec3(0.99, 0.96, 0.89);
- vec3 base2 = vec3(0.92, 0.91, 0.83);
- vec3 base00 = vec3(0.40, 0.48, 0.51);
- vec3 ec_normal = normalize(cross(dFdx(ec_pos), dFdy(ec_pos)));
- float a = dot(ec_normal, vec3(0.0, 0.0, 1.0));
- float b = dot(ec_normal, vec3(-0.57, -0.57, 0.57));
-
- gl_FragColor = vec4((a*base2 + (1-a)*base00)*0.5 +
- (b*base3 + (1-b)*base00)*0.5, 1.0);
-}
+++ /dev/null
-#version 120
-attribute vec3 vertex_position;
-
-uniform mat4 transform_matrix;
-uniform mat4 view_matrix;
-
-varying vec3 ec_pos;
-
-void main() {
- gl_Position = view_matrix*transform_matrix*
- vec4(vertex_position, 1.0);
- ec_pos = gl_Position.xyz;
-}
+++ /dev/null
-#version 120
-
-varying vec3 frag_color;
-
-void main() {
- gl_FragColor = vec4(frag_color, 1.0);
-}
+++ /dev/null
-#version 120
-attribute vec2 vertex_position;
-attribute vec3 vertex_color;
-
-varying vec3 frag_color;
-
-void main() {
- gl_Position = vec4(vertex_position, 0.9, 1.0);
- frag_color = vertex_color;
-}
+++ /dev/null
-<RCC>
- <qresource prefix="/">
- <file>gl/mesh.frag</file>
- <file>gl/mesh.vert</file>
- <file>gl/quad.frag</file>
- <file>gl/quad.vert</file>
- <file>style.qss</file>
- </qresource>
-</RCC>
+++ /dev/null
-QWidget {
- background-color: #fdf6e3;
- color: #839496;
-}
-
-QPushButton {
- background-color: #eee8d5;
- border-top-width: 5px;
- border-bottom-width: 5px;
- border-left-width: 30px;
- border-right-width: 30px;
- border-style: flat;
- margin: 0px;
- color: #839496;
-}
-
-QPushButton:pressed {
- background-color: #ddd7d4;
-}
{
setWindowTitle("fstl");
- QFile styleFile( ":/style.qss" );
+ QFile styleFile( ":/qt/style.qss" );
styleFile.open( QFile::ReadOnly );
setStyleSheet(styleFile.readAll());