summaryrefslogtreecommitdiffstats
path: root/Smoke/streamlines.c
diff options
context:
space:
mode:
authorOliver Schinagl <oliver@schinagl.nl>2007-12-18 18:24:04 (GMT)
committerOliver Schinagl <oliver@schinagl.nl>2007-12-18 18:24:04 (GMT)
commitc287b3f591fe3e10dceedfd90a5ce71b2c703988 (patch)
tree98a1fe82d85e97199b099a720e9784064f8430b9 /Smoke/streamlines.c
parent9363bc6887a7ffb9ea6c0f6a63a93c215e227502 (diff)
download2iv35-c287b3f591fe3e10dceedfd90a5ce71b2c703988.zip
2iv35-c287b3f591fe3e10dceedfd90a5ce71b2c703988.tar.gz
2iv35-c287b3f591fe3e10dceedfd90a5ce71b2c703988.tar.bz2
More cleaning up, seperating modules etc
Diffstat (limited to 'Smoke/streamlines.c')
-rw-r--r--Smoke/streamlines.c88
1 files changed, 46 insertions, 42 deletions
diff --git a/Smoke/streamlines.c b/Smoke/streamlines.c
index fb580fc..59f9b33 100644
--- a/Smoke/streamlines.c
+++ b/Smoke/streamlines.c
@@ -1,43 +1,47 @@
-// Includes
-
-#ifdef G_OS_WIN32
-#define WIN32_LEAN_AND_MEAN 1
-#include <windows.h>
-#endif
-
-#include "fluids.h"
-#include "streamlines.h"
-#include "seedpoint.h"
-#include "funcs.h"
-
-void render_streamlines(void)
-{
- int i, j, k, l, idx;
- float v;
- struct point p;
- int *frame_history;
- fftw_real cell_x, cell_y;
-
- i = j = k = l = 0;
-
- for (i = 0; i < get_cur_seedpoint(); i++)
- {
- p = get_seedpoint(i);
-
- while (j < DIM)
- {
- frame_history = frame_hist[j];
-
+// Includes
+
+#ifdef G_OS_WIN32
+#define WIN32_LEAN_AND_MEAN 1
+#include <windows.h>
+#endif
+
+#include <rfftw.h>
+#include <GL/gl.h>
+#include <GL/glu.h>
+
+#include "fluids.h"
+#include "streamlines.h"
+#include "seedpoint.h"
+#include "funcs.h"
+
+void render_streamlines(void)
+{
+ int i, j, k, l, idx;
+ float v;
+ struct point p;
+ int *frame_history;
+ fftw_real cell_x, cell_y;
+
+ i = j = k = l = 0;
+
+ for (i = 0; i < get_cur_seedpoint(); i++)
+ {
+ p = get_seedpoint(i);
+
+ while (j < DIM)
+ {
+ frame_history = frame_hist[j];
+
cell_x = (fftw_real)winWidth / (fftw_real)(DIM + 1); // Grid cell width
- cell_y = (fftw_real)winHeight / (fftw_real)(DIM + 1); // Grid cell heigh
-
- cell_x = round(p.x / cell_x);
- cell_y = round(p.y / cell_y);
-
- idx = cell_x + (cell_y * DIM) + (j * DIM * DIM);
- //v = frame_history[idx];
-
- j++;
- }
- }
-}
+ cell_y = (fftw_real)winHeight / (fftw_real)(DIM + 1); // Grid cell heigh
+
+ cell_x = round(p.x / cell_x);
+ cell_y = round(p.y / cell_y);
+
+ idx = cell_x + (cell_y * DIM) + (j * DIM * DIM);
+ //v = frame_history[idx];
+
+ j++;
+ }
+ }
+}