videoGL.h

openGL (ish) interface to DS 3D hardware. [詳細]

#include "nds/dma.h"
#include "nds/ndstypes.h"
#include "nds/arm9/video.h"
#include "nds/arm9/cache.h"
#include "nds/arm9/trig_lut.h"
#include "nds/arm9/math.h"
#include "nds/dynamicArray.h"

ソースコードを見る。

構成

struct  m3x3
 Holds a Matrix of 3x3. [詳細]
struct  m4x4
 Holds a Matrix of 4x4. [詳細]
struct  m4x3
 Holds a Matrix of 4x3. [詳細]
struct  GLvector
 Holds a Vector
related functions: glScalev(), glTranslatev(). [詳細]
struct  gl_hidden_globals

マクロ定義

#define GL_STATIC_INL   static inline
#define LUT_SIZE   (1<<15)
#define LUT_MASK   ((1<<15) - 1)
#define MAX_TEXTURES   2048
#define int_to_12d3(n)   ((n) << 3)
 convert int to fixed12d3
#define float_to_12d3(n)   ((fixed12d3)((n) * (1 << 3)))
 convert float to fixed12d3
#define GL_MAX_DEPTH   0x7FFF
 the maximum value for type fixed12d3
#define inttof32(n)   ((n) << 12)
 convert int to f32
#define f32toint(n)   ((n) >> 12)
 convert f32 to int
#define floattof32(n)   ((int32)((n) * (1 << 12)))
 convert float to f32
#define f32tofloat(n)   (((float)(n)) / (float)(1<<12))
 convert f32 to float
#define f32tot16(n)   ((t16)(n >> 8))
 convert f32 to t16
#define inttot16(n)   ((n) << 4)
 convert int to t16
#define t16toint(n)   ((n) >> 4)
 convert t16 to int
#define floattot16(n)   ((t16)((n) * (1 << 4)))
 convert float to t16
#define TEXTURE_PACK(u, v)   (((u) & 0xFFFF) | ((v) << 16))
 Pack 2 t16 texture coordinate values into a 32bit value.
#define inttov16(n)   ((n) << 12)
 convert int to v16
#define f32tov16(n)   (n)
 f32 to v16
#define v16toint(n)   ((n) >> 12)
 convert v16 to int
#define floattov16(n)   ((v16)((n) * (1 << 12)))
 convert float to v16
#define VERTEX_PACK(x, y)   (((x) & 0xFFFF) | ((y) << 16))
 Pack to v16 values into one 32bit value.
#define inttov10(n)   ((n) << 9)
 convert int to v10
#define f32tov10(n)   ((v10)(n >> 3))
 convert f32 to v10
#define v10toint(n)   ((n) >> 9)
 convert v10 to int
#define floattov10(n)   ((n>.998) ? 0x1FF : ((v10)((n)*(1<<9))))
 convert float to v10
#define NORMAL_PACK(x, y, z)   (((x) & 0x3FF) | (((y) & 0x3FF) << 10) | ((z) << 20))
 Pack 3 v10 normals into a 32bit value.
#define GL_FALSE   0
#define GL_TRUE   1
#define FIFO_COMMAND_PACK(c1, c2, c3, c4)   (((c4) << 24) | ((c3) << 16) | ((c2) << 8) | (c1))
 packs four packed commands into a 32bit command for sending to the GFX FIFO
#define REG2ID(r)   (u8)( ( ((u32)(&(r)))-0x04000400 ) >> 2 )
 converts a GFX command for use in a packed command list
#define FIFO_NOP   REG2ID(GFX_FIFO)
 packed command for nothing, just here to pad your command lists
#define FIFO_STATUS   REG2ID(GFX_STATUS)
 packed command for geometry engine status register
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dstatus
#define FIFO_COLOR   REG2ID(GFX_COLOR)
 packed command for vertex color directly
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dpolygonattributes
#define FIFO_VERTEX16   REG2ID(GFX_VERTEX16)
 packed command for a vertex with 3 16bit paramaters(and 16bits of padding)
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dpolygondefinitionsbyvertices
#define FIFO_TEX_COORD   REG2ID(GFX_TEX_COORD)
 packed command for a texture coordinate
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dtexturecoordinates
#define FIFO_TEX_FORMAT   REG2ID(GFX_TEX_FORMAT)
 packed command for texture format
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dtextureformats
#define FIFO_PAL_FORMAT   REG2ID(GFX_PAL_FORMAT)
 packed command for texture palette attributes
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dtextureattributes
#define FIFO_CLEAR_COLOR   REG2ID(GFX_CLEAR_COLOR)
 packed command for clear color of the rear plane
GBATEK http://nocash.emubase.de/gbatek.htm#ds3drearplane
#define FIFO_CLEAR_DEPTH   REG2ID(GFX_CLEAR_DEPTH)
 sets depth of the rear plane
GBATEK http://nocash.emubase.de/gbatek.htm#ds3drearplane
#define FIFO_LIGHT_VECTOR   REG2ID(GFX_LIGHT_VECTOR)
 packed command for direction of a light source
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dpolygonlightparameters
#define FIFO_LIGHT_COLOR   REG2ID(GFX_LIGHT_COLOR)
 packed command for color for a light
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dpolygonlightparameters
#define FIFO_NORMAL   REG2ID(GFX_NORMAL)
 packed command for normal for following vertices
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dpolygonlightparameters
#define FIFO_DIFFUSE_AMBIENT   REG2ID(GFX_DIFFUSE_AMBIENT)
 packed command for setting diffuse and ambient material properties for the following vertices
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dpolygonlightparameters
#define FIFO_SPECULAR_EMISSION   REG2ID(GFX_SPECULAR_EMISSION)
 packed command for setting specular and emmissive material properties for the following vertices
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dpolygonlightparameters
#define FIFO_SHININESS   REG2ID(GFX_SHININESS)
 packed command for setting the shininess table to be used for the following vertices
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dpolygonlightparameters
#define FIFO_POLY_FORMAT   REG2ID(GFX_POLY_FORMAT)
 packed command for setting polygon attributes
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dpolygonattributes
#define FIFO_BEGIN   REG2ID(GFX_BEGIN)
 packed command that starts a polygon vertex list
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dpolygondefinitionsbyvertices
#define FIFO_END   REG2ID(GFX_END)
 packed command that has no discernable effect, it's probably best to never use it since it bloats the size of the list.
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dpolygondefinitionsbyvertices
#define FIFO_FLUSH   REG2ID(GFX_FLUSH)
 packed command that has the same effect as swiWaitForVBlank()
GBATEK http://nocash.emubase.de/gbatek.htm#ds3ddisplaycontrol
#define FIFO_VIEWPORT   REG2ID(GFX_VIEWPORT)
 packed command for setting viewport
GBATEK http://nocash.emubase.de/gbatek.htm#ds3ddisplaycontrol

