Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
106 user(s) are online (52 user(s) are browsing Forums)

Members: 1
Guests: 105

sailor, more...

Headlines

 
  Register To Post  

« 1 ... 29 30 31 (32) 33 34 35 ... 72 »
Re: SDL2
Home away from home
Home away from home


See User information
@Capehill

Today found problem with some of stuff i work on , which just crahes when i do "alt+enter" to switch from fullscreen to window mode when context created via GLES2

Step by step i reduce things, just in end to find out that "testgles2.c" crashes the same !

Its enough to run it like:

ram:> testgles2 --fullscreen

And then when cube start rotating, press "alt+enter", and it immediately crashes, there is crashlog:

http://kas1e.mikendezign.com/aos4/sdl ... 2_2019-01-30_01-39-13.txt

What is intersting, is that if you run that test case in window mode, then you can switch by alt+enter to fullscreen, and then back, and again, and all works for about 20-30 times, and then can still crashes like that.

But at least with running in fullscreen mode by default, and then "alt+enter", crashes all the time 100%.

We of course can report it to Daniel (in hope it can be some ogles2.library issue), but probabaly it need to be checked in SDL2 firstly ?

Version of SDL2 i use are one from 13_12_2018, so fresh one.

Thanks !

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: SDL2
Home away from home
Home away from home


See User information
@Capehill
And if it will be of any help, that what i have on serial when i run testgles in fullscreen, and then press alt+enter:

http://kas1e.mikendezign.com/aos4/sdl2/serial.txt

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: SDL2
Just can't stay away
Just can't stay away


See User information
@kas1e

When window is destroyed, it seems to leave the OGLES context with a dangling window pointer.

Is there a way to update context's window pointer?

Go to top
Re: SDL2
Home away from home
Home away from home


See User information
And it happens only when we run in fullscreen and then switch to window. If we run in window mode , then switch to fullscreen and back to window work (at least most of times, later it still can crash). Its like it should work, but something wrong

Quote:

Is there a way to update context's window pointer?


You mean in SDL2 or in ogles2 ? How it done for minigl ?

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: SDL2
Just can't stay away
Just can't stay away


See User information
@kas1e

in OGLES2.

SDL cannot recreate context with a new window pointer because application would have the old context pointer then.

Go to top
Re: SDL2
Home away from home
Home away from home


See User information
@Capehill
As for minigl same sdl2 code works to switch from fullscreen to window , is it mean that minigl have way to update context's window pointer ? I mean did you use it for minigl ? If so what functions of minigl you use for ? (so we can compare if we have analogue for ogles2).

I just didnt see anything of that sort in sdlopengl.c, maybe it done somewhere deeper in sdl2 ?

Still strange why it didnt crush if we run it from window mode and then switch to fullscreen and then back to window.. Maybe just luck ?

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: SDL2
Just can't stay away
Just can't stay away


See User information
@kas1e

MiniGL context doesn't use window pointer.

I think it's possible that new window is created at the same memory location than the old one, if no other system allocations happen during toggling.

Go to top
Re: SDL2
Home away from home
Home away from home


See User information
@Capehill
I wrote to Daniel about with pointing out on that thread, let's see what he say, maybe there is already some functionality in ogles2 which can help us with.

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: SDL2
Home away from home
Home away from home


See User information
@Capehill
Quote:

I think it's possible that new window is created at the same memory location than the old one, if no other system allocations happen during toggling.


And you are right imho. If i run it in window mode, then switch to fullscreen and then press amiga+m to play with system a bit (so to make some other allocations), then switching back to window crashes same as if i run testcase in fullscreen initialy.

What mean it was/are luck that i can switch from window to fullscreen and back.

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: SDL2
Home away from home
Home away from home


See User information
@Capehill
For sake of tests i tried just that test code:

int result;
    
    if ( 
fullscr!=0){
            
result SDL_SetWindowFullscreen(glWindow,SDL_WINDOW_FULLSCREEN);
            if (
result == 0) { printf ("switch to FULLSCREEN mode fine!\n");
            } else {
                
printf("Switch to FULLSCREEN mode failed: %s\n"SDL_GetError());
            }
                
           
    } else if( 
fullscr==0){
            
result SDL_SetWindowFullscreen(glWindow,0);
            if (
result == 0) { printf ("switch to WINDOW mode fine!\n");
            } else {
                
printf("Switch to WINDOW mode failed: %s\n"SDL_GetError());
            }
            
    }


So when i press alt+enter , and before crash happens, i always have "success". So from SDL side all kind of "ok", the problem happens somewhere later.

I write mail to Daniel 2 days ago about, but he didn't answer, maybe it in the spam box , so tryed to reask in GL4ES thread, maybe we will be lucky there.

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: SDL2
Home away from home
Home away from home


See User information
@Capehill
Check plz GL4ES thread, Daniel answer about. What we need its aglSetParamTags(OGLES2_CCT_WINDOW,Window*,TAG_DONE);
Daniel add it year ago , and that what in the readme about:

Quote:

Target window can now be set / toggled via

aglSetParamTags(OGLES2_CCT_WINDOW,Window*,TAG_DONE);

and target screen-mode can now be set / toggled via

aglSetParamTags(OGLES2_CCT_MODEID,ulong mode_id,TAG_DONE);

Note: the purpose of this mechanism is to be able to easily switch between window and fullscreen-mode with the context surviving. For this to work the window / screen *must* be handled by the same GPU. This means that in systems with multiple graphic-boards this won't work if your window/screenmode switch implies a GPU-switch too.


Is it OS4_GLES_SwapWindow() of SDL2 we need to change ?

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: SDL2
Not too shy to talk
Not too shy to talk


See User information
Use aglSetParamsTags2 or aglSetParams2. The others are deprecated and should be avoided! Parameters are identical.

Go to top
Re: SDL2
Just can't stay away
Just can't stay away


See User information
@Daytona675x

Thanks, I wasn't aware of this function, I think my readme.txt is older (May 2017).

@kas1e

We could start there.

Go to top
Re: SDL2
Just can't stay away
Just can't stay away


See User information
@samo79

The protracker 2.3e binary on that site is for 68k amigas, but there is an sdl2 version as well that is a pretty much perfect clone of PT 2.3d.
Someone would need to port it though.

Go to top
Re: SDL2
Home away from home
Home away from home


See User information
@Capehill
Quote:

We could start there.


I just add to the OS4_GLES_SwapWindow(), after "if (videodata->vsyncEnabled) {" , and before aglSwapBuffers(), that:

if (videodata->vsyncEnabled) {
                
IGraphics->WaitTOF();
            }

            
struct TagItem setparams[] =
            {
                {
OGLES2_CCT_WINDOW, (ULONG)data->syswin},
                {
TAG_DONE0}
            };

            
aglSetParams2(setparams);

            
aglSwapBuffers();



I.e. just call of aglSetParams2 with data->syswin, and it seems did the trick.

At least, with the game i test it fix issue with switching, as well as fix the issue with switching in testgles2.c example too.

Not sure through if it right place to call it there, or if it should be called always like this (maybe some "if non-valid window-check" is need it for or something), but seems it fix issue anyway.

Btw, also found that test/testgles2.c , should be changed for amigaos4 : at the begining to have HAVE_OPENGLES2 define work, need to add || defined(__amigaos4__) to that big line of defines at top.

Should i create ticket for those issues (or one for both) ?

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: SDL2
Home away from home
Home away from home


See User information
@Capehill

Also i notice another issue with iconification on SDL2: Iconification not always grab the correct icon of binary, but instead fallback to the deafult "ENVARC:Sys/def_window". I tested few games, and in some it works, in other are not. I for sake of tests even take the same icon everywhere, and from one binary compiled with the same SDL2 it works, with another one compiled with same SDL2 it didn't.

All i have on serial for working ones are:

[OS4_IconifyWindow] Iconifying 'PROTOTYPE'
[OS4_HideWindow] Hiding window 'PROTOTYPE'



And for non working ones are:

[OS4_GetDiskObject] Falling back to 'ENVARC:Sys/def_window'
[OS4_IconifyWindow] Iconifying 'Foobillard++'
[OS4_HideWindow] Hiding window 'Foobillard++'


or for other game:


[OS4_GetDiskObject] Falling back to 'ENVARC:Sys/def_window'
[OS4_IconifyWindow] Iconifying 'Friking Shark'
[OS4_HideWindow] Hiding window 'Friking Shark'


I then do some debug prinfs in OS4_GetDiskObject():

static struct DiskObject *OS4_GetDiskObject(_THIS)
{
    
SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata;

    
struct DiskObject *diskObject NULL;

    if (
videodata->appName) {
        
diskObject IIcon->GetDiskObject(videodata->appName);
        
        
dprintf("We after diskObject = IIcon->GetDiskObject(videodata->appName);\\n");
        
dprintf("videodata->appName are : %s\\n"videodata->appName);
    }

    if (!
diskObject) {
        
CONST_STRPTR fallbackIconName "ENVARC:Sys/def_window";

        
dprintf("Falling back to '%s'\\n"fallbackIconName);
        
diskObject IIcon->GetDiskObjectNew(fallbackIconName);
    }

    return 
diskObject;
}



And, while i have come into that if (videodata->appName), so i have words "we after blabla", and printf for videodata->appName show name correctly "foobillard++", diskobject seems still NULL or mess (like it unitialized), and so it fallback on default icon.


So then i put for sake of test firstly that:

diskObject = IIcon->GetDiskObject("PROGDIR:foobillard++");

And it works, icon takes, all fine. But as videodata->appName printfs just "foobillard++", i tried that:

diskObject = IIcon->GetDiskObject("foobillard++");

And it fail the same !

So seems there some bug related to the getting of real path of the filename. If i put also that:

diskObject = IIcon->GetDiskObject("work:foobillardplusplus/foobillard++"); , it also works fine.

I remember we have kind of same issue for SDL1 some time ago, but this one was arise when we just run app from another place, and not from its home directory, like:

Quote:

ram:> works:game/game.exe


But probably same changes which you do for SDL1 to fix that can be applied to the SDL2 to fix what we have now. If it of course same issue, but looks very well like it is (if it works with PROGIDR: and full path, but didn't with just pure name).


Edited by kas1e on 2019/2/7 21:08:27
Edited by kas1e on 2019/2/7 21:14:15
Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: SDL2
Just can't stay away
Just can't stay away


See User information
@kas1e

Maybe the program has changed the current directory so that the exe can't be found by using a relative path?

Look for a call to chdir() in the code. It would explain why "PROGDIR:foobillard++" works (and also absolute path) but not "foobillard++".

Go to top
Re: SDL2
Home away from home
Home away from home


See User information
@Salas00
Yeah, exactly :) found "chdir(data_dir)".

So it mean SDL2 code need to build absolute patches for getting diskobject, as i test 4 games, 3 of them fail with that error. Or maybe just adding "PROGDIR:" before appname will be enough..

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: SDL2
Just can't stay away
Just can't stay away


See User information
@kas1e

The simplest fix would probably be to just add:
BPTR olddir IDOS->SetCurrentDir(IDOS->GetProgramDir());
/* ... */
IDOS->SetCurrentDir(olddir);

around the GetDiskObjectNew() call.

Go to top
Re: SDL2
Home away from home
Home away from home


See User information
@salas00
Yeah, that did the trick as well.

@Capehill
Found another issue with iconification: when you run sdl2 app in window mode it have iconification gadget all fine. But then, when you switch to fullscreen (via SDL_SetWindowFullscreen() ), and then back to the window via the same SDL_SetWindowFullscreen(), then iconify gadget disappear. Like code which re-create window forgot to add iconification gadget as it done when window firstly created.

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top

  Register To Post
« 1 ... 29 30 31 (32) 33 34 35 ... 72 »

 




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




Powered by XOOPS 2.0 © 2001-2023 The XOOPS Project