#ifdef G_OS_WIN32 #define WIN32_LEAN_AND_MEAN 1 #include #endif #include #include #include "funcs.h" #include "fluids.h" #include "palette.h" #include "renderer_gl.h" #include "glyphs.h" static int glyphs_render = FALSE; static int glyphs_num_colors = PALETTE_MAXCOLORS; static int glyphs_colormap = PALETTE_BLACKWHITE; static int glyphs_sort = GLYPH_LINES; static int glyphs_dataset_color = DATASET_RHO; static int glyphs_dataset_direction = DATASET_RHO; static float glyphs_alpha = 1.0f; static fftw_real *glyphs_frame_color; struct fftw_real_xy glyphs_frame_direction; void glyphs_set_render(int render_glyphs) { glyphs_render = render_glyphs; } int glyphs_get_render(void) { return glyphs_render; } void glyphs_set_num_colors(int num_colors) { glyphs_num_colors = num_colors; } int glyphs_get_num_colors(void) { return glyphs_num_colors; } void glyphs_set_colormap(int colormap) { glyphs_colormap = colormap; } int glyphs_get_colormap(void) { return glyphs_colormap; } void glyphs_set_alpha(float alpha) { glyphs_alpha = alpha; } float glyphs_get_alpha(void) { return glyphs_alpha; } void glyphs_set_dataset_color(int dataset) { glyphs_dataset_color = dataset; } int glyphs_get_dataset_color(void) { return glyphs_dataset_color; } void glyphs_set_dataset_direction(int dataset) { glyphs_dataset_direction = dataset; } int glyphs_get_dataset_direction(void) { return glyphs_dataset_direction; } void glyphs_set_sort(int sort) { glyphs_sort = sort; switch (glyphs_sort) { case GLYPH_ARROWS: renderer_load_bmp_texture("arrow.bmp"); break; case GLYPH_QUAKE: renderer_load_raw_texture("quake.raw"); break; default: break; } } int glyphs_get_sort(void) { return glyphs_sort; } void glyphs_set_frame_color(fftw_real *frame) { glyphs_frame_color = frame; } fftw_real *glyphs_get_frame_color(void) { return glyphs_frame_color; } void glyphs_set_frames_direction(struct fftw_real_xy frame) { glyphs_frame_direction = frame; } struct fftw_real_xy glyphs_get_frames_direction(void) { return glyphs_frame_direction; } struct color4f glyphs_get_color(float value) { struct color4f return_value; return_value = set_palette(glyphs_colormap, value, glyphs_num_colors); return_value.a = glyphs_alpha; return return_value; }