Yukino::Graphics Class Reference

Class that manages the video system. More...

#include <Graphics.h>

List of all members.

Public Member Functions

UINT Init (int w, int h, int bpp=32, bool winmode=false)
 Function to initialize the object Graphics.
void Release (void)
 Function to finalize the object Graphics.
void SetTitle (const char *title, const char *icon=NULL)
 Function to change the title of the window.
void HideCursor (void)
 Function to hide the cursor of the mouse.
void ShowCursor (void)
 Function to show the cursor of the mouse.
UINT Update (void)
 Function to update the content of the screen.
UINT Fill (Uint32 color, Rect *rect=NULL)
 Function to fill up with a color a region of the screen.
UINT Blit (const Surface &objsrc, Rect *dst=NULL, Rect *src=NULL)
 Function to put in screen a Surface.
UINT Blit (const Surface &objsrc, int x, int y, Rect *src=NULL)
 Function to put in screen a Surface.
UINT Blit (SDL_Surface *srfsrc, Rect *dst=NULL, Rect *src=NULL)
 Function to put in screen a SDL_Surface.
UINT Blit (SDL_Surface *srfsrc, int x, int y, Rect *src=NULL)
 Function to put in screen a SDL_Surface.
UINT Blit (const Sprite &objsrc, Rect *dst=NULL)
 Function to put in screen a Sprite.
UINT Blit (const Sprite &objsrc, int x, int y)
 Function to put in screen a Sprite.
UINT Paste (Surface &objdst, Rect *dst=NULL, Rect *src=NULL) const
 Function to copy a region of the screen in a Surface.
UINT Paste (Surface &objdst, int x, int y, Rect *src=NULL) const
 Function to copy a region of the screen in a Surface.
UINT Paste (SDL_Surface *srfdst, Rect *dst=NULL, Rect *src=NULL) const
 Function to copy a region of the screen in a SDL_Surface.
UINT Paste (SDL_Surface *srfdst, int x, int y, Rect *src=NULL) const
 Function to copy a region of the screen in a SDL_Surface.
UINT PutText (Font &font, const char *text, dword fc, Rect *dst=NULL)
 Function to put in screen a text.
UINT PutText (Font &font, const char *text, dword fc, int x, int y)
 Function to put in screen a text.
UINT PutUNICODE (Font &font, const word *text, dword fc, Rect *dst=NULL)
 Function to put in screen an UNICODE text.
UINT PutUNICODE (Font &font, const word *text, dword fc, int x, int y)
 Function to put in screen an UNICODE text.
SDL_Surface * GetBuffer (void)
 Function to obtain the video buffer.

Static Public Member Functions

static GraphicsGetInstance (void)
 Function to obtain the instance of Graphics.


Detailed Description

Class that manages the video system.

The Graphics class manages the subjects related to the video system, such as to create the window and to change the resolution, to paint images contained in a Surface or a Sprite in screen, or to paint text in a position.


Member Function Documentation

UINT Yukino::Graphics::Blit ( const Sprite objsrc,
int  x,
int  y 
)

Function to put in screen a Sprite.

This function serves to put frame present of the Sprite origin, in a coordinates of the screen.

Parameters:
objsrc Source image.
x Coordinate x.
y Coordinate y.
Returns:
If everything goes well returns 0, on errors returns: GRAPHICS_ERROR_BLITSURFACE.

UINT Yukino::Graphics::Blit ( const Sprite objsrc,
Rect dst = NULL 
)

Function to put in screen a Sprite.

This function serves to put frame present of the Sprite origin, in a determined region of the screen.

Parameters:
objsrc Source image.
dst Destination area.
Returns:
If everything goes well returns 0, on errors returns: GRAPHICS_ERROR_BLITSURFACE.

UINT Yukino::Graphics::Blit ( SDL_Surface *  srfsrc,
int  x,
int  y,
Rect src = NULL 
)

Function to put in screen a SDL_Surface.

This function serves to put a region determined of an image origin, in a coordinates of the screen.

