Allegro.cc - Online Community

Allegro.cc Forums » Allegro Development » GDI+ and Allegro

This thread is locked; no one can reply to it. rss feed Print
GDI+ and Allegro
Korval
Member #1,538
September 2001
avatar

Currently, Allegro can do blitting to an arbiturary HDC via regular GDI functions. This process, however, is quite slow.

Recently, Microsoft has built a new version of the GDI called GDI+. This one is much faster, and more full-featured (alpha blending), than the old GDI interface. Will Allegro have an option to use GDI+ blitting options (rotation, scale, blending, etc) in Allegro 5.0, or will it still only support blitting via the regular GDI? Note that GDI+ is a C++ class interface.

Actaully, as I think about it, maybe Allegro could have, as an alternative to DDraw support, GDI+ support. The GDI+ seems to have the features and performance to make it useful, at the very least, in tools if not in games.

Thomas Fjellstrom
Member #476
June 2000
avatar

If someone codes the driver, I don't see why not. Heck, If someone codes a driver for 4, It might just be included. Someone just needs to do the work.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Korval
Member #1,538
September 2001
avatar

Quote:

Heck, If someone codes a driver for 4

A driver for "4"? What does that mean?

Thomas Fjellstrom
Member #476
June 2000
avatar

If someone writes an Allegro 4 driver so allegro can use GDI+ for drawing, it has a good chance (IMO) of being included.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Korval
Member #1,538
September 2001
avatar

Oh, for version 4.0 of Allegro...

What is involved with writing said driver?

Thomas Fjellstrom
Member #476
June 2000
avatar

Probably just looking at the current GDI driver and adapting it to use the new GDI+ API.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

nonnus29
Member #2,606
August 2002
avatar

So where is this GDI+ ? In the VS.NET ? So it would be good for XP only?

Johnny13
Member #805
October 2000
avatar

imho no reason to use gdi since we already have DirectX9::)

Alg3D Praise my Games!!<code>#define SPAMMER (post>=666&&postperday>=6)</code><Mr.spellcaster>What post? <Mr.spellcaster>A useful post by me.

spellcaster
Member #1,493
September 2001
avatar

Quote:

imho no reason to use gdi since we already have DirectX9::)

And now use DirectX9 to draw on your win32 toolbar :) Or to run under win 3.11
Or to print an image, or to... but I guess you get the idea ;)

Don't be so single minded... I mean you have been coding for dos until recently...

--
There are no stupid questions, but there are a lot of inquisitive idiots.

A J
Member #3,025
December 2002
avatar

if GDI+ is a new technology
wouldn't it only be available for winXP ?
(and possibly win2k).

___________________________
The more you talk, the more AJ is right. - ML

MiquelFire
Member #3,110
January 2003
avatar

Based on what he said, it sounds like something 2000 came up with. Unless he's including that "bubble" stuff from XP

---
Febreze (and other air fresheners actually) is just below perfumes/colognes, and that's just below dead skunks in terms of smells that offend my nose.
MiquelFire.red
If anyone is of the opinion that there is no systemic racism in America, they're either blind, stupid, or racist too. ~Edgar Reynaldo

Korval
Member #1,538
September 2001
avatar

Quote:

Probably just looking at the current GDI driver and adapting it to use the new GDI+ API.

I didn't think there was an actual GDI driver. I mean, there are functions to blit a BITMAP to a HDC, but those are not the regular blitting functions, nor do they support normal Allegro functionality (trans, rotate, etc).

Is there any documentation on writing a driver for Allegro?

Quote:

So where is this GDI+ ?

GDI+ comes with WinXP, but if you download something off of Microsoft's site, even a Win98 machine or NT 4 (sp6) can use GDI+.

Anomalous
Member #3,112
January 2003
avatar

GDI+ is included with WinXP, but prior versions of Windows don't support it by default. You can install it for older versions of Windows though, and package the redistributable with your applications...

_____________________________________________________________
(EDIT - spelling/grammar/presentation/emoticons/content)

Thomas Fjellstrom
Member #476
June 2000
avatar

Quote:

I didn't think there was an actual GDI driver.

um.. What about the GFX_GDI driver? :) Thats what I was talking about.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Korval
Member #1,538
September 2001
avatar

One of the main reasons for having this GDI+ driver is because, according to the Allegro developers, writing DirectX code that works reasonably well with a window that can resize is very difficult. The GDI, and GDI+, have no problems with this whatsoever.

I want to have a version of Allegro that I can stick into an MFC app that will resize itself correctly (for tools), but I also want this version to run at a reasonable speed. GDI+ offers the reasonable speed part that the regular GDI did not.

Quote:

um.. What about the GFX_GDI driver? Thats what I was talking about.

I didn't even realize that was there.

Bob
Free Market Evangelist
September 2000
avatar

Quote:

writing DirectX code that works reasonably well with a window that can resize is very difficult

It would be possible if DDraw had facilities to do this. Unfortunately, it doesn't. This means that Allegro needs to destroy the DDraw surfaces, including all video bitmaps, then recreate them, every time the user moves the mouse to resize, and all while the application is drawing on to them at the same time.

Quote:

I want to have a version of Allegro that I can stick into an MFC app that will resize itself correctly (for tools), but I also want this version to run at a reasonable speed.

Good idea! I'm all for it.

--
- Bob
[ -- All my signature links are 404 -- ]

spellcaster
Member #1,493
September 2001
avatar

This get's my vote as well.
But doesn't the problem remain? I mean, even with GDI, GDI+ you'll need to rectrate the buffers?
On the other hand, if youo do this only (once) at the end of the resize op, the performance hit should be not that hard, esp. if we talk tools here, right?

--
There are no stupid questions, but there are a lot of inquisitive idiots.

Korval
Member #1,538
September 2001
avatar

Quote:

I mean, even with GDI, GDI+ you'll need to rectrate the buffers?

Maybe the screen and soforth, but the GDI+ objects (BITMAPs, etc) don't rely on the existance of a HDC.

Go to: