Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Program Announcements / D3DFunc V3.0

Author
Message
Blue Dragon
18
Years of Service
User Offline
Joined: 21st Oct 2005
Location:
Posted: 14th Jan 2007 18:08 Edited at: 14th Jan 2007 18:12
I swear it was down last night. Owell, all's well that ends well! I got it now. Thanks!

And I see why it cant be uploaded directly - too big. Still, it would be nice if this could be posted directly on THIS site so as to keep it available. Well, that's not my call anyway.

Signatures are a waste of bytes.
Mistrel
Retired Moderator
18
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 26th Jan 2007 00:12 Edited at: 26th Jan 2007 00:14
When I enable anti-aliasing on my GeForce 6800 it breaks my menu.



I'm drawing the box using d3d_box and then drawing the lines around the box using d3d_line.

The height and width of the menus are identical but their dimensions have been slightly skewed because of the AA. Cloggy, can you provide an override to disable AA on some of the calls? I would like to disable it only on the box and line draws.

http://3dfolio.com
dugzilla
20
Years of Service
User Offline
Joined: 5th Aug 2003
Location:
Posted: 31st Jan 2007 13:30
I have a problem. I uploaded code for you to see yourself. I make a d3d_line3d. Then I make an object,load an image and texture the object. Problem is when I texture my object the 3dline gets textured as well. Is it possible this bug can be fixed anytime soon?

Attachments

Login to view attachments
Cloggy
19
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 31st Jan 2007 13:51
Please give this version a try.

Sorry for not responding to other posts, but I don't get much time on this at the moment. This bug was a very simple fix. If this appears to be ok I will upload to the website when I get a chance.

Cheers,

Cloggy

Attachments

Login to view attachments
dugzilla
20
Years of Service
User Offline
Joined: 5th Aug 2003
Location:
Posted: 31st Jan 2007 18:46 Edited at: 31st Jan 2007 18:47
Perfect! Good job Cloggy. Thanks for the fast respond and the excellent DLL.....
Peter H
20
Years of Service
User Offline
Joined: 20th Feb 2004
Location: Witness Protection Program
Posted: 31st Jan 2007 21:04
Hey cloggy, thanks for the great dll!

