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.

DarkBASIC Professional Discussion / d3d_text disappears in windowed mode when window moved (D3DFunc)

Author
Message
Ben_UK78
15
Years of Service
User Offline
Joined: 10th Jul 2010
Location:
Posted: 3rd Dec 2011 09:10
Hi all,

I am thinking of starting a project that will run in a window, but with previous projects doing the same and using d3d_text the text vanishes while you move the window around the desktop.

Does anyone know a way around this? Am I doing something silly somewhere?

Cheers

Ben
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 3rd Dec 2011 09:37
Anything 2D will disappear whilst moving the window. Sprites, pasted images, text, the lot.
Only 3D will remain. I too find this annoying.

My signature is NOT a moderator plaything! Stop changing it!
Ben_UK78
15
Years of Service
User Offline
Joined: 10th Jul 2010
Location:
Posted: 3rd Dec 2011 09:58
No workaround then!

I wonder if taking a screen grab and displaying that while dragging the window would work?...

Have you developed any work arounds?
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 3rd Dec 2011 10:01
As soon as you take a screen grab and paste it, it too would disappear. remember, ALL 2D will vanish. Only 3D. Perhaps creating a screen quad and pasting the screen grab onto that would work, but get image is very very slow.

My signature is NOT a moderator plaything! Stop changing it!
Ben_UK78
15
Years of Service
User Offline
Joined: 10th Jul 2010
Location:
Posted: 3rd Dec 2011 10:15
Hmmm, I wonder if grabbing the screen memory allocation and creating a bitmap from it (from a memblock) then pasting this to a 3d plane facing the camera would work?
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 3rd Dec 2011 12:00
You could use a similar process to the fullscreen bloom shader, where you render the screen to an image, then use the Image Kit to paste the HUD to that image and paste that to the screen.

My signature is NOT a moderator plaything! Stop changing it!
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 3rd Dec 2011 13:06
Hi there. This code nearly works. It grab the image if mousey<=1 and texture backdrop. I know that is not exact, but better than nothing.




Cheers.

I'm not a grumpy grandpa
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 3rd Dec 2011 15:30
You could use a method like this...

It works with the images, so your HUD will be ok. You just need to convert your text to images so you can paste that onto the screen image too. (In my game engine, I use an AppGameKit style text to image routine. You could create something similar for this)

This uses the (Absolutely invaluable) Image Kit by Sven B. I suggest you download it!

My signature is NOT a moderator plaything! Stop changing it!
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 3rd Dec 2011 18:52
@Mobiius I'v got Image Kit. but with my code above my writing "MOVE WINDOW" don't disappear when we move the windows.

Cheers.

I'm not a grumpy grandpa
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 4th Dec 2011 10:57
It does if you move your mouse off the bottom or the side of the window, then move it around the window to the top them move it.

Plus, with your method, you have to specifically setup your scene to work this way.

With my way, you can just plug it into any scene with only minor modifications. (And my method is way faster )

My signature is NOT a moderator plaything! Stop changing it!
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 4th Dec 2011 12:30
Quote: "And my method is way faster "


Could be faster, but this is not the purpose. In my code, when we move the windos, all that we writte on the screen, remains visible and not disappears. In your method above, I don't mean the images but your writting, disappears when we move the windows.

Cheers.

I'm not a grumpy grandpa
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 4th Dec 2011 13:56
Like I said...
Quote: "You just need to convert your text to images so you can paste that onto the screen image too."

After using AppGameKit, I much prefer this way to drawing text now. It's quicker, and allows for better formatting of text. (Rotations, alpha fading, colouring etc)

As for this..
Quote: "all that we write on the screen, remains visible and not disappears"

This isn't entirely true, your code only works if you move the mouse off the top of the screen. If you move it off any other way, or move the mouse very fast, your code does not work. Mine works all the time.

My signature is NOT a moderator plaything! Stop changing it!
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 4th Dec 2011 16:38 Edited at: 4th Dec 2011 16:43
It was you the one who talk about to setup the scene. Of course that you will have to setup to achieve what you need. My example works as you say, off the top because we drag windows from its top, but is easy to setup left/right and bottom to do the same.

I'm not discussing ....just saying that in this way you don't need any plug-in.

Cheers.

I'm not a grumpy grandpa
Booma
17
Years of Service
User Offline
Joined: 29th Mar 2009
Location:
Posted: 5th Dec 2011 18:03 Edited at: 24th Dec 2011 10:00
Hi all,

Why we can't simply clear the screen when user move or resize window? f/ex CLS?

I have implemented this idea in one command.

SMii
14
Years of Service
User Offline
Joined: 25th Dec 2011
Location:
Posted: 25th Dec 2011 12:00
Sorry for my English.

When I execute this code (from post above)



I have got an error:
Could not determine parameter type of 'bo wmoving monitor(1)' at line 7'

what I am doing wrong?
Booma
17
Years of Service
User Offline
Joined: 29th Mar 2009
Location:
Posted: 27th Dec 2011 13:18
@SMii

copy the dll from attachment to plugins-user folder

Login to post a reply

Server time is: 2026-07-10 01:06:44
Your offset time is: 2026-07-10 01:06:44