型定義

typedef uint16 fixed12d3
 Used for depth (glClearDepth, glCutoffDepth).
typedef short t16
 text coordinate 12.4 fixed point
typedef short int v16
 vertex 4.12 fixed format
typedef short int v10
 normal .10 fixed point, NOT USED FOR 10bit VERTEXES!!!
typedef unsigned short rgb
 Holds a color value. 1bit alpha, 5bits red, 5bits green, 5bits blue.
typedef struct m3x3 m3x3
 Holds a Matrix of 3x3.
typedef struct m4x4 m4x4
 Holds a Matrix of 4x4.
typedef struct m4x3 m4x3
 Holds a Matrix of 4x3.
typedef struct GLvector GLvector
 Holds a Vector
related functions: glScalev(), glTranslatev().
typedef struct gl_hidden_globals gl_hidden_globals

列挙型

enum  GL_GLBEGIN_ENUM {
  GL_TRIANGLES = 0,
  GL_QUADS = 1,
  GL_TRIANGLE_STRIP = 2,
  GL_QUAD_STRIP = 3,
  GL_TRIANGLE = 0,
  GL_QUAD = 1
}
 

Enums selecting polygon draw mode
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dpolygondefinitionsbyvertices
related functions: glBegin().

[詳細]
enum  GL_MATRIX_MODE_ENUM {
  GL_PROJECTION = 0,
  GL_POSITION = 1,
  GL_MODELVIEW = 2,
  GL_TEXTURE = 3
}
 

Enums selecting matrix mode
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dmatrixloadmultiply
related functions: glMatrixMode().

[詳細]
enum  GL_MATERIALS_ENUM {
  GL_AMBIENT = 0x01,
  GL_DIFFUSE = 0x02,
  GL_AMBIENT_AND_DIFFUSE = 0x03,
  GL_SPECULAR = 0x04,
  GL_SHININESS = 0x08,
  GL_EMISSION = 0x10
}
 

Enums for setting up materials
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dpolygonlightparameters
related functions: glMaterialf().

[詳細]
enum  GL_POLY_FORMAT_ENUM {
  POLY_FORMAT_LIGHT0 = (1<<0),
  POLY_FORMAT_LIGHT1 = (1<<1),
  POLY_FORMAT_LIGHT2 = (1<<2),
  POLY_FORMAT_LIGHT3 = (1<<3),
  POLY_MODULATION = (0<<4),
  POLY_DECAL = (1<<4),
  POLY_TOON_HIGHLIGHT = (2<<4),
  POLY_SHADOW = (3<<4),
  POLY_CULL_FRONT = (1<<6),
  POLY_CULL_BACK = (2<<6),
  POLY_CULL_NONE = (3<<6),
  POLY_FOG = (1<<15)
}
 

Enums for setting how polygons will be displayed
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dpolygonattributes
related functions: glPolyFmt(), glInit(), POLY_ALPHA(), POLY_ID().

[詳細]
enum  GL_TEXTURE_SIZE_ENUM {
  TEXTURE_SIZE_8 = 0,
  TEXTURE_SIZE_16 = 1,
  TEXTURE_SIZE_32 = 2,
  TEXTURE_SIZE_64 = 3,
  TEXTURE_SIZE_128 = 4,
  TEXTURE_SIZE_256 = 5,
  TEXTURE_SIZE_512 = 6,
  TEXTURE_SIZE_1024 = 7
}
 

Enums for size of a texture, specify one for horizontal and one for vertical related functions: glTexImage2d(), glTexParameter().

[詳細]
enum  GL_TEXTURE_PARAM_ENUM {
  GL_TEXTURE_WRAP_S = (1 << 16),
  GL_TEXTURE_WRAP_T = (1 << 17),
  GL_TEXTURE_FLIP_S = (1 << 18),
  GL_TEXTURE_FLIP_T = (1 << 19),
  GL_TEXTURE_COLOR0_TRANSPARENT = (1<<29),
  TEXGEN_OFF = (0<<30),
  TEXGEN_TEXCOORD = (1<<30),
  TEXGEN_NORMAL = (2<<30),
  TEXGEN_POSITION = (3<<30)
}
 

Enums for texture parameters, such as texture wrapping and texture coord stuff
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dtextureattributes
related functions: glTexImage2d(), glTexParameter().

[詳細]
enum  GL_TEXTURE_TYPE_ENUM {
  GL_RGB32_A3 = 1,
  GL_RGB4 = 2,
  GL_RGB16 = 3,
  GL_RGB256 = 4,
  GL_COMPRESSED = 5,
  GL_RGB8_A5 = 6,
  GL_RGBA = 7,
  GL_RGB = 8
}
 

Enums for texture formats
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dtextureformats
related functions: glTexImage2d(), glTexParameter().

[詳細]
enum  DISP3DCNT_ENUM {
  GL_TEXTURE_2D = (1<<0),
  GL_TOON_HIGHLIGHT = (1<<1),
  GL_ALPHA_TEST = (1<<2),
  GL_BLEND = (1<<3),
  GL_ANTIALIAS = (1<<4),
  GL_OUTLINE = (1<<5),
  GL_FOG_ONLY_ALPHA = (1<<6),
  GL_FOG = (1<<7),
  GL_COLOR_UNDERFLOW = (1<<12),
  GL_POLY_OVERFLOW = (1<<13),
  GL_CLEAR_BMP = (1<<14)
}
 

3D Display Control Register Enums
GBATEK http://nocash.emubase.de/gbatek.htm#ds3ddisplaycontrol
related functions: glEnable(), glDisable(), glInit()

[詳細]
enum  GL_GET_ENUM {
  GL_GET_VERTEX_RAM_COUNT,
  GL_GET_POLYGON_RAM_COUNT,
  GL_GET_MATRIX_VECTOR,
  GL_GET_MATRIX_POSITION,
  GL_GET_MATRIX_PROJECTION,
  GL_GET_MATRIX_CLIP,
  GL_GET_TEXTURE_WIDTH,
  GL_GET_TEXTURE_HEIGHT
}
 

Enums for reading stuff from the geometry engine
http://nocash.emubase.de/gbatek.htm#ds3diomap
related functions: glGetInt(), glGetFixed().

[詳細]
enum  GLFLUSH_ENUM {
  GL_TRANS_MANUALSORT = (1<<0),
  GL_WBUFFERING = (1<<1)
}
 

Enums for glFlush()
GBATEK http://nocash.emubase.de/gbatek.htm#ds3ddisplaycontrol
related functions: glEnable(), glDisable(), glInit().

[詳細]

関数

void glRotatef32i (int angle, int32 x, int32 y, int32 z)
 Rotates the model view matrix by angle about the specified unit vector.
