_________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          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
sprite.cpp File Reference
#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)
 

Function Documentation

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.

Parameters
gThe graphic to be drawn. It may consist of multiple OpenGL textures if it is too large to fit in one texture.
texturesThe 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_begX coordinate of the left side of the rectangle to be drawn from *g.
gy_begY coordinate of the top of the rectangle to be drawn from *g.
gx_endX coordinate of the right side of the rectangle to be drawn from *g.
gy_endY coordinate of the bottom of the rectangle to be drawn from *g.
sx_begX coordinate of the left side of the graphic on the screen.
sy_begY coordinate of the top of the graphic on the screen.
flipWhether 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.
(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.