Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
133 user(s) are online (76 user(s) are browsing Forums)

Members: 0
Guests: 133

more...

Support us!

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?

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
Anonymous
Re: What is the canonical way of disabling screen blanker through C?
@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

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
Anonymous
Re: What is the canonical way of disabling screen blanker through C?
@samo79

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

Go to top

  Register To Post

 




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



Polls
Running AmigaOS 4 on?
AmigaOne SE/XE or microA1
Pegasos2
X5000
X1000
A1222
Sam 440/460
Classic PowerPC Amiga
WinUAE emulation
Qemu emulation
Total Votes: 147
The poll will close at 2025/12/1 12:00
2 Comments


Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project