int glTexImage2D (int target, int empty1, GL_TEXTURE_TYPE_ENUM type, int sizeX, int sizeY, int empty2, int param, const uint8 *texture)
 Loads a 2D texture into texture memory and sets the currently bound texture ID to the attributes specified.
void glTexLoadPal (const u16 *pal, u16 count, u32 addr)
 Loads a palette into the specified texture addr.
int gluTexLoadPal (const u16 *pal, u16 count, uint8 format)
 Loads a palette into the next available palette slot, returns the addr on success or -1.
void glTexParameter (uint8 sizeX, uint8 sizeY, const uint32 *addr, GL_TEXTURE_TYPE_ENUM mode, GL_TEXTURE_PARAM_ENUM param)
 Set parameters for the current texture. Although named the same as its gl counterpart, it is not compatible. Effort may be made in the future to make it so.
u32 glGetTexParameter (void)
 Returns the active texture parameter (constructed from internal call to glTexParameter).
void * glGetTexturePointer (int name)
 returns the address alocated to the texure named by name
void glBindTexture (int target, int name)
 glBindTexure sets the current named texture to the active texture. Target is ignored as all DS textures are 2D
void glColorTable (uint8 format, uint32 addr)
 glColorTable establishes the location of the current palette. Roughly follows glColorTableEXT. Association of palettes with named textures is left to the application.
int glGenTextures (int n, int *names)
 Creates room for the specified number of textures.
void glResetTextures (void)
 Resets the gl texture state freeing all texture memory.
void glTexCoord2f32 (int32 u, int32 v)
 Sets texture coordinates for following vertices
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dtextureattributes
void glMaterialf (GL_MATERIALS_ENUM mode, rgb color)
 specify the material properties to be used in rendering lit polygons
void glInit_C (void)
gl_hidden_globalsglGetGlobals ()
uint32 POLY_ALPHA (int n)
 used in glPolyFmt() to set the alpha level for the following polygons, set to 0 for wireframe mode
uint32 POLY_ID (int n)
 used in glPolyFmt() to set the Polygon ID for the following polygons
void glBegin (GL_GLBEGIN_ENUM mode)
 Starts a polygon group.
void glEnd (void)
 Ends a polygon group, this seems to be a dummy function that does absolutely nothing, feel free to never use it.
void glClearDepth (fixed12d3 depth)
 reset the depth buffer to this value; generally set this to GL_MAX_DEPTH.
GBATEK http://nocash.emubase.de/gbatek.htm#ds3drearplane
void glColor3b (uint8 red, uint8 green, uint8 blue)
 Set the color for following vertices.
void glColor (rgb color)
 Set the color for following vertices.
void glVertex3v16 (v16 x, v16 y, v16 z)
 specifies a vertex
void glTexCoord2t16 (t16 u, t16 v)
 Sets texture coordinates for following vertices
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dtextureattributes
void glPushMatrix (void)
 Pushes the current matrix onto the stack
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dmatrixstack
void glPopMatrix (int32 num)
 Pops num matrices off the stack
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dmatrixstack
void glRestoreMatrix (int32 index)
 Restores the current matrix from a location in the stack
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dmatrixstack
void glStoreMatrix (int32 index)
 Place the current matrix into the stack at a location
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dmatrixstack
void glScalev (const GLvector *v)
 multiply the current matrix by a translation matrix
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dmatrixloadmultiply
void glTranslatev (const GLvector *v)
 multiply the current matrix by a translation matrix
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dmatrixloadmultiply
void glTranslate3f32 (int32 x, int32 y, int32 z)
 multiply the current matrix by a translation matrix
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dmatrixloadmultiply
void glScalef32 (int32 factor)
 multiply the current matrix by a scale matrix
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dmatrixloadmultiply
void glLight (int id, rgb color, v10 x, v10 y, v10 z)
 set a light up. Only parallel light sources are supported on the DS
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dpolygonlightparameters
void glNormal (uint32 normal)
 the normal to use for following vertices
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dpolygonlightparameters
void glLoadIdentity (void)
 loads an identity matrix to the current matrix, same as glIdentity(void)
void glMatrixMode (GL_MATRIX_MODE_ENUM mode)
 change the current matrix mode
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dmatrixloadmultiply

void glViewport (uint8 x1, uint8 y1, uint8 x2, uint8 y2)
 specify the viewport for following drawing, can be set several times per frame.
GBATEK http://nocash.emubase.de/gbatek.htm#ds3ddisplaycontrol
void glFlush (uint32 mode)
 Waits for a Vblank and swaps the buffers(like swiWaitForVBlank), but lets you specify some 3D options
GBATEK http://nocash.emubase.de/gbatek.htm#ds3ddisplaycontrol
void glMaterialShinyness (void)
 The DS uses a table for shininess..this generates a half-ass one.
void glCallList (const u32 *list)
 throws a packed list of commands into the graphics FIFO via asyncronous DMA
The first 32bits is the length of the packed command list, followed by a the packed list.
If you want to do this really fast then write your own code that that does this synchronously and only flushes the cache when the list is changed
There is sometimes a problem when you pack the GFX_END command into a list, so don't. GFX_END is a dummy command and never needs called
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dgeometrycommands
void glPolyFmt (uint32 params)
 Set the parameters for polygons rendered on the current frame
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dpolygonattributes
void glEnable (int bits)
 Enables various gl states (blend, alpha test, etc..).
void glDisable (int bits)
 Disables various gl states (blend, alpha test, etc..).
void glLoadMatrix4x4 (const m4x4 *m)
 Loads a 4x4 matrix into the current matrix.
void glLoadMatrix4x3 (const m4x3 *m)
 Loads a 4x3 matrix into the current matrix.
void glMultMatrix4x4 (const m4x4 *m)
 Multiplies the current matrix by m.
void glMultMatrix4x3 (const m4x3 *m)
 multiplies the current matrix by
void glMultMatrix3x3 (const m3x3 *m)
 multiplies the current matrix by m
void glRotateXi (int angle)
 Rotates the current modelview matrix by angle about the x axis.
void glRotateYi (int angle)
 Rotates the current modelview matrix by angle about the y axis.
void glRotateZi (int angle)
 Rotates the current modelview matrix by angle about the z axis.
void glOrthof32 (int32 left, int32 right, int32 bottom, int32 top, int32 zNear, int32 zFar)
 Multiplies the current matrix into ortho graphic mode.
void gluLookAtf32 (int32 eyex, int32 eyey, int32 eyez, int32 lookAtx, int32 lookAty, int32 lookAtz, int32 upx, int32 upy, int32 upz)
 Places the camera at the specified location and orientation (fixed point version).
void glFrustumf32 (int32 left, int32 right, int32 bottom, int32 top, int32 near, int32 far)
 Specifies the viewing frustum for the projection matrix (fixed point version).
void gluPerspectivef32 (int fovy, int32 aspect, int32 zNear, int32 zFar)
 Utility function which sets up the projection matrix (fixed point version).
void gluPickMatrix (int x, int y, int width, int height, const int viewport[4])
 Utility function which generates a picking matrix for selection.
void glResetMatrixStack (void)
 Resets matrix stack to top level.
void glSetOutlineColor (int id, rgb color)
 Specifies an edge color for polygons.
void glSetToonTable (const uint16 *table)
 Loads a toon table.
void glSetToonTableRange (int start, int end, rgb color)
 Sets a range of colors on the toon table.
void glGetFixed (const GL_GET_ENUM param, int32 *f)
 Grabs fixed format of state variables
OpenGL's modelview matrix is handled on the DS with two matrices. The combination of the DS's position matrix and directional vector matrix hold the data that is in OpenGL's one modelview matrix. (a.k.a. modelview = postion and vector)
http://nocash.emubase.de/gbatek.htm#ds3diomap
void glAlphaFunc (int alphaThreshold)
 set the minimum alpha value that will be used
GBATEK http://nocash.emubase.de/gbatek.htm#ds3ddisplaycontrol
void glCutoffDepth (fixed12d3 wVal)
 Stop the drawing of polygons that are a certain distance from the camera.
GBATEK http://nocash.emubase.de/gbatek.htm#ds3ddisplaycontrol
void glInit ()
 Initializes the gl state machine (must be called once before using gl calls).
void glClearColor (uint8 red, uint8 green, uint8 blue, uint8 alpha)
 sets the color of the rear-plane(a.k.a Clear Color/Plane)
void glClearPolyID (uint8 ID)
 sets the polygon ID of the rear-plane(a.k.a. Clear/Color Plane), useful for antialiasing and edge coloring
void glGetInt (GL_GET_ENUM param, int *i)
 Grabs integer state variables from openGL.
void glVertex3f (float x, float y, float z)
 specifies a vertex location
void glRotatef32 (float angle, int32 x, int32 y, int32 z)
 Rotate on an arbitrary axis.
void glRotatef (float angle, float x, float y, float z)
 Rotate about an arbitrary axis.
void glColor3f (float r, float g, float b)
 specify a color for following vertices
void glScalef (float x, float y, float z)
 multiply the current matrix by a scale matrix
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dmatrixloadmultiply
void glTranslatef (float x, float y, float z)
 multiply the current matrix by a translation matrix
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dmatrixloadmultiply
void glNormal3f (float x, float y, float z)
 the normal to use for following vertices
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dpolygonlightparameters
void glRotateX (float angle)
 Rotates the current modelview matrix by angle degrees about the x axis.
void glRotateY (float angle)
 Rotates the current modelview matrix by angle degrees about the y axis.
void glRotateZ (float angle)
 Rotates the current modelview matrix by angle degrees about the z axis.
void glOrtho (float left, float right, float bottom, float top, float zNear, float zFar)
 Multiplies the current matrix into ortho graphic mode.
void gluLookAt (float eyex, float eyey, float eyez, float lookAtx, float lookAty, float lookAtz, float upx, float upy, float upz)
 Places the camera at the specified location and orientation (floating point version).
void glFrustum (float left, float right, float bottom, float top, float near, float far)
 Specifies the viewing frustum for the projection matrix (floating point version).
void gluPerspective (float fovy, float aspect, float zNear, float zFar)
 Utility function which sets up the projection matrix (floating point version).
void glTexCoord2f (float s, float t)
 Sets texture coordinates for following vertices
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dtextureattributes

変数

gl_hidden_globals glGlobalData

説明

openGL (ish) interface to DS 3D hardware.


列挙型

3D Display Control Register Enums
GBATEK http://nocash.emubase.de/gbatek.htm#ds3ddisplaycontrol
related functions: glEnable(), glDisable(), glInit()

列挙型の値:
GL_TEXTURE_2D 

enable/disable textures on the geometry engine

GL_TOON_HIGHLIGHT 

enable = Highlight shading; disable = Toon shading

GL_ALPHA_TEST 

whether to use the alpha threshold set in glAlphaFunc()

GL_BLEND 

enable/disable alpha blending

GL_ANTIALIAS 

nable/disable edge antialiasing; polygons must have different polygon IDs for the effect to work and the rear plane must be clear

GL_OUTLINE 

enable/disable edge coloring; the high 3bits of the polygon ID determine the color; glSetOutlineColor() sets the available colors

GL_FOG_ONLY_ALPHA 

enable = fade into background?; disable = don't fade?

GL_FOG 

enables/disables fog

GL_COLOR_UNDERFLOW 

enable = color buffer underflow, setting resets overflow flag; disable = no color buffer overflow

GL_POLY_OVERFLOW 

enable = polygon/vertex buffer overflow, setting resets overflow flag; disable = no polygon/vertex buffer overflow

GL_CLEAR_BMP 

rear/clear plane is in BMP mode; disable = rear/color plane is in clear mode

Enums for reading stuff from the geometry engine
http://nocash.emubase.de/gbatek.htm#ds3diomap
related functions: glGetInt(), glGetFixed().

列挙型の値:
GL_GET_VERTEX_RAM_COUNT 

returns a count of vertexes currently stored in hardware vertex ram. Use glGetInt() to retrieve

GL_GET_POLYGON_RAM_COUNT 

returns a count of polygons currently stored in hardware polygon ram. Use glGetInt() to retrieve

GL_GET_MATRIX_VECTOR 

returns the current 3x3 directional vector matrix. Use glGetFixed() to retrieve

GL_GET_MATRIX_POSITION 

returns the current 4x4 position matrix. Use glGetFixed() to retrieve

GL_GET_MATRIX_PROJECTION 

returns the current 4x4 projection matrix. Use glGetFixed() to retrieve

GL_GET_MATRIX_CLIP 

returns the current 4x4 clip matrix. Use glGetFixed() to retrieve

GL_GET_TEXTURE_WIDTH 

returns the width of the currently bound texture. Use glGetInt() to retrieve

GL_GET_TEXTURE_HEIGHT 

returns the height of the currently bound texture. Use glGetInt() to retrieve

Enums selecting polygon draw mode
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dpolygondefinitionsbyvertices
related functions: glBegin().

列挙型の値:
GL_TRIANGLES 

draw triangles with each 3 vertices defining a triangle

GL_QUADS 

draw quads with each 4 vertices defining a quad

GL_TRIANGLE_STRIP 

draw triangles with the first triangle defined by 3 vertices, then each additional triangle being defined by one additional vertex

GL_QUAD_STRIP 

draw quads with the first quad being defined by 4 vertices, then each additional triangle being defined by 2 vertices.

GL_TRIANGLE 

same as GL_TRIANGLES, old non-OpenGL version

GL_QUAD 

same as GL_QUADS, old non-OpenGL version

Enums for setting up materials
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dpolygonlightparameters
related functions: glMaterialf().

列挙型の値:
GL_AMBIENT 

sets the ambient color for the material. The color when the normal is not facing light

GL_DIFFUSE 

sets the diffuse color for the material. The color when the normal is facing light

GL_AMBIENT_AND_DIFFUSE 

sets the set ambient and diffuse colors for the material; just a two-in-one of the above.

GL_SPECULAR 

sets the specular color for the material. The glossy(highlight) color of the polygon

GL_SHININESS 

sets the shininess color for the material. The color that shines back to the user. I have shiny pants!

GL_EMISSION 

sets the emission color for the material. bright color that is indepentant of normals and lights

Enums selecting matrix mode
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dmatrixloadmultiply
related functions: glMatrixMode().

列挙型の値:
GL_PROJECTION 

used to set the Projection Matrix

GL_POSITION 

used to set the Position Matrix

GL_MODELVIEW 

used to set the Modelview Matrix

GL_TEXTURE 

used to set the Texture Matrix

Enums for setting how polygons will be displayed
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dpolygonattributes
related functions: glPolyFmt(), glInit(), POLY_ALPHA(), POLY_ID().

列挙型の値:
POLY_FORMAT_LIGHT0 

enable light number 0

POLY_FORMAT_LIGHT1 

enable light number 1

POLY_FORMAT_LIGHT2 

enable light number 2

POLY_FORMAT_LIGHT3 

enable light number 3

POLY_MODULATION 

enable modulation shading mode; this is the default

POLY_DECAL 

enable decal shading

POLY_TOON_HIGHLIGHT 

enable toon/highlight shading mode

POLY_SHADOW 

enable shadow shading

POLY_CULL_FRONT 

cull front polygons

POLY_CULL_BACK 

cull rear polygons

POLY_CULL_NONE 

don't cull any polygons

POLY_FOG 

enable/disable fog for this polygon

Enums for texture parameters, such as texture wrapping and texture coord stuff
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dtextureattributes
related functions: glTexImage2d(), glTexParameter().

列挙型の値:
GL_TEXTURE_WRAP_S 

wrap(repeat) texture on S axis

GL_TEXTURE_WRAP_T 

wrap(repeat) texture on T axis

GL_TEXTURE_FLIP_S 

flip texture on S axis when wrapping

GL_TEXTURE_FLIP_T 

flip texture on T axis when wrapping

GL_TEXTURE_COLOR0_TRANSPARENT 

interpret color 0 as clear, same as old GL_TEXTURE_ALPHA_MASK

TEXGEN_OFF 

use unmodified texcoord

TEXGEN_TEXCOORD 

multiply texcoords by the texture-matrix

TEXGEN_NORMAL 

set texcoords equal to normal * texture-matrix, used for spherical reflection mapping

TEXGEN_POSITION 

set texcoords equal to vertex * texture-matrix

Enums for size of a texture, specify one for horizontal and one for vertical related functions: glTexImage2d(), glTexParameter().

列挙型の値:
TEXTURE_SIZE_8 

8 texels

TEXTURE_SIZE_16 

16 texels

TEXTURE_SIZE_32 

32 texels

TEXTURE_SIZE_64 

64 texels

TEXTURE_SIZE_128 

128 texels

TEXTURE_SIZE_256 

256 texels

TEXTURE_SIZE_512 

512 texels

TEXTURE_SIZE_1024 

1024 texels

Enums for texture formats
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dtextureformats
related functions: glTexImage2d(), glTexParameter().

列挙型の値:
GL_RGB32_A3 

32 color palette, 3 bits of alpha

GL_RGB4 

4 color palette

GL_RGB16 

16 color palette

GL_RGB256 

256 color palette

GL_COMPRESSED 

compressed texture

GL_RGB8_A5 

8 color palette, 5 bits of alpha

GL_RGBA 

15 bit direct color, 1 bit of alpha

GL_RGB 

15 bit direct color, manually sets alpha bit to 1

Enums for glFlush()
GBATEK http://nocash.emubase.de/gbatek.htm#ds3ddisplaycontrol
related functions: glEnable(), glDisable(), glInit().

列挙型の値:
GL_TRANS_MANUALSORT 

enable manual sorting of translucent polygons, otherwise uses Y-sorting

GL_WBUFFERING 

enable W depth buffering of vertices, otherwise uses Z depth buffering


関数

GL_STATIC_INLvoid glAlphaFunc ( int  alphaThreshold  ) 

set the minimum alpha value that will be used
GBATEK http://nocash.emubase.de/gbatek.htm#ds3ddisplaycontrol

引数:
alphaThreshold minimum alpha value that will be used (0-15)
GL_STATIC_INLvoid glBegin ( GL_GLBEGIN_ENUM  mode  ) 
void glBindTexture ( int  target,
int  name 
)

glBindTexure sets the current named texture to the active texture. Target is ignored as all DS textures are 2D

引数:
target ignored, only here for OpenGL compatability
name the name(int value) to set to the current texture
例:
Graphics/3D/nehe/lesson06/source/nehe6.cpp, Graphics/3D/nehe/lesson07/source/nehe7.cpp, Graphics/3D/nehe/lesson08/source/nehe8.cpp, Graphics/3D/nehe/lesson09/source/nehe9.cpp, Graphics/3D/nehe/lesson10/source/nehe10.cpp, Graphics/3D/nehe/lesson10b/source/nehe10b.cpp, Graphics/3D/nehe/lesson11/source/nehe11.cpp, と input/Touch_Pad/touch_look/source/main.cpp.
GL_STATIC_INLvoid glClearColor ( uint8  red,
uint8  green,
uint8  blue,
uint8  alpha 
)
GL_STATIC_INLvoid glClearDepth ( fixed12d3  depth  ) 
GL_STATIC_INLvoid glClearPolyID ( uint8  ID  ) 
GL_STATIC_INLvoid glColor ( rgb  color  ) 

Set the color for following vertices.

引数:
color the 15bit color value
GL_STATIC_INLvoid glColor3b ( uint8  red,
uint8  green,
uint8  blue 
)

Set the color for following vertices.

引数:
red the red component (0-255) Bottom 3 bits ignored
green the green component (0-255) Bottom 3 bits ignored
blue the blue component (0-255) Bottom 3 bits ignored
例:
Graphics/3D/3D_Both_Screens/source/template.c, Graphics/3D/nehe/lesson09/source/nehe9.cpp, と Graphics/3D/nehe/lesson11/source/nehe11.cpp.
GL_STATIC_INLvoid glColor3f ( float  r,
float  g,
float  b 
)
GL_STATIC_INLvoid glCutoffDepth ( fixed12d3  wVal  ) 

Stop the drawing of polygons that are a certain distance from the camera.
GBATEK http://nocash.emubase.de/gbatek.htm#ds3ddisplaycontrol

