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.

Author
Message
Cloggy
12
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 10th Jan 2006 00:43 Edited at: 19th Apr 2009 13:07
Attached is version 3 of my D3DFunc dll.

New Features

D3D_Dot3d and D3D_Line3d now both work in any camera view. You have to draw them in each view. This give the flexability of not drawing them in camera views where they aren't needed. you also specify the color when drawing them rather than using a separate command.

D3D_SetView has been removed as the new camera code makes this redundant.

I have updated the showcase code to relfect the camera changes, and am working on some code examples for each command.

I would like to take this opportunity to thank SilentS for adding gradient boxes and making other general improvements is my absence. Also DmitryK for providing me with the code for getting camera info. If anyone else gave me help, thank you.

If anyone finds any bugs, or has requests for extra functionality, please post them to this thread.

BTW - I'll post the full source to this dll in the next couple of days.

EDIT - Latest dll, Documentation and Source located here http://www.dbdepot.co.uk/d3dfunc.html

EDIT - Now updated to include version compatible with U6.2

EDIT - New Version Uploaded V3.6 - Added Isometric Camera

EDIT - New Version Uploaded V3.6.5 - Fixed 3d Line Texture problem

EDIT - New Version Uploaded V3.7 - New Commands. See readme for details

EDIT - 30/10/2008 - New Version Uploaded. Compiled for DBPro v6.9+ will not work for previous versions. See website for old versions

Attachments

Login to view attachments
blanky
12
Years of Service
User Offline
Joined: 3rd Aug 2004
Location: ./
Posted: 10th Jan 2006 17:32
Niiice, man. This thing has always been a wonderful utility DLL, looking forward to trying out the new version...

/me downloads

Support the AAANJL by doing nothing! Visit teh site below..
Philip
14
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 10th Jan 2006 23:56
Excellent. Thanks to Cloggy and all his contributors. This remains a major plugin resource for the entire community. If Cloggy even attends a DBPro Convention, and is over the legal drinking age, he will be bought free beer.

Cheer if you like bears! Cheer if you like jam sandwiches!
RiiDii: "I highly recommend Philip's vector tutorials"
P3.2ghz / 1 gig / GeForce FX 5900 128meg / WinXP home
Cloggy
12
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 11th Jan 2006 20:24 Edited at: 11th Jan 2006 20:42
Philip,

If I ever make it to a convention I'll be sure to bring my drinking head .Cheers!

BTW Here is the latest source for this dll.

Cheers,

Cloggy

Attachments

Login to view attachments
BatVink
Moderator
14
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 10th Feb 2006 15:54 Edited at: 10th Feb 2006 15:55
Cloggy, I tested the Font Size modification, and it's working perfectly. It's a big improvement when pasting text onto sprites, no jaggy edges and the ability to add transparency



Attachments

Login to view attachments
Peter H
13
Years of Service
User Offline
Joined: 20th Feb 2004
Location: Witness Protection Program
Posted: 10th Feb 2006 18:56
w00t!

Thanks! I've been using the older version in my game, but i'll update now

"We make the worst games in the universe..."
Cloggy
12
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 10th Feb 2006 20:19
Here is the fixed version, I've also made changes so the text speed is the same regardless of alignment (previously center and right aligned text was about 20% slower!)

Cheers,

Cloggy

Attachments

Login to view attachments
JoelJ
13
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 10th Feb 2006 21:47
you should post a link to the most recent download in your first post of this thread, to help people looking for it

BatVink
Moderator
14
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 20th Feb 2006 16:46 Edited at: 20th Feb 2006 16:48
Text size still seems to be a problem. The following screenshot is D3D text on the left, standard text on the right. They are both size 24, and the buttons they are on are 32 pixels high. If you look at the "p" in the middle button, it's too large for teh height.



Attachments

Login to view attachments
Cloggy
12
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 20th Feb 2006 20:44
BatVink,

The text output by D3D_Text is 24 pixels high whereas the test produced by DBP is much smaller. Do a test with all capital letters and take the results into a paint package. The problem is that 24 pixels is not the height from the top of the tallest letter to the bottom of the lowest.

I could look at trying to match the size with DBP but I'm not sure how the text size you specify actually relates to the height in pixels (points maybe?).

Cheers,

Cloggy
Peter H
13
Years of Service
User Offline
Joined: 20th Feb 2004
Location: Witness Protection Program
Posted: 21st Feb 2006 22:40 Edited at: 21st Feb 2006 22:40
I was playing my game that uses this dll on a different computer then my own, and even though the game was running the same resolution... all the text was alot bigger than on my computer...

