17117f1b4Smrg/** 27117f1b4Smrg * \file dlist.h 37117f1b4Smrg * Display lists management. 47117f1b4Smrg */ 57117f1b4Smrg 67117f1b4Smrg/* 77117f1b4Smrg * Mesa 3-D graphics library 87117f1b4Smrg * 97117f1b4Smrg * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. 107117f1b4Smrg * 117117f1b4Smrg * Permission is hereby granted, free of charge, to any person obtaining a 127117f1b4Smrg * copy of this software and associated documentation files (the "Software"), 137117f1b4Smrg * to deal in the Software without restriction, including without limitation 147117f1b4Smrg * the rights to use, copy, modify, merge, publish, distribute, sublicense, 157117f1b4Smrg * and/or sell copies of the Software, and to permit persons to whom the 167117f1b4Smrg * Software is furnished to do so, subject to the following conditions: 177117f1b4Smrg * 187117f1b4Smrg * The above copyright notice and this permission notice shall be included 197117f1b4Smrg * in all copies or substantial portions of the Software. 207117f1b4Smrg * 217117f1b4Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 227117f1b4Smrg * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 237117f1b4Smrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24af69d88dSmrg * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 25af69d88dSmrg * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 26af69d88dSmrg * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27af69d88dSmrg * OTHER DEALINGS IN THE SOFTWARE. 287117f1b4Smrg */ 297117f1b4Smrg 307117f1b4Smrg 317117f1b4Smrg 327117f1b4Smrg#ifndef DLIST_H 337117f1b4Smrg#define DLIST_H 347117f1b4Smrg 3501e04c3fSmrg#include <stdio.h> 367117f1b4Smrg 3701e04c3fSmrgstruct gl_context; 3801e04c3fSmrg 3901e04c3fSmrg/** 4001e04c3fSmrg * Describes the location and size of a glBitmap image in a texture atlas. 4101e04c3fSmrg */ 4201e04c3fSmrgstruct gl_bitmap_glyph 4301e04c3fSmrg{ 4401e04c3fSmrg unsigned short x, y, w, h; /**< position and size in the texture */ 4501e04c3fSmrg float xorig, yorig; /**< bitmap origin */ 4601e04c3fSmrg float xmove, ymove; /**< rasterpos move */ 4701e04c3fSmrg}; 4801e04c3fSmrg 4901e04c3fSmrg 5001e04c3fSmrg/** 5101e04c3fSmrg * Describes a set of glBitmap display lists which live in a texture atlas. 5201e04c3fSmrg * The idea is when we see a code sequence of glListBase(b), glCallLists(n) 5301e04c3fSmrg * we're probably drawing bitmap font glyphs. We try to put all the bitmap 5401e04c3fSmrg * glyphs into one texture map then render the glCallLists as a textured 5501e04c3fSmrg * quadstrip. 5601e04c3fSmrg */ 5701e04c3fSmrgstruct gl_bitmap_atlas 5801e04c3fSmrg{ 597ec681f3Smrg GLint Id; 6001e04c3fSmrg bool complete; /**< Is the atlas ready to use? */ 6101e04c3fSmrg bool incomplete; /**< Did we fail to construct this atlas? */ 6201e04c3fSmrg 6301e04c3fSmrg unsigned numBitmaps; 6401e04c3fSmrg unsigned texWidth, texHeight; 6501e04c3fSmrg struct gl_texture_object *texObj; 6601e04c3fSmrg struct gl_texture_image *texImage; 6701e04c3fSmrg 6801e04c3fSmrg unsigned glyphHeight; 6901e04c3fSmrg 7001e04c3fSmrg struct gl_bitmap_glyph *glyphs; 7101e04c3fSmrg}; 7201e04c3fSmrg 7301e04c3fSmrgvoid 7401e04c3fSmrg_mesa_delete_bitmap_atlas(struct gl_context *ctx, 7501e04c3fSmrg struct gl_bitmap_atlas *atlas); 767117f1b4Smrg 777117f1b4Smrg 78af69d88dSmrgGLboolean GLAPIENTRY 79af69d88dSmrg_mesa_IsList(GLuint list); 8001e04c3fSmrg 81af69d88dSmrgvoid GLAPIENTRY 82af69d88dSmrg_mesa_DeleteLists(GLuint list, GLsizei range); 8301e04c3fSmrg 84af69d88dSmrgGLuint GLAPIENTRY 85af69d88dSmrg_mesa_GenLists(GLsizei range); 8601e04c3fSmrg 87af69d88dSmrgvoid GLAPIENTRY 88af69d88dSmrg_mesa_NewList(GLuint name, GLenum mode); 8901e04c3fSmrg 90af69d88dSmrgvoid GLAPIENTRY 91af69d88dSmrg_mesa_EndList(void); 9201e04c3fSmrg 93af69d88dSmrgvoid GLAPIENTRY 9401e04c3fSmrg_mesa_CallList(GLuint list); 9501e04c3fSmrg 96af69d88dSmrgvoid GLAPIENTRY 9701e04c3fSmrg_mesa_CallLists(GLsizei n, GLenum type, const GLvoid *lists); 9801e04c3fSmrg 99af69d88dSmrgvoid GLAPIENTRY 100af69d88dSmrg_mesa_ListBase(GLuint base); 101af69d88dSmrg 10201e04c3fSmrgstruct gl_display_list * 1037ec681f3Smrg_mesa_lookup_list(struct gl_context *ctx, GLuint list, bool locked); 1047117f1b4Smrg 10501e04c3fSmrgvoid 10601e04c3fSmrg_mesa_compile_error(struct gl_context *ctx, GLenum error, const char *s); 10701e04c3fSmrg 10801e04c3fSmrgvoid * 1097ec681f3Smrg_mesa_dlist_alloc_vertex_list(struct gl_context *ctx, 1107ec681f3Smrg bool copy_to_current); 1117117f1b4Smrg 11201e04c3fSmrgvoid 11301e04c3fSmrg_mesa_delete_list(struct gl_context *ctx, struct gl_display_list *dlist); 1147117f1b4Smrg 11501e04c3fSmrgvoid 11601e04c3fSmrg_mesa_initialize_save_table(const struct gl_context *); 1177117f1b4Smrg 11801e04c3fSmrgvoid 11901e04c3fSmrg_mesa_install_dlist_vtxfmt(struct _glapi_table *disp, 12001e04c3fSmrg const GLvertexformat *vfmt); 1217117f1b4Smrg 12201e04c3fSmrgvoid 12301e04c3fSmrg_mesa_init_display_list(struct gl_context * ctx); 1247117f1b4Smrg 1257ec681f3Smrgbool 1267ec681f3Smrg_mesa_get_list(struct gl_context *ctx, GLuint list, 1277ec681f3Smrg struct gl_display_list **dlist, 1287ec681f3Smrg bool locked); 1297117f1b4Smrg 1304a49301eSmrg#endif /* DLIST_H */ 131