www.delorie.com/gnu/docs/xaos/xaos_19.html   search  
 
Buy GNU books!


An fast realtime interactive fractal zoomer

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.1.2 Other information

Also some additional variables are used to inform ui about driver. All this values can be changed by init functions in case they are unknown before.

textheight,textwidth
width and height of your font
palettestart,paletteend
First and last palette entry, that should be changed. This you should use to avoid changing of entries reserved for window system, text, mouse etc.
maxentries;
Number of allocatable entries. Normally should be palettestart-paletteend
imagetype
defines type of image. Should be one of following values:
UI_C256
clasical 256 color with palette scheme used by most older graphics adapters. You should use it also for staticcolor schemes but they are not supported well in current version.
UI_TRUECOLOR
32bpp truecolor mode
UI_TRUECOLOR24
24bpp truecolor mode.
UI_HICOLOR
16bpp hicolor mode (65536 colors)
UI_REALCOLOR
16bpp realcolor mode (32768 colors)

FOLLOWING PART IS NOT REQUIRED TO MAKE FIRST VERSION OF DRIVER WORKING. so you may skip to REGISTERING DRIVER for first read and return here later.

help
help text. This text is displayed at the end of ui' help. So you can put your copyright there and additional informations about driver.

helpsize
number of lines of help

params
Using this you may define command line options for you driver.

They are defined using params structure like:
 
  static struct params params[]={
    {"-mode",P_NUMBER,&defmode,
      "Select graphics mode(same number as in interactive menu)"},
    {NULL,0,NULL,NULL}  /*this is MUST be last option field*/
  };

every line is one parameters. List ends with {NULL,0,NULL,NULL}. First filed is option name. Second field is type of parameter:

P_SWITCH
no parameter - variable is just set to 1 if option
P_NUMBER
integer number
P_STRING
string
P_FLOAT
floating point number (variable is float)
Third is pointer to variable that is changed if option is set. It is for example int* for P_NUMBER or P_SWITCH and so on.. Last one is help text. Displayed by ui -h

width,height
see FLAGS. May be set to 0.0, 0.0 for the begining

maxwidth,maxheight
see FLAGS. May be set to 0,0 for the begining

FLAGS
This variable says more about your driver. You may start with value 0. But for final version it is recomeded to read following section curefully.

Flags are uppercase constants and should be set by following way:

ASYNC_PALETTE | PALETTE_ROTATION

following switches are supported:

RANDOM_PALETTE_SIZE
random size of palette. This is used in X where palette is shared between programs. By default xaos allocates all available colors up to 256. This is not very nice to other aplications in X. So randomsize causes that just some random number of colors(between 8-256) are allocated. Also when this variable is off XaoS expects that allways same number of colors is available.
UPDATE_AFTER_RESIZE
recalculate and redraw screen even if its size is not changed. In case that resize precodure destruys data in buffers
Palette rotation options:

Palette rotation should be implemented by various ways. You may define following values to let xaos know about features/limitations of your implementetion:

ROTATE_INSIDE_CALCULATION
call rotate routing inside calculation loop too? (vbuff should include incorrect data)
PALETTE_REDISPLAYS
If you rotate_palette function displays buffers(like in truecolor modes. Set this to 1 and ui will handle this more effectivly)

Screen/window size informations

Xaos needs to know exact size of displayed images. This is required for random dot stereograms and also for keeping fractals in their shape (do not make them wide on 640x200 resolution etc.) So minimally one of the following values should be defined. (they are sorted in order I preffer them)

SCREENSIZE
values width/height specifies exact size of screen/window in centimeters
PIXELSIZE
values width/height specifies exact size of one pixel in centimeters This is better for windowed enviroments where window size is often changed
FULLSCREEN
driver runs fullscreen. XaoS automatically uses default screen size (29.0cm x 21.5cm)
RESOLUTION
driver does not know exact screen size. But knows resolution used. (it is in variables width/height) XaoS automatically calculates pixel width using:29.0cm/maxwidth and height: 21.5/maxheight
Of course default width and height can be changed by command line options. You may also use combinations like:
SCREENSIZE | FULLSCREEN
the best for fullscreen drivers
PIXELSIZE | RESOLUTION
the best for windowed drivers
FULLSCREEN
for fullscreen drivers than have no idea about screen size...

do not forget to set width, height, maxwidth, maxheight fields if required.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003