CEGUI In DDraw(Window's semi-transparent)

Forum for general chit-chat or off-topic discussion.

Moderators: CEGUI MVP, CEGUI Team

singbol
Not too shy to talk
Not too shy to talk
Posts: 36
Joined: Sun Aug 23, 2009 04:44

CEGUI In DDraw(Window's semi-transparent)

Postby singbol » Sun Aug 23, 2009 12:31

I've Finished the DDrawRenderer and DDrawTexture class,and I at last come to get that the alpha blend in do render is alpha from image, which I mean make the image in the imageset be transparent.
My real problem is that I set the alpha value of specified window(like FrameWindow),it doesn't make the FrameWindow Semi-Transparent.
Guys,help me!!!

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: CEGUI In DDraw(Window's semi-transparent)

Postby CrazyEddie » Mon Aug 24, 2009 09:21

Why did you feel the need to basically post the same thing twice, seven hours apart? What exactly was going through your mind at the time? What did you believe would be the outcome of such an action? What was your reasoning for doing this?

I ask these questions to try and understand the mentality of people who do this, because to be quite honest, it baffles me. We are not a forum with heavy traffic - it's especially quiet over weekends - so the chances of your original post getting 'pushed down' are virtually zero. In addition it was clear to see that at the time of your second copy of the post, there had been no answers to any posts since the Thursday, doesn't this give a hint that - no your original post had not been 'missed' - we just were not around on the forum to answer anybodies posts, so posting again serves no purpose what so ever.

I have to reiterate, this kind of behaviour is just completely beyond my comprehension. It makes no sense to me at all. I'd like somebody to explain this, because I am at a loss.

CE.

Jamarr
CEGUI MVP
CEGUI MVP
Posts: 812
Joined: Tue Jun 03, 2008 23:59
Location: USA

Re: CEGUI In DDraw(Window's semi-transparent)

Postby Jamarr » Mon Aug 24, 2009 16:08

:lol:
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!

singbol
Not too shy to talk
Not too shy to talk
Posts: 36
Joined: Sun Aug 23, 2009 04:44

Re: CEGUI In DDraw(Window's semi-transparent)

Postby singbol » Tue Aug 25, 2009 06:56

I'm sorry for this stupid work.~So sorry.
:(

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: CEGUI In DDraw(Window's semi-transparent)

Postby CrazyEddie » Tue Aug 25, 2009 09:11

To try to address the question: I don't think direct draw offers the functionality required to achieve this, although I can't be 100% certain - it's quite a few years since I used this API.

CE.

singbol
Not too shy to talk
Not too shy to talk
Posts: 36
Joined: Sun Aug 23, 2009 04:44

Re: CEGUI In DDraw(Window's semi-transparent)

Postby singbol » Thu Aug 27, 2009 09:58

thank you for your reply, I've finished this hard work for me~I implemented the alpha blend by lines of codes, directdraw have no support for alpha channel(I think)~~~~~
I main simulated the directfbRenderer, and at last, this can be used in other ddraw application just pass the DDrawRenderer 2 parameters:IDirectDraw7* and IDirectDrawSurface7*(backsurface),but how can I use it by pass it
IDirectDraw* and IDirectDrawSurface*, I've no idea!
thanks again and sorry for my foolish action!

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: CEGUI In DDraw(Window's semi-transparent)

Postby CrazyEddie » Fri Aug 28, 2009 08:43

It's good that you - I think - have something working.

but how can I use it by pass it IDirectDraw* and IDirectDrawSurface*, I've no idea!

Is that a question? If so could you rephrase it since I don't think I understand. As far as I recall there is no generic IDirectDraw*; I believe it's always suffixed by the interface number.

CE.

singbol
Not too shy to talk
Not too shy to talk
Posts: 36
Joined: Sun Aug 23, 2009 04:44

Re: CEGUI In DDraw(Window's semi-transparent)

Postby singbol » Fri Aug 28, 2009 09:10

yes,there's IDirectDraw*,the 1st version.

I can't use my bad DDrawRenderer class in another app.and it corrupt when loadScheme(not enough quota).
If there's a chance, I send the DDrawRenderer and DDrawTexture to you?but maybe there's no need to you.
If you have some extra time, I'll trouble you to help me with these stuff.

and there's the CEGUI.log:

Code: Select all

28/08/2009 17:45:25 (Std)    ---- Version 0.6.2 ----
28/08/2009 17:45:25 (Std)    ---- Renderer module is: CEGUI::DirectDraw7Renderer - DDraw based renderer module for CEGUI ----
28/08/2009 17:45:25 (Std)    ---- XML Parser module is: CEGUI::ExpatParser - Official expat based parser module for CEGUI ----
28/08/2009 17:45:25 (Std)    ---- Scripting module is: None ----
28/08/2009 17:45:25 (Std)    Attempting to load Scheme from file 'TaharezLook.scheme'.
28/08/2009 17:45:25 (Std)    Attempting to create an Imageset from the information specified in file 'TaharezLook.imageset'.
28/08/2009 17:45:25 (Std)    Started creation of Imageset from XML specification:
28/08/2009 17:45:25 (Std)    ---- CEGUI Imageset name: TaharezLook
28/08/2009 17:45:25 (Std)    ---- Source texture file: TaharezLook.tga in resource group: (Default)
28/08/2009 17:45:25 (Std)    Attempting to create Font from the information specified in file 'simhei.font'.
28/08/2009 17:45:25 (Std)    Started creation of FreeType Font:
28/08/2009 17:45:25 (Std)    ---- CEGUI font name: simhei
28/08/2009 17:45:25 (Std)    ----     Source file: simhei.ttf in resource group: (Default)
28/08/2009 17:45:25 (Std)    ---- Real point size: 8
28/08/2009 17:45:26 (Std)    Succsessfully loaded 22060 glyphs
28/08/2009 17:45:26 (Std)    ===== Falagard 'root' element: look and feel parsing begins =====
28/08/2009 17:45:26 (Std)    ===== Look and feel parsing completed =====
28/08/2009 17:45:26 (Error)   CEGUI::GenericException in file ..\..\..\src\CEGUIDynamicModule.cpp(99) : DynamicModule::DynamicModule - Failed to load module 'CEGUIFalagardWRBase': Invalid access to memory location.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: CEGUI In DDraw(Window's semi-transparent)

Postby CrazyEddie » Fri Aug 28, 2009 10:49

I looked at the ddraw header, apparently you can define the DIRECTDRAW_VERSION macro to some earlier version to get compatibility with the earlier releases - so that may allow you to use the IDirectDraw* instead of the IDirectDraw7*, I don't know though - I did not try this out or anything.

I've never previously seen those errors mentioned - either the "not enough quota" nor the "Invalid access to memory location." - and not just in CEGUI, I mean never, ever!

When you say you can't use your renderer "in another app", that's confusing. What app does it work in? The CEGUI Demos, perhaps?

I don't have any spare time at all(!) Though if you do send anything to me, send just the source code (no binary stuff), and I do not promise anything (for instance, I'll probably not look at it until Monday, at the earliest).

CE.

singbol
Not too shy to talk
Not too shy to talk
Posts: 36
Joined: Sun Aug 23, 2009 04:44

Re: CEGUI In DDraw(Window's semi-transparent)

Postby singbol » Fri Aug 28, 2009 11:49

thank you very much~~~~

another app comes because I tried to test the DDrawRenderer by writing a Win32 App whose rendering module is ddraw,
and it performs very well! now I want to inject this CEGUI(using DDrawRenderer) to a game(not writing by myself), it didn't run.~~~

whatever, I just send you the source code~~~and wish your improvement on them!

again, My Poor English!I can't express myself clearly! :(

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: CEGUI In DDraw(Window's semi-transparent)

Postby CrazyEddie » Sun Aug 30, 2009 08:49

Ok, I'll look over the files in a day or so and get back to you ;)

CE

singbol
Not too shy to talk
Not too shy to talk
Posts: 36
Joined: Sun Aug 23, 2009 04:44

Re: CEGUI In DDraw(Window's semi-transparent)

Postby singbol » Mon Aug 31, 2009 01:21

thank you and sorry for taking up your precious time~~~~~ :)

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: CEGUI In DDraw(Window's semi-transparent)

Postby CrazyEddie » Mon Aug 31, 2009 16:35

I've spent a while playing about with this, and will make a few comments and observations.

* Firstly, with regard to the injecting of CEGUI into existing apps, I know nothing about this at all; it's clearly hackish (which is fine, nobody likes a good hack more than me!) so results are always going to vary wildly. I guess you should get advise from the creator of the injection system.

* I imagine the issues with the module failing to load with that 'quota' error is tied to the above (if everything worked in a separate app, it must be).

* With regards to making it work with the earliest DDraw version, I got it to compile ok, though my 'flip' function (running in windowed mode) always failed with DDERR_SURFACEBUSY.

With regards to the code itself:
* In the function "DirectDraw7Renderer::doRender(void)" you're clearing the target surface every time (and doing it the hard way, too - why not Blt with DDBLT_COLORFILL?). If you're intending that surface to have been previously drawn to, you surely do not want to be doing this. If you're 'caching' the GUI output to a separate offscreen surface, then that's a different matter.

* You may like to dispense with the 'z' coordinate and the sorting of quads. This is generally not required, unless you're employing a hack to manipulate imagery layering, so can save some cycles.

* Some of the preparation work, such as the setup of the source and dest rects and the colour value, in "DirectDraw7Renderer::doRender(RenderQuad *quad)" could be saved by storing that info precalculated in the RenderQuad structs you queue (ideally you should fill that structure with as close to the final data as possible in queueQuad, rather than recalculating it every rendering pass through the quad list). I know we're using similar techniques in the 0.6.x code, but it's totally wasteful and should have been fixed years ago.

* Ok. The BIG issue. While obviously to get the required blending, you're having to perform the blit operations manually on the processor, the issue is that I can't ever see you getting acceptable performance by doing this (I got between 10 and 11 FPS running the FirstWindow sample from CEGUI). I played about with various things here, but was unable to get any acceptable results from the accelerated functions. I don't know what to suggest as far as this goes and clearly this is the key issue (I have suggestions partly because I've forgotten most of what I ever knew about DDraw - I really struggled to get anything working at all :lol:).

CE.

singbol
Not too shy to talk
Not too shy to talk
Posts: 36
Joined: Sun Aug 23, 2009 04:44

Re: CEGUI In DDraw(Window's semi-transparent)

Postby singbol » Tue Sep 01, 2009 12:07

Thanks for your advice.
The speed of the rendering can be improved by creating the "systemmemory" surface, which performs some good.
I'll take your advice and try to modify it by myself, under your great help!
Thanks again, no more words since I can't say any more by myself.~~aha~~ :)


Return to “Offtopic Discussion”

Who is online

Users browsing this forum: No registered users and 8 guests