Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsShowcase → dx4vb (DirectX For VisualBasic)
dx4vb (DirectX For VisualBasic)
2006-10-11, 4:18 AM #1
over the past couple days ive been putting together a quick 'n dirty little DLL, primarily for visual basic users (though it'll work in any language on win32 that can import dll functions), to make it a really quick + easy job to get graphics hardware acceleration for drawing 2d graphics and text. plus not to mention there are additional features not possible with stock VB drawing commands.

the primary goal was to make a fast graphics library for VB that is utterly easy to use and crash-proof.


Current features list
---------------------------
-Any 4:3 resolution (640x480, 800x600, 1024x768, 1600x1200, etc)
-Resolution-independent drawing
-Ridiculously easy fullscreen support (just flip a boolean to true)
-Support for 24-bit BMP images (transparency via 255/0/255 color key)
-Support for 32-bit BMP images (8-bit alpha channel allows for smooth edges.. photoshop exports these)
-Alpha blending
-Color and alpha modulation
-Image rotation by any angle
-Image scaling
-Trilinear texture filtering (makes scaled/rotated images look great)
-Text drawing with any font
-Automatic variable character width
-Font smoothing
-A few various utility functions, such as getting the angle between 2 points (useful for pointing an image to a specific position, as demonstrated in the example program)
-Performance that is many hundreds times faster than GDI
-Extremely easy to use


Features to be implemented
---------------------------------------
-Any ideas for more?


Current DX4VB command listing
------------------------------------------
DXInitialize, DXShutdown
DXLoadSprite, DXDrawSprite, DXUnloadSprite
DXLoadFont, DXDrawText, DXUnloadFont
DXAngleBetweenPoints, DXGetMousePos



example program (currently outdated), 3000 snowflakes
http://binarydemons.com/~strike/files/3000snowflakes.rar

(press escape to quit)

note this program is a demonstration, not a stress test; it takes more like 10,000 snowflakes before performance starts to become hindered :P

using triangle fans to draw text and batching all the sprites by texture will result in even higher performance (potentially by quite a bit). this type of thing could be done later down the line and would be completely backwards compatible. in other words, somebody could make a game with the library and later on simply replace the DLL with a newer version and get an even higher performance boost without even having to recompile their game.




i would be more than happy to expand the library to include support for DirectInput and DirectSound if anybody thinks they might be interested (although FMOD is probably the best and simplest choice for a sound library since it supports just about any sound format you could possibly want).
[ B A H ]
Bad *** by nature,
Hackers by choice
2006-10-11, 7:43 AM #2
Hehe, I like random pointing dudes, they should be included in every techdemo.

BTW: 1280x1024 is 5:4, not 4:3...
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2006-10-11, 2:45 PM #3
hehe oops, you're right, thanks (fixed original post)
actually you could fire it up in 1280x1024 but the proportions would be slightly borked lol


the dude points at the mouse position, not randomly ;)
an example of DXAngleBetweenPoints() in use
[ B A H ]
Bad *** by nature,
Hackers by choice
2006-10-11, 5:24 PM #4
character spacing is now fixed and drawing text looks an awful lot better as a result. the next step is to get font smoothing (anti-alias fonts) looking good.. right now it pretty much just blurs the character set, and doesn't look too hot :P
[ B A H ]
Bad *** by nature,
Hackers by choice
2006-10-11, 9:46 PM #5
You need to grab the mouse so us dual-monitor users aren't accidentally clicking off the screen.
2006-10-11, 10:14 PM #6
its a demonstration app for a graphics library...


besides, there's nothing to click anyway
[ B A H ]
Bad *** by nature,
Hackers by choice
2006-10-13, 6:16 PM #7
new updates:
-----------------------------

completely rewrote font loader. much faster now and font smoothing is fixed.

still causes a bit of a delay though.. wish i could draw with a true-type font without having to use horrendously slow GDI..

even with GDI, it would be much faster if i could get GetDIBits() to work..

1,048,576 calls to GetPixel()
is probably a lot slower than
1 call to GetDIBits()

(even though the same 1024x1024 image would be copied)


the DLL is more or less ready to be released, unless i or someone else can think of additional functionality that is desireable...
[ B A H ]
Bad *** by nature,
Hackers by choice
2006-10-13, 6:34 PM #8
didn't work on my downstairs computer but its ok on this one
"Nulla tenaci invia est via"
2006-10-13, 7:16 PM #9
i would be curious why.. if its a VB problem, maybe your other computer doesnt have .NET framework installed or something which im not as concerned about.

i would like to make sure the DLL is as compatible as possible though :S
[ B A H ]
Bad *** by nature,
Hackers by choice
2006-10-14, 1:45 AM #10
now that I think about it yes you're right.. it does not have .net framework installed.
"Nulla tenaci invia est via"

↑ Up to the top!