EdenSurfacesIntroductionTexture loading, selection, and drawing. DiscussionEdenSurfaces forms one part of the Eden library. Functions
EdenGLCapabilityCheckChecks for the presence of an OpenGL capability by version or extension. int EdenGLCapabilityCheck( const unsigned short minVersion, const unsigned char *extension); Parameters
Return ValueTRUE If either of the tests passes, or FALSE if both fail. DiscussionChecks for the presence of an OpenGL capability by version or extension. The test returns true if EITHER the OpenGL driver's OpenGL implementation version meets or exceeds a minimum value (passed in in minVersion) OR if an OpenGL extension identifier passed in as a character string is non-NULL, and is found in the current driver's list of supported extensions. EdenGluCheckExtensionCheck for the availability of an OpenGL extension. GLboolean EdenGluCheckExtension( const GLubyte *extName, const GLubyte *extString); ParametersReturn ValueTRUE, if the extension is found, FALSE otherwise. DiscussionProvides the same functionality as the gluCheckExtension() function, since some platforms don't have GLU version 1.3 or later. EdenSurfacesDrawDraw a texture on a quad using OpenGL. EDEN_BOOL EdenSurfacesDraw( const int contextIndex, const TEXTURE_INDEX_t textureIndex, const int width, const int height, const EDEN_TEXTURE_SCALING_MODE scaleMode, const EDEN_TEXTURE_ALIGNMENT_MODE alignMode); ParametersReturn ValueTRUE if the function succeeded, FALSE otherwise. DiscussionDraws the texture pointed to by index on a surface of size (width, height) OpenGL units, with the lower-left corner of the surface at the origin, and the surface lying in the X-Y plane. To draw at a different position and/or orientation precede with glTranslate/glRotate calls. EdenSurfacesFinalFinalise the EdenSurfaces library. EDEN_BOOL EdenSurfacesFinal( void); Return ValueTRUE if the function succeeded, FALSE otherwise. DiscussionThis function should be called once no more calls to any other EdenSurfaces*() functions are required, to free up allocated memory. Does NOT require that a valid OpenGL context be available. EdenSurfacesInitInitialise the EdenSurfaces library. EDEN_BOOL EdenSurfacesInit( const int contextsActiveCount, const int textureIndicesMax); ParametersReturn ValueTRUE if the function succeeded, FALSE otherwise. DiscussionThis function must be called prior to any other EdenSurfaces*() functions being called. Does NOT require that a valid OpenGL context be available. EdenSurfacesTextureLoadLoads textures into OpenGL texture objects. EDEN_BOOL EdenSurfacesTextureLoad( const int contextIndex, const int numTextures, const TEXTURE_INFO_t *textureInfo, TEXTURE_INDEX_t *textureIndices, char *hasAlpha_out); Parameters
Return ValueTRUE if all textures were loaded correctly, FALSE if one or more were not. DiscussionLoads numTextures textures into OpenGL texture objects, for the specified OpenGL context (the first context has a contextIndex of 0). EdenSurfacesTextureSetBinds the OpenGL texture. void EdenSurfacesTextureSet( const int contextIndex, TEXTURE_INDEX_t textureIndex); Parameters
EdenSurfacesTextureUnloadUnloads textures and frees OpenGL texture objects. EDEN_BOOL EdenSurfacesTextureUnload( const int contextIndex, const int numTextures, TEXTURE_INDEX_t *textureIndices); Parameters
Return ValueTRUE if the function succeeded, FALSE otherwise. DiscussionUnloads numTextures textures from OpenGL texture objects, for the specified OpenGL context. Typedefs
EDEN_TEXTURE_ALIGNMENT_MODEHow to align the texture content when drawing a texture on a quad. typedef enum { CENTRE, TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, BOTTOM_RIGHT, LEFT, TOP, RIGHT, BOTTOM } EDEN_TEXTURE_ALIGNMENT_MODE; EDEN_TEXTURE_SCALING_MODEScaling mode to use when drawing a texture on a quad. Constants
TEXTURE_INFO_ttypedef struct { const char *pathname; GLboolean mipmaps; GLint internalformat; GLint min_filter; GLint mag_filter; GLint wrap_s; GLint wrap_t; GLclampf priority; GLint env_mode; //GLfloat env_color[4]; } TEXTURE_INFO_t; Fields
|