Hello guys,

I am having some trouble building my game engine. Basically I want to change the content of a texture at every frame and render it on a quad. So, I decided to use glTexSubImage2D to reupload the content of my texture in every frame. It works great for 10 to 20 seconds but after that it causes graphics driver to crash (Windows shows an error saying graphics driver has crashed and recovered) and after that the monitor flickers and the game screen just freezes. My graphics card is ATI Radeon 6630M and I have installed latest driver through the 'Device Manager'.
I am sure it is due to glTexSubImage2D because if I comment it out from my source, it doesn't cause the crash anymore.

Here's how I am setting up the texture:

Code :
	glGenTextures(1, &texture);
	glBindTexture(GL_TEXTURE_2D, texture);
	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 1024, 1024, 0, GL_BGRA, GL_UNSIGNED_BYTE, 0);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);

And here's how I am reuploading the texture at every frame:

Code :
	glActiveTexture(GL_TEXTURE0);
	glBindTexture(GL_TEXTURE_2D, texture);
	glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, frameWidth, frameHeight, GL_BGRA, GL_UNSIGNED_BYTE, frameBuffers[currentActiveBuffer]);

If someone could help me fix the problem I would really appreciate it.

Thanks!