any ideas why this happened??

"We make the worst games in the universe..."
Philip
14
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 21st Feb 2006 23:19
That computer had a different screen resolution and you didn't have a set display mode command in your game?

Cheer if you like bears! Cheer if you like jam sandwiches!
Quote of the week: "... I started learning DBP while I was a Satellite Network Controller for the US Army Space Command ... "
BatVink
Moderator
14
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 22nd Feb 2006 17:16
mmmm...I'll explain my problem with regard to the text size. I want to make buttons that are the correct height and width for the text on them. What I did was set the DB Pro Text Size to the same as my D3D Text size. The theory being, I can now use text width() to set the size of my button.

Any way around this?

Peter H
13
Years of Service
User Offline
Joined: 20th Feb 2004
Location: Witness Protection Program
Posted: 22nd Feb 2006 19:06
Quote: "That computer had a different screen resolution and you didn't have a set display mode command in your game?"

ahh... that would do it... i somehow thought that the projects settings would do this for you... but apparently not...

"We make the worst games in the universe..."
Scilynt
14
Years of Service
User Offline
Joined: 13th Nov 2002
Location: .-#-.
Posted: 23rd Feb 2006 00:53 Edited at: 23rd Feb 2006 01:02
The easiest way to help BatVink would be to include D3D_GetTextWidth/Height functions. Cloggy is already calculating the size of the bounding box in order to draw, so it wouldn't be too much trouble to add in a couple of functions to expose those values.

The best way to "fix" BatVinks "problem" would be to expose the size of text through another two functions such as D3D_GetTextWidth/Height, that take the font to be used, and the string. This way you're keeping to, what I assume, is the way DX sees text, rather than tweaking the code to perform the same as DBP.

Working code for the function based on the last released source:
+ Code Snippet

Even though I use g_pTextSprite in the code, it doesn't matter if you're inside StartText/EndText as it's never actually used. Depending on the current state of the source, this can just be pasted in and new resource strings added.

And a small image to show it in action, width and height are grabbed and stored in variables, then the box command used in the drawing loop.


On a side note, Cloggy, I noticed your resource IDs had a small problem, you had both IDS_STRING1 and IDS_STRING22 set as 1, and were using IDS_STRING22 for the first string table resource, quick fix though it doesn't cause any problems as is.

Attachments

Login to view attachments
Oneka
13
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 23rd Feb 2006 02:58
Hey cloggy is there / possible of a command that makes an outline for the text? because this would be very useful for my game for reading reason / looks I want an oultine thats black and the innerlines to be white...


Making better games everday!
Oh yeah and just so you know its Oh-nek-a not One-ka!
Scilynt
14
Years of Service
User Offline
Joined: 13th Nov 2002
Location: .-#-.
Posted: 27th Feb 2006 07:37 Edited at: 27th Feb 2006 07:39
Using Cloggy's latest release does seem to crash with 6.0 B1.

If you need a replacement until Cloggy is able to prepare a fixed release, my version based on the latest released source still works (attached).

The only problem being is that Cloggy's latest revisions to the source for speed improvements aren't included. The bonus, is that functions to retrieve text width and height are included.

+ Code Snippet

Attachments

Login to view attachments
Cloggy
12
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 1st Mar 2006 09:55
I've put the new TextHeight and Width code in the latest source. Also added a parameter that allows you to specifiy that a fonts size is in pixels (current D3D sizing) or in points (the same as DBPro).

I just have a few things to check with regards compatibility with 5.9 and 6.0, plus some help file updates, before I post the new version.

Also looking to create a small web page with everything on it. Rather then keep posting new versions. This will hold both the source and the compiled dll.

Oneka - I can't see any way of producing a outline font. I will study the DirectX documents, but don't hold out much hope.

Cheers,

Cloggy
Duffer
14
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 1st Mar 2006 17:21
looking better n better

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
Oneka
13
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 1st Mar 2006 22:46 Edited at: 1st Mar 2006 22:47
Ok....well cloggy if you cant do that then can you put in commands like the text commands that return integers/ strings...

+ Code Snippet

Becuase I could use those commands to create my own outline for the text, I can do it now using the built in but they are slow and that isnt good when you have to place each character to the screen to have this effect....


