SetGfxDriver problems on program close
BlitzPlus Forums/BlitzPlus Programming/SetGfxDriver problems on program close
| ||
Whenever I use the OpenGL driver in B+, my program crashes on close. I tried the suggestion of adding "Setbuffer Desktopbuffer()" at the end of the program but to no avail. Even something like this ends in the "Windows encountered a problem..." message: SetGfxDriver 2 Graphics 800,600,32,2 SetBuffer BackBuffer() While Not KeyHit(1) Cls Color 255,255,0 Oval 0,0,100,100,1 Flip Wend End The native driver is way to slow for my game, and DirectDraw runs fast enough, but it's being phased out, correct? I'm have a nVidia GeForce 8400M GS. Thanks in advance. |
| ||
This happens for me whenever I use OpenGL and use a graphics window instead of a GUI window. This was reported many years, ago as a bug, but never seemed to get addressed. |
| ||
Lets see if I can get it working in a GUI window tonight... until then, can someone fill me in on the current state and near future for Direct Draw? EDIT: Wikipedia claims DirectDraw is still part of older versions of DirectX, but has since been replaced by Direct2D. I've read on various threads that it runs under emulation in Windows 7, so what does this entail for compatibility issues? |
| ||
Yeah GUI window may work but definitely not acceptable for my game. This is a real downer. |
| ||
You are using OpenGL, not DirectDraw. FWIW, the bug also exists in XP. Under emulation on Vista and 7, DD does not use D2D (which only works on 7 and Vista SP2), the emulation translates DD at runtime to use textured quads in D3D. D2D was designed to replace DD, and is what should be used in the future, but it is not used for DD emulation. This answer your question? |
| ||
Sauer: You might want to search for a DX9 2D engine that Dabhand made for Blitz Plus. It works very well, and it is free and should be very easy to integrate into your existing project. |
| ||
I was asking about DirectDraw because I basically have three options; the default native driver, OGL, or Direct Draw. DirectDraw is fast enough for my needs, but I was worried about compatibility issues, so I really wanted to go OGL. Is it safe to use the DirectDraw driver? As for the DX9 engine, last time I checked it was not in DLL form yet and I couldn't figure out how to compile a DLL properly at the time. EDIT: It appears Dabz's stuff is down at the moment... I can't connect to directxion.com. Was there a DLL made? |
| ||
Is it safe to use the DirectDraw driver? My experience only, but DD seems to work better under emulation than older versions of D3D. DD emulation is actually fairly simple. Personally, I would not have a problem using Direct Draw on Vista/7, but would never use older versions of D3D under Vista/7. As for the DX9 engine, last time I checked it was not in DLL form yet Actually, Dabz knocked out a DLL for me a long time ago (seems like a year or more back) and posted it. I would imagine it would be at the monkey forums if it is still available. If not, you might want to post over there and ask Dabz. I use his DX9 DLL with BMax daily. It works very well. |
| ||
Alright, I'll just use the DirectDraw driver then, we'll see how it goes when I test it on newer systems. Until then, onward with game dev. Thanks for your advice GaryV! |
| ||
It would be nice if BRL would fix the bug though ;) |
| ||
As for the DX9 engine, last time I checked it was not in DLL form yet If you still need it, heres the source:- http://www.blitzmonkeys.com/index.php?topic=10.0 Heres the DLL (With DECLS file):- http://www.blitzmonkeys.com/adminfiles/dabz/DX9_Binary.zip Dabz |
| ||
Dabz, what is the license on the source? Public Domain? |
| ||
Thanks a million Dabz, I'll get this implemented ASAP. |
| ||
Dabz, what is the license on the source? Public Domain? Do anything you like with it Gary, a little credit would be nice for anything released with it, but generally, its open for abuse! ;) Thanks a million Dabz, I'll get this implemented ASAP No probs! :) Dabz |
| ||
Thank you Dabhand. I have been happily using the DLL, but haven't been able to use the source due to we can't use any source unless it is open source. ps. Don't give up! |
| ||
ps. Don't give up! lol, I'm actually eyeing up openGL, sort of cross platform solution that I can chuck into C++, a lot of openGL engines are either way too much for what I need, or not enough. We'll see how it goes! :) Dabz |
| ||
Hey Dabz, I tried your userlib but I keep getting the "User lib not found" runtime error. All of my other userlibs work fine except for this one, any ideas? Thanks, |
| ||
Ah, forgots about this yesterday, lol, will investigate! :D Dabz |
| ||
Take your time, no rush. |
| ||
Sauer, can you please check your PM's over at BlitzMonkeys please! thanks Dabz |
| ||
I am glad to see Dabhand is still giving support/fixes for this. |
| ||
I am glad to see Dabhand is still giving support/fixes for this. 'fraid not Gary mate, due to certain circumstance, I have no way of testing this with BlitzPlus! Just wish he asked about 3 weeks ago. Dabz |
| ||
fraid not Gary mate, due to certain circumstance, I have no way of testing this with BlitzPlus! I haven't encountered the problem that Sauer describes with the DX9 engine, so I can't be of much help. As to the OpenGL issue, it would be nice if it was fixed as otherwise B+ is a really solid product. It really doesn't affect me though, as I use the GUI side of B+ when using OpenGL. |
| ||
I haven't encountered the problem that Sauer describes with the DX9 engine, so I can't be of much help. Could you email a version of that lib to Sauer, yours works, so in respect, if it doesnt on his, then its obviously something else! :) Cheers Gary Dabz |
| ||
I am using what was downloaded via the links you posted above. I can download them and email them to him if he wants? It sounds like he may not be using user libs properly (putting the lib and DLL in the right places)? |
| ||
They're in the userlib folder in the B+ directly. My other userlibs work fine, but not this one. |
| ||
Any chance you are on a 64-bit OS? |
| ||
Nope, 32 bit Vista. |
| ||
Since you are on Vista, have you actually downloaded and installed DirectX 9? |
| ||
Also what directory have you installed B+ to? |
| ||
Hmm, I've never thought to see if DX is on my computer. I thought I had because of some classes I took but come to think about it, that was on another box. Would this mean I would have to include a bunch of DX dll's along with the .exe? And B+ is in C:/Program Files/BlitzPlus EDIT: I have DX11 on my machine. Thanks for the help so far, Last edited 2010 |
| ||
Due to the file virtualization used in Vista/7, it really isn't a good idea to install B+ under program files as you can run into some virtual store conflicts. |
| ||
I am only using the DLL with BMax and I haven't had an issue, but I do have the same DX9 SDK installed on my work systems (and deployment systems) that Dabhand used. I dug out B+ and I have tried it on XP and 7 here at the house (that do not have the versions of the DX SDK that Dab compiled against) and I am getting the same error as you. Hmmm... Last edited 2010 |
| ||
Ok, on the XP system, the problem is I only have DX9 March 2008 installed. I am downloading the march 2009 version of DX9 and I will install it and try running the B+ example again... As a note, on Vista and 7, you can install DX9 side by side with what comes on the OS and you often need to to get older programs to run because not everything will work properly under emulation.... |
| ||
After updating DX on my XP system, I am still getting the same error. Grrr... |
| ||
Mmmm sounds like its got to be a bitch, it uses the March 2009 DirectX SDK, so that should of helped if you downloaded and installed the redistributable... Another possibility is you may need this: http://www.microsoft.com/downloads/en/details.aspx?FamilyID=9b2da534-3e03-4391-8a4d-074b9f2bc1bf&displaylang=en But not overly sure as no one has posted about side-by-side errors, but, it was built using VC++ 2008 Express, so worth a punt. Lastly, and probably the biggy, the only other option really is to recompile the whole source to a new DLL using all the newest bits and bobs there is, it could pick up something there. It of a bugger mind, wonder whats changed, because obviously, the DLL hasnt!?! Dabz |
| ||
That was it Dabhand. It works perfectly on XP and 7 here with Blitz Plus once the VC++ 2008 runtimes are installed. I am actually pissed at myself for overlooking that, I definitely should have picked up on that. Doh! |
| ||
As an FYI, I installed the VC++ 2008 runtimes on my 7 machine and I still get the error, but I have not installed DX9 on my Windows 7 machine. Once I also installed DX9 on Windows 7 the error is gone. So Sauer: You will need to have the DX9 (March 2009 or newer) runtimes installed on your system and the VC++ 2008 runtimes installed on your system. Your EUs will also need to have these installed to run your games properly. Many people (especially gamers) will already have these installed. |
| ||
Thank you very much for a solution, it is very appreciated. |
| ||
Glad to help. |
| ||
To fix the crash when using OGL do following steps: 1. Add this to your userlib folder .lib "kernel32.dll" api_ExitProcess (uExitCode%) : "ExitProcess" 2. Instead of end use api_ExitProcess(0) Hope if anybody stumbels about the same problem this will be helpful. (tested with windows 7 x64 prof and b+ 1.47) |
| ||
It would still be nice if Mark would actually fix this long-standing bug that has apparently always been here and has apparently been reported many times. |