Just to tell you though i have a "bug" (maybe it's a feature) when i switch resolutions during my program... afterwards, all the d3d calls don't draw anything

One man, one lawnmower, plenty of angry groundhogs.
Cloggy
19
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 31st Jan 2007 23:40
Peter,

whenever you change resolutions you need to run D3D_Init. Everything should work fine then.

Cheers,

Cloggy
Peter H
20
Years of Service
User Offline
Joined: 20th Feb 2004
Location: Witness Protection Program
Posted: 1st Feb 2007 03:31 Edited at: 1st Feb 2007 03:32
hmm... it still doesn't work... (i had actually already tried that, but i tried it again)

I've also tried re-defining the d3d_font and d3d_color, but it still didn't work... any ideas?

One man, one lawnmower, plenty of angry groundhogs.
Cloggy
19
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 1st Feb 2007 09:49
Peter,

I've tested it on D3DFunc.dll V3.6 and it works fine with this code:-



There were problems on earlier version when you changed resolutions but that should be fixed now.

You do need to recreate any fonts you use as well as re-initialising d3dFunc.

Cheers,

Cloggy
Peter H
20
Years of Service
User Offline
Joined: 20th Feb 2004
Location: Witness Protection Program
Posted: 1st Feb 2007 17:19 Edited at: 1st Feb 2007 17:31
ah, well i have V3.0.0.0.0....

i'll download 3.6 and try it out.

[edit] works now, just trying to get it to look the way i want again as it made the text kind of see-throughey and small.

One man, one lawnmower, plenty of angry groundhogs.
Mistrel
Retired Moderator
18
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 5th Feb 2007 01:27
Cloggy, your modifications to my menu may be a band-aid for when AA is turned on but it's actually breaking the correct menu layout:



I on certain AA resolutions on my GeForce 6800 the text would become blurry as well. I don't have any screenshots of that for you and I can't duplicate it on the new machine's 8800 GTS. My friend also couldn't duplicate it on my GeForce 4 MX.

http://3dfolio.com
Cloggy
19
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 5th Feb 2007 10:27 Edited at: 5th Feb 2007 10:28
Mistrel,

The problem is due to a difference between the way certain graphics cards draw lines. On my ATI card, your original code causes the horizontal lines to draw 1 pixel too long! Obviously I made the change to correct this. It would appear that NVIDIA Cards actually draw the lines 1 pixel shorter than you specify.

I am testing some changes where I add .5 to the end pixel position when rendering the line. This appears to work correctly, see attached dll.

EDIT - Need my amended version of your menu code.

Cheers,

Cloggy

Attachments

Login to view attachments
Cloggy
19
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 5th Feb 2007 21:44
I've done some further testing and the change I've made now means lines draw correctly on both NVIDIA and ATI cards.

As far as the AA problems go, I have no control over what is antialiased and what isn't. I know that if you have an LCD screen, running a DBPro exe in a resolution lower than that of you monitor will cause problems.

If you know of a way to stop the lines antialiasing then please let me know and I will incorporate those changes, other than that we're stuck with it the way it is.

Cheers,

Cloggy
Mistrel
Retired Moderator
18
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 6th Feb 2007 18:32
Your changes correct the draw distance with AA off using your changes but the menu becomes very distorted with AA on. This is what it looks like with 4x enabled.



http://3dfolio.com
Cloggy
19
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 6th Feb 2007 21:40
Mistrel,

It seems to all be down to "rasterization rules"

I'm looking into it at the moment, but I'm off on holiday for 2 weeks starting thursday, so it may be a while before I come up with any sort of answer.

Cheers,

Cloggy
Ric
19
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 7th Feb 2007 12:58
Hi Cloggy - hopefully catch you just before you go on holiday! Firstly, can you confirm that the d3dfunc.dll you posted 5 posts up (the post which starts 'Mistrel, The problem is due to a ...') is actually the latest version - even though it says version 3.2.0.0?

I have used this version with my dbpro project GUI Studio, (using the latest version of dbpro), in which I use just the basic text commands (d3d_init, d3d_font, d3d_starttext/text/endtext).

When the project is compiled into an exe, it runs fine on most users machines, but about 1 in 10 users report that it crashes out with just the '.... has encountered an error and needs to close' message. We have identified that removing all d3d references solves the problem.

Are there any requirements that the end users machine must have the d3dfunc.dll or any other dll's installed on their machine for the d3d commands to work? (I don't see why - just a stab in the dark). I know all end users have directx9.0c, in order to run exe's compiled by the latest version of dbp.

Any other theories why it would crash out for some users?

Anyway - thanks for all your work on this - your d3d function is an important part of GUI Studio - if you'd like a free copy, email me and I'll send you a download link.

Cloggy
19
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 7th Feb 2007 13:12
Ric,

Glad to know you've found this very useful.

The version posted in recently in this thread is the latest one, but there are some issues with line drawing and AA as you may have read.

D3DFunc only requires DirectX9.0c in order to run, Maybe you could try a small test on those PC'c with the problem. Try running this code.



If that fails then try taking out the text display code.

At least it gives us a small section of code to investigate.

I'll keep checking this thread until 4PM GMT. After that I'm off

Cheers,

Cloggy
Ric
19
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 7th Feb 2007 19:06
Thanks Cloggy - looks like I missed you, but we seem to have a work around, although I can't explain why it works.

The user who was not able to run the compiled .exe on his sytem downloaded the d3dfunc.dll himself, and put it in the same folder as the exe. It then worked. I said it must be a coincidence, as the d3dfunc.dll is embedded into the .exe, so I asked him to remove the dll and try running it again. Lo and behold, when he removed it, it crashed. Replaced it again, and it worked.

I don't know if it's of any consequence, but the version he installed was v3.6.0.0, which I think he got from your website, whereas the one I had when compiling was the one above as I mentioned.

