aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llglsandbox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llglsandbox.cpp')
-rw-r--r--linden/indra/newview/llglsandbox.cpp61
1 files changed, 31 insertions, 30 deletions
diff --git a/linden/indra/newview/llglsandbox.cpp b/linden/indra/newview/llglsandbox.cpp
index 45f674d..7506004 100644
--- a/linden/indra/newview/llglsandbox.cpp
+++ b/linden/indra/newview/llglsandbox.cpp
@@ -4,7 +4,7 @@
4 * 4 *
5 * $LicenseInfo:firstyear=2003&license=viewergpl$ 5 * $LicenseInfo:firstyear=2003&license=viewergpl$
6 * 6 *
7 * Copyright (c) 2003-2008, Linden Research, Inc. 7 * Copyright (c) 2003-2009, Linden Research, Inc.
8 * 8 *
9 * Second Life Viewer Source Code 9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab 10 * The source code in this file ("Source Code") is provided by Linden Lab
@@ -142,7 +142,7 @@ void LLAgent::renderAutoPilotTarget()
142 gGL.pushMatrix(); 142 gGL.pushMatrix();
143 143
144 // not textured 144 // not textured
145 LLGLSNoTexture no_texture; 145 gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
146 146
147 // lovely green 147 // lovely green
148 glColor4f(0.f, 1.f, 1.f, 1.f); 148 glColor4f(0.f, 1.f, 1.f, 1.f);
@@ -355,10 +355,11 @@ void LLCompass::draw()
355 355
356 if (mBkgndTexture) 356 if (mBkgndTexture)
357 { 357 {
358 mBkgndTexture->bind(); 358 gGL.getTexUnit(0)->bind(mBkgndTexture.get());
359
359 gGL.color4f(1.0f, 1.0f, 1.0f, 1.0f); 360 gGL.color4f(1.0f, 1.0f, 1.0f, 1.0f);
360 361
361 gGL.begin(LLVertexBuffer::QUADS); 362 gGL.begin(LLRender::QUADS);
362 363
363 gGL.texCoord2f(1.f, 1.f); 364 gGL.texCoord2f(1.f, 1.f);
364 gGL.vertex2i(width, height); 365 gGL.vertex2i(width, height);
@@ -381,10 +382,10 @@ void LLCompass::draw()
381 382
382 if (mTexture) 383 if (mTexture)
383 { 384 {
384 mTexture->bind(); 385 gGL.getTexUnit(0)->bind(mTexture.get());
385 gGL.color4f(1.0f, 1.0f, 1.0f, 1.0f); 386 gGL.color4f(1.0f, 1.0f, 1.0f, 1.0f);
386 387
387 gGL.begin(LLVertexBuffer::QUADS); 388 gGL.begin(LLRender::QUADS);
388 389
389 gGL.texCoord2f(1.f, 1.f); 390 gGL.texCoord2f(1.f, 1.f);
390 gGL.vertex2i(width, height); 391 gGL.vertex2i(width, height);
@@ -426,9 +427,9 @@ void LLHorizontalCompass::draw()
426 F32 left = center - COMPASS_RANGE; 427 F32 left = center - COMPASS_RANGE;
427 F32 right = center + COMPASS_RANGE; 428 F32 right = center + COMPASS_RANGE;
428 429
429 mTexture->bind(); 430 gGL.getTexUnit(0)->bind(mTexture.get());
430 gGL.color4f(1.0f, 1.0f, 1.0f, 1.0f ); 431 gGL.color4f(1.0f, 1.0f, 1.0f, 1.0f );
431 gGL.begin( LLVertexBuffer::QUADS ); 432 gGL.begin( LLRender::QUADS );
432 433
433 gGL.texCoord2f(right, 1.f); 434 gGL.texCoord2f(right, 1.f);
434 gGL.vertex2i(width, height); 435 gGL.vertex2i(width, height);
@@ -447,7 +448,7 @@ void LLHorizontalCompass::draw()
447 448
448 // Draw the focus line 449 // Draw the focus line
449 { 450 {
450 LLGLSNoTexture gls_no_texture; 451 gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
451 gGL.color4fv( mFocusColor.mV ); 452 gGL.color4fv( mFocusColor.mV );
452 gl_line_2d( half_width, 0, half_width, height ); 453 gl_line_2d( half_width, 0, half_width, height );
453 } 454 }
@@ -465,7 +466,7 @@ void LLWind::renderVectors()
465 466
466 F32 region_width_meters = LLWorld::getInstance()->getRegionWidthInMeters(); 467 F32 region_width_meters = LLWorld::getInstance()->getRegionWidthInMeters();
467 468
468 LLGLSNoTexture gls_no_texture; 469 gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
469 gGL.pushMatrix(); 470 gGL.pushMatrix();
470 LLVector3 origin_agent; 471 LLVector3 origin_agent;
471 origin_agent = gAgent.getPosAgentFromGlobal(mOriginGlobal); 472 origin_agent = gAgent.getPosAgentFromGlobal(mOriginGlobal);
@@ -479,11 +480,11 @@ void LLWind::renderVectors()
479 gGL.pushMatrix(); 480 gGL.pushMatrix();
480 gGL.translatef((F32)i * region_width_meters/mSize, (F32)j * region_width_meters/mSize, 0.0); 481 gGL.translatef((F32)i * region_width_meters/mSize, (F32)j * region_width_meters/mSize, 0.0);
481 gGL.color3f(0,1,0); 482 gGL.color3f(0,1,0);
482 gGL.begin(LLVertexBuffer::POINTS); 483 gGL.begin(LLRender::POINTS);
483 gGL.vertex3f(0,0,0); 484 gGL.vertex3f(0,0,0);
484 gGL.end(); 485 gGL.end();
485 gGL.color3f(1,0,0); 486 gGL.color3f(1,0,0);
486 gGL.begin(LLVertexBuffer::LINES); 487 gGL.begin(LLRender::LINES);
487 gGL.vertex3f(x * 0.1f, y * 0.1f ,0.f); 488 gGL.vertex3f(x * 0.1f, y * 0.1f ,0.f);
488 gGL.vertex3f(x, y, 0.f); 489 gGL.vertex3f(x, y, 0.f);
489 gGL.end(); 490 gGL.end();
@@ -501,7 +502,7 @@ void LLViewerParcelMgr::renderRect(const LLVector3d &west_south_bottom_global,
501 const LLVector3d &east_north_top_global ) 502 const LLVector3d &east_north_top_global )
502{ 503{
503 LLGLSUIDefault gls_ui; 504 LLGLSUIDefault gls_ui;
504 LLGLSNoTexture gls_no_texture; 505 gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
505 LLGLDepthTest gls_depth(GL_TRUE); 506 LLGLDepthTest gls_depth(GL_TRUE);
506 507
507 LLVector3 west_south_bottom_agent = gAgent.getPosAgentFromGlobal(west_south_bottom_global); 508 LLVector3 west_south_bottom_agent = gAgent.getPosAgentFromGlobal(west_south_bottom_global);
@@ -532,7 +533,7 @@ void LLViewerParcelMgr::renderRect(const LLVector3d &west_south_bottom_global,
532 gGL.color4f(1.f, 1.f, 0.f, 1.f); 533 gGL.color4f(1.f, 1.f, 0.f, 1.f);
533 534
534 // Cheat and give this the same pick-name as land 535 // Cheat and give this the same pick-name as land
535 gGL.begin(LLVertexBuffer::LINES); 536 gGL.begin(LLRender::LINES);
536 537
537 gGL.vertex3f(west, north, nw_bottom); 538 gGL.vertex3f(west, north, nw_bottom);
538 gGL.vertex3f(west, north, nw_top); 539 gGL.vertex3f(west, north, nw_top);
@@ -549,7 +550,7 @@ void LLViewerParcelMgr::renderRect(const LLVector3d &west_south_bottom_global,
549 gGL.end(); 550 gGL.end();
550 551
551 gGL.color4f(1.f, 1.f, 0.f, 0.2f); 552 gGL.color4f(1.f, 1.f, 0.f, 0.2f);
552 gGL.begin(LLVertexBuffer::QUADS); 553 gGL.begin(LLRender::QUADS);
553 554
554 gGL.vertex3f(west, north, nw_bottom); 555 gGL.vertex3f(west, north, nw_bottom);
555 gGL.vertex3f(west, north, nw_top); 556 gGL.vertex3f(west, north, nw_top);
@@ -609,14 +610,14 @@ void LLViewerParcelMgr::renderParcel(LLParcel* parcel )
609 F32 ne_top = ne_bottom + POST_HEIGHT; 610 F32 ne_top = ne_bottom + POST_HEIGHT;
610 F32 nw_top = nw_bottom + POST_HEIGHT; 611 F32 nw_top = nw_bottom + POST_HEIGHT;
611 612
612 LLGLSNoTexture gls_no_texture; 613 gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
613 LLGLDepthTest gls_depth(GL_TRUE); 614 LLGLDepthTest gls_depth(GL_TRUE);
614 615
615 LLUI::setLineWidth(2.f); 616 LLUI::setLineWidth(2.f);
616 gGL.color4f(0.f, 1.f, 1.f, 1.f); 617 gGL.color4f(0.f, 1.f, 1.f, 1.f);
617 618
618 // Cheat and give this the same pick-name as land 619 // Cheat and give this the same pick-name as land
619 gGL.begin(LLVertexBuffer::LINES); 620 gGL.begin(LLRender::LINES);
620 621
621 gGL.vertex3f(west, north, nw_bottom); 622 gGL.vertex3f(west, north, nw_bottom);
622 gGL.vertex3f(west, north, nw_top); 623 gGL.vertex3f(west, north, nw_top);
@@ -633,7 +634,7 @@ void LLViewerParcelMgr::renderParcel(LLParcel* parcel )
633 gGL.end(); 634 gGL.end();
634 635
635 gGL.color4f(0.f, 1.f, 1.f, 0.2f); 636 gGL.color4f(0.f, 1.f, 1.f, 0.2f);
636 gGL.begin(LLVertexBuffer::QUADS); 637 gGL.begin(LLRender::QUADS);
637 638
638 gGL.vertex3f(west, north, nw_bottom); 639 gGL.vertex3f(west, north, nw_bottom);
639 gGL.vertex3f(west, north, nw_top); 640 gGL.vertex3f(west, north, nw_top);
@@ -759,7 +760,7 @@ void LLViewerParcelMgr::renderHighlightSegments(const U8* segments, LLViewerRegi
759 bool has_segments = false; 760 bool has_segments = false;
760 761
761 LLGLSUIDefault gls_ui; 762 LLGLSUIDefault gls_ui;
762 LLGLSNoTexture gls_no_texture; 763 gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
763 LLGLDepthTest gls_depth(GL_TRUE); 764 LLGLDepthTest gls_depth(GL_TRUE);
764 765
765 gGL.color4f(1.f, 1.f, 0.f, 0.2f); 766 gGL.color4f(1.f, 1.f, 0.f, 0.2f);
@@ -786,7 +787,7 @@ void LLViewerParcelMgr::renderHighlightSegments(const U8* segments, LLViewerRegi
786 if (!has_segments) 787 if (!has_segments)
787 { 788 {
788 has_segments = true; 789 has_segments = true;
789 gGL.begin(LLVertexBuffer::QUADS); 790 gGL.begin(LLRender::QUADS);
790 } 791 }
791 renderOneSegment(x1, y1, x2, y2, PARCEL_POST_HEIGHT, SOUTH_MASK, regionp); 792 renderOneSegment(x1, y1, x2, y2, PARCEL_POST_HEIGHT, SOUTH_MASK, regionp);
792 } 793 }
@@ -802,7 +803,7 @@ void LLViewerParcelMgr::renderHighlightSegments(const U8* segments, LLViewerRegi
802 if (!has_segments) 803 if (!has_segments)
803 { 804 {
804 has_segments = true; 805 has_segments = true;
805 gGL.begin(LLVertexBuffer::QUADS); 806 gGL.begin(LLRender::QUADS);
806 } 807 }
807 renderOneSegment(x1, y1, x2, y2, PARCEL_POST_HEIGHT, WEST_MASK, regionp); 808 renderOneSegment(x1, y1, x2, y2, PARCEL_POST_HEIGHT, WEST_MASK, regionp);
808 } 809 }
@@ -850,14 +851,14 @@ void LLViewerParcelMgr::renderCollisionSegments(U8* segments, BOOL use_pass, LLV
850 851
851 if (use_pass && (mCollisionBanned == BA_NOT_ON_LIST)) 852 if (use_pass && (mCollisionBanned == BA_NOT_ON_LIST))
852 { 853 {
853 LLViewerImage::bindTexture(mPassImage); 854 gGL.getTexUnit(0)->bind(mPassImage);
854 } 855 }
855 else 856 else
856 { 857 {
857 LLViewerImage::bindTexture(mBlockedImage); 858 gGL.getTexUnit(0)->bind(mBlockedImage);
858 } 859 }
859 860
860 gGL.begin(LLVertexBuffer::QUADS); 861 gGL.begin(LLRender::QUADS);
861 862
862 for (y = 0; y < STRIDE; y++) 863 for (y = 0; y < STRIDE; y++)
863 { 864 {
@@ -1011,10 +1012,10 @@ void LLViewerObjectList::renderObjectBeacons()
1011 LLGLSUIDefault gls_ui; 1012 LLGLSUIDefault gls_ui;
1012 1013
1013 { 1014 {
1014 LLGLSNoTexture gls_ui_no_texture; 1015 gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
1015 1016
1016 S32 last_line_width = -1; 1017 S32 last_line_width = -1;
1017 // gGL.begin(LLVertexBuffer::LINES); // Always happens in (line_width != last_line_width) 1018 // gGL.begin(LLRender::LINES); // Always happens in (line_width != last_line_width)
1018 1019
1019 for (S32 i = 0; i < mDebugBeacons.count(); i++) 1020 for (S32 i = 0; i < mDebugBeacons.count(); i++)
1020 { 1021 {
@@ -1031,7 +1032,7 @@ void LLViewerObjectList::renderObjectBeacons()
1031 } 1032 }
1032 glLineWidth( (F32)line_width ); 1033 glLineWidth( (F32)line_width );
1033 last_line_width = line_width; 1034 last_line_width = line_width;
1034 gGL.begin(LLVertexBuffer::LINES); 1035 gGL.begin(LLRender::LINES);
1035 } 1036 }
1036 1037
1037 const LLVector3 &thisline = debug_beacon.mPositionAgent; 1038 const LLVector3 &thisline = debug_beacon.mPositionAgent;
@@ -1049,11 +1050,11 @@ void LLViewerObjectList::renderObjectBeacons()
1049 } 1050 }
1050 1051
1051 { 1052 {
1052 LLGLSNoTexture gls_ui_no_texture; 1053 gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
1053 LLGLDepthTest gls_depth(GL_TRUE); 1054 LLGLDepthTest gls_depth(GL_TRUE);
1054 1055
1055 S32 last_line_width = -1; 1056 S32 last_line_width = -1;
1056 // gGL.begin(LLVertexBuffer::LINES); // Always happens in (line_width != last_line_width) 1057 // gGL.begin(LLRender::LINES); // Always happens in (line_width != last_line_width)
1057 1058
1058 for (S32 i = 0; i < mDebugBeacons.count(); i++) 1059 for (S32 i = 0; i < mDebugBeacons.count(); i++)
1059 { 1060 {
@@ -1069,7 +1070,7 @@ void LLViewerObjectList::renderObjectBeacons()
1069 } 1070 }
1070 glLineWidth( (F32)line_width ); 1071 glLineWidth( (F32)line_width );
1071 last_line_width = line_width; 1072 last_line_width = line_width;
1072 gGL.begin(LLVertexBuffer::LINES); 1073 gGL.begin(LLRender::LINES);
1073 } 1074 }
1074 1075
1075 const LLVector3 &thisline = debug_beacon.mPositionAgent; 1076 const LLVector3 &thisline = debug_beacon.mPositionAgent;