Nilorea Library

- Main Page
- Modules
- Data Structures
- Files

All Data Structures Files Functions Variables Typedefs Macros Groups
Macros | Functions
GFX: graphic mode utilities

## Macros

#define | MODE_OGL 1
#define | MODE_DX 2

## Functions

int | gfx_status (int ACTION, int value)
| status of opengl & or directx More...
int | gfx_mode (int card, int W, int H, int VW, int VH, int depth, float r, float g, float b, float alpha)
| init and make a clear of the grafic screen More...
int | Force32BitBmpToAlpha (BITMAP *bmp)
| Force if already not a 32bpp bmp to be the same with an alpha channel. More...
void | force_color_to_be (BITMAP *bmp, int oldcolor, int newcolor)
| Change all the bmp pixel of the same color src to color dst. More...
void | ogl_blit (GLuint mytexture, int x, int y, int r, int g, int b, int alpha, int w, int h, int mode)
| Draw a given texture to the screen at position x,y and of size w,h. More...

## Detailed Description

## Macro Definition Documentation

#define MODE_DX 2

DirectX mode flag for grafic_status

Definition at line 31 of file n_gfx.h.

#define MODE_OGL 1

OpenGL mode flag for grafic_status

Definition at line 29 of file n_gfx.h.

## Function Documentation

Force32BitBmpToAlpha | ( | BITMAP * | bmp | ) |

Force if already not a 32bpp bmp to be the same with an alpha channel.

Parameters

  bmp | the bitmap to check

Returns
  TRUE or FALSE

Definition at line 118 of file n_gfx.c.

force_color_to_be | ( | BITMAP * | bmp,
|  | int | oldcolor,
|  | int | newcolor
| ) |  |

Change all the bmp pixel of the same color src to color dst.

Parameters

  bmp | the bitmap where the effect take place
  oldcolor | the color to change
  newcolor | the new color of oldcolor ;)

Definition at line 163 of file n_gfx.c.

int gfx_mode | ( | int | card,
|  | int | W,
|  | int | H,
|  | int | VW,
|  | int | VH,
|  | int | depth,
|  | float | r,
|  | float | g,
|  | float | b,
|  | float | alpha
| ) |  |

init and make a clear of the grafic screen

fn int gfx_mode( int card , int W , int H , int VW , int VH , int depth , float r , float g , float b , float alpha )

Parameters

  card | type of GFX_MODE wanted
  W | width size of screen
  H | heigh size of screen
  VW | virtual width size of screen
  VH | virtual heigh size of screen
  depth | depth wanted
  r | red color of the first cleared screen
  g | green color of the first cleared screen
  b | blue color of the first cleared screen
  alpha | alpha color of the first cleared screen

Returns
  TRUE or FALSE

Definition at line 49 of file n_gfx.c.

Here is the call graph for this function:

Here is the caller graph for this function:

int gfx_status | ( | int | ACTION,
|  | int | value
| ) |  |

status of opengl & or directx

Parameters

  ACTION | set it to GET or SET
  value | if action is set to SET, then status take the value 'value' else nothing is done with 'value'

Returns
  the gfx_status, MODE_OGL or MODE_DX

Definition at line 18 of file n_gfx.c.

Here is the caller graph for this function:

ogl_blit | ( | GLuint | mytexture,
|  | int | x,
|  | int | y,
|  | int | r,
|  | int | g,
|  | int | b,
|  | int | alpha,
|  | int | w,
|  | int | h,
|  | int | mode
| ) |  |

Draw a given texture to the screen at position x,y and of size w,h.

Parameters

  mytexture | the opengl texture index of texture to use
  x | x position
  y | y position
  r | Red Color
  g | Green Color
  b | Blue Color
  alpha | Alpha Color
  w | Width of the blit
  h | Height of the blit
  mode | 0 normal , 1 trans

Returns
  NOTHING it's void

Definition at line 190 of file n_gfx.c.