Any ideas why this could be happening?

Anyway, the solution seems to be in this case to make sure that the dll is distributed with the exe - if that's ok with you?

Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 7th Feb 2007 22:22
@Ric Have them replace thier dll in the DBP plugins folder with the one that comes with you application, reboot, and see if it fixes it. We ran into a similar problem with a different dll a few years ago. Windows was finding the wrong dll since they had the same name. If this fixes it then just include a link to the version of the dll that you are using in your emails for users who also use the d3dfunc dll.

Ric
19
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 7th Feb 2007 23:12
Quote: "Windows was finding the wrong dll since they had the same name"


That's a thought. Thanks, this is beginning to make sense. I'll do some more tests.

Ric
19
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 8th Feb 2007 00:51
It turns out that the user had not installed any version of the dll previously. However, it does appear to be a versioning issue. Embedded within my compiled exe is the latest version from a few posts above (actually labelled 3.2.0.0). This works on the majority of users systems. The user who's program crashed with this version could only get it to work by putting v3.6.0.0 (from Cloggy's website) into the program directory - I believe that is the second most recent version. Putting the most recent version in the same place did not work (obviously, I suppose, as that is what was inside my exe - but at least it demonstrated that it was a versioning issue, and not that the exe wasn't finding any dll at all.)

Anyway, now that we know that some versions work for some users and others don't, I can at least help diagnose the problem when my program crashes! If it's ok by Cloggy, I'll retain copies of both versions so users have an alternative if things don't work.

Unless - anyone wants to tell me another way to make antialiased text from within DBPro, that looks as good as Cloggy's antialiased text??

dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 10th Feb 2007 09:47 Edited at: 10th Feb 2007 09:47
Hey Cloggy, awsome dll you have here, and I've used it for many projects Hoever I've finally tracked down a bug relating to 3D lines using your plugin, as in one of my previous versions some of my 3d lines would just turn black 0,0,0 RGB and I had no clue what was causing this, and in my latest rewrite as soon as I added either the "Disbale Object ZRead/Write" any 3D lines that were drawn over any objects with either of these attributes, the line would turn black instantly, It would be awsome if you could fix this before the compo deadline (6 days) .

Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 11th Mar 2007 18:52
Whenever I use paste image or sprite, no d3d_line3d lines will draw anymore

What is happening, and can you fix it?



The lines do not show, unless you remove paste image. The same happens with sprite. However, box works.

Cloggy
19
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 11th Mar 2007 21:37
Diggsey,

for some reason I removed the code that set the texture to NULL. This seems to have caused the problem.

Attached is a fixed version v3.65.

This should sort things out.

Cheers,

Cloggy

Attachments

Login to view attachments
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 11th Mar 2007 23:46
Thanks for the super fast fix

Bongadoo
17
Years of Service
User Offline
Joined: 4th May 2006
Location:
Posted: 12th Mar 2007 12:37
I'm trying to create a tooltip popup. Essentially it is a sprite box created to the correct size for the text, which is then overlayed with D3D_TEXT. The problem is D3D_TEXT is always drawn first with the sprite over the top.

So I thought I would create a bitmap, D3D_TEXT to it, GET IMAGE, then use that image as the text for the gadget in the tooltip. This method doesn't work either, as D3D_TEXT apparently doesn't really get drawn to the bitmap, so you just get a blank image. I've tried capturing after updating the backbuffer but this doesn't work either; I guess it's just because the text is an output and not related to the backbuffer? I don't want to get into locking pixels to solve this simple issue

So basically, is there anyway to ensure the priority of the D3D_TEXT is drawn last, or a way to grab an image of D3D_TEXT, or is this just not possible at all? If not, I guess its back to good old bitmap fonts!

"I haven't failed. I've just found ten thousand ways that don't work." - Thomas Edison
Cloggy
19
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 12th Mar 2007 12:45
Bongadoo,

Have you tried using d3d_box rather that a sprite. There is no way to draw d3d_text over a sprite due to the way DBPro works.

I'm currenty at work so I can't experiment, but if I get the chance later I'll have a more in depth look for you.

Cheers,

Cloggy
Bongadoo
17
Years of Service
User Offline
Joined: 4th May 2006
Location:
Posted: 12th Mar 2007 13:57 Edited at: 12th Mar 2007 13:59
Thanks for the quick response Cloggy. Unfortunately it has to be a sprite due to the artwork. Aye, I thought it might not be possible. It will be better in the long run to use bitmap fonts to get the performance increase anyway, just not looking forward to making them and setting up individual letter kerning I want to have text with the feel of standard text, not unispaced.

If there was a way to get the text into an image or onto a bitmap(quickly) then that would be my favourite solution Don't spend too much time over it!

"I haven't failed. I've just found ten thousand ways that don't work." - Thomas Edison
Cloggy
19
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 12th Mar 2007 14:21
Bongadoo,

What you need to do to use sprites is the following



This works for me. A bit of a bodge but hopefully it will sort your problems out.

Cheers,

Cloggy
Bongadoo
17
Years of Service
User Offline
Joined: 4th May 2006
Location:
Posted: 12th Mar 2007 15:17
That's interesting I'll try it after I've finished work, cheers.

"I haven't failed. I've just found ten thousand ways that don't work." - Thomas Edison
Bongadoo
17
Years of Service
User Offline
Joined: 4th May 2006
Location:
Posted: 12th Mar 2007 18:07
That code works fine with a sprite. I'm using an eXtends window for the tooltip (which I assumed was just a sprite), but it either isn't, or the eXtends code is prioritising over the top of the text. I've tried XGUI UPDATE call before drawing text but no luck either.

Looks like it's a problem with eXtends then Oh well, thanks anyhow

"I haven't failed. I've just found ten thousand ways that don't work." - Thomas Edison
TEH_CODERER
20
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 14th Mar 2007 20:58
OK. Well here is my problem; sorry if it has already been mentioned. The line3d commands work perfectly in a seperate app but when I incorporate them into my game they don't work that nicely at all! Using the command:



works fine in a seperate app but in the game it produces a dark green line. Also, if I use the paste image command it results in the line not even appearing.

Any ideas?

Thanks.

Cloggy
19
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 14th Mar 2007 21:39
Have you tried version 3.65 from a few posts up? That gets rid of the problem with paste image.

Cheers,

Cloggy
Mistrel
Retired Moderator
18
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 8th May 2007 02:09 Edited at: 8th May 2007 02:09
When I load a texture onto an object in my scene my grid takes on the color of that texture.

http://3dfolio.com/files/d3df_txbug.zip

Use the number keys 1 and 2 to turn the texture on/off.

http://3dfolio.com
Cloggy
19
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 8th May 2007 02:19
I have tried your code and it works fine here. Have you definately got the latest version? v3.65 is posted a few posts earlier in this thread (dated 11th Mar 2007 20:37).

This solves that problem. Sorry but I haven't yet had a chance to update my web site.

Cheers,

Cloggy
Mistrel
Retired Moderator
18
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 8th May 2007 03:17
That did it. Thanks, Cloggy!

http://3dfolio.com
Cloggy
19
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 9th May 2007 02:14
I've now updated the website. I aim to put some example code for using d3dfunc on there as soon as I get the time. At the moment it's just the latest plus old versions of the plugin, and some code snippets I have posted before.

Cheers,

Cloggy
Nicholas Thompson
19
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 10th May 2007 02:32
I like the new site design - but Geek-retro

Keep up the fantastic work on the module, it rocks

[center]
Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 10th May 2007 09:06
@ Cloggy -

Fantastic! Cloggy could you either post here or on the website some more general (idiot-ptoof) stuff on the isometric camera commands and use of them? I'm particularly interested as well in capturing isometric images for the old-style isometric rpg style...

Also, a little more on the 2d commands and uses...?

In any event, thanks for posting the update...

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
Cloggy
19
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 10th May 2007 10:25
Duffer,

I will endeavour to produce an example of using isometric cameras over the next day or two.

As far as using the camera to produce 2d Isometric images to use, I thought of using the isomentric camera commands to do that but then I thought why not just use the isometric camera in game. That way you get all the advantages of the 3d engine (shaders,lighting collison, etc.).

Also you don't need to worry about different map layers, if a character walks behind a tree then they will automatically be rendered behind it, the engine will not need to know that the tree is a layer above the character.

Does that make sense?

Cheers,

Cloggy
Cloggy
19
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 10th May 2007 11:10
Here is a very quick example of an isometric camera. Press "I" for isometric view, "P" for perspective view, left and right arrow keys rotate view arount (0,0,0).

Camera starts in best position for isometric rendering.



I will try to expand on this example as I get the time.

Cheers,

Cloggy
Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 10th May 2007 14:22
@ Cloggy,

Great - thx!

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
Cloggy
19
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 20th May 2007 03:32
Currently in the process of adding some new features. These may move over into a new dll as they are gui related.

They include:-



I'm also looking at adding code to allow unfilled boxes as well as filled.

Looking at an option to create isometric buttons from DBPro Objects.

Here is a piccy of the current state of the textured progress bar.



the texture is fixed to the max size of the progress bar, so it doesn't stretch or squash as the progress bar moves.

Cheers,

Cloggy
Juso
21
Years of Service
User Offline
Joined: 23rd Sep 2002
Location: Finland
Posted: 20th May 2007 12:44 Edited at: 20th May 2007 12:45
Congratulations Cloggy. This is very very brilliant dll.

But there is a nasty bug when using reflection shading and d3dline:

Cloggy
19
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 21st May 2007 18:15
Juso,

I'll have a look. Unfortunately most of these types of bugs are caused by the fact that all of my dll's rendering happens before DarkBasic does its own. This is something I can't change. I've spoken to Lee Bamber about it in the past, and he said when he gets the chance he will have a look for me but I don't hold out much hope.

That said I will take a look as it may be something I can change easily.

Cheers,

Cloggy
Brendy boy
18
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 25th May 2007 17:20
Can i ask you for a favour Cloggy. Can you remove the parts of the source code in d3d func 3.0 dll which are related to 3d commands so only the code for the 2d text remains and then post it on the forums. I know a little of c++ programing and i would try to make the code faster and add some new commands. The problem is that i don't have the globstruck.h and dbpro.h files so i can't compile the code and since i don't know what parts of the code are related to 3d i don't know what code to remove.

God is real unless declared integer.
Cloggy
19
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 25th May 2007 17:51
Brendy Boy,

I would, but it would take me too long. globstruct.h is available from this site in one of the DBPro Extras downloads. I think it is also in the sourec download from my site, although it does need to go in your include directory. No idea what the DBPro.h file is.

I am currently making a number of changes to the plugin myself. So if you are thinking of adding some commands you would be better off putting them in you own dll, or sending them to me once you have implemented them and I could integrate them into my source.

Otherwise it's going to start getting confusing for people.

Cheers,

Cloggy
Brendy boy
18
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 25th May 2007 17:58
I wrote it wrong. It isn't dbpro.h. It is dbodata.h Can you tell me where can i download that. The reason why i need the source without the 3d relating code is because i'm a beginner so i don't know how to start my own dll.

God is real unless declared integer.
Cloggy
19
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 25th May 2007 18:18
Attached is the extras file containing those files you need. see here for example dll code from this site. I think someone has produced a dll framework project as a base to create new dlls. (IanM I think).

Cheers,

Cloggy

Attachments

Login to view attachments
vibe runner
17
Years of Service
User Offline
Joined: 7th Aug 2006
Location: The Future
Posted: 26th May 2007 12:22
Just adding £0.02 of praise for this project. Have only just started using it, it's amazing. You know that, but thanks all the same.

Login to post a reply

Server time is: 2024-04-26 02:18:30
Your offset time is: 2024-04-26 02:18:30