Advertisement
Advertisement
| 05.15.2008 at 02:16AM PDT, ID: 23404354 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
|
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
| Microsoft |
| Apple |
| Internet |
| Gamers |
| Digital Living |
| Virus & Spyware |
| Hardware |
| Software |
| ITPro |
| Developer |
| Storage |
| OS |
| Database |
| Security |
| Programming |
| Web Development |
| Networking |
| Other |
| Community Support |
| 05.15.2008 at 02:25AM PDT, ID: 21571753 |
| 05.15.2008 at 03:17AM PDT, ID: 21571991 |
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154: |
int MapWindow::InitGL(GLvoid) // All Setup For OpenGL Goes Here
{
if (!LoadGLTextures()) // Jump To Texture Loading Routine ( NEW )
{
return FALSE; // If Texture Didn't Load Return FALSE
}
glEnable(GL_TEXTURE_2D); // Enable Texture Mapping ( NEW )
glShadeModel(GL_SMOOTH); // Enable Smooth Shading
glClearColor(1.0f, 1.0f, 1.0f, 0.0f); // Black Background
glClearDepth(1.0f); // Depth Buffer Setup
glEnable(GL_DEPTH_TEST); // Enables Depth Testing
glDepthFunc(GL_LEQUAL); // The Type Of Depth Testing To Do
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); // Really Nice Perspective Calculations
return TRUE; // Initialization Went OK
}
int MapWindow::LoadGLTextures() // Load Bitmaps And Convert To Textures
{
int Status=FALSE; // Status Indicator
AUX_RGBImageRec *TextureImage[1]; // Create Storage Space For The Texture
memset(TextureImage,0,sizeof(void *)*1); // Set The Pointer To NULL
// Load The Bitmap, Check For Errors, If Bitmap's Not Found Quit
if (TextureImage[0]=LoadBMP("0.bmp"))
{
Status=TRUE; // Set The Status To TRUE
glGenTextures(1, &texture[0]); // Create The Texture
// Typical Texture Generation Using Data From The Bitmap
glBindTexture(GL_TEXTURE_2D, texture[0]);
glTexImage2D(GL_TEXTURE_2D, 0, 3, TextureImage[0]->sizeX, TextureImage[0]->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, TextureImage[0]->data);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
}
if (TextureImage[0]) // If Texture Exists
{
if (TextureImage[0]->data) // If Texture Image Exists
{
free(TextureImage[0]->data); // Free The Texture Image Memory
}
free(TextureImage[0]); // Free The Image Structure
}
return Status; // Return The Status
}
AUX_RGBImageRec *MapWindow::LoadBMP(char *Filename) // Loads A Bitmap Image
{
return auxDIBImageLoad(Filename); // Load The Bitmap And Return A Pointer
}
int MapWindow::DrawGLScene(GLvoid) // Here's Where We Do All The Drawing
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear The Screen And The Depth Buffer
glLoadIdentity(); // Reset The Current Modelview Matrix
list<Region>::iterator iter;
if(CountyVisible)
{
for(iter = Counties.begin(); iter != Counties.end(); iter++)
{
DrawRegion(&*iter, "CO");
}
}
if(LandmarkVisible)
{
list<LandmarkPoint>::iterator liter;
for(liter = Landmarks.begin(); liter != Landmarks.end(); liter++)
{
DrawBitmap(&*liter);
}
}
return TRUE; // Everything Went OK
}
void MapWindow::DrawRegion(Region* MyRegion, _bstr_t Type)
{
glBindTexture(GL_TEXTURE_2D, 0);
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
if(Type == (_bstr_t)"CO")
{
glLineWidth( 3.0f );
glColor3f( 0.0f, 0.0f, 0.0f );
}
else
{
glLineWidth( 1.0f );
glColor3f( 0.0f, 0.0f, 0.0f );
}
list<Point>::iterator piter;
glBegin(GL_POLYGON);
for(piter = MyRegion->Points.begin(); piter != MyRegion->Points.end(); piter++)
{
if(piter == MyRegion->Points.begin())
{
piter++;
}
glVertex3f(piter->x, piter->y, zCoord);
}
glEnd();
glFlush();//Draw everything to the screen
}
void MapWindow::DrawBitmap(LandmarkPoint* MyLandmark)
{
glBindTexture(GL_TEXTURE_2D, texture[0]);
glBegin(GL_QUADS);
//Front Face
glTexCoord2f(0.0f, 0.0f); glVertex3f(MyLandmark->MyPoint.x-8, MyLandmark->MyPoint.y-8, zCoord);
glTexCoord2f(1.0f, 0.0f); glVertex3f(MyLandmark->MyPoint.x+8, MyLandmark->MyPoint.y-8, zCoord);
glTexCoord2f(1.0f, 1.0f); glVertex3f(MyLandmark->MyPoint.x+8, MyLandmark->MyPoint.y+8, zCoord);
glTexCoord2f(0.0f, 1.0f); glVertex3f(MyLandmark->MyPoint.x-8, MyLandmark->MyPoint.y+8, zCoord);
// Back Face
glTexCoord2f(1.0f, 0.0f); glVertex3f(MyLandmark->MyPoint.x-8, MyLandmark->MyPoint.y-8, zCoord);
glTexCoord2f(1.0f, 1.0f); glVertex3f(MyLandmark->MyPoint.x-8, MyLandmark->MyPoint.y+8, zCoord);
glTexCoord2f(0.0f, 1.0f); glVertex3f(MyLandmark->MyPoint.x+8, MyLandmark->MyPoint.y+8, zCoord);
glTexCoord2f(0.0f, 0.0f); glVertex3f(MyLandmark->MyPoint.x+8, MyLandmark->MyPoint.y-8, zCoord);
glEnd();
glFlush();//Draw everything to the screen
}
|
| 05.15.2008 at 05:10AM PDT, ID: 21572591 |
1: 2: |
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); glColor3f(1.0f, 1.0f, 1.0f); |
| 05.15.2008 at 05:31AM PDT, ID: 21572748 |
| 05.15.2008 at 05:44AM PDT, ID: 21572890 |