Game Development Community

TGB screen at init is full of trash

by Bruno · in Torque Game Builder · 04/07/2010 (12:53 pm) · 7 replies

Hi guys,

Before my game starts (in window mode), the screen shows up full of trash.
If i play anyother game, and then load up my TGB game, the screen shows the remains of the other game in my window, like if the memory of the video card is not cleared.
Is there a way to avoid this ?

thanks,
Bruno

#1
04/07/2010 (12:55 pm)
This does indeed sound more like a video card not clearing buffers etc. What make and model of card is it?
#2
04/07/2010 (1:00 pm)
Pretty much all of them, this has been tested in my 2 machines and bigfish QA
#3
04/07/2010 (1:03 pm)
I had a couple of people reporting this when Vista was first released and there were several cards that had low OpenGL support and the drivers were not correctly clearing the video buffers.

What version of the drivers are installed? Does switching to D3D rather than GL in the preferences work better?
#4
04/07/2010 (1:08 pm)
Its running in D3D by default, i can't run the game in GL because then the game will crash in Vista/Windows 7, and won't go by the requirements they have for the game (sleep mode, ctrl-alt-tab), etc,etc.
Is there a way to clear the video card ? Like, just get it all black before anything is rendered ?
My card is a Geforce Go 7950GTX and Forceware version 167.43.
No idea about the bigfish QA department.
#5
04/07/2010 (2:09 pm)
I had this problem and the only way I could solve it was to edit the source code. I had to clear the video buffer right after the AnimateWindow() call or something like that. Sorry I don't remember the exact file or line of code I modified right now, but I could look it up later.
#6
04/07/2010 (2:19 pm)
How did you clear the video buffer ?
If you could look it up, i would own you one ;)
#7
04/07/2010 (5:38 pm)
Well, I'm not sure how much this will help you because I made the fix for openGL.

Inside of winOGLvideo.cc around line 886 you should see this:

AnimateWindow( winState.appWindow, 90, AW_BLEND );

Right after that line I added this statement:
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
This cleared up all the junk in the video buffer.

I imagine that in your case you can make a similar fix inside of winD3Dvideo.cc by finding the correct place to clear the buffer.

To do that, you'll probably need a line of code similar to this:
d3dDevice->Clear(0,NULL,D3DCLEAR_TARGET, D3DCOLOR_XRGB(0,0,0),1.0f,0)

Hope that helps! Good luck!