| TerraLib 4.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/drivers/GL/dmesa.h
Go to the documentation of this file.

    00001 /*
    00002  * Mesa 3-D graphics library
    00003  * Version:  6.1
    00004  *
    00005  * Copyright (C) 1999-2004  Brian Paul   All Rights Reserved.
    00006  *
    00007  * Permission is hereby granted, free of charge, to any person obtaining a
    00008  * copy of this software and associated documentation files (the "Software"),
    00009  * to deal in the Software without restriction, including without limitation
    00010  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
    00011  * and/or sell copies of the Software, and to permit persons to whom the
    00012  * Software is furnished to do so, subject to the following conditions:
    00013  *
    00014  * The above copyright notice and this permission notice shall be included
    00015  * in all copies or substantial portions of the Software.
    00016  *
    00017  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
    00018  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    00019  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
    00020  * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
    00021  * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
    00022  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
    00023  */
    00024
    00025 /*
    00026  * DOS/DJGPP device driver for Mesa
    00027  *
    00028  *  Author: Daniel Borca
    00029  *  Email : dborca@users.sourceforge.net
    00030  *  Web   : http://www.geocities.com/dborca
    00031  */
    00032
    00033
    00034 #ifndef DMESA_H_included
    00035 #define DMESA_H_included
    00036
    00037 #define DMESA_MAJOR_VERSION 6
    00038 #define DMESA_MINOR_VERSION 5
    00039
    00040 /* Sample Usage:
    00041  *
    00042  * 1. Call DMesaCreateVisual() to initialize graphics.
    00043  * 2. Call DMesaCreateContext() to create a DMesa rendering context.
    00044  * 3. Call DMesaCreateBuffer() to define the window.
    00045  * 4. Call DMesaMakeCurrent() to bind the DMesaBuffer to a DMesaContext.
    00046  * 5. Make gl* calls to render your graphics.
    00047  * 6. Use DMesaSwapBuffers() when double buffering to swap front/back buffers.
    00048  * 7. Before exiting, destroy DMesaBuffer, DMesaContext and DMesaVisual.
    00049  */
    00050
    00051 typedef struct dmesa_context *DMesaContext;
    00052 typedef struct dmesa_visual *DMesaVisual;
    00053 typedef struct dmesa_buffer *DMesaBuffer;
    00054
    00055 #ifdef __cplusplus
    00056 extern "C" {
    00057 #endif
    00058
    00059 /*
    00060  * Create a new Visual and set graphics mode.
    00061  */
    00062 DMesaVisual DMesaCreateVisual (GLint width,        /* X res */
    00063                                GLint height,       /* Y res */
    00064                                GLint colDepth,     /* BPP */
    00065                                GLint refresh,      /* refresh rate: 0=default */
    00066                                GLboolean dbFlag,   /* double-buffered */
    00067                                GLboolean rgbFlag,  /* RGB mode */
    00068                                GLint alphaSize,    /* requested bits/alpha */
    00069                                GLint depthSize,    /* requested bits/depth */
    00070                                GLint stencilSize,  /* requested bits/stencil */
    00071                                GLint accumSize);   /* requested bits/accum */
    00072
    00073 /*
    00074  * Destroy Visual and restore screen.
    00075  */
    00076 void DMesaDestroyVisual (DMesaVisual v);
    00077
    00078
    00079
    00080 /*
    00081  * Create a new Context for rendering.
    00082  */
    00083 DMesaContext DMesaCreateContext (DMesaVisual visual, DMesaContext share);
    00084
    00085 /*
    00086  * Destroy Context.
    00087  */
    00088 void DMesaDestroyContext (DMesaContext c);
    00089
    00090 /*
    00091  * Return a handle to the current context.
    00092  */
    00093 DMesaContext DMesaGetCurrentContext (void);
    00094
    00095
    00096
    00097 /*
    00098  * Create a new Buffer (window).
    00099  */
    00100 DMesaBuffer DMesaCreateBuffer (DMesaVisual visual,
    00101                                GLint xpos, GLint ypos,
    00102                                GLint width, GLint height);
    00103
    00104 /*
    00105  * Destroy Buffer.
    00106  */
    00107 void DMesaDestroyBuffer (DMesaBuffer b);
    00108
    00109 /*
    00110  * Return a handle to the current buffer.
    00111  */
    00112 DMesaBuffer DMesaGetCurrentBuffer (void);
    00113
    00114 /*
    00115  * Swap the front and back buffers for the given Buffer.
    00116  * No action is taken if the buffer is not double buffered.
    00117  */
    00118 void DMesaSwapBuffers (DMesaBuffer b);
    00119
    00120 /*
    00121  * Bind Buffer to Context and make the Context the current one.
    00122  */
    00123 GLboolean DMesaMakeCurrent (DMesaContext c, DMesaBuffer b);
    00124
    00125
    00126
    00127 /*
    00128  * Move/Resize current Buffer.
    00129  */
    00130 GLboolean DMesaMoveBuffer (GLint xpos, GLint ypos);
    00131 GLboolean DMesaResizeBuffer (GLint width, GLint height);
    00132
    00133 /*
    00134  * Set palette index, using normalized values.
    00135  */
    00136 void DMesaSetCI (int ndx, GLfloat red, GLfloat green, GLfloat blue);
    00137
    00138 /*
    00139  * DMesa functions
    00140  */
    00141 typedef void (*DMesaProc) ();
    00142 DMesaProc DMesaGetProcAddress (const char *name);
    00143
    00144 /*
    00145  * DMesa state retrieval.
    00146  */
    00147 #define DMESA_GET_SCREEN_SIZE 0x0100
    00148 #define DMESA_GET_DRIVER_CAPS 0x0200
    00149 #define DMESA_GET_VIDEO_MODES 0x0300
    00150 #define DMESA_GET_BUFFER_ADDR 0x0400
    00151
    00152 #define DMESA_DRIVER_DBL_BIT 0x1 /* double-buffered */
    00153 #define DMESA_DRIVER_YUP_BIT 0x2 /* lower-left window origin */
    00154 int DMesaGetIntegerv (GLenum pname, GLint *params);
    00155
    00156 #ifdef __cplusplus
    00157 }
    00158 #endif
    00159
    00160 #endif

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines