Leaders snarfblam Posted July 4, 2003 Leaders Posted July 4, 2003 I am learning directx, and im making a sidescroller as my first game. My program draws my level. I am just not exactly sure as to the difference between the DrawFastFlags.Wait and DrawFastFlags.DoNotWait flags. When should i use which? Also, any tips for making a side scroller for a directx newbie would be great. Quote [sIGPIC]e[/sIGPIC]
AndreRyan Posted July 7, 2003 Posted July 7, 2003 Always use the Wait flag, Wait means the program will wait until nothing else is using the surface (or at least that particular part of it) before using it. If you use DoNotWait and another thread is drawing to the surface and it overlaps where you're drawing then the program will crash, it may improve performance slightly but isn't really worth the risk Quote .Net allows software to be written for any version of Windows and not break like Unmanaged applications unless using Unmanaged procedures like APIs. If your program uses large amounts of memory but releases it when something else needs it, then what's the problem?
*Experts* Nerseus Posted July 7, 2003 *Experts* Posted July 7, 2003 I'd suggestion making it a user option. If you don't want that trouble, use Wait. I've never heard of DoNotWait crashing a program but it might cause "tearing". In a 2D game that will look especially bad. It means drawing may occur during a screen retrace, which means the top half of the screen (or some portion, maybe not exactly half) will be slightly ahead of or behind the bottom half. Sometimes it's only a few pixels, sometimes 8, 16, 32 or more! Even a few pixels in 3D games can look quite noticable especially during laggy portions (where the time between frames is greater, the tearing will be worse). -Ner Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Leaders snarfblam Posted July 7, 2003 Author Leaders Posted July 7, 2003 Hey, thanks a ton for the info guys. Quote [sIGPIC]e[/sIGPIC]
*Gurus* divil Posted July 7, 2003 *Gurus* Posted July 7, 2003 The "tearing" happens when your program doesn't wait for the VSync of the monitor before drawing. That is actually a different flag (WaitFlags.NoVSync or something) and nothing to do with DoNotWait, if memory serves. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Co2 Posted July 8, 2003 Posted July 8, 2003 To wait or not to wait; that's a good question. :confused: While making my tetris, I asked myself the same question. I didn't see any difference between the two. I used both. My code was greatly based on tutorials from DirectX9 SDK. From what I've seen in those tutorials, they often use the DoNotWait flag. I had no crash, no tearing or any other problems using DoNotWait. I'll be looking into it. Quote
Leaders snarfblam Posted July 8, 2003 Author Leaders Posted July 8, 2003 Tetris is also windowed, not that that necessarily matters, i dont know; I've never made a windowed program in directx. But a question about those tutorials: where are they? The only directx tutorials that came with the sdk that i can find are for direct3d. Worse yet, the only documentation I can find is the C++ documentation. Microsoft.com is very lacking in Directx9 documentation, as well as the rest of the internet. Quote [sIGPIC]e[/sIGPIC]
Co2 Posted July 10, 2003 Posted July 10, 2003 DirectDraw tutorials or samples are located in %DXSDK%\Samples\VB.Net\DirectDraw\ where %DXSDK% is the directory in which you installed DirectX 9 SDK (In my case, C:\DXSKD). As for documentation, you can read on msdn that it is still a preliminary documentation. I'm not sure but you might not have downloaded the complete sdk if you lack some samples. Quote
AndreRyan Posted July 10, 2003 Posted July 10, 2003 I've been told not to use DoNotWait because drawing functions lock surface memory while drawing, and locked memory can't be locked a second time. Sorry if I was wrong Quote .Net allows software to be written for any version of Windows and not break like Unmanaged applications unless using Unmanaged procedures like APIs. If your program uses large amounts of memory but releases it when something else needs it, then what's the problem?
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.