Archived

This topic is now archived and is closed to further replies.

Little White Lines

This topic is 5011 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am working on a console based 3D engine with a friend, and am having some difficulties with the scene rendering. I use WriteConsoleOutput to print the entire scene at a time, but for some reason I am getting little white lines in my image. These are minimized as I drop the frame rate, and disappear when the application is full screened. Any idea as to how I can make them go away? The full source code is available at www.ezequal.com/OrigamiMan64/DOS3D.zip, but be wary, it's massive :-P [edited by - OrigamiMan64 on March 26, 2004 8:28:40 PM]

Share this post


Link to post
Share on other sites
Those flickers aren''t caused by a blazing fast cursor, that''s caused by the way Windows draws your window.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/wingdistart_9ezp.asp

Seems you may have to subclass the WindowProc for your console window in order to lie to windows about having cleared the background of your console.

Share this post


Link to post
Share on other sites
quote:
Original post by TSwitch
Those flickers aren''t caused by a blazing fast cursor, that''s caused by the way Windows draws your window.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/wingdistart_9ezp.asp

Seems you may have to subclass the WindowProc for your console window in order to lie to windows about having cleared the background of your console.


What does the GDI link have to do with subclassing winproc?

Share this post


Link to post
Share on other sites
Oops, it didn''t point to the right article. But if you looked under Technical Articles, you''d find an article titled "Flicker-Free Displays Using an Off-Screen DC". In it, he mentions "lying" to windows about having processed the WM_ERASEBKGND message in order to not have to draw over the background.

I tried to verify if this was happening by subclassing the console window, but it doesn''t appear that I''m getting passed a proper handle to the console window from GetConsoleWindow.

I guess you''re on your own.

Share this post


Link to post
Share on other sites
I just found out that you can''t subclass those fucking elitist console windows. You''re SOL with your current approach. You''ll probably have to rewrite it to have your own window and your own drawing techniques.

At any rate, you''d have more control over your display.

Share this post


Link to post
Share on other sites
Haha! I did it! I beat the white lines! I was able to subclass the window using SetWindowLong to replace the message handler.

WNDPROC OldConWndProc;

LRESULT CALLBACK ConsoleManagerWndProc ( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam )
{
switch ( message )
{
case WM_ERASEBKGND:
return ( LRESULT ) 1; // Say we handled it.
}
return CallWindowProc ( OldConWndProc, hwnd, message, wParam, lParam );
}


and in my initialization code:


OldConWndProc = ( WNDPROC ) SetWindowLong ( GetConsoleWindow ( ), GWL_WNDPROC, ( LONG ) ConsoleManagerWndProc );


Thanks for the help everyone!

sources:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dngdi/html/msdn_flicker.asp
http://www.codeproject.com/dialog/messagehandling4.asp

Share this post


Link to post
Share on other sites