_________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
                   Stratagus - A free fantasy real time strategy game engine

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | List of all members
CVideo Class Reference

#include <video.h>

Public Member Functions

 CVideo ()
 
Uint32 MapRGB (SDL_PixelFormat *f, Uint8 r, Uint8 g, Uint8 b)
 
Uint32 MapRGB (SDL_PixelFormat *f, const CColor &color)
 
Uint32 MapRGBA (SDL_PixelFormat *f, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 
Uint32 MapRGBA (SDL_PixelFormat *f, const CColor &color)
 
void GetRGB (Uint32 c, SDL_PixelFormat *f, Uint8 *r, Uint8 *g, Uint8 *b)
 
void GetRGBA (Uint32 c, SDL_PixelFormat *f, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a)
 
video.cpp - The universal video functions.
void LockScreen ()
 
void UnlockScreen ()
 
void ClearScreen ()
 
bool ResizeScreen (int width, int height)
 
linedraw.cpp - The general linedraw functions.
void DrawPixelClip (Uint32 color, int x, int y)
 
void DrawTransPixelClip (Uint32 color, int x, int y, unsigned char alpha)
 
void DrawVLine (Uint32 color, int x, int y, int height)
 
void DrawTransVLine (Uint32 color, int x, int y, int height, unsigned char alpha)
 
void DrawVLineClip (Uint32 color, int x, int y, int height)
 
void DrawTransVLineClip (Uint32 color, int x, int y, int height, unsigned char alpha)
 
void DrawHLine (Uint32 color, int x, int y, int width)
 
void DrawTransHLine (Uint32 color, int x, int y, int width, unsigned char alpha)
 
void DrawHLineClip (Uint32 color, int x, int y, int width)
 
void DrawTransHLineClip (Uint32 color, int x, int y, int width, unsigned char alpha)
 
void DrawLine (Uint32 color, int sx, int sy, int dx, int dy)
 
void DrawTransLine (Uint32 color, int sx, int sy, int dx, int dy, unsigned char alpha)
 
void DrawLineClip (Uint32 color, const PixelPos &pos1, const PixelPos &pos2)
 
void DrawTransLineClip (Uint32 color, int sx, int sy, int dx, int dy, unsigned char alpha)
 
void DrawRectangle (Uint32 color, int x, int y, int w, int h)
 
void DrawTransRectangle (Uint32 color, int x, int y, int w, int h, unsigned char alpha)
 
void DrawRectangleClip (Uint32 color, int x, int y, int w, int h)
 
void DrawTransRectangleClip (Uint32 color, int x, int y, int w, int h, unsigned char alpha)
 
void FillRectangle (Uint32 color, int x, int y, int w, int h)
 
void FillTransRectangle (Uint32 color, int x, int y, int w, int h, unsigned char alpha)
 
void FillRectangleClip (Uint32 color, int x, int y, int w, int h)
 
void FillTransRectangleClip (Uint32 color, int x, int y, int w, int h, unsigned char alpha)
 
void DrawCircle (Uint32 color, int x, int y, int r)
 
void DrawTransCircle (Uint32 color, int x, int y, int r, unsigned char alpha)
 
void DrawCircleClip (Uint32 color, int x, int y, int r)
 
void DrawTransCircleClip (Uint32 color, int x, int y, int r, unsigned char alpha)
 
void FillCircle (Uint32 color, int x, int y, int radius)
 
void FillTransCircle (Uint32 color, int x, int y, int radius, unsigned char alpha)
 
void FillCircleClip (Uint32 color, const PixelPos &screenPos, int radius)
 
void FillTransCircleClip (Uint32 color, int x, int y, int radius, unsigned char alpha)
 

Public Attributes

int Width
 
int Height
 
int ViewportWidth
 
int ViewportHeight
 Actual width of the window. More...
 
int Depth
 Actual height of the window. More...
 
bool FullScreen
 

Constructor & Destructor Documentation

CVideo::CVideo ( )
inline

Member Function Documentation

void CVideo::ClearScreen ( )

Clear the video screen.

void CVideo::DrawCircle ( Uint32  color,
int  x,
int  y,
int  r 
)
void CVideo::DrawCircleClip ( Uint32  color,
int  x,
int  y,
int  r 
)
void CVideo::DrawHLine ( Uint32  color,
int  x,
int  y,
int  width 
)
void CVideo::DrawHLineClip ( Uint32  color,
int  x,
int  y,
int  width 
)
void CVideo::DrawLine ( Uint32  color,
int  sx,
int  sy,
int  dx,
int  dy 
)
void CVideo::DrawLineClip ( Uint32  color,
const PixelPos pos1,
const PixelPos pos2 
)
void CVideo::DrawPixelClip ( Uint32  color,
int  x,
int  y 
)
void CVideo::DrawRectangle ( Uint32  color,
int  x,
int  y,
int  w,
int  h 
)
void CVideo::DrawRectangleClip ( Uint32  color,
int  x,
int  y,
int  w,
int  h 
)
void CVideo::DrawTransCircle ( Uint32  color,
int  x,
int  y,
int  r,
unsigned char  alpha 
)
void CVideo::DrawTransCircleClip ( Uint32  color,
int  x,
int  y,
int  r,
unsigned char  alpha 
)
void CVideo::DrawTransHLine ( Uint32  color,
int  x,
int  y,
int  width,
unsigned char  alpha 
)
void CVideo::DrawTransHLineClip ( Uint32  color,
int  x,
int  y,
int  width,
unsigned char  alpha 
)
void CVideo::DrawTransLine ( Uint32  color,
int  sx,
int  sy,
int  dx,
int  dy,
unsigned char  alpha 
)
void CVideo::DrawTransLineClip ( Uint32  color,
int  sx,
int  sy,
int  dx,
int  dy,
unsigned char  alpha 
)
void CVideo::DrawTransPixelClip ( Uint32  color,
int  x,
int  y,
unsigned char  alpha 
)
void CVideo::DrawTransRectangle ( Uint32  color,
int  x,
int  y,
int  w,
int  h,
unsigned char  alpha 
)
void CVideo::DrawTransRectangleClip ( Uint32  color,
int  x,
int  y,
int  w,
int  h,
unsigned char  alpha 
)
void CVideo::DrawTransVLine ( Uint32  color,
int  x,
int  y,
int  height,
unsigned char  alpha 
)
void CVideo::DrawTransVLineClip ( Uint32  color,
int  x,
int  y,
int  height,
unsigned char  alpha 
)
void CVideo::DrawVLine ( Uint32  color,
int  x,
int  y,
int  height 
)
void CVideo::DrawVLineClip ( Uint32  color,
int  x,
int  y,
int  height 
)
void CVideo::FillCircle ( Uint32  color,
int  x,
int  y,
int  radius 
)
void CVideo::FillCircleClip ( Uint32  color,
const PixelPos screenPos,
int  radius 
)
void CVideo::FillRectangle ( Uint32  color,
int  x,
int  y,
int  w,
int  h 
)
void CVideo::FillRectangleClip ( Uint32  color,
int  x,
int  y,
int  w,
int  h 
)
void CVideo::FillTransCircle ( Uint32  color,
int  x,
int  y,
int  radius,
unsigned char  alpha 
)
void CVideo::FillTransCircleClip ( Uint32  color,
int  x,
int  y,
int  radius,
unsigned char  alpha 
)
void CVideo::FillTransRectangle ( Uint32  color,
int  x,
int  y,
int  w,
int  h,
unsigned char  alpha 
)
void CVideo::FillTransRectangleClip ( Uint32  color,
int  x,
int  y,
int  w,
int  h,
unsigned char  alpha 
)
void CVideo::GetRGB ( Uint32  c,
SDL_PixelFormat *  f,
Uint8 *  r,
Uint8 *  g,
Uint8 *  b 
)
inline
void CVideo::GetRGBA ( Uint32  c,
SDL_PixelFormat *  f,
Uint8 *  r,
Uint8 *  g,
Uint8 *  b,
Uint8 *  a 
)
inline
void CVideo::LockScreen ( )

Lock the screen for write access.

Uint32 CVideo::MapRGB ( SDL_PixelFormat *  f,
Uint8  r,
Uint8  g,
Uint8  b 
)
inline
Uint32 CVideo::MapRGB ( SDL_PixelFormat *  f,
const CColor color 
)
inline
Uint32 CVideo::MapRGBA ( SDL_PixelFormat *  f,
Uint8  r,
Uint8  g,
Uint8  b,
Uint8  a 
)
inline
Uint32 CVideo::MapRGBA ( SDL_PixelFormat *  f,
const CColor color 
)
inline
bool CVideo::ResizeScreen ( int  w,
int  h 
)

Resize the video screen.

Returns
True if the resolution changed, false otherwise
void CVideo::UnlockScreen ( )

Unlock the screen for write access.

Member Data Documentation

int CVideo::Depth

Actual height of the window.

bool CVideo::FullScreen
int CVideo::Height
int CVideo::ViewportHeight

Actual width of the window.

int CVideo::ViewportWidth
int CVideo::Width

The documentation for this class was generated from the following files:
(C) Copyright 1998-2012 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.