Parameters:
srfsrc Source image.
x Coordinate x.
y Coordinate y.
src Source area.
Returns:
If everything goes well returns 0, on errors returns: GRAPHICS_ERROR_BLITSURFACE.

UINT Yukino::Graphics::Blit ( SDL_Surface *  srfsrc,
Rect dst = NULL,
Rect src = NULL 
)

Function to put in screen a SDL_Surface.

This function serves to put a region determined of an image origin, in a region also determined of the screen.

Parameters:
srfsrc Source image.
dst Destination area.
src Source area.
Returns:
If everything goes well returns 0, on errors returns: GRAPHICS_ERROR_BLITSURFACE.

UINT Yukino::Graphics::Blit ( const Surface objsrc,
int  x,
int  y,
Rect src = NULL 
)

Function to put in screen a Surface.

This function serves to put a region determined of an image origin, in a coordinates of the screen.

Parameters:
objsrc Source image.
x Coordinate x.
y Coordinate y.
src Source area.
Returns:
If everything goes well returns 0, on errors returns: GRAPHICS_ERROR_BLITSURFACE.

UINT Yukino::Graphics::Blit ( const Surface objsrc,
Rect dst = NULL,
Rect src = NULL 
)

Function to put in screen a Surface.

This function serves to put a region determined of an image origin, in a region also determined of the screen.

Parameters:
objsrc Source image.
dst Destination area.
src Source area.
Returns:
If everything goes well returns 0, on errors returns: GRAPHICS_ERROR_BLITSURFACE.

UINT Yukino::Graphics::Fill ( Uint32  color,
Rect rect = NULL 
)

Function to fill up with a color a region of the screen.

This function serves to fill up a region of the screen, with a color.

Parameters:
color Fill color.
rect Destination area to fill.
Returns:
If everything goes well returns 0, on errors returns: GRAPHICS_ERROR_FILLRECT.

SDL_Surface* Yukino::Graphics::GetBuffer ( void   )  [inline]

Function to obtain the video buffer.

This function serves to obtain the video buffer.

Returns:
It gives back to a pointer to the video buffer if everything has gone well, if there is no memory for the buffer, gives back NULL.

Graphics * Yukino::Graphics::GetInstance ( void   )  [static]

Function to obtain the instance of Graphics.

This function creates an instance of Graphics, in case of not being created, and gives back a pointer of this if memory is successful requesting.

Returns:
It gives back to a pointer to the object Graphics if everything has gone well, if there is no memory for the object, gives back NULL.

void Yukino::Graphics::HideCursor ( void   ) 

Function to hide the cursor of the mouse.

This function serves to hide the cursor of the mouse in the application.

See also:
ShowCursor().

UINT Yukino::Graphics::Init ( int  w,
int  h,
int  bpp = 32,
bool  winmode = false 
)

Function to initialize the object Graphics.

This function serves to initialize the object Graphics, passing to him the width, the height, the depth of color and if the window mode is activated.

Parameters:
w Width of the application.
h Height of the application.
bpp Depth of color of the application.
winmode Window mode activated.
See also:
Release().
Returns:
If everything goes well returns 0, on errors returns: GRAPHICS_ERROR_VIDEOMODEOK, GRAPHICS_ERROR_SETVIDEOMODE, GRAPHICS_ERROR_TTFINIT.

UINT Yukino::Graphics::Paste ( SDL_Surface *  srfdst,
int  x,
int  y,
Rect src = NULL 
) const

Function to copy a region of the screen in a SDL_Surface.

This function serves to copy a determined area of the screen, in a coordinates of a destination image.

Parameters:
srfdst Destination image.
x Coordinate x.
y Coordinate y.
src Source area.
Returns:
If everything goes well returns 0, on errors returns: GRAPHICS_ERROR_COPYSCREEN.

UINT Yukino::Graphics::Paste ( SDL_Surface *  srfdst,
Rect dst = NULL,
Rect src = NULL 
) const

Function to copy a region of the screen in a SDL_Surface.

This function serves to copy a determined area of the screen, in a region also determined of a destination image.

