Login
Username:

Password:

Remember me



Lost Password?

Register now!
Sections
Who's Online
40 user(s) are online (16 user(s) are browsing Forums)

Members: 1
Guests: 39

Paul, more...
Support us!
Recent OS4 Files
OS4Depot.net





Window class, gadgets and blitting
Just can't stay away
Joined:
2007/7/14 21:30
From Lothric
Posts: 1064
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?

   Report Go to top

Re: Window class, gadgets and blitting
Just can't stay away
Joined:
2009/5/1 18:57
From Czech Republic
Posts: 1128
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.

_________________
Smoke me a kipper, I'll be back for breakfast!

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
   Report Go to top

Re: Window class, gadgets and blitting
Just can't stay away
Joined:
2007/7/14 21:30
From Lothric
Posts: 1064
@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.

   Report Go to top

Re: Window class, gadgets and blitting
Just can't stay away
Joined:
2009/5/1 18:57
From Czech Republic
Posts: 1128
@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.

_________________
Smoke me a kipper, I'll be back for breakfast!

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
   Report Go to top

Re: Window class, gadgets and blitting
Just can't stay away
Joined:
2007/7/14 21:30
From Lothric
Posts: 1064
@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?

   Report Go to top

Re: Window class, gadgets and blitting
Not too shy to talk
Joined:
2006/11/26 17:45
Posts: 272

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

   Report Go to top

Re: Window class, gadgets and blitting
Just can't stay away
Joined:
2007/7/14 21:30
From Lothric
Posts: 1064
@thomas

Right, RefreshGList seems to work. Thanks guys.

   Report Go to top

Re: weight bar and space.gadget
Just can't stay away
Joined:
2007/7/14 21:30
From Lothric
Posts: 1064
EDIT2: rendering problem solved.


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





[Advanced Search]


Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project