The SGADE Documentation

the SGADE The Socrates Gameboy Advance Development Engine

The SGADE is a development library for the Nintendo Gameboy Advance. It's free for all uses and is distributed without guarantees. For more information visit the SGADE page.


Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages  

SoPolygon

Module representing a polygon. More...

Files

file  SoPolygon.c
file  SoPolygon.h

Data Structures

struct  SoPolygon
 Polygon structure definition. More...


Defines

#define SO_POLYGON_MAX_NUM_VERTICES
 Maximum number of vertices in a polygon.


Functions

SoVector2SoPolygonGetTextureCoordinates (SoPolygon *a_This)
 To get the array of texture coordinates of the polygon.

u32 SoPolygonGetVertexIndex (SoPolygon *a_This, u32 a_Index)
 To get a single vertex from the polygon.

u32 SoPolygonGetNumVertices (SoPolygon *a_This)
 To get the number of vertices in the polygon.

u32 SoPolygonGetPaletteIndex (SoPolygon *a_This)
 To get the color of the polygon.

void SoPolygonSetPaletteIndex (SoPolygon *a_This, u32 a_PaletteIndex)
 To set the color of the polygon.


Detailed Description

Module representing a polygon.

This module contains a structure and methods for dealing with polygons. The SoMesh structure contains a list of these polygons.


Define Documentation

#define SO_POLYGON_MAX_NUM_VERTICES
 

Maximum number of vertices in a polygon.

This is used by the SoCamera module in the clipping routine. We use a fixed size array to hold clipped vertices, and make sure we never exceed this maximum number. Which shouldn't be much of a problem, since you should be using triangles anyway.


Function Documentation

u32 SoPolygonGetNumVertices SoPolygon   a_This
 

To get the number of vertices in the polygon.

Parameters:
a_This  This pointer
Returns :
Number of vertices in this polygon

u32 SoPolygonGetPaletteIndex SoPolygon   a_This
 

To get the color of the polygon.

Parameters:
a_This  This pointer
Returns :
The palette index of the polygon.

SoVector2* SoPolygonGetTextureCoordinates SoPolygon   a_This
 

To get the array of texture coordinates of the polygon.

Parameters:
a_This  This pointer
Returns :
Array of texture coordinates of the polygon
This method can return NULL if the polygon has no texture coordinates.

u32 SoPolygonGetVertexIndex SoPolygon   a_This,
u32    a_Index
 

To get a single vertex from the polygon.

Parameters:
a_This  This pointer
a_Index  Index of the requested vertex, in the range [0..SoPolygonGetNumVertices - 1].
Returns :
The requested vertex.

void SoPolygonSetPaletteIndex SoPolygon   a_This,
u32    a_PaletteIndex
 

To set the color of the polygon.

Parameters:
a_This  This pointer
a_PaletteIndex  Palette index you want the polygon to use.


Copyright 2002 by the SGADE authors. See SoLicense.h or Visit the SGADE page for more information.