Parameters:
srfdst Destination image.
dst Destination area.
src Source area.
Returns:
If everything goes well returns 0, on errors returns: GRAPHICS_ERROR_COPYSCREEN.

UINT Yukino::Graphics::Paste ( Surface objdst,
int  x,
int  y,
Rect src = NULL 
) const

Function to copy a region of the screen in a Surface.

This function serves to copy a determined area of the screen, in a coordinates of a destination image.

Parameters:
objdst Destination image.
x Coordinate x.
y Coordinate y.
src Source area.
Returns:
If everything goes well returns 0, on errors returns: GRAPHICS_ERROR_COPYSCREEN.

UINT Yukino::Graphics::Paste ( Surface objdst,
Rect dst = NULL,
Rect src = NULL 
) const

Function to copy a region of the screen in a Surface.

This function serves to copy a determined area of the screen, in a region also determined of a destination image.

Parameters:
objdst Destination image.
dst Destination area.
src Source area.
Returns:
If everything goes well returns 0, on errors returns: GRAPHICS_ERROR_COPYSCREEN.

UINT Yukino::Graphics::PutText ( Font font,
const char *  text,
dword  fc,
int  x,
int  y 
)

Function to put in screen a text.

This function serves to put in screen a text chain, with a determined font and color, in a coordinates of the screen.

Parameters:
font Font of the text.
text String with the text.
fc Color of the text.
x Coordinate x.
y Coordinate y.
Returns:
If everything goes well returns 0, on errors returns: GRAPHICS_ERROR_RENDERTEXT, GRAPHICS_ERROR_BLITSURFACE.

UINT Yukino::Graphics::PutText ( Font font,
const char *  text,
dword  fc,
Rect dst = NULL 
)

Function to put in screen a text.

This function serves to put in screen a text chain, with a determined font and color, in a destination area of the screen.

Parameters:
font Font of the text.
text String with the text.
fc Color of the text.
dst Destination area.
Returns:
If everything goes well returns 0, on errors returns: GRAPHICS_ERROR_RENDERTEXT, GRAPHICS_ERROR_BLITSURFACE.

UINT Yukino::Graphics::PutUNICODE ( Font font,
const word text,
dword  fc,
int  x,
int  y 
)

Function to put in screen an UNICODE text.

This function serves to put in screen a text chain, with a determined font and color, in a coordinates of the screen.

Parameters:
font Font of the text.
text String with the text.
fc Color of the text.
x Coordinate x.
y Coordinate y.
Returns:
If everything goes well returns 0, on errors returns: GRAPHICS_ERROR_RENDERTEXT, GRAPHICS_ERROR_BLITSURFACE.

UINT Yukino::Graphics::PutUNICODE ( Font font,
const word text,
dword  fc,
Rect dst = NULL 
)

Function to put in screen an UNICODE text.

This function serves to put in screen a text chain, with a determined font and color, in a destination area of the screen.

Parameters:
font Font of the text.
text String with the text.
fc Color of the text.
dst Destination area.
Returns:
If everything goes well returns 0, on errors returns: GRAPHICS_ERROR_RENDERTEXT, GRAPHICS_ERROR_BLITSURFACE.

void Yukino::Graphics::Release ( void   ) 

Function to finalize the object Graphics.

This function serves to finalize the object Graphics.

See also:
Init().

void Yukino::Graphics::SetTitle ( const char *  title,
const char *  icon = NULL 
)

Function to change the title of the window.

This function serves to change the title of the created window, and the icon of this, by another content in a file.

Parameters:
title New title of the window.
icon Path of the new icon.

void Yukino::Graphics::ShowCursor ( void   ) 

Function to show the cursor of the mouse.

This function serves to show the cursor of the mouse in the application.

See also:
HideCursor().

UINT Yukino::Graphics::Update ( void   ) 

Function to update the content of the screen.

This function serves to update the content of the screen, since the library by defect has activated the double buffering.

Returns:
If everything goes well returns 0, on errors returns: GRAPHICS_ERROR_UPDATE.


The documentation for this class was generated from the following files:
Generated on Sun Jun 25 03:43:36 2006 for Yukino by  doxygen 1.4.7