I’m a WIN API OpenGL user. I learned my OpenGL from nehe.gamedev.net. Okay, I’ve got a rather strange problem. I don’t know why my program is doing this. I’m making a game and I’m making an opening screen with a bitmap, and to goto the high score bitmap I’m testing for a mouse click with an area of pixels that contains the pic of the button the quad that I drew. Unfortunately this is not working. If anyone has any idea why this is so messed up, please help me.
Here’s the coding from my DrawGLScene:
glLoadIdentity(); // Reset The View
GetCursorPos(&mpos);
// Get The Current Mouse Position ( Add )
if ( (mpos.x>100) && (mpos.x<200) && (mpos.x>100) && (mpos.y<360) && (mpos.y>260) )
high_score = TRUE;
else
high_score = FALSE;
if ( (mpos.x<=337) && (mpos.x>=258) && (mpos.y<=449) && (mpos.y>=405) )
OK = TRUE;
else
OK = FALSE;
int page = 0;
// Checking for High Scores Button on Title
// Page
if (lmp_hit && (page!=1) && hsp_hit)
page = 1;
// Checking for OK Button on High Scores Page
else if (lmp_hit && (page!=0) && OKp_hit)
page = 0;
glBindTexture(GL_TEXTURE_2D, texture[page]);
// Opening.bmp
glTranslatef(0.0f, 0.0f, -35.0f);
glBegin(GL_QUADS);
// Draw A Quad
glEnd();
Here’s the coding for my button testing:
if (high_score && !hsp)
{
hsp = TRUE;
hsp_hit = !hsp_hit;
}
if (!high_score)
{
hsp = FALSE;
}
if (OK && !OKp)
{
OKp = TRUE;
OKp_hit = !OKp_hit;
}
if (!OK)
{
OKp = FALSE;
}
Any help would be greatly appreciated. I hope you can understand all that.
-jeremyp