引数:
wVal polygons that are beyond this W-value(distance from camera) will not be drawn; 15bit value.
GL_STATIC_INLvoid glDisable ( int  bits  ) 

Disables various gl states (blend, alpha test, etc..).

引数:
bits bit mask of desired attributes, attributes are enumerated in DISP3DCNT_ENUM
GL_STATIC_INLvoid glEnable ( int  bits  ) 
GL_STATIC_INLvoid glFlush ( uint32  mode  ) 
GL_STATIC_INLvoid glFrustum ( float  left,
float  right,
float  bottom,
float  top,
float  near,
float  far 
)

Specifies the viewing frustum for the projection matrix (floating point version).

警告:
FLOAT VERSION!!!! please use glFrustumf32()
引数:
left left right top and bottom describe a rectangle located at the near clipping plane
right left right top and bottom describe a rectangle located at the near clipping plane
top left right top and bottom describe a rectangle located at the near clipping plane
bottom left right top and bottom describe a rectangle located at the near clipping plane
near Location of a the near clipping plane (parallel to viewing window)
far Location of a the far clipping plane (parallel to viewing window)
GL_STATIC_INLvoid glFrustumf32 ( int32  left,
int32  right,
int32  bottom,
int32  top,
int32  near,
int32  far 
)

Specifies the viewing frustum for the projection matrix (fixed point version).

引数:
left left right top and bottom describe a rectangle located at the near clipping plane
right left right top and bottom describe a rectangle located at the near clipping plane
top left right top and bottom describe a rectangle located at the near clipping plane
bottom left right top and bottom describe a rectangle located at the near clipping plane
near Location of a the near clipping plane (parallel to viewing window)
far Location of a the far clipping plane (parallel to viewing window)
int glGenTextures ( int  n,
int *  names 
)
GL_STATIC_INLvoid glGetFixed ( const GL_GET_ENUM  param,
int32 *  f 
)

Grabs fixed format of state variables
OpenGL's modelview matrix is handled on the DS with two matrices. The combination of the DS's position matrix and directional vector matrix hold the data that is in OpenGL's one modelview matrix. (a.k.a. modelview = postion and vector)
http://nocash.emubase.de/gbatek.htm#ds3diomap

引数:
param The state variable to retrieve
f pointer with room to hold the requested data
GL_STATIC_INLvoid glGetInt ( GL_GET_ENUM  param,
int *  i 
)

Grabs integer state variables from openGL.

引数:
param The state variable to retrieve
i pointer with room to hold the requested data
void* glGetTexturePointer ( int  name  ) 

returns the address alocated to the texure named by name

引数:
name the name of the texture to get a pointer to
GL_STATIC_INLvoid glLight ( int  id,
rgb  color,
v10  x,
v10  y,
v10  z 
)

set a light up. Only parallel light sources are supported on the DS
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dpolygonlightparameters

引数:
id the number of the light to setup
color the color of the light
x the x component of the lights directional vector. Direction must be normalized
y the y component of the lights directional vector. Direction must be normalized
z the z component of the lights directional vector. Direction must be normalized
例:
Graphics/3D/nehe/lesson06/source/nehe6.cpp, Graphics/3D/nehe/lesson07/source/nehe7.cpp, Graphics/3D/nehe/lesson08/source/nehe8.cpp, Graphics/3D/nehe/lesson09/source/nehe9.cpp, Graphics/3D/nehe/lesson10/source/nehe10.cpp, Graphics/3D/nehe/lesson10b/source/nehe10b.cpp, と input/Touch_Pad/touch_look/source/main.cpp.
GL_STATIC_INLvoid glLoadMatrix4x3 ( const m4x3 m  ) 

Loads a 4x3 matrix into the current matrix.

引数:
m pointer to a 4x4 matrix
GL_STATIC_INLvoid glLoadMatrix4x4 ( const m4x4 m  ) 

Loads a 4x4 matrix into the current matrix.

引数:
m pointer to a 4x4 matrix
void glMaterialf ( GL_MATERIALS_ENUM  mode,
rgb  color 
)
GL_STATIC_INLvoid glMatrixMode ( GL_MATRIX_MODE_ENUM  mode  ) 
GL_STATIC_INLvoid glMultMatrix3x3 ( const m3x3 m  ) 

multiplies the current matrix by m

引数:
m pointer to a 3x3 matrix
GL_STATIC_INLvoid glMultMatrix4x3 ( const m4x3 m  ) 

multiplies the current matrix by

引数:
m pointer to a 4x3 matrix
GL_STATIC_INLvoid glMultMatrix4x4 ( const m4x4 m  ) 

Multiplies the current matrix by m.

引数:
m pointer to a 4x4 matrix
GL_STATIC_INLvoid glNormal ( uint32  normal  ) 

the normal to use for following vertices
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dpolygonlightparameters

警告:
The nature of the format means that you can't represent the following normals exactly (0,0,1), (0,1,0), or (1,0,0)
引数:
normal the packed normal(3 * 10bit x, y, z)
例:
Graphics/3D/nehe/lesson10b/source/nehe10b.cpp, と input/Touch_Pad/touch_look/source/main.cpp.
GL_STATIC_INLvoid glNormal3f ( float  x,
float  y,
float  z 
)

the normal to use for following vertices
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dpolygonlightparameters

警告:
FLOAT VERSION!!!! please use glNormal()
引数:
x x component of the normal, vector must be normalized
y y component of the normal, vector must be normalized
z z component of the normal, vector must be normalized
例:
Graphics/3D/nehe/lesson07/source/nehe7.cpp, Graphics/3D/nehe/lesson08/source/nehe8.cpp, と Graphics/3D/nehe/lesson10/source/nehe10.cpp.
GL_STATIC_INLvoid glOrtho ( float  left,
float  right,
float  bottom,
float  top,
float  zNear,
float  zFar 
)

Multiplies the current matrix into ortho graphic mode.

警告:
FLOAT VERSION!!!! please use glOrthof32()
引数:
left left vertical clipping plane
right right vertical clipping plane
bottom bottom vertical clipping plane
top top vertical clipping plane
zNear near clipping plane
zFar far clipping plane
GL_STATIC_INLvoid glOrthof32 ( int32  left,
int32  right,
int32  bottom,
int32  top,
int32  zNear,
int32  zFar 
)

Multiplies the current matrix into ortho graphic mode.

引数:
left left vertical clipping plane
right right vertical clipping plane
bottom bottom vertical clipping plane
top top vertical clipping plane
zNear near clipping plane
zFar far clipping plane
GL_STATIC_INLvoid glPolyFmt ( uint32  params  ) 
GL_STATIC_INLvoid glPopMatrix ( int32  num  ) 
GL_STATIC_INLvoid glRestoreMatrix ( int32  index  ) 

Restores the current matrix from a location in the stack
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dmatrixstack

引数:
index the place in the stack to restore to
GL_STATIC_INLvoid glRotatef ( float  angle,
float  x,
float  y,
float  z 
)

