Ignore:
Timestamp:
May 21, 2000, 10:57:14 PM (25 years ago)
Author:
jeroen
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/opengl/mesa/context.h

    r2970 r3582  
    1 /* $Id: context.h,v 1.3 2000-03-02 13:27:30 sandervl Exp $ */
     1/* $Id: context.h,v 1.4 2000-05-21 20:26:33 jeroen Exp $ */
    22
    33/*
    44 * Mesa 3-D graphics library
    5  * Version:  3.1
     5 * Version:  3.3
    66 *
    77 * Copyright (C) 1999  Brian Paul   All Rights Reserved.
     
    3434
    3535#include "types.h"
    36 
    37 #ifdef THREADS
    38    /*
    39     * A seperate GLcontext for each thread
    40     */
    41    extern GLcontext *gl_get_thread_context( void );
    42 #else
    43    /*
    44     * All threads use same pointer to current context.
    45     */
    46    extern GLcontext *CC;
    47    extern struct immediate *CURRENT_INPUT;
    48 #endif
    49 
    50 
     36#include "glapi.h"
    5137
    5238/*
     
    9177
    9278/*
     79 * Create/destroy a GLframebuffer.  A GLframebuffer is like a GLX drawable.
     80 * It bundles up the depth buffer, stencil buffer and accum buffers into a
     81 * single entity.
     82 */
     83extern GLframebuffer *gl_create_framebuffer( GLvisual *visual,
     84                                             GLboolean softwareDepth,
     85                                             GLboolean softwareStencil,
     86                                             GLboolean softwareAccum,
     87                                             GLboolean softwareAlpha );
     88
     89extern void gl_destroy_framebuffer( GLframebuffer *buffer );
     90
     91
     92
     93/*
    9394 * Create/destroy a GLcontext.  A GLcontext is like a GLX context.  It
    9495 * contains the rendering state.
     
    99100                                     GLboolean direct);
    100101
     102extern GLboolean gl_initialize_context_data( GLcontext *ctx,
     103                                             GLvisual *visual,
     104                                             GLcontext *share_list,
     105                                             void *driver_ctx,
     106                                             GLboolean direct );
     107
     108extern void gl_free_context_data( GLcontext *ctx );
     109
    101110extern void gl_destroy_context( GLcontext *ctx );
    102111
    103 /* Called by the driver after both the context and driver are fully
    104  * initialized.  Currently just reads the config file.
    105  */
     112
    106113extern void gl_context_initialize( GLcontext *ctx );
    107114
    108 /*
    109  * Create/destroy a GLframebuffer.  A GLframebuffer is like a GLX drawable.
    110  * It bundles up the depth buffer, stencil buffer and accum buffers into a
    111  * single entity.
    112  */
    113 extern GLframebuffer *gl_create_framebuffer( GLvisual *visual );
    114 
    115 extern void gl_destroy_framebuffer( GLframebuffer *buffer );
    116 
     115
     116extern void gl_copy_context(const GLcontext *src, GLcontext *dst, GLuint mask);
    117117
    118118
    119119extern void gl_make_current( GLcontext *ctx, GLframebuffer *buffer );
    120120
     121
     122extern void gl_make_current2( GLcontext *ctx, GLframebuffer *drawBuffer,
     123                              GLframebuffer *readBuffer );
     124
     125
    121126extern GLcontext *gl_get_current_context(void);
    122127
    123 extern void gl_copy_context(const GLcontext *src, GLcontext *dst, GLuint mask);
    124 
    125 extern void gl_set_api_table( GLcontext *ctx, const struct gl_api_table *api );
    126 
    127 
    128 
    129 /*
    130  * GL_MESA_resize_buffers extension
    131  */
    132 extern void gl_ResizeBuffersMESA( GLcontext *ctx );
     128
     129/*
     130 * Macros for fetching current context, input buffer, etc.
     131 */
     132#ifdef THREADS
     133
     134#define GET_CURRENT_CONTEXT(C)  GLcontext *C = (GLcontext *) (_glapi_Context ? _glapi_Context : _glapi_get_context())
     135
     136#define GET_IMMEDIATE  struct immediate *IM = ((GLcontext *) (_glapi_Context ? _glapi_Context : _glapi_get_context()))->input
     137
     138#define SET_IMMEDIATE(ctx, im)          \
     139do {                                    \
     140   ctx->input = im;                     \
     141} while (0)
     142
     143#else
     144
     145extern struct immediate *_mesa_CurrentInput;
     146
     147#define GET_CURRENT_CONTEXT(C)  GLcontext *C = (GLcontext *) _glapi_Context
     148
     149#define GET_IMMEDIATE struct immediate *IM = _mesa_CurrentInput
     150
     151#define SET_IMMEDIATE(ctx, im)          \
     152do {                                    \
     153   ctx->input = im;                     \
     154   _mesa_CurrentInput = im;             \
     155} while (0)
     156
     157#endif
     158
     159
     160
     161extern void
     162_mesa_swapbuffers(GLcontext *ctx);
     163
     164
     165extern struct _glapi_table *
     166_mesa_get_dispatch(GLcontext *ctx);
    133167
    134168
     
    143177
    144178extern void gl_error( GLcontext *ctx, GLenum error, const char *s );
     179
    145180extern void gl_compile_error( GLcontext *ctx, GLenum error, const char *s );
    146181
    147 extern GLenum gl_GetError( GLcontext *ctx );
    148 
    149 
    150 extern void gl_update_state( GLcontext *ctx );
    151 
    152 
    153 /* for debugging */
    154 extern void gl_print_state( const char *msg, GLuint state );
    155 
    156 /* for debugging */
    157 extern void gl_print_enable_flags( const char *msg, GLuint flags );
     182
     183
     184extern void
     185_mesa_Finish( void );
     186
     187extern void
     188_mesa_Flush( void );
     189
     190
     191
     192extern void
     193_mesa_init_no_op_table(struct _glapi_table *exec);
     194
     195extern void
     196_mesa_init_exec_table(struct _glapi_table *exec);
     197
    158198
    159199
Note: See TracChangeset for help on using the changeset viewer.