-/* $Id: context.c,v 1.50 2000/03/22 23:20:12 brianp Exp $ */
+/* $Id: context.c,v 1.51 2000/03/27 17:54:17 brianp Exp $ */
/*
* Mesa 3-D graphics library
out_of_memory = GL_FALSE;
for (i=0;i<MAX_TEXTURE_LEVELS;i++) {
- ctx->Texture.Proxy1D->Image[i] = gl_alloc_texture_image();
- ctx->Texture.Proxy2D->Image[i] = gl_alloc_texture_image();
- ctx->Texture.Proxy3D->Image[i] = gl_alloc_texture_image();
+ ctx->Texture.Proxy1D->Image[i] = _mesa_alloc_texture_image();
+ ctx->Texture.Proxy2D->Image[i] = _mesa_alloc_texture_image();
+ ctx->Texture.Proxy3D->Image[i] = _mesa_alloc_texture_image();
if (!ctx->Texture.Proxy1D->Image[i]
|| !ctx->Texture.Proxy2D->Image[i]
|| !ctx->Texture.Proxy3D->Image[i]) {
if (out_of_memory) {
for (i=0;i<MAX_TEXTURE_LEVELS;i++) {
if (ctx->Texture.Proxy1D->Image[i]) {
- gl_free_texture_image(ctx->Texture.Proxy1D->Image[i]);
+ _mesa_free_texture_image(ctx->Texture.Proxy1D->Image[i]);
}
if (ctx->Texture.Proxy2D->Image[i]) {
- gl_free_texture_image(ctx->Texture.Proxy2D->Image[i]);
+ _mesa_free_texture_image(ctx->Texture.Proxy2D->Image[i]);
}
if (ctx->Texture.Proxy3D->Image[i]) {
- gl_free_texture_image(ctx->Texture.Proxy3D->Image[i]);
+ _mesa_free_texture_image(ctx->Texture.Proxy3D->Image[i]);
}
}
gl_free_texture_object(NULL, ctx->Texture.Proxy1D);
* Return new gl_texture_image struct with all fields initialized to zero.
*/
struct gl_texture_image *
-gl_alloc_texture_image( void )
+_mesa_alloc_texture_image( void )
{
return CALLOC_STRUCT(gl_texture_image);
}
void
-gl_free_texture_image( struct gl_texture_image *teximage )
+_mesa_free_texture_image( struct gl_texture_image *teximage )
{
if (teximage->Data) {
FREE( teximage->Data );
texImage = texObj->Image[level];
if (!texImage) {
- texImage = gl_alloc_texture_image();
+ texImage = _mesa_alloc_texture_image();
texObj->Image[level] = texImage;
if (!texImage) {
gl_error(ctx, GL_OUT_OF_MEMORY, "glTexImage1D");
texImage = texObj->Image[level];
if (!texImage) {
- texImage = gl_alloc_texture_image();
+ texImage = _mesa_alloc_texture_image();
texObj->Image[level] = texImage;
if (!texImage) {
gl_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D");
texImage = texObj->Image[level];
if (!texImage) {
- texImage = gl_alloc_texture_image();
+ texImage = _mesa_alloc_texture_image();
texObj->Image[level] = texImage;
if (!texImage) {
gl_error(ctx, GL_OUT_OF_MEMORY, "glTexImage3D");
* Fetch a texture image from the device driver.
* Store the results in the given texture object at the given mipmap level.
*/
-static void
-get_teximage_from_driver( GLcontext *ctx, GLenum target, GLint level,
- const struct gl_texture_object *texObj )
+void
+_mesa_get_teximage_from_driver( GLcontext *ctx, GLenum target, GLint level,
+ const struct gl_texture_object *texObj )
{
GLvoid *image;
GLenum imgFormat, imgType;
if (!texImage->Data) {
/* try to get the texture image from the device driver */
- get_teximage_from_driver(ctx, target, level, texObj);
+ _mesa_get_teximage_from_driver(ctx, target, level, texObj);
discardImage = GL_TRUE;
}
else {
const GLint xoffsetb = xoffset + texImage->Border;
GLboolean retain = GL_TRUE;
if (!texImage->Data) {
- get_teximage_from_driver( ctx, target, level, texObj );
+ _mesa_get_teximage_from_driver( ctx, target, level, texObj );
if (!texImage->Data) {
make_null_texture(texImage);
}
GLboolean retain = GL_TRUE;
if (!texImage->Data) {
- get_teximage_from_driver( ctx, target, level, texObj );
+ _mesa_get_teximage_from_driver( ctx, target, level, texObj );
if (!texImage->Data) {
make_null_texture(texImage);
}
-/* $Id: teximage.h,v 1.5 2000/03/23 16:23:14 brianp Exp $ */
+/* $Id: teximage.h,v 1.6 2000/03/27 17:54:17 brianp Exp $ */
/*
* Mesa 3-D graphics library
extern struct gl_texture_image *
-gl_alloc_texture_image( void );
+_mesa_alloc_texture_image( void );
extern void
-gl_free_texture_image( struct gl_texture_image *teximage );
+_mesa_free_texture_image( struct gl_texture_image *teximage );
+extern void
+_mesa_get_teximage_from_driver( GLcontext *ctx, GLenum target, GLint level,
+ const struct gl_texture_object *texObj );
+
/*** API entry point functions ***/