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

src/video/sprite.cpp File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#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:
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.

(C) Copyright 1998-2011 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.