phflow.c File Reference

Creates the render- and control-window and runs the main-loop. More...

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <stdarg.h>
#include <string.h>
#include <SDL/SDL.h>
#include <SDL/SDL_image.h>
#include "rendermodes.h"
#include "sketch.h"

Defines

#define SPEED
#define SPEED_FAST
#define SPEED_SLOW
#define VIEW_DIST_ADD
#define FPS_X
#define FPS_Y
#define PRINT_RENDERTIME
#define QUIT_POLL_MACRO
#define updatecrc32(c, crc)
#define updateadl32(c, crc)

Functions

void fputbytes (unsigned long v, long n)
 Put Bytes. Originally written by Ken Silverman http://www.advsys.net/ken.
void pngoutopenfile (char *fnam, long xsiz, long ysiz)
 Open file for png-output. Originally written by Ken Silverman http://www.advsys.net/ken.
void pngoutputpixel (long rgbcol)
 Output pixel to png-file. Originally written by Ken Silverman http://www.advsys.net/ken.
void free_fdo (void)
 Free the flow data object "fdo".
void cleanup (int status, const char *fmt,...)
 Free resources and exit.
void resizeSDLscreen (int new_w, int new_h)
 Resize screen.
void initSDL (int xs, int ys, int bpp, int fullscreen)
 Create SDL-window.
void getinput (void)
 Input-handler.
void gtk_gui_iteration (void)
 One gtk_main()-iteration.
int initapp (int argc, char **argv)
 The application's "heart".

Variables

const char * command_name
int vol_loaded
float ipos [4]
float ifor [4]
float iup [4]
float istr [4]
int rendermode
uint32_t rendermode_toggle
uint32_t faceshade_toggle
uint32_t slice_dir_toggle
uint32_t doubleclick_toggle [2]
uint32_t click_switcher
uint32_t last_mb_up
uint32_t last_mb_dn
uint32_t last_doubleclick
uint32_t tfunc_timeout_response
char double_clicked
uint32_t tfunc_timeout
int refresh
int hiqu_auto
int lobound
int hibound
char txt []
uint32_t digit_bg [12 *16 *8]
int fill_bg
int additional_clears
uint32_t showFPS
int gmx
int gmy
int mgrab_rendersurf
int mgrab_tfuncsurf
int mgrab_rendersurf_rmb
int mgrab_tfuncsurf_rmb
int draw_single_sline
float seedpoint [2]
FILE * pngofil
long pngoxplc
long pngoyplc
long pngoxsiz
long pngoysiz
unsigned long pngocrc
unsigned long pngoadcrc
long crctab32 [256]


Detailed Description

Creates the render- and control-window and runs the main-loop.


Function Documentation

void cleanup int  status,
const char *  fmt,
  ...
 

Free resources and exit.

Is called, whenever an error occurs or the program terminates noramlly.

Parameters:
status The exit-code.
fmt Additional output-message (used e.g. for describing the error that caused the cleanup in more detail).

void getinput void   ) 
 

Input-handler.

Polls the input-devices. Keyboard, Mouse and Window-manager-events are handled here.

void gtk_gui_iteration void   ) 
 

One gtk_main()-iteration.

Instead of calling gtk_main() (which does not return control to the program until termination) each iteration is executed explicitly through this function-call.

int initapp int  argc,
char **  argv
 

The application's "heart".

int main(int argc, char **argv) - "abstraction" This makes it possible to make a "real" Win32 application out of this (so no console-window is opened upon double-click in the explorer! Don't forget to remove /DCONSOLE when compiling the program). Look at w32main.c for details!

Parameters:
argc The ANSI-C argument-count.
argv The ANSI-C argument-vector.
Returns:
Exit code (actually never reached...cleanup() handles all the exits).

void initSDL int  xs,
int  ys,
int  bpp,
int  fullscreen
 

Create SDL-window.

Allocates the necessary buffers for rendering.

Parameters:
xs The SDL-window's width.
ys The SDL-window's height.
bpp The SDL-window's bit-depth.
fullscreen Flag that indicates, if the SDL-window is fullscreen or windowed.

void resizeSDLscreen int  new_w,
int  new_h
 

Resize screen.

Is called, whenever the window-size changes. Reallocates the necessary buffers for rendering.

Parameters:
new_w The new width.
new_h The new height.


Generated on Mon Jan 22 17:35:12 2007 for PHFLOW - Flow Visualizer by  doxygen 1.4.6