Rotate about an arbitrary axis.

警告:
FLOAT VERSION!!!! please use glRotatef32i()
引数:
angle the angle to rotate by
x the x component of the axis to rotate on
y the y component of the axis to rotate on
z the z component of the axis to rotate on
例:
Graphics/3D/nehe/lesson04/source/nehe4.cpp, Graphics/3D/nehe/lesson05/source/nehe5.cpp, Graphics/3D/nehe/lesson06/source/nehe6.cpp, Graphics/3D/nehe/lesson07/source/nehe7.cpp, Graphics/3D/nehe/lesson08/source/nehe8.cpp, Graphics/3D/nehe/lesson09/source/nehe9.cpp, Graphics/3D/nehe/lesson10/source/nehe10.cpp, と Graphics/3D/nehe/lesson11/source/nehe11.cpp.
GL_STATIC_INLvoid glRotatef32 ( float  angle,
int32  x,
int32  y,
int32  z 
)

Rotate on an arbitrary axis.

警告:
FLOAT VERSION!!!! please use glRotatef32i()
引数:
angle the angle to rotate by
x the x component of the axis to rotate on
y the y component of the axis to rotate on
z the z component of the axis to rotate on
void glRotatef32i ( int  angle,
int32  x,
int32  y,
int32  z 
)

Rotates the model view matrix by angle about the specified unit vector.

引数:
angle The angle to rotate by
x X component of the unit vector axis.
y Y component of the unit vector axis.
z Z component of the unit vector axis.
例:
Graphics/3D/3D_Both_Screens/source/template.c, Graphics/3D/nehe/lesson10b/source/nehe10b.cpp, と input/Touch_Pad/touch_look/source/main.cpp.
GL_STATIC_INLvoid glRotateX ( float  angle  ) 

Rotates the current modelview matrix by angle degrees about the x axis.

警告:
FLOAT VERSION!!!! please use glRotateXi()
引数:
angle The angle to rotate by
例:
Graphics/3D/Display_List/source/main.cpp.
GL_STATIC_INLvoid glRotateXi ( int  angle  ) 

Rotates the current modelview matrix by angle about the x axis.

引数:
angle The angle to rotate by (angle is -32768 to 32767)
GL_STATIC_INLvoid glRotateY ( float  angle  ) 

Rotates the current modelview matrix by angle degrees about the y axis.

警告:
FLOAT VERSION!!!! please use glRotateYi()
引数:
angle The angle to rotate by
例:
Graphics/3D/Display_List/source/main.cpp.
GL_STATIC_INLvoid glRotateYi ( int  angle  ) 

Rotates the current modelview matrix by angle about the y axis.

引数:
angle The angle to rotate by (angle is -32768 to 32767)
GL_STATIC_INLvoid glRotateZ ( float  angle  ) 

Rotates the current modelview matrix by angle degrees about the z axis.

警告:
FLOAT VERSION!!!! please use glRotateZi()
引数:
angle The angle to rotate by
例:
RealTimeClock/Watch/source/main.cpp.
GL_STATIC_INLvoid glRotateZi ( int  angle  ) 

Rotates the current modelview matrix by angle about the z axis.

引数:
angle The angle to rotate by (angle is -32768 to 32767)
GL_STATIC_INLvoid glScalef ( float  x,
float  y,
float  z 
)

multiply the current matrix by a scale matrix
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dmatrixloadmultiply

警告:
FLOAT VERSION!!!! please use glScalev() or glScalef32()
引数:
x scaling on the x axis
y scaling on the y axis
z scaling on the z axis
GL_STATIC_INLvoid glScalef32 ( int32  factor  ) 

multiply the current matrix by a scale matrix
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dmatrixloadmultiply

引数:
factor the factor to scale by
GL_STATIC_INLvoid glScalev ( const GLvector v  ) 

multiply the current matrix by a translation matrix
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dmatrixloadmultiply

引数:
v the vector to translate by
GL_STATIC_INLvoid glSetOutlineColor ( int  id,
rgb  color 
)

Specifies an edge color for polygons.

引数:
id which outline color to set (0-7)
color the 15bit color to set
GL_STATIC_INLvoid glSetToonTable ( const uint16 *  table  ) 

Loads a toon table.

引数:
table pointer to the 32 color palette to load into the toon table
GL_STATIC_INLvoid glSetToonTableRange ( int  start,
int  end,
rgb  color 
)

Sets a range of colors on the toon table.

引数:
start the start of the range
end the end of the range
color the color to set for that range
GL_STATIC_INLvoid glStoreMatrix ( int32  index  ) 

Place the current matrix into the stack at a location
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dmatrixstack

引数:
index the place in the stack to put the current matrix
GL_STATIC_INLvoid glTexCoord2f ( float  s,
float  t 
)

Sets texture coordinates for following vertices
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dtextureattributes

警告:
FLOAT VERSION!!!! please use glTexCoord2t16()
引数:
s S(a.k.a. U) texture coordinate (0.0 - 1.0)
t T(a.k.a. V) texture coordinate (0.0 - 1.0)
例:
Graphics/3D/nehe/lesson06/source/nehe6.cpp, Graphics/3D/nehe/lesson07/source/nehe7.cpp, Graphics/3D/nehe/lesson08/source/nehe8.cpp, Graphics/3D/nehe/lesson09/source/nehe9.cpp, と Graphics/3D/nehe/lesson10/source/nehe10.cpp.
void glTexCoord2f32 ( int32  u,
int32  v 
)

Sets texture coordinates for following vertices
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dtextureattributes

引数:
u U(a.k.a. S) texture coordinate (0.0 - 1.0)
v V(a.k.a. T) texture coordinate (0.0 - 1.0)
GL_STATIC_INLvoid glTexCoord2t16 ( t16  u,
t16  v 
)

Sets texture coordinates for following vertices
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dtextureattributes

引数:
u U(a.k.a. S) texture coordinate in texels
v V(a.k.a. T) texture coordinate in texels
例:
Graphics/3D/nehe/lesson10b/source/nehe10b.cpp, Graphics/3D/nehe/lesson11/source/nehe11.cpp, と input/Touch_Pad/touch_look/source/main.cpp.
int glTexImage2D ( int  target,
int  empty1,
GL_TEXTURE_TYPE_ENUM  type,
int  sizeX,
int  sizeY,
int  empty2,
int  param,
const uint8 *  texture 
)

Loads a 2D texture into texture memory and sets the currently bound texture ID to the attributes specified.

