Advertisement

KillProcess

Started by January 03, 2001 09:36 PM
1 comment, last by Sparky 24 years, 1 month ago
Getting a LINK Error:1104 can''t open file. When recompiling my App. It seems the process is not getting killed when the program recieves the WM_CLOSE message. The process still runs in the background and I can''t re-compile till I re-start my computer. This is getting frustrating to say the least! The app runs fine the first time then if I make changes to the code and recompile I get this error. Any suggestions? My code is based on HeHe''s Tutorials #10...and...#32. It loads a Milkshape model and Several Quadratics that have their own image maps. Not sure where to start looking or I would post my code here. I assume it''s somewhere in KillGLWindow() or WinMain()? Sparky Robert Snyder
Robert Snyder
You''ll want to be careful how closely you are copying code between the two. For #32 I basically ripped out bits of tut #6 to use and adapted them so they have the NeHe tutorial style.

To kill the process, use CTRL-ALT-DEL. But you shouldn''t have to. How are you closing the app.?

There might be a bit too much code to post, but if you can narrow it down and post that information it would make it easier to figure out what is wrong.

~~~
Cheers!
Brett Porter
PortaLib3D : A portable 3D game/demo libary for OpenGL
~~~Cheers!Brett PorterPortaLib3D : A portable 3D game/demo libary for OpenGLCommunity Service Announcement: Read How to ask questions the smart way before posting!
Advertisement
Thanks for the reply Brett. I made no changes to the code that origianly closed the tutorials. And the process isn''t visible with Ctrl+Alt+Del. It seems to be leaving something behind. Could I have a memory leak somwhere? Some memory space not getting deallocated? Still learning about dynamic allocation.

One thing that might be a problem is that I am using your Texture Loading code from Lesson 32 and the Texture loading code from Lesson 10 combined in one call to LoadGLTexture(). I have to think there is a better way to do this!

GLuint LoadGLTexture( const char *filename )
{
AUX_RGBImageRec *TextureImage[5];
memset(TextureImage,0,sizeof(void *)*5);
if ((TextureImage[0]=LoadBMP("Data/earth2.bmp")) &&
(TextureImage[1]=LoadBMP("Data/moon2.bmp")) &&
(TextureImage[2]=LoadBMP("Data/mars.bmp")) &&
(TextureImage[3]=LoadBMP("Data/venus.bmp")) &&
(TextureImage[4]=LoadBMP("Data/jupiter.bmp"))

{
glGenTextures(5, &texture[0]);

for (int loop1=0; loop1<5; loop1++)
{
glBindTexture(GL_TEXTURE_2D,texture[loop1]);
glTexParameteri(GL_TEXTURE_2D,
GL_TEXTURE_MAG_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,
GL_TEXTURE_MIN_FILTER,
GL_LINEAR_MIPMAP_NEAREST);
gluBuild2DMipmaps(GL_TEXTURE_2D, 3, TextureImage[loop1]->sizeX,
TextureImage[loop1]->sizeY,
GL_RGB, GL_UNSIGNED_BYTE,
TextureImage[loop1]->data);
}

for (loop1=0; loop1<5; loop1++)
{
if (TextureImage[loop1])
{
if (TextureImage[loop1]->data)
{
free(TextureImage[loop1]->data);
}

free(TextureImage[loop1]);
}
}
}



AUX_RGBImageRec *pImage;
GLuint texture = 0;

pImage = LoadBMP( filename );
if ( pImage != NULL && pImage->data != NULL )
{
glGenTextures(1, &texture);
glBindTexture(GL_TEXTURE_2D, texture);
gluBuild2DMipmaps(GL_TEXTURE_2D, 3, pImage->sizeX, pImage->sizeY, GL_RGB,
GL_UNSIGNED_BYTE, pImage->data);
glTexParameteri(GL_TEXTURE_2D,
GL_TEXTURE_MIN_FILTER,
GL_LINEAR_MIPMAP_NEAREST);
glTexParameteri(GL_TEXTURE_2D,
GL_TEXTURE_MAG_FILTER,GL_LINEAR);

free(pImage->data);
free(pImage);
}

return texture;
}

By the way, I downloaded your PortaLib3D and when compiling, it tells me I''m missing "png.h".

Robert Snyder
Robert Snyder

This topic is closed to new replies.

Advertisement