Making better games everday!
Oh yeah and just so you know its Oh-nek-a not One-ka!
harggood
14
Years of Service
User Offline
Joined: 9th Apr 2003
Location: the forest
Posted: 1st Mar 2006 23:19
I'm glad you're continuing to work on this great .dll. I use it for everything. Thanks.

Awfuldark Forest
Cloggy
12
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 1st Mar 2006 23:44 Edited at: 2nd Mar 2006 00:23
Oneka,

Text Width is in the version I will release soon. As for the other functions, I am pretty certain that there are other dlls available to do this already. They are probably better than anything I can manage as my c++ skills are very basic.

harggood - Thanks for the support!

SilentS - Can you tell me what SDK release you used? I just upgraded to Dec 2005 and double the time taken to render text.

Cheers,

Cloggy
Scilynt
14
Years of Service
User Offline
Joined: 13th Nov 2002
Location: .-#-.
Posted: 2nd Mar 2006 01:08
Just been speaking with Cloggy over MSN regarding some issues he's having. Not completely resolved just yet, but I've been asked to release the latest build of the DLL. It's only the DLL atm though, I'm sure Cloggy will post the updated help files when he's able to.

Quick list of new or updated commands:
+ Code Snippet

Think that's all.

Attachments

Login to view attachments
dark coder
14
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 2nd Mar 2006 12:40
hey cloggy i have to say this plugin is awsome ive been using it for a few months now i used it in my caiman compo however since im on a japanese windows i think the fonts appear as different sizes so ive been using sprite fonts lately.

im running dbp 5.9 and the not so latest d3d v2 and it would just silently crash and using a process of elimination on the example code it seems i have to add a spacebar() command to stop it from silently crashing :o. but other than that its great .

Halowed are the ori.
Cloggy
12
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 3rd Mar 2006 00:05 Edited at: 3rd Mar 2006 00:50
I think I have sorted out the problems I was getting with the Direct SDK (gone back to April 2005). This should work with DBP 6.0 B1 and still be compatible with 5.9.

One good thing to note is the dll is now only 60KB in size!

You will need to have the latest DirectX redistributable install, but obviously that will apply if you have 6.0 anyway.

Help and keywords have now been updated.

Let me know if there are any problems running on 6.0 as I haven't been able to get 6.0 working as yet!

Cheers,

Cloggy

Attachments

Login to view attachments
BatVink
Moderator
14
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 3rd Mar 2006 17:59
OK...so I posted a question and then forgot to come back .
I am <------ this glad -------> you could do the text height and width thing. I've got my app working by bodging the figures, but now I can replace it with real commands - sweet!

Thanks guys!

Cloggy
12
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 4th Mar 2006 01:12
I have added 1 more text command

+ Code Snippet

This will draw aligned text within a specified region. It will automatically word wrap. The latest dll, help an source can be found here http://www.cloggj.f2s.com/DBPro/

I have edited the first post to include this link, and I will always post the latest changes there rather than attach them to posts.

As always let me know if there are any problems, or if you have any suggestions for new commands.

Cheers,