引数:
target not used, just here for OpenGL compatibility
empty1 not used, just here for OpenGL compatibility
type The format of the texture
sizeX the horizontal size of the texture; valid sizes are enumerated in GL_TEXTURE_TYPE_ENUM
sizeY the vertical size of the texture; valid sizes are enumerated in GL_TEXTURE_TYPE_ENUM
empty2 not used, just here for OpenGL compatibility
param parameters for the texture
texture pointer to the texture data to load
例:
Graphics/3D/nehe/lesson06/source/nehe6.cpp, Graphics/3D/nehe/lesson07/source/nehe7.cpp, Graphics/3D/nehe/lesson08/source/nehe8.cpp, Graphics/3D/nehe/lesson09/source/nehe9.cpp, Graphics/3D/nehe/lesson10/source/nehe10.cpp, Graphics/3D/nehe/lesson10b/source/nehe10b.cpp, Graphics/3D/nehe/lesson11/source/nehe11.cpp, と input/Touch_Pad/touch_look/source/main.cpp.
void glTexLoadPal ( const u16 *  pal,
u16  count,
u32  addr 
)

Loads a palette into the specified texture addr.

引数:
pal pointer to the palette to load
count the size of the palette
addr the offset in VRAM to load the palette
void glTexParameter ( uint8  sizeX,
uint8  sizeY,
const uint32 *  addr,
GL_TEXTURE_TYPE_ENUM  mode,
GL_TEXTURE_PARAM_ENUM  param 
)

Set parameters for the current texture. Although named the same as its gl counterpart, it is not compatible. Effort may be made in the future to make it so.

引数:
sizeX the horizontal size of the texture; valid sizes are enumerated in GL_TEXTURE_TYPE_ENUM
sizeY the vertical size of the texture; valid sizes are enumerated in GL_TEXTURE_TYPE_ENUM
addr offset into VRAM where you put the texture
mode the type of texture
param paramaters for the texture
GL_STATIC_INLvoid glTranslate3f32 ( int32  x,
int32  y,
int32  z 
)

multiply the current matrix by a translation matrix
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dmatrixloadmultiply

引数:
x translation on the x axis
y translation on the y axis
z translation on the z axis
例:
Graphics/3D/Display_List/source/main.cpp, Graphics/3D/nehe/lesson10b/source/nehe10b.cpp, と input/Touch_Pad/touch_look/source/main.cpp.
GL_STATIC_INLvoid glTranslatef ( float  x,
float  y,
float  z 
)
GL_STATIC_INLvoid glTranslatev ( const GLvector v  ) 

multiply the current matrix by a translation matrix
GBATEK http://nocash.emubase.de/gbatek.htm#ds3dmatrixloadmultiply

引数:
v the vector to translate by
GL_STATIC_INLvoid gluLookAt ( float  eyex,
float  eyey,
float  eyez,
float  lookAtx,
float  lookAty,
float  lookAtz,
float  upx,
float  upy,
float  upz 
)

Places the camera at the specified location and orientation (floating point version).

警告:
FLOAT VERSION!!!! please use gluLookAtf32()
引数:
eyex (eyex, eyey, eyez) Location of the camera.
eyey (eyex, eyey, eyez) Location of the camera.
eyez (eyex, eyey, eyez) Location of the camera.
lookAtx (lookAtx, lookAty, lookAtz) Where the camera is looking.
lookAty (lookAtx, lookAty, lookAtz) Where the camera is looking.
lookAtz (lookAtx, lookAty, lookAtz) Where the camera is looking.
upx <upx, upy, upz> Unit vector describing which direction is up for the camera.
upy <upx, upy, upz> Unit vector describing which direction is up for the camera.
upz <upx, upy, upz> Unit vector describing which direction is up for the camera.
例:
Graphics/3D/Display_List/source/main.cpp, と RealTimeClock/Watch/source/main.cpp.
GL_STATIC_INLvoid gluLookAtf32 ( int32  eyex,
int32  eyey,
int32  eyez,
int32  lookAtx,
int32  lookAty,
int32  lookAtz,
int32  upx,
int32  upy,
int32  upz 
)

Places the camera at the specified location and orientation (fixed point version).

引数:
eyex (eyex, eyey, eyez) Location of the camera.
eyey (eyex, eyey, eyez) Location of the camera.
eyez (eyex, eyey, eyez) Location of the camera.
lookAtx (lookAtx, lookAty, lookAtz) Where the camera is looking.
lookAty (lookAtx, lookAty, lookAtz) Where the camera is looking.
lookAtz (lookAtx, lookAty, lookAtz) Where the camera is looking.
upx <upx, upy, upz> Unit vector describing which direction is up for the camera.
upy <upx, upy, upz> Unit vector describing which direction is up for the camera.
upz <upx, upy, upz> Unit vector describing which direction is up for the camera.
GL_STATIC_INLvoid gluPerspective ( float  fovy,
float  aspect,
float  zNear,
float  zFar 
)
GL_STATIC_INLvoid gluPerspectivef32 ( int  fovy,
int32  aspect,
int32  zNear,
int32  zFar 
)

Utility function which sets up the projection matrix (fixed point version).

引数:
fovy Specifies the field of view in degrees (-32768 to 32767)
aspect Specifies the aspect ratio of the screen (normally screen width/screen height)
zNear Specifies the near clipping plane
zFar Specifies the far clipping plane
GL_STATIC_INLvoid gluPickMatrix ( int  x,
int  y,
int  width,
int  height,
const int  viewport[4] 
)

Utility function which generates a picking matrix for selection.

引数:
x 2D x of center (touch x normally)
y 2D y of center (touch y normally)
width width in pixels of the window (3 or 4 is a good number)
height height in pixels of the window (3 or 4 is a good number)
viewport the current viewport (normally {0, 0, 255, 191})
int gluTexLoadPal ( const u16 *  pal,
u16  count,
uint8  format 
)

Loads a palette into the next available palette slot, returns the addr on success or -1.

引数:
pal pointer to the palette to load
count the size of the palette
format the format of the texture
GL_STATIC_INLvoid glVertex3f ( float  x,
float  y,
float  z 
)
GL_STATIC_INLvoid glVertex3v16 ( v16  x,
v16  y,
v16  z 
)

specifies a vertex

引数:
x the x component for the vertex
y the y component for the vertex
z the z component for the vertex
例:
Graphics/3D/nehe/lesson10b/source/nehe10b.cpp, Graphics/3D/nehe/lesson11/source/nehe11.cpp, と input/Touch_Pad/touch_look/source/main.cpp.
GL_STATIC_INLvoid glViewport ( uint8  x1,
uint8  y1,
uint8  x2,
uint8  y2 
)
GL_STATIC_INLuint32 POLY_ALPHA ( int  n  ) 
GL_STATIC_INLint32 POLY_ID ( int  n  ) 

used in glPolyFmt() to set the Polygon ID for the following polygons

引数:
n the ID to set for following polygons (0-63)
 全て クラス ファイル 関数 変数 型定義 列挙型 列挙型の値 マクロ定義
libndsに対してMon Apr 26 23:39:50 2010に生成されました。  doxygen 1.6.3