P
Pete
Well I've been sat here for hours twiddling with this code and it's
time to scream for help.
Hi there I'm a Student at Sheffield University programming the mapping
section of a control system for a flight simulator.
In order to do the graphical part required for the map we have an fox
declared window with an OpenGL canvas in it (loosely based on the
glviewer example which you get with the Fox toolkit download).
Things have been going hunky-dory so far but now im stuck with this
problem: When I inluded my most recent bit of code which loads Bitmaps
into OpenGL and declares them as textures I've been getting a:
0xC0000005: Access Violation from:
// Find function
const void* FXMetaClass::search(FXSelector key) const {
register const FXObject::FXMapEntry* lst=(const
FXObject::FXMapEntry*)assoc;
register FXuint n=nassocs;
while(n--){
//THE FOLLOWING LINE OF CODE:
if(lst->keylo<=key && key<=lst->keyhi) return lst;
lst=(const FXObject::FXMapEntry*) (((const FXchar*)lst)+assocsz);
}
return NULL;
}
If you already know exactly what the problem is GREAT! I'd really
appreciate if you could get back to me as soon as possible. If however
you need a bit more info then read on as I'v included the bit of code
that defines the textures:
if ((TextureImage[0]=LoadBMP("COMPASS ROSE.bmp")) && //Load those
bitmaps!
(TextureImage[1]=LoadBMP("RUNWAY.bmp")) &&
(TextureImage[2]=LoadBMP("VOR.bmp")) &&
(TextureImage[3]=LoadBMP("ILS and ILS-DME.bmp")) &&
(TextureImage[4]=LoadBMP("NDB.bmp")) &&
(TextureImage[5]=LoadBMP("DME.bmp")) &&
(TextureImage[6]=LoadBMP("TAC.bmp")) &&
(TextureImage[7]=LoadBMP("VOR-DME.bmp")))
{
Status=TRUE; // Set The Status To TRUE glGenTextures(8,
&texture[0]); // Create 8 Textures
for (int loop=0; loop<1; loop++) // Loop Through All 8 Textures
{
glBindTexture(GL_TEXTURE_2D, texture[loop]);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
gluBuild2DMipmaps(GL_TEXTURE_2D, 3, TextureImage[loop]->sizeX,
TextureImage[loop]->sizeY, GL_RGB, GL_UNSIGNED_BYTE,
TextureImage[loop]->data);
}
}
for (int loop=0; loop<1; loop++) // Loop Through All 8
Textures
{
if (TextureImage[loop]) // If Texture Exists
{
if (TextureImage[loop]->data) // If Texture Image Exists
{
free(TextureImage[loop]->data); // Free The Texture Image
Memory
}
free(TextureImage[loop]); // Free The Image Structure
}
}
Sorry about the length of this enquiry I just wanted to make sure I
included as much info as possible, if I'v missed anything you need to
know please dont hesitate to ask. Thanks a lot
Pete
p.s HEEEEEEEEEELLLLLPPP!!!!!!!!!!!!!!!!!
time to scream for help.
Hi there I'm a Student at Sheffield University programming the mapping
section of a control system for a flight simulator.
In order to do the graphical part required for the map we have an fox
declared window with an OpenGL canvas in it (loosely based on the
glviewer example which you get with the Fox toolkit download).
Things have been going hunky-dory so far but now im stuck with this
problem: When I inluded my most recent bit of code which loads Bitmaps
into OpenGL and declares them as textures I've been getting a:
0xC0000005: Access Violation from:
// Find function
const void* FXMetaClass::search(FXSelector key) const {
register const FXObject::FXMapEntry* lst=(const
FXObject::FXMapEntry*)assoc;
register FXuint n=nassocs;
while(n--){
//THE FOLLOWING LINE OF CODE:
if(lst->keylo<=key && key<=lst->keyhi) return lst;
lst=(const FXObject::FXMapEntry*) (((const FXchar*)lst)+assocsz);
}
return NULL;
}
If you already know exactly what the problem is GREAT! I'd really
appreciate if you could get back to me as soon as possible. If however
you need a bit more info then read on as I'v included the bit of code
that defines the textures:
if ((TextureImage[0]=LoadBMP("COMPASS ROSE.bmp")) && //Load those
bitmaps!
(TextureImage[1]=LoadBMP("RUNWAY.bmp")) &&
(TextureImage[2]=LoadBMP("VOR.bmp")) &&
(TextureImage[3]=LoadBMP("ILS and ILS-DME.bmp")) &&
(TextureImage[4]=LoadBMP("NDB.bmp")) &&
(TextureImage[5]=LoadBMP("DME.bmp")) &&
(TextureImage[6]=LoadBMP("TAC.bmp")) &&
(TextureImage[7]=LoadBMP("VOR-DME.bmp")))
{
Status=TRUE; // Set The Status To TRUE glGenTextures(8,
&texture[0]); // Create 8 Textures
for (int loop=0; loop<1; loop++) // Loop Through All 8 Textures
{
glBindTexture(GL_TEXTURE_2D, texture[loop]);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
gluBuild2DMipmaps(GL_TEXTURE_2D, 3, TextureImage[loop]->sizeX,
TextureImage[loop]->sizeY, GL_RGB, GL_UNSIGNED_BYTE,
TextureImage[loop]->data);
}
}
for (int loop=0; loop<1; loop++) // Loop Through All 8
Textures
{
if (TextureImage[loop]) // If Texture Exists
{
if (TextureImage[loop]->data) // If Texture Image Exists
{
free(TextureImage[loop]->data); // Free The Texture Image
Memory
}
free(TextureImage[loop]); // Free The Image Structure
}
}
Sorry about the length of this enquiry I just wanted to make sure I
included as much info as possible, if I'v missed anything you need to
know please dont hesitate to ask. Thanks a lot
Pete
p.s HEEEEEEEEEELLLLLPPP!!!!!!!!!!!!!!!!!