$treeview $search $mathjax
Stratagus
2.2.7
$projectbrief
|
$projectbrief
|
$searchbox |
_________ __ __ / _____// |_____________ _/ |______ ____ __ __ ______ \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/ / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ \ /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ > \/ \/ \//_____/ \/ ______________________ ______________________ T H E W A R B E G I N S Stratagus - A free fantasy real time strategy game engine
#include "stratagus.h"
#include "video.h"
Functions | |
sprite.cpp - The general sprite functions. | |
void | DrawTexture (const CGraphic *g, GLuint *textures, int gx_beg, int gy_beg, int gx_end, int gy_end, int sx_beg, int sy_beg, int flip) |
void DrawTexture | ( | const CGraphic * | g, | |
GLuint * | textures, | |||
int | gx_beg, | |||
int | gy_beg, | |||
int | gx_end, | |||
int | gy_end, | |||
int | sx_beg, | |||
int | sy_beg, | |||
int | flip | |||
) |
Draw a rectangular part of a CGraphic to the screen.
This function does not attempt to clip the CGraphic based on the screen coordinates. If the caller wants clipping, it can set the parameters accordingly, or perhaps configure OpenGL to clip the output.
g | The graphic to be drawn. It may consist of multiple OpenGL textures if it is too large to fit in one texture. | |
textures | The OpenGL textures to be drawn. There must be g->NumTextures elements in the array. These textures may be the same as g->Textures, or perhaps variants of them with different colors for a specific player. | |
gx_beg | X coordinate of the left side of the rectangle to be drawn from *g. | |
gy_beg | Y coordinate of the top of the rectangle to be drawn from *g. | |
gx_end | X coordinate of the right side of the rectangle to be drawn from *g. | |
gy_end | Y coordinate of the bottom of the rectangle to be drawn from *g. | |
sx_beg | X coordinate of the left side of the graphic on the screen. | |
sy_beg | Y coordinate of the top of the graphic on the screen. | |
flip | Whether to flip the graphic in the X direction. In any case, the graphic will extend from sx_beg to (gx_end - gx_beg + sx_beg) on the screen. Flipping controls which of those values corresponds to gx_beg and which one to gx_end. |