Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
165 user(s) are online (157 user(s) are browsing Forums)

Members: 1
Guests: 164

Amigafreak02, more...

Support us!

Headlines

 
  Register To Post  

Window class, gadgets and blitting
Just can't stay away
Just can't stay away


See User information
I'm using the window class but it doesn't really contain any visible gadgets so far. I'm just blitting onto the window area.

Now, I would like to add some gadgets so this changes my rendering logic completely.

Should I use the space.gadget and SPACE_RenderBox or something else, for the custom (to be blitted) area?

Go to top
Re: Window class, gadgets and blitting
Amigans Defender
Amigans Defender


See User information
One way to do this is use the space.gadget and provide your own SPACE_RenderHook function, in which you'll perform your blitting. Another way is to write your own gadget subclass and do the blitting inside the GM_RENDER method. Pretty much the same thing, only more laborious.

The Rear Window blog

AmigaOne X5000 @ 2GHz / 4GB RAM / Radeon RX 560 / ESI Juli@ / AmigaOS 4.1 Final Edition
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition
Go to top
Re: Window class, gadgets and blitting
Just can't stay away
Just can't stay away


See User information
@trixie

Quote:

One way to do this is use the space.gadget and provide your own SPACE_RenderHook function, in which you'll perform your blitting. Another way is to write your own gadget subclass and do the blitting inside the GM_RENDER method. Pretty much the same thing, only more laborious.


I'm currently just blitting over the render box area, it seems to work.

One thing I noticed with vertical layout + space gadget that even though autodoc says LAYOUT_SpaceOuter defaults to FALSE, it seems to be rather TRUE here. I need to set it FALSE to get rid of a small border between window border and layout.

Go to top
Re: Window class, gadgets and blitting
Amigans Defender
Amigans Defender


See User information
@Capehill

Quote:
I'm currently just blitting over the render box area, it seems to work.

Technically, you can blit over any Intuition gadget (after all it's just an area in a window's rastport) - yet it's not what you do.

In BOOPSI the idea is that the gadget imagery is rendered by the gadget itself (rather than by the application), upon receiving a GM_RENDER message from Intuition. The space.gadget is different in that it provides a way for the application to supply its own GM_RENDER code (via a custom render hook function) to take care of the gadget imagery.

So I'd recommend that you use SPACE_RenderHook to install your hook function, and do the blitting there. This way you can be sure that the gadget rendering will be performed at the right time. You won't have to check for window resizing because your render hook function will be invoked automatically every time Intuition detects a resize. Also, the render hook function will provide you with the valid rastport pointer to use for the blitting.

If you need an example just send me a PM.

The Rear Window blog

AmigaOne X5000 @ 2GHz / 4GB RAM / Radeon RX 560 / ESI Juli@ / AmigaOS 4.1 Final Edition
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition
Go to top
Re: Window class, gadgets and blitting
Just can't stay away
Just can't stay away


See User information
@trixie

I forgot to mention that I need to blit in real-time (OpenGL). Render hook gets called at arbitrary times by the system from my point of view, so using only the render hook doesn't seem sufficient.

Is there a better way to mix real-time blitting and gadgets than query the render box size of the space.gadget?

Go to top
Re: Window class, gadgets and blitting
Not too shy to talk
Not too shy to talk


See User information

You can trigger GM_RENDER when needed. Either use RefreshGList or DoMethod.

Go to top
Re: Window class, gadgets and blitting
Just can't stay away
Just can't stay away


See User information
@thomas

Right, RefreshGList seems to work. Thanks guys.

Go to top
Re: weight bar and space.gadget
Just can't stay away
Just can't stay away


See User information
EDIT2: rendering problem solved.


Edited by Capehill on 2020/6/12 18:50:36
Edited by Capehill on 2020/6/18 15:57:07
Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project