Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
123 user(s) are online (97 user(s) are browsing Forums)

Members: 0
Guests: 123

more...

Headlines

 
  Register To Post  

What is the canonical way of disabling screen blanker through C?
Quite a regular
Quite a regular


See User information
What is the canonical way of disabling screen blanker through C for a particular application?

If liberty means anything at all, it means the right to tell people what they do not want to hear.
George Orwell.
Go to top
Re: What is the canonical way of disabling screen blanker through C?
Site Builder
Site Builder


See User information
Have a look at this page
https://wiki.amigaos.net/wiki/Application_Library
at some point, it writes that
Quote:
It can control the behaviour of screen-blankers. Applications that don’t want to be disturbed may prevent the blanker from kicking in, or tell other applications to “keep quiet”.

Follow me on
Ko-fi, Twitter, YouTube, Twitch
Go to top
Re: What is the canonical way of disabling screen blanker through C?
Home away from home
Home away from home


See User information
@walkero

But what if I don't want (or can't) add another dependency and simply want to tell the screenblanker to shut up if the program is running?

Isn't there a c/c++ example that just tells screenblanker to not disturb?

Thank you

People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
Go to top
Re: What is the canonical way of disabling screen blanker through C?
Home away from home
Home away from home


See User information
@rjd324, Raziel
Yeah, this is easy, you just open application.library (part of OS, so no dependencies), register your app on start, then send notification to screenblanker engine to shut up when need it, and at exit from your app de-register/close application.library.

That easy and few strings:

Open/register:

// application.library (to register app, to enable/disable blankers, etc).
    
if (!(ApplicationBase OpenLibrary("application.library"52))) {
        
fprintf(stderr,"Failed to open application.library\n");
        return 
FALSE;
    }     
    
IApplication  = (struct ApplicationIFace *)GetInterface(ApplicationBase"application"2NULL);

    
// register an app for aplication library
    
appID RegisterApplication("Odyssey",
                
REGAPP_URLIdentifier"none",
                
REGAPP_Description"Odyssey Web Browser",
                
TAG_END);



DeRegister/Close:

if (ApplicationBase) {
        
UnregisterApplication(appIDNULL);
        
DropInterface((struct Interface*)IApplication);
        
CloseLibrary(ApplicationBase);
        
ApplicationBase NULL;
    }



So when basics done, you can then send from your app all the notifications to screenblanker engine : and to disabled screenblankers, and to enable them back.

For Odyssey i made this function which pass arguments as "struct screen" and bool TRUE/FALSE for enable/disable screenblanker engine:

void enable_blanker(struct Screen *screenULONG enable)
{
            if(
enable)
            {
                    
// enable screenblanker
                    
SetApplicationAttrs(appID,
                                
APPATTR_AllowsBlankerTRUE,
                                
APPATTR_NeedsGameModeFALSE,
                    
TAG_END);
            }
            else
            {
                    
// disable screenblanker
                    
SetApplicationAttrs(appID,
                                
APPATTR_AllowsBlankerFALSE,
                                
APPATTR_NeedsGameModeTRUE,
                    
TAG_END); 
            }
}


Then in any place of the Odyssey i can just then:

somethings blblalbalbal

enable_blanker
(_screen(obj), FALSE);

something blablablab;

enable_blanker(_screen(obj), TRUE);



And that all

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: What is the canonical way of disabling screen blanker through C?
Home away from home
Home away from home


See User information
@kas1e

Could you try to implement it in ScummVM?

Go to top
Re: What is the canonical way of disabling screen blanker through C?
Home away from home
Home away from home


See User information
@samo
Matter of copy+paste of this code if Raziel need it. Dunno why it may needs for Scummvm through ?

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: What is the canonical way of disabling screen blanker through C?
Home away from home
Home away from home


See User information
@kas1e

Because its annoying in some games

Go to top
Re: What is the canonical way of disabling screen blanker through C?
Home away from home
Home away from home


See User information
@samo79

I'll try to add it (when time permits)...may need some help

People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
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-2023 The XOOPS Project