Revision: 6705
http://playerstage.svn.sourceforge.net/playerstage/?rev=6705&view=rev
Author: alexcb
Date: 2008-06-27 14:54:18 -0700 (Fri, 27 Jun 2008)
Log Message:
-----------
fixed selection picker bug related to camera model
Modified Paths:
--------------
code/stage/trunk/libstage/canvas.cc
code/stage/trunk/libstage/model_camera.cc
Modified: code/stage/trunk/libstage/canvas.cc
===================================================================
--- code/stage/trunk/libstage/canvas.cc 2008-06-27 21:10:16 UTC (rev 6704)
+++ code/stage/trunk/libstage/canvas.cc 2008-06-27 21:54:18 UTC (rev 6705)
@@ -88,11 +88,14 @@
// TODO XX
//return NULL;
+
// render all models in a unique color
make_current(); // make sure the GL context is current
glClearColor ( 1,1,1,1 ); // white
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
+ glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
+
glDisable(GL_DITHER);
glDisable(GL_BLEND); // turns off alpha blending, so we read back
// exactly what
we write to a pixel
@@ -115,10 +118,10 @@
//printf("mod->Id(): 0x%X, rByte: 0x%X, gByte: 0x%X,
bByte: 0x%X, aByte: 0x%X\n", modelId, rByte, gByte, bByte, aByte);
glColor4ub( rByte, gByte, bByte, aByte );
- mod->DrawPicker();
+ mod->DrawPicker();
}
}
-
+
// read the color of the pixel in the back buffer under the mouse
// pointer
GLint viewport[4];
@@ -141,8 +144,8 @@
modelId |= bByte << 16;
//modelId |= aByte << 24;
- //printf("Clicked rByte: 0x%X, gByte: 0x%X, bByte: 0x%X, aByte:
0x%X\n", rByte, gByte, bByte, aByte);
- //printf("-->model Id = 0x%X\n", modelId);
+// printf("Clicked rByte: 0x%X, gByte: 0x%X, bByte: 0x%X, aByte: 0x%X\n",
rByte, gByte, bByte, aByte);
+// printf("-->model Id = 0x%X\n", modelId);
StgModel* mod = StgModel::LookupId( modelId );
Modified: code/stage/trunk/libstage/model_camera.cc
===================================================================
--- code/stage/trunk/libstage/model_camera.cc 2008-06-27 21:10:16 UTC (rev
6704)
+++ code/stage/trunk/libstage/model_camera.cc 2008-06-27 21:54:18 UTC (rev
6705)
@@ -139,6 +139,9 @@
if( _height > _canvas->h() )
_height = _canvas->h();
+ GLint viewport[4];
+ glGetIntegerv(GL_VIEWPORT,viewport);
+
glViewport( 0, 0, _width, _height );
_camera.update();
_camera.SetProjection();
@@ -170,6 +173,7 @@
_frame_color_data );
+ glViewport( viewport[0], viewport[1], viewport[2], viewport[3] );
_canvas->invalidate();
return true;
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit