]> git.sur5r.net Git - fstl/commitdiff
Big reorganization
authorMatt Keeter <matt.j.keeter@gmail.com>
Thu, 13 Mar 2014 13:17:51 +0000 (06:17 -0700)
committerMatt Keeter <matt.j.keeter@gmail.com>
Thu, 13 Mar 2014 13:17:51 +0000 (06:17 -0700)
16 files changed:
gl/gl.qrc [new file with mode: 0644]
gl/mesh.frag [new file with mode: 0644]
gl/mesh.vert [new file with mode: 0644]
gl/quad.frag [new file with mode: 0644]
gl/quad.vert [new file with mode: 0644]
qt/fstl.pro [new file with mode: 0644]
qt/qt.qrc [new file with mode: 0644]
qt/style.qss [new file with mode: 0644]
src/fstl.pro [deleted file]
src/gl/mesh.frag [deleted file]
src/gl/mesh.vert [deleted file]
src/gl/quad.frag [deleted file]
src/gl/quad.vert [deleted file]
src/resources.qrc [deleted file]
src/style.qss [deleted file]
src/window.cpp

diff --git a/gl/gl.qrc b/gl/gl.qrc
new file mode 100644 (file)
index 0000000..38d525c
--- /dev/null
+++ b/gl/gl.qrc
@@ -0,0 +1,8 @@
+<RCC>
+    <qresource prefix="gl/">
+        <file>mesh.frag</file>
+        <file>mesh.vert</file>
+        <file>quad.frag</file>
+        <file>quad.vert</file>
+    </qresource>
+</RCC>
diff --git a/gl/mesh.frag b/gl/mesh.frag
new file mode 100644 (file)
index 0000000..5949025
--- /dev/null
@@ -0,0 +1,15 @@
+#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);
+}
diff --git a/gl/mesh.vert b/gl/mesh.vert
new file mode 100644 (file)
index 0000000..e60e76b
--- /dev/null
@@ -0,0 +1,13 @@
+#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;
+}
diff --git a/gl/quad.frag b/gl/quad.frag
new file mode 100644 (file)
index 0000000..1c02e1b
--- /dev/null
@@ -0,0 +1,7 @@
+#version 120
+
+varying vec3 frag_color;
+
+void main() {
+    gl_FragColor = vec4(frag_color, 1.0);
+}
diff --git a/gl/quad.vert b/gl/quad.vert
new file mode 100644 (file)
index 0000000..6698297
--- /dev/null
@@ -0,0 +1,10 @@
+#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;
+}
diff --git a/qt/fstl.pro b/qt/fstl.pro
new file mode 100644 (file)
index 0000000..74cab3b
--- /dev/null
@@ -0,0 +1,31 @@
+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
diff --git a/qt/qt.qrc b/qt/qt.qrc
new file mode 100644 (file)
index 0000000..883ac14
--- /dev/null
+++ b/qt/qt.qrc
@@ -0,0 +1,5 @@
+<RCC>
+    <qresource prefix="qt/">
+        <file>style.qss</file>
+    </qresource>
+</RCC>
diff --git a/qt/style.qss b/qt/style.qss
new file mode 100644 (file)
index 0000000..36eeee4
--- /dev/null
@@ -0,0 +1,19 @@
+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;
+}
diff --git a/src/fstl.pro b/src/fstl.pro
deleted file mode 100644 (file)
index 8729f8c..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-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
diff --git a/src/gl/mesh.frag b/src/gl/mesh.frag
deleted file mode 100644 (file)
index 5949025..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#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);
-}
diff --git a/src/gl/mesh.vert b/src/gl/mesh.vert
deleted file mode 100644 (file)
index e60e76b..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#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;
-}
diff --git a/src/gl/quad.frag b/src/gl/quad.frag
deleted file mode 100644 (file)
index 1c02e1b..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#version 120
-
-varying vec3 frag_color;
-
-void main() {
-    gl_FragColor = vec4(frag_color, 1.0);
-}
diff --git a/src/gl/quad.vert b/src/gl/quad.vert
deleted file mode 100644 (file)
index 6698297..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#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;
-}
diff --git a/src/resources.qrc b/src/resources.qrc
deleted file mode 100644 (file)
index a88f834..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-<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>
diff --git a/src/style.qss b/src/style.qss
deleted file mode 100644 (file)
index 36eeee4..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-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;
-}
index 13d3583b3a58121133ce625cd526282991c3e4e9..f3a7438291d07d88d4282e4e95c33695192e3d3b 100644 (file)
@@ -11,7 +11,7 @@ Window::Window(QWidget *parent) :
 {
     setWindowTitle("fstl");
 
-    QFile styleFile( ":/style.qss" );
+    QFile styleFile( ":/qt/style.qss" );
     styleFile.open( QFile::ReadOnly );
     setStyleSheet(styleFile.readAll());