Cloggy
dark coder
14
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 4th Mar 2006 07:37
i have a suggestion im on a japanese version of win xp and when people send me games or something that have text on the fonts are allways very small sometimes i cant even read them, same for the forum code snippet boxes i cant read whats inside, so could you possibly add something to check the size of the fonts or something and resize them so they should look the same on all pc`s?

also like on the standard db text functions you can make it have a box around it(forget the name) and this would be very usefull to me as im making an editor and i will be adding selecting text soon, and having to draw a box behind the text and then flip the texts colour is rather tedious.

Halowed are the ori.
Cloggy
12
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 4th Mar 2006 13:53
dark coder,

That may be a bit difficult without having the japanese version in XP myself. I'll see what I can find out. As far as caning the background color of text. It can be done but will mean significant changes to the currunt command set (mainly adding a background color parameter). Again I'll have a think and may radically change the way things are done in the next major release.

Mold Rat,

It's a bit difficult for me to test with 6.0 as I haven't got it working myself. I have passed copies on to SilentS for testing and he had no problems. The problem is I think I should use the December 2005 SDK, but doing that halves the text drawing speed which isn't good. It's a problem with the SDK as the 3dtext sample provided is also much slower than previous versions.

Once Lee releases the version on DBPro sith statically linked MFC8.0 libraries I will try 6.0 again.

Cheers,

Cloggy
Scilynt
14
Years of Service
User Offline
Joined: 13th Nov 2002
Location: .-#-.
Posted: 4th Mar 2006 18:26
Anyone who's having problems, could you run this? [1.3MB]

If this works, then there's something wrong with your code, not the plugin.

If it doesn't work, then there's either something wrong with the plugin, or a required component is missing from your system.

Attachments

Login to view attachments
Scilynt
14
Years of Service
User Offline
Joined: 13th Nov 2002
Location: .-#-.
Posted: 5th Mar 2006 01:36 Edited at: 5th Mar 2006 02:13
That was compiled with U6B2, notice the filename.

Perhaps providing some code that doesn't work will help.

[EDIT #1]
The problem seems to be if you don't use a command inside DBPSystemDebug.dll, so DBP hasn't included it in the EXE.

This is a required DLL, as it exposes the D3D Device for the plugin to output the text to the screen.

In order to have that DLL included, you need to have atleast one of the following commands in your app, or another DLL that requires this one. If you don't need any of them just put one of them somewhere where you app will never reach.

+ Code Snippet
Scilynt
14
Years of Service
User Offline
Joined: 13th Nov 2002
Location: .-#-.
Posted: 5th Mar 2006 03:40 Edited at: 5th Mar 2006 03:41
Easily fixed, you're missing the D3D_Init command. D3D_Init must be called before any function, it sets up the library for interacting with various parts of the DBP engine.

So,
+ Code Snippet
Philip
14
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 6th Mar 2006 23:42 Edited at: 6th Mar 2006 23:46
(Post edited by The Bear to remove spectacularly stupid comment about the parameters of the d3d_dot3d command, of which The Bear is rightly embarrassed)

Cheer if you like bears! Cheer if you like jam sandwiches!
Quote of the week: "... I started learning DBP while I was a Satellite Network Controller for the US Army Space Command ... "
Scilynt
14
Years of Service
User Offline
Joined: 13th Nov 2002
Location: .-#-.
Posted: 7th Mar 2006 04:18
You can manually add line breaks by using Chr$(13) + Chr$(10) or just Chr$(10).
Oneka
13
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 7th Mar 2006 05:32
Congrats with your progress
If you could add
+ Code Snippet
I can do what I want with my text thanks


Making better games everday!
Oh yeah and just so you know its Oh-nek-a not One-ka!
Scilynt
14
Years of Service
User Offline
Joined: 13th Nov 2002
Location: .-#-.
Posted: 7th Mar 2006 06:14
The built in string commands will work fine with the plugin. Unless you had an obscure reason for requesting them.
Scilynt
14
Years of Service
User Offline
Joined: 13th Nov 2002
Location: .-#-.
Posted: 7th Mar 2006 10:01 Edited at: 7th Mar 2006 10:09
It's 10 and 13...

10 - New Line (Line Feed)
13 - Carriage Return

11 - Vertical Tab
Oneka
13
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 7th Mar 2006 13:01
Yeah I didnt want to use the built in because of speed reasons...doing my little trick reduces the frame rate some and I need it to be as fast as it can be....


Making better games everday!
Oh yeah and just so you know its Oh-nek-a not One-ka!
Scilynt
14
Years of Service
User Offline
Joined: 13th Nov 2002
Location: .-#-.
Posted: 8th Mar 2006 14:48
Re: TextWidth: This has been the way DX works for atleast 1½ years, at first it was considered a bug, but it appears that this is how it's meant to work. So, in order to "fix" this, will need some hack around.

Re: D3D_Box: In the next release things have been changed a little regarding boxes, although I haven't seen the latest release just yet. I think originally the alpha parameter was there due to the way the box command originally worked, in that it didn't support alpha, so another way was used when you specified it. Now the original way has been removed, and alpha is supported throughout.

Just one more thing I want to add, remember this is still Cloggys DLL, although I'm helping him with bits, it's still nothing compared to what he's done himself. So all credit to him.
Philip
14
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 8th Mar 2006 16:53
I'd love a d3d_circle or d3d_eclipse command. I am currently creating these shapes using the d3d_dot3d command but it'd be simpler to have a built in command.

Cheer if you like bears! Cheer if you like jam sandwiches!
Quote of the week: "... I started learning DBP while I was a Satellite Network Controller for the US Army Space Command ... "
CuCuMBeR
14
Years of Service
User Offline
Joined: 11th Jan 2003
Location: Turkey
Posted: 8th Mar 2006 23:15
downloaded the latest dll from your web site and it gives me an error "d3dx9_25.dll can not be found"
Cloggy
12
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 8th Mar 2006 23:37
The latest version of the dll requires the December 2005 DirectX runtime, as is was compiled to work with DBP 6.0b2.

It will still work with older versions but only with the latest directX runtime.

Philip - SilentS has written the routines to draw circles and elipses, but we need to make some slight modifications in order to increase performance.

Cheers,

Cloggy
Scilynt
14
Years of Service
User Offline
Joined: 13th Nov 2002
Location: .-#-.
Posted: 9th Mar 2006 01:43 Edited at: 9th Mar 2006 02:13
Actually D3DX9_25 is a DLL from the April release, perhaps we could put up two versions, one that is the current version, and one that doesn't require the additional DLL but gains another 300-350KB.

Regarding the 2D stuff, Cloggy and I have been working on it, got some things sorted out, I think we've optimized it pretty well. Work is carrying on tomorrow, but we've got two new functions which lead into other functions.

[EDIT]
I should also mention that with the next release you shouldn't need to use one of the commands I listed above just to have the DLL work. The plugin will take care of including the bare necessities required to run.
Philip
14
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 9th Mar 2006 03:19 Edited at: 10th Mar 2006 23:37
@Cloggy and SilentS

Commands to draw 2d circles and eclipses would certainly be nice but what I really meant in my post above (and I didn't make clear - for which I apologise) were 3d circles and ellipses, i.e. d3d_circle3d etc.

I guess the logical command to do something like this would be:

d3d_circle3d x#, y#, z#, radius#, size, colour, z enable

where x#, y# and z# are the dimensions of the vector that describes the normal of the plane on which the 3d circle resides.

Incidentally, if you are going to include 2d circle commands, please can you also include a filled circle command?

Cheer if you like bears! Cheer if you like jam sandwiches!
Quote of the week: "... I started learning DBP while I was a Satellite Network Controller for the US Army Space Command ... "
Scilynt
14
Years of Service
User Offline
Joined: 13th Nov 2002
Location: .-#-.
Posted: 9th Mar 2006 04:40
My mistake, I hadn't paid enough attention to your post to realise the Dot3D.

I haven't had a look into the 3D commands yet, Cloggy's the only one to have handled that so far. Depending on how we can create the object, the current function, which is used for 2D circle and ellipses, should translate fine to the world of 3D.

Also, you'd need to add rotation in to it, anyway, I'll take a look at it and see what I can do.

Regarding a filled circle, that is pretty much done, aswell as other filled shapes.
dark coder
14
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 9th Mar 2006 09:24
i have a big request could you possibly just redo all of the dbp sprite functions :p, or atleast add the ability to mask part of an image, say you have a health bar instead of scaling it which looks tacky you could only render part of it as this would be great for hp bars and even maps which currently in dbp requires some very funky uv map scrolling which is very painstaking.

Halowed are the ori.
Philip
14
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 9th Mar 2006 13:45
Quote: "i have a big request "


You got that right.

Cheer if you like bears! Cheer if you like jam sandwiches!
Quote of the week: "... I started learning DBP while I was a Satellite Network Controller for the US Army Space Command ... "
Cloggy
12
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 9th Mar 2006 14:35
Philip,

Could you give me any example code for creating a 3d circle. This would make the whole process much quicker.

Cheers,

Cloggy
Philip
14
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 10th Mar 2006 01:01 Edited at: 10th Mar 2006 23:37
Hi Cloggy!

Very happy to oblige you sir.

Here is a little demonstration I've thrown together using v5.9 of how to draw a 3d circle (using your existing dot3d command):

+ Code Snippet

An ellipse is a bit more complex mathematically. My current code for that is a quick hack. I'd better clean it up before I post it.

Cheer if you like bears! Cheer if you like jam sandwiches!
Quote of the week: "... I started learning DBP while I was a Satellite Network Controller for the US Army Space Command ... "
Cloggy
12
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 10th Mar 2006 01:08
Philip,

Thanks for that. I'm just looking into a possible directX bug. try the following command

+ Code Snippet

It only renders a single pixel. This happens on any 45 degree line!

I've recreated in in some downloaded samples, so it's not just duff coding on my part. It causes some problems with the new 2d polygon commands as some pixels can be left undrawn.

Once I'm over this I'll concentrate on the 3d circle command.

Cheers,

Cloggy

Login to post a reply

Server time is: 2017-07-23 23:29:18
Your offset time is: 2017-07-23 23:29:18