summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/context.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2002-10-11 17:41:03 +0000
committerBrian Paul <[email protected]>2002-10-11 17:41:03 +0000
commit8ad1076dc2afda8ed37e5a9f6a757583eba90375 (patch)
tree30bc52e2db6e089972d441a53c070e8377cb684d /src/mesa/main/context.c
parent9e84910749744efcba06670f622cc00d279f26f1 (diff)
Another round of glRead/DrawBuffer() clean-ups and simplifications.
Replaced ctx->Color._DriverDrawBuffer with swrast->CurrentBuffer. Replaced ctx->Pixel._DriverReadBuffer with ctx->Pixel._ReadSrcMask. swrast->Driver.SetBuffer() takes FRONT/BACK_LEFT/RIGHT_BIT values now. Added tokens and code for GL_AUX buffers, for completeness.
Diffstat (limited to 'src/mesa/main/context.c')
-rw-r--r--src/mesa/main/context.c119
1 files changed, 103 insertions, 16 deletions
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index cac01e4d8e6..e9c82c91be7 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -1,4 +1,4 @@
-/* $Id: context.c,v 1.182 2002/10/10 00:22:13 brianp Exp $ */
+/* $Id: context.c,v 1.183 2002/10/11 17:41:03 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -1714,17 +1714,15 @@ _mesa_initialize_context( GLcontext *ctx,
if (visual->doubleBufferMode) {
ctx->Color.DrawBuffer = GL_BACK;
- ctx->Color._DriverDrawBuffer = GL_BACK_LEFT;
ctx->Color._DrawDestMask = BACK_LEFT_BIT;
ctx->Pixel.ReadBuffer = GL_BACK;
- ctx->Pixel._DriverReadBuffer = GL_BACK_LEFT;
+ ctx->Pixel._ReadSrcMask = BACK_LEFT_BIT;
}
else {
ctx->Color.DrawBuffer = GL_FRONT;
- ctx->Color._DriverDrawBuffer = GL_FRONT_LEFT;
ctx->Color._DrawDestMask = FRONT_LEFT_BIT;
ctx->Pixel.ReadBuffer = GL_FRONT;
- ctx->Pixel._DriverReadBuffer = GL_FRONT_LEFT;
+ ctx->Pixel._ReadSrcMask = FRONT_LEFT_BIT;
}
if (!alloc_proxy_textures(ctx)) {
@@ -1732,17 +1730,106 @@ _mesa_initialize_context( GLcontext *ctx,
return GL_FALSE;
}
- /* register the most recent extension functions with libGL */
- _glapi_add_entrypoint("glTbufferMask3DFX", 553);
- _glapi_add_entrypoint("glCompressedTexImage3DARB", 554);
- _glapi_add_entrypoint("glCompressedTexImage2DARB", 555);
- _glapi_add_entrypoint("glCompressedTexImage1DARB", 556);
- _glapi_add_entrypoint("glCompressedTexSubImage3DARB", 557);
- _glapi_add_entrypoint("glCompressedTexSubImage2DARB", 558);
- _glapi_add_entrypoint("glCompressedTexSubImage1DARB", 559);
- _glapi_add_entrypoint("glGetCompressedTexImageARB", 560);
- /* XXX we should add a bunch of new functions here */
-
+ /*
+ * For XFree86/DRI: tell libGL to add these functions to the dispatcher.
+ * Basically, we should add all extension functions above offset 577.
+ * This enables older libGL libraries to work with newer drivers that
+ * have newer extensions.
+ */
+ /* GL_ARB_window_pos aliases with GL_MESA_window_pos */
+ _glapi_add_entrypoint("glWindowPos2dARB", 513);
+ _glapi_add_entrypoint("glWindowPos2dvARB", 514);
+ _glapi_add_entrypoint("glWindowPos2fARB", 515);
+ _glapi_add_entrypoint("glWindowPos2fvARB", 516);
+ _glapi_add_entrypoint("glWindowPos2iARB", 517);
+ _glapi_add_entrypoint("glWindowPos2ivARB", 518);
+ _glapi_add_entrypoint("glWindowPos2sARB", 519);
+ _glapi_add_entrypoint("glWindowPos2svARB", 520);
+ _glapi_add_entrypoint("glWindowPos3dARB", 521);
+ _glapi_add_entrypoint("glWindowPos3dvARB", 522);
+ _glapi_add_entrypoint("glWindowPos3fARB", 523);
+ _glapi_add_entrypoint("glWindowPos3fvARB", 524);
+ _glapi_add_entrypoint("glWindowPos3iARB", 525);
+ _glapi_add_entrypoint("glWindowPos3ivARB", 526);
+ _glapi_add_entrypoint("glWindowPos3sARB", 527);
+ _glapi_add_entrypoint("glWindowPos3svARB", 528);
+ /* new extension functions */
+ _glapi_add_entrypoint("glAreProgramsResidentNV", 578);
+ _glapi_add_entrypoint("glBindProgramNV", 579);
+ _glapi_add_entrypoint("glDeleteProgramsNV", 580);
+ _glapi_add_entrypoint("glExecuteProgramNV", 581);
+ _glapi_add_entrypoint("glGenProgramsNV", 582);
+ _glapi_add_entrypoint("glGetProgramParameterdvNV", 583);
+ _glapi_add_entrypoint("glGetProgramParameterfvNV", 584);
+ _glapi_add_entrypoint("glGetProgramivNV", 585);
+ _glapi_add_entrypoint("glGetProgramStringNV", 586);
+ _glapi_add_entrypoint("glGetTrackMatrixivNV", 587);
+ _glapi_add_entrypoint("glGetVertexAttribdvNV", 588);
+ _glapi_add_entrypoint("glGetVertexAttribfvNV", 589);
+ _glapi_add_entrypoint("glGetVertexAttribivNV", 590);
+ _glapi_add_entrypoint("glGetVertexAttribPointervNV", 591);
+ _glapi_add_entrypoint("glIsProgramNV", 592);
+ _glapi_add_entrypoint("glLoadProgramNV", 593);
+ _glapi_add_entrypoint("glProgramParameter4dNV", 594);
+ _glapi_add_entrypoint("glProgramParameter4dvNV", 595);
+ _glapi_add_entrypoint("glProgramParameter4fNV", 596);
+ _glapi_add_entrypoint("glProgramParameter4fvNV", 597);
+ _glapi_add_entrypoint("glProgramParameters4dvNV", 598);
+ _glapi_add_entrypoint("glProgramParameters4fvNV", 599);
+ _glapi_add_entrypoint("glRequestResidentProgramsNV", 600);
+ _glapi_add_entrypoint("glTrackMatrixNV", 601);
+ _glapi_add_entrypoint("glVertexAttribPointerNV", 602);
+ _glapi_add_entrypoint("glVertexAttrib1dNV", 603);
+ _glapi_add_entrypoint("glVertexAttrib1dvNV", 604);
+ _glapi_add_entrypoint("glVertexAttrib1fNV", 605);
+ _glapi_add_entrypoint("glVertexAttrib1fvNV", 606);
+ _glapi_add_entrypoint("glVertexAttrib1sNV", 607);
+ _glapi_add_entrypoint("glVertexAttrib1svNV", 608);
+ _glapi_add_entrypoint("glVertexAttrib2dNV", 609);
+ _glapi_add_entrypoint("glVertexAttrib2dvNV", 610);
+ _glapi_add_entrypoint("glVertexAttrib2fNV", 611);
+ _glapi_add_entrypoint("glVertexAttrib2fvNV", 612);
+ _glapi_add_entrypoint("glVertexAttrib2sNV", 613);
+ _glapi_add_entrypoint("glVertexAttrib2svNV", 614);
+ _glapi_add_entrypoint("glVertexAttrib3dNV", 615);
+ _glapi_add_entrypoint("glVertexAttrib3dvNV", 616);
+ _glapi_add_entrypoint("glVertexAttrib3fNV", 617);
+ _glapi_add_entrypoint("glVertexAttrib3fvNV", 618);
+ _glapi_add_entrypoint("glVertexAttrib3sNV", 619);
+ _glapi_add_entrypoint("glVertexAttrib3svNV", 620);
+ _glapi_add_entrypoint("glVertexAttrib4dNV", 621);
+ _glapi_add_entrypoint("glVertexAttrib4dvNV", 622);
+ _glapi_add_entrypoint("glVertexAttrib4fNV", 623);
+ _glapi_add_entrypoint("glVertexAttrib4fvNV", 624);
+ _glapi_add_entrypoint("glVertexAttrib4sNV", 625);
+ _glapi_add_entrypoint("glVertexAttrib4svNV", 626);
+ _glapi_add_entrypoint("glVertexAttrib4ubNV", 627);
+ _glapi_add_entrypoint("glVertexAttrib4ubvNV", 628);
+ _glapi_add_entrypoint("glVertexAttribs1dvNV", 629);
+ _glapi_add_entrypoint("glVertexAttribs1fvNV", 630);
+ _glapi_add_entrypoint("glVertexAttribs1svNV", 631);
+ _glapi_add_entrypoint("glVertexAttribs2dvNV", 632);
+ _glapi_add_entrypoint("glVertexAttribs2fvNV", 633);
+ _glapi_add_entrypoint("glVertexAttribs2svNV", 634);
+ _glapi_add_entrypoint("glVertexAttribs3dvNV", 635);
+ _glapi_add_entrypoint("glVertexAttribs3fvNV", 636);
+ _glapi_add_entrypoint("glVertexAttribs3svNV", 637);
+ _glapi_add_entrypoint("glVertexAttribs4dvNV", 638);
+ _glapi_add_entrypoint("glVertexAttribs4fvNV", 639);
+ _glapi_add_entrypoint("glVertexAttribs4svNV", 640);
+ _glapi_add_entrypoint("glVertexAttribs4ubvNV", 641);
+ _glapi_add_entrypoint("glPointParameteriNV", 642);
+ _glapi_add_entrypoint("glPointParameterivNV", 643);
+ _glapi_add_entrypoint("glMultiDrawArraysEXT", 644);
+ _glapi_add_entrypoint("glMultiDrawElementsEXT", 645);
+ _glapi_add_entrypoint("glActiveStencilFaceEXT", 646);
+ _glapi_add_entrypoint("glDeleteFencesNV", 647);
+ _glapi_add_entrypoint("glGenFencesNV", 648);
+ _glapi_add_entrypoint("glIsFenceNV", 649);
+ _glapi_add_entrypoint("glTestFenceNV", 650);
+ _glapi_add_entrypoint("glGetFenceivNV", 651);
+ _glapi_add_entrypoint("glFinishFenceNV", 652);
+ _glapi_add_entrypoint("glSetFenceNV", 653);
/* Find the larger of Mesa's dispatch table and libGL's dispatch table.
* In practice, this'll be the same for stand-alone Mesa. But for DRI