phdvr.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 "rendermodes.h"
#include "sketch.h"
#include "macros_isoval.h"
#include "font12x16.h"

Data Structures

struct  tiletype

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 signprint (int x0, int y0, const char *str, unsigned int color, int dstw, unsigned int *dstmem)
 Print text to screen. Print 12x16 sized font. The font-set and the code for displaying it were created by Ken Silverman and/or Tom Dobrowolski http://www.advsys.net/ken and http://ged.ax.pl/~tomkh.
void fputbytes (unsigned long v, long n)
 Put Bytes.
void pngoutopenfile (char *fnam, long xsiz, long ysiz)
 Open file for png-output.
void pngoutputpixel (long rgbcol)
 Output pixel to png-file.
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
tiletype dd
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.

void signprint int  x0,
int  y0,
const char *  str,
unsigned int  color,
int  dstw,
unsigned int *  dstmem
 

Print text to screen. Print 12x16 sized font. The font-set and the code for displaying it were created by Ken Silverman and/or Tom Dobrowolski http://www.advsys.net/ken and http://ged.ax.pl/~tomkh.

Parameters:
x0 x screen-coordinate for text-start.
y0 y screen-coordinate for text-start.
str The text to print.
color The color in which to print the text.
dstw The destination surface's width.
dstmem Pointer to the destination surface.


Generated on Wed Dec 13 08:40:13 2006 for PHDVR - Direct Volume Renderer by  doxygen 1.4.6