DrawPrimitiveUP error
Sr. GuapoOK, here goes. In the DaBooda 2D Engine, I have been having constant problems trying to get it to run. Finally I discovered the line of code giving me the error. The line of code is simply the line which renders the sprite(Tri Strip) to the backbuffer: Direct3DDevice.DrawPrimitiveUP D3DPT_TRIANGLESTRIP, 2, TextureStrip(0), Len(TextureStrip(0)) The exact error is an automation error, if that helps. I know this has happenned to me before when I have tried drawing 2D triangles in DX8, though not for a while. I can't remember how I fixed it, or if I even did. If anyone has experienced this before, please impart on us your knowledge... [:)]
masterboodaThank you for posting this, I forgot to last night... I have still been looking for an answer to this, without any luck... I hope somebody knows.. DaBooda out...
Eric Coleman
quote:
The exact error is an automation error,
All errors in DirectX will be an "automation error." You need to make a note of the actuall error number and then use the d3dx (DirectX8) library to find out what the error number means. If you're using DirectX7, then you can get an error lookup tool from VoodooVB. If you know which line is causing the error, then you can easily look in the SDK to find out what kind of possible errors that sub, function, method, or property could generate.
masterboodaI did that already and all the error code states, is that a bad parameter has been passed to the call. Now considering all the parameters there is(are, sorry dumb country boy from oklahoma), I was hoping there would be somebody that had a similar problem and already figured out the parameter, to save some debug time. I was wondering if it could be the specular component, because for all my other programs, I never used it, but now I am... Sr. Guapo, do me a favor and change all the colors to default values on the strips, and see if it will display it... just do this in the RenderMap sub in the DBTurbo2DEngine.cls, it is the first one called from the render routine... the commands look like this 'Set up Strip TextureStrip(0) = MakeStrip(TopX, TopY, 0, 1, TSMap.C1, TSMap.S1, TMap.Tx1, TMap.Ty1) TextureStrip(1) = MakeStrip(TopX + TMap.SubMapWidth, TopY, 0, 1, TSMap.C2, TSMap.S2, TMap.Tx2, TMap.Ty1) TextureStrip(2) = MakeStrip(TopX, TopY + TMap.SubMapHeight, 0, 1, TSMap.C3, TSMap.S3, TMap.Tx1, TMap.Ty2) TextureStrip(3) = MakeStrip(TopX + TMap.SubMapWidth, TopY + TMap.SubMapHeight, 0, 1, TSMap.C4, TSMap.S4, TMap.Tx2, TMap.Ty2) Just change the TSMap.C1...C4 to &HFFFFFFFF and the TSMap.S1...S4 to 0... see if that will display the maps.... I hope that works, because that is an easy fix... maybe... Thanks for the help... DaBooda out...
Almar JolingJust as a quick General tip: Len(TextureStrip(0)) you know before what type Texturestrip is, so simply make it a constant. I doubt VB's compiler will calculate how big Len(TextureStrip(0) is during compilation. So, if you make a constant of it, you'll save a needless call, X times, every frame.. :)
Eric ColemanDid you set the correct FVF? And instead of using "2" in the function, use "2&" to avoid an implicit conversion everytime the function is called.
masterboodaOne issue of this error, is that it works perfectly well on my computer, as it does others, but there are a few that it does not work on. If the FVF was set up wrong, wouldn't it not work at all? And for the 2&, I am clueless as to what you are trying to say there, so could you clarify that a little bit more for me? Thank you so far... DaBooda out...
Sr. GuapoSorry to say it, but changing the colors did not help... Also, does DX have its own set of errors I can display (or at least output w/ debug.print)? If so, how do I access these. All I can get now is the vague VB Automation Error and some weird number: -2005530516 (8876086c)...
Eric ColemanAs I said already, use the d3dx library to lookup the error number. Check directx4vb, it's used in some of the examples. Also, "2&" is an explicit constant of type long, compared to "2" which is an implicit constant of type integer.
masterboodaSorry about that, I was just awake and blurry eyed, when I read your post, I didn't know you were talking about the drawprimitiveup function, I would try that, but the error is not on my end... I woder if Sr. Guapo had any luck changine that... because that might fix it, but I'm at this moment, not holding much hope... Sorry again, I didn't see the 2... need coffee before getting on these things... Also to Almar, thanks for the head up on that, that will save a some process time, which in video game terms equal fps... but if the value within TextureStrip(0 to 3) is always changine, would that effect the size of it... or am I looking at this wrong... I know, I will try it out... couldn't hurt... DaBooda Out.... and thanks again for the help... To self: should have made the engine in dx7....
Sr. Guapo
quote:
if the value within TextureStrip(0 to 3) is always changine, would that effect the size of it
No, it is just the size on disk. If you change the value of a variable, it doesn't change the size of the variable. About the 2&, I did change it, but nothing happened. I don't know. I wil keep trying...
VBBRSee, just from the top of my head... You are creating 2 triangles, right? So this is 4 vertices. So, Len(TextureStrip(0)) shouldn't be Len(TextureStrip(0)) * 4 ? Maybe this problem only occurs on Sr. Guapo's PC because most cards could figure out the correct size and manage that, but maybe his doesn't.
masterboodaThe problem I am having, is the Len(TextureStip(0)) Isn't that calculation done on vb's end before it is passed over to the DirectX8 call... for example I have this function.. Value = Multiply(4*2, 8) It will return a 64 of course, now vb will covert this 4*2 to be considered an 8 before being passed to the function itself, so the function is only recieving two 8's, or am I seeing this wrong.... For example lets say that Len(TextureStrip(0)) is equal to 4. I create this constant TSize = 4 These commands then are identical: Direct3DDevice.DrawPrimitiveUP D3DPT_TRIANGLESTRIP, 2, TextureStrip(0), Len(TextureStrip(0)) Direct3DDevice.DrawPrimitiveUP D3DPT_TRIANGLESTRIP, 2, TextureStrip(0), TSize Direct3DDevice.DrawPrimitiveUP D3DPT_TRIANGLESTRIP, 2, TextureStrip(0), 4 Because the call gets the same values regardless right? DaBooda out...
VBBRWhat I meant was, one Len(TextureStrip(0)) for one vertex, four times Len(TextureStrip(0)) for vertices. [;)]
masterboodaYes but when you use the Len() statement, you are actually gathering the size of the full array, so if you multiply it by 4, you will get 4 times what you would need... right? Sometimes, I am stubborn about wrapping my head around code... forgive me on this... I am trying to figure out a way to error proof this ahead of myself... Must find the error first.... DaBooda out...
VBBRI guess array(0) returns the variable of index 0 right? so Len(array(0)) returns the size of the variable in index 0. Also I think Jack Hoxley's tutorials do multiply the values.
masterboodaI originally thought that too, but when you use the Len(Array(0)) you are actually pointing to the start of the array, and the total of the whole array is returned. I took another look at Jack Hoxley's tutorials again, and he doesn't multiply them either. But I could be wrong on this again... that is a pretty common occurance with me. DaBooda out...
VBBROh yeah I just looked at the tutorials and figured it out, sorry. Actually the function gets the size of just one vertex (since it already asks for the number of primitives so it could calculate the total size)
masterboodaNow that makes sense.... and sorry I was so stubborn about it. DaBooda out...
masterboodaSr. Guapo, if you haven't thrown the engine into the recycle bin yet, I have one question. Have you tried playing Cool Pong, and if you have did it work. If it does I can cross reference the two engines, and find whats different, but from what I can tell is the render routines are pretty much the same on both.... This is if you haven't tossed it into the recycle bin and flushed, I would blame you if you did... DaBooda out...
Sr. GuapoI haven't tossed it yet... I did try CoolPong, and it did work fine. There must be something that is slightly different in each of the engines. I hope one of us can find a the answer soon... [;)]
Eric ColemanI think I should clarify some of the stuff in this thread. The Len() function returns either the size of a string, the size of a basic data type, or the data size of a structure. As the SDK shows, the fourth parameter in DrawPrimitiveUp is the stride, which is the distance from one element to another. You may want to use a triangle list instead of a strip. It is possible that the video card doesn't support rendering strips.
masterboodaI thought that too, but he ran the cool pong just fine and it used strips... And I have looked over both engines, and this area is identical in every way... but there must be a difference somewhere.... I will keep looking... DaBooda out...
Sr. GuapoIt isn't strips, that is what I have always used for my programs. The ony thing I can think of is something in the initialisation code that is slightly different. I have tried turning off gamma, and alpha blending, but none of that helped. [:(]
masterboodaThe problem is the initialization is the same in both engines, really the only difference between the 2 engines, is that v1.0 uses collections, while turbo uses actual variables to store all the objects... this gave me the speed boost... because I took out all the variants But I did notice one thing that might make the difference... and that is the tu and tv values... in v1.0 I actually subtracted .05 from the edges to keep it from bleeding , but in Turbo I used the full value... Try this, in the makestrips commands, change all the last 2 tu and tv values to 0 and 1. Maybe your card will not allow for odd values... If that makes sense... DaBooda out...
Sr. GuapoWait, I'm confused. I checked the values in the tmap.tx1, etc. variables and they already are all either 0 or 1. I don't think that's the problem, anyway, but I don't really know what else it could be...
masterboodaI was eating lunch, and something just clicked in my head, about the differences between the two differen't engines, and I believe its not the engines, its the difference between the two programs built on the engines.... do me on last favore and download this file: http://dabooda.servegame.com/test3.zip See if you get any display, and if you do use the arrow keys and escape to exit... Thanks for all the help... and if this one doesn't work, I am completely out of ideas... DaBooda out...
Sr. GuapoNope... Same error... Wow this is tough. I am not going to give up yet, though. [:)]
masterboodaArgh!!! I am going to figure this out, if it leads to my demise... I will go through every line of code between the two engines, and will find out what is different... it is probably so little and petty too... but I will find it, and I will keep posting changes in here, until we nail this... Thanks for sharing the frustration... DaBooda... Here is a change I made, try this one... http://dabooda.servegame.com/test4.zip P.S. I have to watch a movie with my wife, sigh... I will be back on later tonight...
Sr. GuapoNothing... it has got to be somrthing hardware specific, though I can't imagine what. 2DCoder got a similar error, what were his specs? Maybe there is a similarity, not that it will help much...
masterboodaI have compared the code, and I actually duplicated the same error code on my machine, but at a different line, so I am thinking the error has nothing to do with the line of code, or any of the code, except one thing... This is where I need some more help from you... The way I duplicated this error, is I actually gave the InitializeDisplay command a different device ID, for my computer uses the first device, which is 0, and I know some people have an integrated device as well as a peripheal(sp?) device... when you played cool pong, what options did it give you in the first box? Because, and I am grabbing at straws here, I am thinking that your computer uses a differen't device id, and I simply didn't put that option in the demo program for you to select it... If you could let me know, if there is more than one option, in the coolpong set up screen... Thanks again... and this is literally the only thing that is different, between the two programs... if it isn't this... I'm at a complete loss... DaBooda out...
Sr. GuapoThe CoolPong enumeration just showed one card, the Radeon 9200 series. I did change the setUpDisplay code so that the adapter was D3DADAPTER_DEFAULT, but that did not help. I don't think it is somethging with the resolutions either. I thought maybe that my card did not support 320X240, so I changed it to 640X480, which I have used before. Nothing different happened. It probably does have something to do with that, however, so I will keep playing with it...
masterboodaOk, I have changed a few more things to reflect the v1.0 version... try this file: http://dabooda.servegame.com/test5.zip Hopefully that will run... DaBooda out
masterboodaAnd if that one doesn't work, try this one: http://dabooda.servegame.com/test6 DaBooda out....
Sr. GuapoThat is a no go for #5, sorry to say... Also, the link isn't working for #6, page cannot be displayed...
Sr. GuapoOk, got #6 (you forgot the .zip...). Anyway, it does not give me any error. All it does is display a grey screen, though it is NOT frozen. It will let me escape out of it, with no error messages...
VBBRYeah I think your sleep is more important than the engine, right? Sorry if I seemed offensive I was just trying to clarify everything. [:)]
masterboodaSorry about that .zip thing... Here try this one.. I hope this is it http://dabooda.servegame.com/test.zip DaBooda out..
Sr. GuapoNo, that time I got the same error again... Out of curiosity, what is different in each of these?
masterboodaOk, what I am doing is changing, really the only difference between the two codes. The difference being how the form is set up, because I looked up the error some more, and alot of it is, that the call is being made, while the form or window is being changed, so I have been trying different form set ups.. But I think I might have stumbled onto something, because in cool pong, the first time the screen gets rendered, all that is rendered is the text, then every thing is loaded and then all that is rendered... I'm thinking, I have to give something time to process, before presenting the strips... Try this one, I hope I'm narrowing it down, the fact that test5 ran, told me alot, as for it not displaying anything, is kind of a mystery: http://servegame.dabooda.com/test.zip I am just going to keep using the same file name, so my server don't get clogged up with all these test files..lol DaBooda out...
VBBROh but the correct URL is [url]http://dabooda.servegame.com/test.zip[/url]
VBBR
quote:
Originally posted by masterbooda
Try this one, I hope I'm narrowing it down, the fact that test5 ran, told me alot, as for it not displaying anything, is kind of a mystery
quote:
Originally posted by Sr. Guapo
That is a no go for #5, sorry to say
Wait, it seems like test #5 did NOT run at all.
masterboodaSorry VBBR I am working on about 3 hours of sleep, and It is showing, also this code has my brain tied up and anything else is just secondary... the correct link is : http://dabooda.servegame.com/test.zip And I meant to type test6, sorry for any confusion... I need to get more sleep from now on... DaBooda out...
Sr. GuapoThe most recent one... It did load a light blue screen before giving me an error, don't know if that helps... Get some sleep, you've been working on this non-stop...
masterboodaOk, I did some more changes, I am going to figure it out yet: http://dabooda.servegame.com/test.zip As for sleep, It isn't going to happen, until this problem is resolved... I cannot go any further with this engine, until, this problem has a solution.. DaBooda out...
Sr. GuapoSame thing as the previous one... It turns te screen blue, then gives me the error...
VBBRSeriously, you should sleep... this can't be so important to cut down your sleep time... Also it's hard to think when we're sleepy...
masterboodaOk I changed some more things, caught a few things, that I had missed before... http://dabooda.servegame.com/test.zip DaBooda out...
Sr. GuapoI got really excited with that one... [:)] It loaded the blue screen, then sat for a few seconds... I was ready to celebrate when the error popped up... sigh... Are all of these examples using TRI_STRIPS? I don't think that is the problem, but could you try one with a TRI_LIST or something?
masterboodaThe problem is now, the only difference between v1.0 and Turbo is the fact that v1.0 was a .dll and the examples I am sending you are straight code... but I do not see that being a factor at all, that would make no sense, of course none of this is making sense, because the initialization in both programs is the same as well as the making of and displaying of the strips... I am at a total loss here... It just doesn't make sense to me anymore... but I have actually compiled the engine into a .dll and have made an installer for it, here they are, with another example to try and run... if you would download this, run the installer first and then run the tutorial1 file... the installer registers the .dll and even puts it in your system folder, so do not worry about any of that... http://dabooda.servegame.com/test.zip This is my last attempt.. because as you said with the TRI_STRIPS... the cool pong game uses the same structure as do these programs... and I have tried to take out everything secondary, and looked over the code endless amounts of time, and there is no difference, when it actually comes to the DirectX8 set up.... the only difference is data structure for holding properties... and I changed all those back for these examples... so thats not it... This is the only thing I have left to try... if this doesn't work... I will have to junk the engine, and start a new one... this time in directx7... definetely... DaBooda out...
Sr. GuapoDrum roll. dadadadadadadadadadadadada... Okay, No error!!! however, there was no output either... It just rendered a blank blue screen for about 30 seconds before I escaped out... I hope that is good... Also, do not trash the engine yet. From what I have seen (on my friend's computer) and heard, this is an excellent engine. My computer is the only one it has had major trouble on, and I am planning on tossing it within the next year... Just leave the engine up, and add little things every once in a while... Someday, you or someone else will have the revelation of what went wrong, and the problem will be fixed...
masterboodaSorry had a wicked thunder storm hit us, and had to go offline for awhile.... Ok... no error weeeeee........... but no output.... baaaaaaaddd.... supposed to have output... I am simply at a loss, I need someone smarter than me to figure this one out... because I am simply out of ideas... it doesn't make sense, because the program you just ran, was the same one that gave you the error, but now it doesn't give you the error, but it doesn't show anything also... doesn't make any sense to me at all.... I'm am going to give it a break for a day or two, and that is when something will occur to me... maybe... DaBooda out...
masterboodaHey did you notice, we are warriors now... do we get a pay raise, or just a little more respect, although about 60 of those posts where on this issue... lol.. again, I will give it a day or two, and maybe something will make sense then.. DaBooda out...
Sr. GuapoI was planning on posting the error around on a few other forums... to widen the "knowledge base"... I am sure some one else must have gotten a similar error at some point, I can't be the only one, I just hope they know a solution... About the pay raise: We get a 20% raise, starting immediatly... So let see... 0.00 + 0.2 * 0.00 = ??? [:)]
Almar JolingWhy don't you change to TriangleList? Maybe that works for you.. I like it, since I can put all my objects in one list (having the same texture) and render the batch just at once :).
masterboodaI was tossing the idea around about tri-lists, but things are changing nearly every pass of the render, and objects have an order of being drawn, as well as being visible, and etc... There is to many variables to tend with, that really impedes any short cuts... DaBooda out...
Sr. GuapoThree cheers for the wonderful people at gamedev... I got a response that helped alot... Tou can view it at http://www.gamedev.net/community/forums/topic.asp?topic_id=228478 ... Anyway,I ran dbmon.exe (in the DX9 SDK) while I ran the original source code in the vb IDE. Here is the exact output: 3068: Direct3D8: (INFO) :======================= Hal HWVP device selected 3068: 3068: Direct3D8: (INFO) :Using P3 PSGP 3068: 3068: D3DX: (INFO) Using SSE Instructions 3068: Direct3D8: (ERROR) :Unsupported Interface identifier passed to QueryInterface for IDirect3DDevice8 3068: Direct3D8: (ERROR) :Unsupported Interface identifier passed to QueryInterface for IDirect3DDevice8 That was the exact series of messages. I think I can configure it to give even more detail... Okay, I will attempt to do that while you try to decifer that mess o' info... [:)]
Sr. GuapoHere we go... I cranked up the output... lots of warnings about redundant calls... blah blah blah... OK, the errors: 2196: Direct3D8: (ERROR) :*** Exception in d:\builds\nt32_chk\multimedia\directx\dxg\d3d8\fe\vshader.cpp Line: 666 (coincedence?) 2196: Direct3D8: (ERROR) :Stream 0 stride should match stride, implied by the current vertex shader 2196: Direct3D8: (ERROR) :DrawPrimitiveUP failed (really?!?!) 2196: Direct3D8: (ERROR) :Unsupported Interface identifier passed to QueryInterface for IDirect3DDevice8 2196: Direct3D8: (ERROR) :Unsupported Interface identifier passed to QueryInterface for IDirect3DDevice8 Givin this information, it would appear there is something wrong with my vertex shader??? Don't know if that is right/possible... Also, I have no idea how to fix it... [:(]
masterboodaI was looking at the previous list of errors, and where it errored at was then it set the vertex shader, but this does not make any sense, because the vertex shader is the same in both programs... there has to be one tiny difference, but thanks, this helps narrow it down immensly, we are on the right track here... Also, try something for me, run cool pong with this on, and see how the output differs, if you don't mind, and thanks a bunch for that... I used the dbmon.exe that came with directx8 and it did nothing...lol...I need to get the directx9 sdk... I will keep crunching the code here, I will find it, and thanks again..
masterboodaOmg.... I feel so stupid, especially if this works, I have found one major difference between the two, and why it has effected it this way is beyond me... but try this out, and reload the .dll, and try the tutorial1 program again, you should see one strip, which you can move around with the arrow keys, and escape will exit.... I am not going to mention the fix just yet, for the fear of jinksing it: http://dabooda.servegame.com/test.zip God, I hope this works, and if it does, I will proceed to kicking myself in the rear repeatedly.. DaBooda out..
Sr. GuapoThis should be in the DX8 SDK also... just search for dbmon.exe OK... gave two errors when the setup form loaded: 2576: Direct3D8: (ERROR) :No SW device has been registered.. GetAdapterCaps fails. 2576: Direct3D8: (ERROR) :Unsupported Interface identifier passed to QueryInterface for IDirect3D8 interface Okay, then the actual game: No errors, however, there were hundreds and hundreds of warnings (redundant call blah blah...), but no errors. After few seconds of play, another message popped up: 2676: DINPUT8: Buffer overflow; discard old data Don't know if that means anything, I know nothing of DirectInput... Otherwise it ran fine. No problems. [:)]
Sr. GuapoTo your second comment: sorry, it did not work... it gave the same errors about the vertex shader as before... Out of curiosity, what did you do?
Sr. GuapoI noticed one other message: 2336: Direct3D8: (INFO) :Failed to create driver indexbuffer Don't know if that is useful.. It is not an error, which seems weird... EDIT: It also occurred immediately after the display was changed to 640X480...
masterboodaOk, did one more thing... try this: http://dabooda.servegame.com/test.zip I am trying to run down the order of how things are done, I was looking at each engine, and noticed that certain things where put in another order than the other engine, so I am changing all of this... just download this and run it... use dbmon, and tell me what it says... thank you... DaBooda out..
masterboodaAlso try this one also: http://dabooda.servegame.com/test2.zip Maybe that one will work, I am emulating v1.0 engine, to the best extent I possible can.. DaBooda out...
Sr. Guaponope, same errors again...
Sr. GuapoNo to the second one also... Wow, I don't think I ever seen a bug this bad. It has to be something on my computer... When I installed DX9, I had all kinds of problems, so it may have something to do with that...
masterboodaI would think that if you couldn't run anything with v1.0 also... but everything is the same between the two, down to the vertex shader... I just don't understand it at all... it makes completely no sense what so ever... but I have one last change... this change, makes it almost 99% identical... if this doesn't run... I have no idea what is going on... like I ever did..lol http://dabooda.servegame.com/test.zip Just reload the dll and run the program, again... hopefully for the last time.. DaBooda out...
Sr. GuapoNope, same exact messages (I like the button though [:D])... I noticed one other message (which has been in all of them): 3704: Direct3D8: :BackBufferCount not specified, considered default 1 If there shouldn't only be 1 backbuffer, that is the/a problem, otherwise, I have no idea...
masterboodaI will not be able to post anymore for today, I have to get ready and go to work... sigh... I will think on this for the rest of the day... hopefully something obvious will pop into my head, just try the test above and hopefully I will have good news when I get home tonight...lol DaBooda out...
Sr. GuapoCoupla' more responses on gamedev: Okay, one person mentioned the "stride" error: 2196: Direct3D8: (ERROR) :Stream 0 stride should match stride, implied by the current vertex shader One pointed out that it appears the len() function is returning an improper value, which I don't think is possible, but worth mentioning... More than one person have mentioned the improper use of FVF and SetFVF... I can't believe that would be the problem either, if the demo ran fine on other computers... sigh, I don't think any of that helped, but I won't give up... yet... [:)]
Sr. Guapo
quote:
I used the dbmon.exe that came with directx8 and it did nothing...lol...I need to get the directx9 sdk...
Sorry forgot to mention this... Go into the DX control panel (Start->Settings->Control Panel->DirectX). Go to the D3D tab and switch the radio button to "debug" (as opposed to retail)... That will allow dbmon to access your program...
masterboodaOk, a few more changes where made again, and I hope I have nipped this thing in the bud... I actually thought of a few things while at work, and incorporated them, but this is it, there is isn't any thing else to change, I just don't understand or know what could be different, because as it stands, the code is now, almost at least 99% the same as the v1.0 code, and knowing my luck it's that 1%.... http://dabooda.servegame.com/test.zip please download this horrid test file again, but do me a favor this time, run the tutorial1 first, and if that does not work, then reinstall the .dll and try it again... and if that doesn't work...... well....... I have no more ideas, my brain has been wrung out, I will probably drop the turbo version, and enhance v1.0 to be faster, even though that is all I really did to begin with... DaBooda Out...
masterboodaThere is one plus side to the great debug of '04, we have went from thinking it was a active movie control thingy to this... we have narrowed it down, so I will try to think positve, and the above code, (crossing fingers and toes, wishing I had more appendages), will work... And I'm a computer science major, some student I am... maybe a career change is in order...lol DaBooda out...
2dcoderJust for the heck of it I ran the latest zip. The .dll installer reported it ran fine. I then clicked on the tutorial.exe program. About 30 seconds or so later a small blue screen popped up in the middle of my screen. It did not seem like a normal window with captions, control box, etc. There seemed to be a border around the square. The program exited without any errors or message boxes coming up. Is that good? What is supposed to happen? Edit: I looked in the texture folder and found a graphic. I never saw this graphic while running the program.
Sr. GuapoOkay, I ran the file without installing the .dll with no luck... The blue window popped up, then I got the error message. Hate to say it, but ditto after installing the new dll...
Sr. GuapoI checked on gamedev again... no luck. You think with such an active forum (~1 post/10 seconds...) someone else would have responded...
Sr. Guapomasterbooda, do you still have a copy of the original (ie not turbo) engine? could you make a quick demo with that, and upload it? I want to see if the problem is in the dll itself...
masterboodaOk here is what I did, I have made a exe, with the class inside so it is not using the .dll at all, all the recent changes are in effect here, this will let us know if it is a .dll problem... http://dabooda.servegame.com/test.zip Also if you want the original v1.0 code, you can go here, unfortunately, I cannot make another .dll, and the version I have will not work with your's, because when I created the first one, I did not have any compatibility... but you can download the source here.. http://www.planetsourcecode.com/ Just type in "dabooda 2d" in the search box.... you should be able to download it, also maybe you can give the code a look and see if you find any difference between the two, that I missed. DaBooda out..
masterboodaTo 2d coder, could you maybe run the code, using dbmon, see if you are receiving the same errors, I would appreciate it, this way I know its not a machine specific thing... DaBooda out..
Sr. GuapoOK, downloaded v1.0... I ran it (the example) and it worked fine... there were no errors using dbmon.exe, though it dished out hundreds of warnings about redundant calls (It seems to always do that). I will start looking through the source code to see what I can do...
masterboodaDid the test file, with the compliled turbo engine run? or did it do the same thing? And good luck to finding anything, hopefully you will see something that I didn't, but please if you have more important projects to do, please do those, I have a feeling this is one of those what the heck bugs... DaBooda out...
VBBRWow, if this thread wouldn't explode the server, I would imagine what will.
masterboodaI just have one question left for Sr. Guapo, and that will be all.... When you are running the test programs, I send you, do you extract it to your hardrive first, or run it straight from the zip application, because I was testing some of my tutorials earlier, and I downloaded them from the site, and tried to run it from the winzip, and received the same error, and sometimes, just got a blank screen with no output... it struck me as similar... I was just curious how you ran those... and honest this will be the last question... DaBooda out...
Sr. GuapoOkay, what I did... When the download box popped up, I chose "open", then when winzip popped up, I extracted all the files to a new folder on my hard drive. I will try to save the actual .zip to disk, see if that does anything...
Sr. GuapoNope... same error. This is very weird. We have gone through every possible source, narrowed it down immensly, and still cannot fix the error... lol... [:)]
masterboodaWhat I think I am going to have to do, and this is not great, because when a game is made with this engine, it has to be playable by everyone, not just most, so I am going to look at v1.0 again, and see if I can speed it up to some extent... then I will most likely use that one.... I just don't get it, because as far as the hardware and directx 8 stuff goes, they are identical programs... DaBooda out...
Sr. GuapoOk, I got a response from the man himself... Jack Hoxley... He gave a few tips/possible solutions: 1) Check the 'SetFVF' type commands, and double check that the size of the array/vertex type is actually being correctly passed. Stream-0 is the default stream for fixed function data iirc. 2) Does the code check for lost devices? if not, try to check that it does... you might find this error is related to a lost device (happens when you alt-tab/start-menu and a few other random Win32 messages). 3) If you think its the vertex shader (is there a custom shader, or is it fixed-function?) then your best bet is to put in a load of debug statements revolving around the "Device.Get*( )" function calls - check that what is returned by Get*() is what you expect. Tedious, but might help! He also said, regarding 2dcoder's problem, the TNT-2 is old enough where it can barely run DX8, so that is probably why he is having problems... I don't know if that helps... I think I will try a few in the source code I have, to see if it helps...
masterboodaJack Hoxley, I'm impressed, I have tried to get a hold of him before, with no luck... I will also try some of those suggestions, I am thinking it has to be the device getting lost somewhere, because the vertex shader is set up the same in both engines..... Also for 2dCoder I was assuming it was a hardware issue, but I cannot do anything about that, because the engine is in Directx8..... As for the checks, I will try to work on that , but I unfortunately cannot emulate this problem on my computer.... Thanks for the help, DaBooda out...
masterboodaOh no, not another test file, yes I have another one, could you possibly try it out, I am actually going on the logic of Jack Hoxley... http://dabooda.servegame.com/test.zip DaBooda out...
Sr. GuapoWow, that is the 20th download... Anyway, it didn't work. I used dbmon, and got the same errors as always... PS- if you want to contact Jack Hoxley, just email, he is usually pretty quick (< 2 days). Use the correct email address though. The "jollyjeffers" one is invalid, use the one listed at the bottom of each page on his site ("Jack.Hoxley"...)
masterboodaOk, ok, I have made some different changes.... I am going to fix this if it means the end of me... http://dabooda.servegame.com/test.zip Crossing fingers again...lol DaBooda out...
sdwExample works for me! (Just wanted to make it official that I took part in this thread)
masterboodaThis thread is either a debug, or we are secretly trying to explode the server.... we might reach one of those goals soon... oh, and try this one also after the above one... just maybe between these 2, we will hit it home... http://dabooda.servegame.com/test.zip DaBooda out...
Sr. GuapoPost the first one again... You used the same link, so I dl'ed the same file twice...
Sr. GuapoAlso, the new file did not work, same errors, blah blah blah... I noticed another "info" thingee: 1300: D3DX: (INFO) Using SSE Instructions I have no idea if it is relevant, but just in case, maybe someone knows what it means...
masterboodaThe SSE is the chip on your card, I believe, that is why it states what instructions it is using, what is wierd is the v1.0 don't display that message.... but I have changed some more things... http://dabooda.servegame.com/test.zip I hope this is it, I went back to the drawprimitiveup and changed the len(texturestrip(0)) to an actual value... I boosted the speed, so that is good news, but hopefully we have solved this problem.. DaBooda Out...
Sr. GuapoNope, same error(s)... Also, I think that info message has been there all along, jumbled in with the thousands of other messages. I have the debug out output turned up all the way, so I get some message about everything even semi-DX related...
masterboodaThat is it, I am done, I am tossing the engine, anybody wants it they can have it, I will start working on a directx 7 version, I have done everything possible, and this error will not desist, so it has won, I cannot go on like this anymore, I have to get some programming done, and I will just stick to directx 7 from now on.... I will leave the site up for a couple of days, and anybody who wants it, grab, it, because I am tossing it into the recycle bin... DaBooda out...
masterboodaOk, after being smacked by my wife, and this was her direct quote "You did not just ignore me for a month and a half, to toss it into the trash."... and she is right, I will not give up on this engine... This is what I know so far.... This engine, works on every computer reported to me, except 2, Sr. Guapo's and 2dCoder's... Ok, both of these two computers have the same processor speed, 500mhz... but I have 400mhz so I do not think that has anything to do with it... Ok, Sr.Guapo has 256mb ram, i believe that 2dcoder has 128, and I have 128... that can't be it... Ok, Sr. guapo has a radeon 9200 64mb, 2dcoder tnt2 ultra and I have nvidia geforcefxf 5200 128 mb......... might be possibly, except v1.0 runs fine on these computers.. sr. guapo is running xp, with .net framework, 2dcoder is running 98se with vb6, and I am running 98se with vb5.... we all have directx9.... Ok, I cannot possible see what could be causing this, because as far as the geometry and display goes, it is the same in both engines, down to the letter, heck I cut and past from 1.0 to turbo... But there is one difference between the two, and that is how objects are created and stored... in v1.0 objects are controlled by collection classes, and turbo it is actual arrays, that I redim preserve when something gets added or removed... this is the only major difference... Also in version 1.0 I used the gettickcount to judge the frame rate, but in turbo I used queryperformance counter... don't know if that would effect it... Looking over both codes endlessly, has only turned up differences in the classes and objects... that is it.... nothing else is different...... By the way Sr.Guapo did you say you also ran this on a laptop, what are the specs on that...? DaBooda out...
masterboodaAlso the error occurs on this line Direct3DDevice.DrawPrimitiveUP D3DPT_TRIANGLESTRIP, 2, TextureStrip(0), Len(TextureStrip(0)) ok and this is what this line looks like in v1.0 Direct3DDevice.DrawPrimitiveUP D3DPT_TRIANGLESTRIP, 2, TextureStrip(0), Len(TextureStrip(0)) See any difference, me neither... Ok now v1.0 has no errors but turbo does from the begininng of the initialization, but they are exactly alike in both codes.... DaBooda out...
Sr. GuapoOK, The laptop's specs: 1.6 GHz Intel Centrino (I know, not my choice...) 512 MB RAM 64 MB GeForce Go5200 Win XP Home DX9 The QueryPerformanceCounter should be fine, as long as you are using it correctly. I have used it before... It obviously isn't how you are rendering the strips, so it must be how they are initialized/created, but you must have tried almost everything... Another point I forgot to mention from Jack Hoxley: "change the Len(...) to LenB(...), to make sure you are not feeding DX a bad block of memory..." worth a try... I can also try and get some more debug output from dbmon. some of the folks at gamedev seem to think it is possible, though I don't know how... I should be able to figure out exactly what was the problem in the render call, ie, I should know which parameter was bad (assuming that was the error) or whatever...
Sr. GuapoI also wanted to ask, does anyone who has run this program succesfully own an ATI Radeon grapics card. Specifically a 9200, but any in general, I want to make sure it isn't some stupid thing with my card...
masterboodaOk, I tried the lenb thing, here is the example... http://dabooda.servegame.com/test.zip Maybe that is it, but I doubt it... also I cannot for the life of me get dbmon to run, for one thing I have DirectX in the control panel, I guess I am going to have to download and run the SDK... sigh... I have a couple of hours to spare I suppose.... but I still think this has something to do with the initialization, because the errors start right off the bat... that is the first thing done... I just understand it... maybe I will make a quick piece of code, that uses the same initialization and remove all else.... DaBooda out...
Sr. GuapoNo, didn't work (not that I wasn't hopeful, mind you...). About dbmon, It won't run, or it won't run correctly? Did you check that you are running the debug versions of Direct3D? If you are not, it won't have any output... If you can't access the DX control panel, I have no idea, maybe DX8 doesn't have its own Control Panel... btw, I am in the process of downloading a new graphics driver from ATI... I'm praying for a miracle, but I'm not optimistic...
masterboodaWell if that doesn't work, try this one... http://dabooda.servegame.com/test2.zip Maybe I did something right...lol... DaBooda out...
Sr. GuapoBrace yourself... whatever you did - IT WORKED!!!. I got the up to about 140 sprites before dropping below 60 FPS. Whatever you did worked *almost* perfectly. I noticed when I exited the program, the same old error was still there, though the program ran fine... Kudos for finally "mostly" fixing it though...
masterboodaHold on a few minutes.......... let me read the above post again........ ok then again......... ok one more time......... unbelievable, I keep thinking there is a catch... I can't simply believe it... this is all I changed........ This Line: Public Const FVF_VertexType = D3DFVF_XYZRHW Or D3DFVF_TEX2 Or D3DFVF_DIFFUSE Or D3DFVF_SPECULAR to this: Public Const FVF_VertexType = D3DFVF_XYZRHW Or D3DFVF_TEX1 Or D3DFVF_DIFFUSE Or D3DFVF_SPECULAR I never even thought of that, but for some reason this engine, wants it that way..... this is fantastic, let me update the .dll and give you a few examples to run, to see if we really nipped this in the bud... DaBooda Out........weeeeeeeee
Sr. GuapoOk, got a correction... The error only occurs when I X-out (by hitting the little "x" button in the upper right, for you Windows challenged folks), but not when I hit escape. I assume that means the error was (I love the past tense) a device lost error... I also ran dbmon (I forgot to in all the previous excitement), and there were absolutely no errors, just the general info it always has...
Sr. GuapoAlso, another interesting fact... When in DX debug mode, I got about 200 - 210 FPS with only one sprite. While in retail I got 235 - 240 FPS. Tht is a considerable improvement, and I just wanted to throw it out there...
masterboodaThe automation error is because I didn't terminate the engine, with the terminate in the form, I only do that when you hit escape... that is normal, what is happening is your catching it right in the middle of the render routine.... I will remember to put that check in the forms from now on...at least the ones that run in a window.. Here is the new .dll and about 3 tutorials examples, reinstall the .dll and see if they run... hopefully it wasn't a combination of things, but I do not believe it is... it is that one silly little thing.... can you believe it........but hey we are warriors now!! whoo hoo... http://dabooda.servegame.com/test.zip Just run those for me, and I will leave you alone forever.... and I thank you for all the help you gave... your name is right next to mine on the credits to this engine... trust me... DaBooda Out...... for the last time on this debug.... lets hope so...lol
masterboodaThe debug vs. retail, kind of makes sense to me, because its like the debug.print command in your program, that slows it down like mad... when its in debug mode, its outputing all the info to the dbmon... but I will be sure to try to make sure mine is not in debug mode..... somehow...lol DaBooda out...
Sr. GuapoI think it is official, the "great debug" of '04 has come to a close... All the examples ran fine, and life is back to normal... Wow, I would just like to point out that I have 28 new subfolders on my computer, one for each attemt to solve the error!! [:D]
masterboodayes!! yes!!! yes!!! this is a better feeling than, nevermind my wife is watching...... It is done.... It is done...... To think a hour and a half ago I was about to toss this thing...lol Man I want to extend a thanks to all your help, and all the sub folders you created... thanks... But it does not explain one thing, and I am not going to ponder on it after this post... why in the world did the v1.0 engine, except tex2, but this one will not........ go figure..... strange... DaBooda out........for good............um............on this problem anyways... knock on wood... P.S. If a moderator, feels the need please delete this to free up half the server... and thank you for allowing us to do this...
cjb0087omfg, its finally finished :D
Eric ColemanI hate to say I told you so, but the error from the very beginning said your stride was wrong, lol
masterboodayeah, yeah.... rub it in why don't ya...lol DaBooda out....
sdwWow, you only had to change a single character of code all along? Ouch
Sr. GuapoAll the really bad errors are like that. Such a nasty error, with such a simple fix... Oh well, at least it is over...
VBBRWow, I can't believe you finally managed to solve that! I'm really impressed... And Sr. Guapo, what is your video card again? Am I sure in understanding it doesn't support more than 1 texture stage?
Sr. GuapoIt is a Radeon 9200 SE... I wouldn't know about texture stages (I've never used them), but I could have sworn it did. It is a fairly recent card... compared to my voodoo3... I think it might not be the multiple texture stages that caused it, but something else dealing with them. If you read masterbooda's comment before about how v1.0 used the FVF description, but I ran that example fine...
VBBRHum, yeah I guess, because my GeForce2 MX (hem) supports 8 stages...
masterboodaI am not going to guess anymore, I am to happy that it is fixed... to me right now, I think it was just a combination of things, and that just seemed to fix it, there was no need for tex2 anyways, so no loss there.... DaBooda out...
VBBRWow, nine pages... this topic is going to mark VBGamer history [;)] Anyway, now you can continue developing the engine for good...
sdwHey, Sr. Gaupo, my card is also a 9200 SE and I ran the test demo fine all along. Does the amount fo memory on the card matter? Mine's 128MB
Sr. GuapoIt is possible, mine is only 64 MB, though I don't think it would... As far as I knew, a 9200 SE was identical to a 9200 SE, except for the speed/mem size... The supported features should be the same...
masterboodaI think it was something else all along, memory related yes, but not video related, it just reflected on the memory of the video card, I don't know if that makes any sense, but with directx there is a lot of stuff behind the scenes... so there is really no way of knowing... DaBooda Out... P.S. As for the cards being the same, they should have the same instruction set on both, the only difference being the memory...
Eric ColemanThe difference is the drivers. It's possible that some video driver's can compensate for a dispcrenpency in explicit stride and the FVF calculated stride. If you get either of those wrong, then you run into the possibility of the video card reading from memory that it possibly shouldn't be reading, and that can cause an error. I suggest you read all the information the SDK has on what FVF means and how directX interprets its meaning.
masterboodaI would believe that the stride was the problem, but the fact that v1.0 ran with the same stride seems to contradict that idea.... I simply think it has to be something else, or I somehow made v1.0 skip that error, which is a possibility... all I know, now it is fixed and it was something that needed to be fixed... DaBooda out...
Sr. Guapo
quote:
The difference is the drivers. It's possible that some video driver's can compensate for a dispcrenpency in explicit stride and the FVF calculated stride.
Is it possible that I could upgrade my driver (which isn't that old... January), and the original app would work? I was actually in the process of downloading a new one when masterbooda released the fixed version, so I stopped the download...
EACamI didn't read this WHOLE thread (goodness)...but it seems there is a misunderstanding of a very simple thing. I don't care about all the specifics and someone may have already answered this...BUT: To get the size of the FVF just use a public constant and call it WHATEVER As Long (I'm not sure about the data type, check to see what the DrawPrimitiveUP wants for that param) and set it to a size at start up: Dim tmpFVF As FVF WHATEVER = Len(tmpFVF) That works perfectly for me. Maybe I'm wrong, but can you get any simpler? Or perhaps your having a problem with something else. In that case, sorry for bugging up the already gargantuan thread [:P]. EDIT: And I have a crappy adapter too.
EACam9 pages? Such an odd number? Who wants to go for 10? Sorry Eric, but this may spur pointless posts...like this one. [:P]
masterboodaIs this post the equivelent of beating a dead horse....lol I would also like to know, if after you updated the driver, if it does work... just out of curiosity... as for the const fvf size thingy.... I did that, and the size on my end was a constant 32... maybe you can check what size it is on your end... maybe that will put this topic to rest... I simply just did this Debug.Print len(texturestrip(0)), I did this at the begining of the engine, then one before the drawprimitiveup and after, and it was always a constant 32..... Not to mention, and I cannot stress this enough, the fvf was set up the same in both engines, but on sr.Guapos it allowed the Tex2 in the fvf, and in Turbo it wouldn't allow it.... so To be honest, I answered the debug problem... but the reason is completely oblivious to me... DaBooda out... P.S. And if we keep going on this, we will soon explode the server and poor Eric will be picking up pieces of this debug for eternity...
Sr. GuapoOK, this is going to annoy many people, but I installed the latest driver, and the original example ran fine. I even checked the FVF value in the source code, and it was set to tex2, so that was all I had to do all along... Wow, this is a little embarassing... It still doesn't make sense why it ran in the original though... Oh well, the problem is solved, without too much major damage...
Sr. GuapoOh, I also put in the debug.print statements, and I got the same thing: a constant 32 for the FVF size...
masterboodaahhhhhhhhh....ahhhh......That is too funny.... but at least I noticed the Tex2.... it was an unnecessary use.... so there is always something to get out of this... DaBooda out... P.S. New drivers? unbelievable.....lol.... still doesn't explain v1.0.... but I will make a new demo and post it, see if there are any problems with the change....lol...here we go again...
EACamThe point of my post was, mainly, to emphasize (i didn't do a good job) that to get a solid good old constant value DONT ACTUALLY USE A CONSTANT! Make a variable, set it at startup and whether or not it changes on different systems, you'll always get the right value, right? And to make sure you aren't causing yourself problems, don't check the size of the FVF in an array! Who knows what that's ACTAULLY giving you? My saying is, don't use something that MAY cause an error, use something that is solid and don't bother the study to see if it'll work. Basically, if some code is shifty, make it sturdy. Anyway, so just create a variable by the FVF type (no arrays, no nothing, just a plain old variable), and use that to get the size. Just my 2c.
EACamhey, we made it!
VBBR10 pages! yay!... ... ...[:p]
masterboodaTo EACam, I did that already a long time ago in the debug, and it produced the same result. I set up a variable to hold the value, and set the size of the fvf(not the array) into the variable... it produced the same result... DaBooda out...
EACamOK...good. Thanks. (Not necessarily to you, but I was trying also to emphasize the importance of avoiding bugs if you don't know EXACTLY what you're doing. [:)])
VBBRYeah and I have one problem here, when my code starts to grow above something like 500 lines inside a module, it starts to get hard for me to find what I asm looking for because of my lack of organization... [:P] That's one of the reasons a program I started just a year ago is already at the 3.2 version... And the 1.x versions weren't even publicly distributed... And the 2.1 version (I think) was the first one to be distributed, only at the october of 2003 if I'm not mistaken. The 3.0 version also didn't come out of my PC but the 3.1 was published in this year march. The 3.2 version which I'm still working on a bit will be released yet this month. The reason I'm telling this is because this program code is a little big already and I'm thinking about re-writing it once again!
masterboodaI understand where you are coming from, this engine code is huge and finding a bug on my end is hard enough, but then trying to find a bug on someone elses end is near impossible... I need to learn how to organize my code a little better, but when I am programming I am just zooming and not even thinking about how it is going to look, just run... Also I have a lot of stuff I have went back to after about a year, and had no idea what I was doing... commenting is a good thing...lol DaBooda out..
EACamFortunately...over the years...I've learned that important concept pretty well. I mean, I still throw things together now and then when it isn't curcial; but when I'm making something potentially large and difficult to debug, I comment just about EVERY line, I place HUGE headings above different functions all for the same general purpose, like: [code] '----------------------------------------------------------- '********************************************** '----------------------------------------------------------- ' RENDERING '----------------------------------------------------------- '********************************************** '----------------------------------------------------------- [/code] and then a bunch of functions/subs for rendering. I am also a HUGE advocate of logging. You should see my log files, they are often HTML (meaning I can color errors red, etc.) and they usually exceed 16 KB. When reading the log, you could practically rewrite my program since, during initialization, i log after every crucial line of code (so that if it bugs up on one, i know EXACTLY where the bug occurred). At the end of the log file, i report performance and errors. I've even addad a feature where all errors are listed at the bottom with anchor links to to each error! With all that, however, I don't use many modules (tho i have over 10 in my current project), and they usually end up being GARGANTUAN, which doesn't make finding functions any easier. So, anyway, that's how i do it...it's probably overdoing it actually...but i'm a perfectionist when it comes to programming. [:)]
Sr. GuapoThat's the exact opposite of me. I use very few comments. I may have one for the most basic things like: [code] 'Game Loop [/code] but that's it. I realize it is bad technique, but I am working on that. I completely self-taught myself Q-BASIC and later VB6, so I never learned any of the typical conventions or taboo of serious programming... I have only recently looked at books or web tutorials, and started to learn all this stuff.
masterboodaThat is my problem too, is that I am self taught, I never learned the commenting or logging technique, because I know what is going on while programming it... and if I leave alone for over a year it is something i wasn't very interested in anyways... as for the bug in this engine... we knew what line caused it, we just didn't know why... all the commenting in the world wouldn't help you with that... Now a variable that has been set wrong I can easily trace, because I can see where the bug is, and trace it all the way back... I think a lot of it depends on programming taste, and whether or not the code is even going to be seen by others... but I am not disputing that commenting is good, I feel it is a good thing and a good habit to be into... but one line comments are sufficient for me... and I split everything into subs and functions anyways, so it is easy to keep track of... Dabooda out...
2dcoderGood news and bad news. Your latest demos work. :) The bad news. Full screen mode fails. I get automation errors when Windows wants to pop anything up or when I manually alt-tab or press the windows start button.
2dcoderI forgot to tell you how I did this. 'Initialize Display Engine.InitializeDisplay Main.hWnd, True, 640, 480 I changed the "True" to "False" for full screen running in your tutorials.
VBBRThat probably is a device lost error. This is going to be attached to the engine soon, I think. About the code organization... Now we must say that VB.NET really helps here, with the "+" and "-" in each function/class/module/everything and also with the "#Region" command. This really is very handy.
sdwI never comment, except when I know I'm going to take a break or think of some more features then I'll make a TODO list. If you make relevent names for your subs, functions, and variables then you really shouldn't need to. I do however use hungarian notation, if that's something like commenting.
Sr. GuapoI use hungarian notation as well, but it can still be confusing when you have 500+ lines of random math commands with no empty lines/comments... Also, 2dcoder, that is the classic device lost error. Whenever Windows takes over the computer, DX throws a fit. I think someone (masterbooda?) is/will be creating a little bit of code to catch the error...
VBBRHey how is that hungarian notation? I have no clue about notations and such. I think the notation I use is the "VBBR notation"... [:P] Also I will adopt EACam's suggestions for logging, thanks EACam.
Sr. GuapoIt's ok, I just learned the actual term yesterday, convenient... Anyway, it is the notation about how a variable should be named, constants are fully capitalized, etc. It also suggested using prefixes (such as n-integer, dbl-double, str-string, etc.) on variables to keep the types straight. I don't know where the name came from, but it is helpful...
masterboodaThat is the next change to the code, is the device lost error fix.... I am looking into the code and it should be an easy enough change, I was going to do it earlier, but got so excited to fix the recent bug I had forgot about it... but noticed it on my request page... It will be implemented shortly into v1.3 code.... Thank you 2dCoder for running those demos again, and thank you for reminding of that bug... it is something I really should have put into it to begin with, but I prefer windowed mode myself, and my bias blinded me...lol Dabooda out...
masterboodaOk, I have another problem here, and I know what the issue is and somewhat how to fix it, but implementing the change is beyond by grasp... The engine is doing this, in fullscreen mode when somebody hits alt tab or minimizes the window it is popping up an error which is the simple device lost error... ok I know the error and I know to check for it, but here is my problem... I have everything in the class and I can't really create an event because that will require the user to do more work, I am trying to implement the check and fix into the render routine, this way no user is the wiser to it even being there.... any suggestions...? DaBooda out...
Eric ColemanYou generally want to stop calling any render functions when the device is lost, so the best way to do that is to go into a secondary loop that waits for the device to return, and then it can reload all textures, vertex buffers, and index buffers. If your class stops the program from functioning in any way because the device is lost, then that's just really bad for the program. In a real game you'll still want to be able to transmit and receive any network data and also keep physics simulations running or somehow pause them to avoid a simulated explosion.
masterboodaThere in lies the problem, because I thought of using the second loop but it would put everything in the clients program on hold. So I thought of maybe skipping the render routine as long as the device is lost, but the rest of the program would run, and they would have to put in an event to notify them. There is no way to install this into the engine without losing one or the other. I will figure something out, but I am tempted to let the user have control over that, because they know when the program has lost focus... and they can set it up to do what they will, because really the engine only runs when one command is called. This will give the user more control, because putting the render loop on pause just wouldn't do. DaBooda out...
masterboodaI'm almost tempted to remove the fullscreen ability anyways, because you can still achieve full screen by maximizing your window and using always on top functions... And Windowed is hundred more times compatible, and the refresh is more stable as well as being able to have any size window, that is a bonus... So any opinions on that? DaBooda out...
Eric Colemanslow, slow, slow.
masterboodaI know I am slow but that is besides the point :) As for windowed being slow, I notice no difference on my machine at all and I am running an archaic piece of junk... actually full screen runs a little slower than windowed for me.... Should I give the user the control over this, or simply let it ride, because there is no way to incorporate this without losing something in the engine... stupid window's and stupid alt tab and window's key... I will concentrate on this tommorrow my mind is tired from writing all these tutorials... Dabooda out...
EACamYeah...and actually, using windowed mode is LESS compatable, i believe. If u do recall, there is a Caps value u need to check that specifies if windowed mode is supported, whereas there is no such enumeration for full screen. To me that seems good enough proof that full screen, when done right, is more compatable. Unfortunately, tho, I have the same problem. In full screen my alt+tab handling (YES, i DO have it) doesn't even work. It causes DX to crash and i haven't the slightest clue why. I think i'll have to rewrite my initialization code and see if i can get it to work, but i'm not sure. From what i hear, however, it is a good idea to load ur textures after restoring, and to me, i feel that if i cant get restoration to work, it wouldn't be any worse for me to just COMPLETELY destroy and re-initialize my window and then reload all the grafix. But yes, Windowed mode IS slower (and there's no hope of gamma correction in windowed mode [;)] - speaking of gamma correction, i still dont have the Interpolate function [}:)]). Well, theres my 2c. P.S. VBBR, i'm glad u like my method [:p], i got it from how MS Visual C++ does its compilation logging.
EACamOh...and hungarian notation is definately a +. I didn't know what that was for the first 2 yrs or so of my programming life (aka, no life), and then i started using it. One nice thing i've found is that, since VB DOESN'T use hungarian notation, by using it u can have things like sName As String whereas Name As String would be invalid since VB already uses Name. Unfortunately, my programming style is like the wind and i have once again neglected to use hungarian notation. It's probably because I had to use a bunch of code i wrote a LONG time ago and i didn't want to seem inconsistent by using hungarian when a lot of the code didn't...i dunno. I should pick it back up tho. [;)]
VBBRDoes anyone have a link for a page explaining hungarian notation?
Sr. GuapoI just sa it in a book the other day (some PHP code book...). There isn't much to explain. Basically, it gives a common nomenclature (sorry, too much chemistry), naming scheme, to variables, functions and classes. It can be adapted to suit your needs as well. Here are some of the more common things: Variable Names: -always lowercase except at the beginning of a word (if the var name is more than one word): variableOne -names should describe the values the variable holds (except for loop variables: i, j, etc.): frameRate -names should have a prefix describing the type of variable: strName, nNumber, dblNumber Constants: -always uppercase, words seperated by underscore: CONSTANT_ONE -rest same as variables Functions/Subroutines/Methods: -just like variables: getValue() Classes: -Just like variables except the first letter is capitalized: GraphicsEngine This is all subject to change based on your own preferences, but it provides a good base to build on.
Eric Coleman
quote:
Originally posted by VBBR
Does anyone have a link for a page explaining hungarian notation?
It's in the VB help file. Look under Visual Basic Documentation > Using Visual Basic > > Programmer's Guide (All Editions) > > > Visual Basic Coding Conventions There should be 4 topics in that "book," read them all.
VBBRHum... that would be good if I had the MSDN CD... well I guess this also exists in the online MSDN, I will take a look, thanks.
Eric ColemanOpen a project in VB, press F1. You don't need the MSDN CD for the VB help file. the MSDN CD is for other stuff.
EACamI'm not so sure. I know it IS that way for VB 5. But for VB 6, I have to have the MSDN installed for help files to work, otherwise it gives me an error like "MSDN not found, please reinstall ..." . P.S. Boy, 12 pages. So, Eric, is this a record? [:D]
EACamYup...this is a record all right. This topic has, currently, over 3 times as many replies as the second closest thread, which was started in April. [:D]
VBBRYeah EACam. I haven't installed the help files because I have only the VB6 CD. Not the MSDN one. But I have found the docs at the MSDN website anyway. [:D]