Login
Username:

Password:

Remember me



Lost Password?

Register now!
Sections
Who's Online
13 user(s) are online (11 user(s) are browsing Forums)

Members: 0
Guests: 13

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



« 1 ... 12 13 14 (15)


Re: SDL1 open issues
Home away from home
Joined:
2007/9/11 11:31
From Russia
Posts: 5531
..


Edited by kas1e on 2019/10/12 10:04:16
_________________
Join us to improve dopus5!
zerohero's mirror of os4/os3 crosscompiler suites
   Report Go to top

Re: SDL1 open issues
Home away from home
Joined:
2007/9/11 11:31
From Russia
Posts: 5531
@Capehill
Another issue is probabaly not related to SDL1 itself (or maybe related, just i do not know at moment), and its some strange one.

I found that when i run some game (sdl1/gl4es/etc) in fullscreen mode. When i run it just as it, and enable fps counter, it show me 30 fps for example. And everything is looks just like 30 fps.

Then, when i do "amiga+m", and made by mouse workbench window (or any other window on workbench) to be active, i still have on other screen those 30 fps (as expected), but when i jump back to the game screen again and make it active, this time fps is doubled to 70 and everythng start to looks like its now indeed 70 fps.

Then, any switch back to workbench and making it active, doing game be 30 fps (as exptected as it not active anymore), and swithcing back to game make it 70fps. But not from first time! I.e. when you run it, i can see workbench is not active, and that my game active, but technically like not :)

It seems that when i run game first time (and even if i operate in it, play in it, i.e. its active), something busy happens. Once i made workbench active and then back to the game: fps back to normal.

I may think of course that its game doing something, but "depending on screens" its just amiga-thing, so maybe something on our side ?

Sorry its a bit unclear, and i can't say if it SDL1 or what else , as i can't find any other game/test which can show the same.

I probabaly can do some hack like when game runs, call intuition Lock/Active of workbench, and then back again to game, but that strange anyway..


EDIT:

I think it can be something about the way how SDL initialisation done , maybe only with this game i have some sort of combo of dbl-bufergin / vsync and something else which didn't showups before.

I currently just hack the game's init code like this:

... initial game's init code ...


#ifdef __amigaos4__
    struct Screen *wb_screen;
    struct Window *first_wb_window;
    
    struct Screen *game_screen;
    struct Window *first_game_window;
    
    struct IntuitionIFace *IIntuition = NULL;
    struct GraphicsIFace  *IGraphics = NULL;

    struct Library *GfxBase = IExec->OpenLibrary("graphics.library", 50);
    IGraphics = (struct GraphicsIFace*)IExec->GetInterface(GfxBase, "main", 1, NULL);
 
    struct Library *IntuitionBase = IExec->OpenLibrary("intuition.library", 50);
    IIntuition = (struct IntuitionIFace*)IExec->GetInterface(IntuitionBase, "main", 1, NULL);
    
    // get workbnech screen and first window pointer, so to make it active when need it
    wb_screen = IIntuition->LockPubScreen(NULL);
    first_wb_window = wb_screen->FirstWindow;
    IIntuition->UnlockPubScreen(NULL, wb_screen);
#endif

.... init SDL/opengl/etc ...

#ifdef __amigaos4__
    // get our new screen pointer and first window to make it active when need it 
    long lock = IIntuition->LockIBase(0);
    game_screen = ((struct IntuitionBase *)IntuitionBase)->ActiveScreen;
    first_game_window = game_screen->FirstWindow;
    IIntuition->UnlockIBase(lock);
             
     // activate the first window on workbench
    IIntuition->ActivateWindow(first_wb_window);

    // active our game'
s window on new screen back to have stable FPS back.
    
IIntuition->ActivateWindow(first_game_window);

    
IExec->DropInterface((struct Interface*)IGraphics);
    
IExec->CloseLibrary(GfxBase);

    
IExec->DropInterface((struct Interface*)IIntuition);
    
IExec->CloseLibrary(IntuitionBase);

#endif


Then it works. Through it still interesting to know why that happens and should't it be fixed in SDL1 or at least to find out why it like this.


Edited by kas1e on 2019/10/15 12:37:16
Edited by kas1e on 2019/10/15 16:25:20
Edited by kas1e on 2019/10/15 16:26:03
_________________
Join us to improve dopus5!
zerohero's mirror of os4/os3 crosscompiler suites
   Report Go to top

Re: SDL1 open issues
Quite a regular
Joined:
2007/7/14 20:30
From Lothric
Posts: 803
@kas1e

Without knowing what a) game, b) SDL1/GL4ES is doing, it's very hard to help.

Is game trying to do some frame capping (SDL_Delay() in game loop)? VSYNCing?

How about this SDL1/GL4ES branch? I don't think I have seen the code lately.

And you have checked the serial line?

   Report Go to top

Re: SDL1 open issues
Home away from home
Joined:
2007/9/11 11:31
From Russia
Posts: 5531
@Capehill

Found, that the code of game:

void App::Run()
{

    
mIsRunning true;

    if ( 
mAppTester->HasTest() && APP.GetEditGui() )
    {
        
APP.SetEditGui(false);
    }

    
IrrlichtDevice irrlichtDevice mIrrlichtManager->GetIrrlichtDevice();
    
video::IVideoDrivervideoDriver =  mIrrlichtManager->GetVideoDriver();
    
gui::IGUIEnvironmentenv irrlichtDevice->getGUIEnvironment();
    
scene::ISceneManagersceneManager mIrrlichtManager->GetSceneManager();
    
bool runningAppTest mAppTester->HasTest();

    
LOG.Info(L"start runningn");

    
// draw everything
    
while(mIsRunning)
    {
        if ( !
irrlichtDevice->run() )
        {
            
LOG.Info(L"stop runningn");
            break;
        }

        
// nothing to do in minimized state except waiting until this changes
        
if (irrlichtDevice->isWindowMinimized())
        {
            
irrlichtDevice->sleep(100);
            continue;
        }

        
UpdateSound();

        
// inactive - just update less often
        
if (!irrlichtDevice->isWindowActive() )
        {
            
irrlichtDevice->sleep(10);
        }

        
// cap framerate
        
static u32 oldTime GetIrrlichtManager()->GetIrrlichtTimer()->getRealTime();
        
u32 newTime GetIrrlichtManager()->GetIrrlichtTimer()->getRealTime();
        if ( 
newTime-oldTime < (u32)GetConfig()->GetMinTimePerFrameMs() )
        {
            continue;
        }
        
oldTime newTime;

        
// Load a new ad. Doing that with a small delay because showing ad's is in an own thread
        // and requesting new ones before last show is through can mess up things.
        
if ( mNeedAd && newTime mLastAdTime 1000 )
        {
            
mNeedAd false;
            if ( 
mAdvert )
                
mAdvert->request(EAT_FULLSCREEN);
        }

        
// begin-scene early do allow drawing debug-output in the rest of updates
        
videoDriver->beginScene(truetruevideo::SColor(150,50,50,200));

        if ( 
mSound && mMode == MODE_GUI && !mSound->IsMusicPlaying() )
        {
            
mMusicManager->PlayMenuMusic();
        }
        
mInputDeviceManager->Update();
        
mController->Update(*mInputDeviceManagermConfig->GetUseTouchInput());

        
mGame->Update();

        
// draw everything
        
if (    GetMode() != MODE_GUI
            
||  !mGui->GetActiveDialog()
            ||  !
mGui->GetActiveDialog()->GetSuppressSceneRendering()
            )
        {
            
sceneManager->drawAll();
        }

        
env->drawAll();

        if ( 
mDrawAiTrack )
        {
            
APP.GetLevel()->GetAiTrack().Draw();
        }

        
videoDriver->endScene();

        
mGui->Update(newTime);

        if ( 
runningAppTest )
        {
            if ( !
mAppTester->Update() )
                break;
        }

        
// be nice
        
irrlichtDevice->yield();
    }
}


See there:

// inactive - just update less often
if (!irrlichtDevice->isWindowActive() )
{
irrlichtDevice->sleep(10);
}

Check in if windowactive and if not , less update with sleep(10), so exactly to reduce FPS.

I comment out that code, and everything works fine from start :)

So i checked and its just irrlicht's isWindowActive didn't return that it active (proved that by putting printfs inside), while it is. We lately in irrlicht itself fix some thing in that terms with one of remaining authors, and i just forget to add that fix to the irrlicht's code coming with game itself, and so it always return on first run that window is inactive.

But if you didn't point out on "main game loop with delay" i for sure dind't find it, so thank as usuall again :)

Quote:

How about this SDL1/GL4ES branch? I don't think I have seen the code lately.


I will put tomorrow on github just the changed files of SDL1/SDL2 i touch for gl4es (so can be easy seen what is changed exactly). I plan to do it before anyway, so at least that will be reasson :)



Edited by kas1e on 2019/10/18 21:12:38
Edited by kas1e on 2019/10/18 21:13:12
Edited by kas1e on 2019/10/18 21:13:48
Edited by kas1e on 2019/10/18 21:24:55
_________________
Join us to improve dopus5!
zerohero's mirror of os4/os3 crosscompiler suites
   Report Go to top

Re: SDL1 open issues
Quite a regular
Joined:
2007/7/14 20:30
From Lothric
Posts: 803
@kas1e

Quote:


As you can see there i just set manually 32 bit to format before calling SDL_ListModes(). And that fail.

It can be that SDL_ListModes() fail to parse pixelFormat properly ?



Serial logs?

   Report Go to top

Re: SDL1 open issues
Home away from home
Joined:
2007/9/11 11:31
From Russia
Posts: 5531
@Capehill

There is one from that test case i post :

[os4_initializeSDL 1.2.15
[os4timer_initializetimer=0x6FF51050
[os4timer_initializeITimer=0x6FF9E380
[os4timer_InitInitializing timer for process 0x67D12C90
[os4timer_InitDone
[os4thread_initializePrimary process 0x67D12C90
[os4video_initializeDevice opened
[os4video_CreateDeviceCreating OS4 video device
[os4video_FindApplicationNameCurrent program name 'a'
[os4video_FindApplicationNameApplication name'a'
[os4video_CreateDeviceDevice created
[os4video_VideoInitFree video memory 203895552
[SDL_DestroyMutexNULL mutex
[os4video_CreateWMCursorCreating cursor 16x16
[os4video_CreateWMCursorcursor 0x639D8010
[os4video_ShowWMCursorSetting cursor 0x639D8010
[os4video_SetVideoModeRequesting new video mode 1024x768x24
[os4video_SetVideoModeRequested flagsANYFORMAT OPENGL
[os4video_SetVideoModeCurrent mode 0x0x32
[os4video_SetVideoModeCurrent mode flags
[os4video_SetVideoModeCurrent hwdata 0x00000000
[os4video_SetVideoModeCreating new display
[os4video_SetVideoModeDeleting old display
[os4video_SetVideoModeOpening new display
[os4video_CreateDisplayCreating a 1024x768x24 windowed display
[os4video_CreateDisplayScreen depth32 pixel format6
[os4video_GetBestWindowPositionVisible screen: (0,0)/(1920x1080)
[
os4video_OpenWindowTrying to open window at (443,140of size (1024x768)
[
os4video_CreateIconifyGadgetCalled
[os4video_GL_InitInitializing MiniGL (window 0x687FAF50)...
[
os4video_GL_InitMiniGLBase 0x63CB9018
[os4video_GL_InitIMiniGL 0x63D81430
[os4video_AllocateBitMapAllocating bitmap 1024*768*16
[os4video_AllocateBitMapAllocating bitmap 1024*768*16
[os4video_GL_InitMiniGL context 0x62F42F10 (0x62F42F10)
[
os4video_SetVideoMode] New display created
[os4video_SetVideoModeObtained flagsANYFORMAT OPENGL PREALLOC
[os4video_ShowWMCursorSetting cursor 0x639D8010
[os4video_ResetCursorCursor image set
[os4video_GL_GetProcAddress] Function 'glBegin' loaded at 0x7F5E404C
[os4video_GL_GetProcAddress] Function 'glBindTexture' loaded at 0x7F5E7150
[os4video_GL_GetProcAddress] Function 'glBlendFunc' loaded at 0x7F5E39FC
[os4video_GL_GetProcAddress] Function 'glColor4f' loaded at 0x7F5E4FB8
[os4video_GL_GetProcAddress] Function 'glCopyTexImage1D' loaded at 0x7F5E7240
[os4video_GL_GetProcAddress] Function 'glDisable' loaded at 0x7F5E3BB0
[os4video_GL_GetProcAddress] Function 'glEnable' loaded at 0x7F5E3B94
[os4video_GL_GetProcAddress] Function 'glEnd' loaded at 0x7F5E4064
[os4video_GL_GetProcAddress] Function 'glFlush' loaded at 0x7F5E3D44
[os4video_GL_GetProcAddress] Function 'glGenTextures' loaded at 0x7F5E7110
[os4video_GL_GetProcAddress] Function 'glGetString' loaded at 0x7F5E3D18
[os4video_GL_GetProcAddress] Function 'glLoadIdentity' loaded at 0x7F5E3E60
[os4video_GL_GetProcAddress] Function 'glMatrixMode' loaded at 0x7F5E3DD0
[os4video_GL_GetProcAddress] Function 'glOrtho' loaded at 0x7F5E3DE8
[os4video_GL_GetProcAddress] Function 'glPixelStorei' loaded at 0x7F5E6C4C
[os4video_GL_GetProcAddress] Function 'glPopAttrib' loaded at 0x7F5E3CAC
[os4video_GL_GetProcAddress] Function 'glPopClientAttrib' loaded at 0x7F5E3CD8
[os4video_GL_GetProcAddress] Function 'glPopMatrix' loaded at 0x7F5E3E4C
[os4video_GL_GetProcAddress] Function 'glPushAttrib' loaded at 0x7F5E3C94
[os4video_GL_GetProcAddress] Function 'glPushClientAttrib' loaded at 0x7F5E3CC0
[os4video_GL_GetProcAddress] Function 'glPushMatrix' loaded at 0x7F5E3E38
[os4video_GL_GetProcAddress] Function 'glTexCoord2f' loaded at 0x7F5E5B9C
[os4video_GL_GetProcAddress] Function 'glTexEnvf' loaded at 0x7F5E6E38
[os4video_GL_GetProcAddress] Function 'glTexImage2D' loaded at 0x7F5E7088
[os4video_GL_GetProcAddress] Function 'glTexParameteri' loaded at 0x7F5E6F30
[os4video_GL_GetProcAddress] Function 'glTexSubImage2D' loaded at 0x7F5E71E4
[os4video_GL_GetProcAddress] Function 'glVertex2i' loaded at 0x7F5E40D0
[os4video_GL_GetProcAddress] Function 'glViewport' loaded at 0x7F5E3E10
[os4video_GL_MakeCurrentContext 0x62F42F10
[os4video_ListModesListing 32-bit modes with format=6
[os4video_FreeWMCursorFreeing 0x639D8010
[os4video_VideoQuitIn VideoQuitthis 0x660F02F0
[os4video_VideoQuitDeleteCurrentDisplay
[os4video_GL_TermHere
[os4video_DeleteCurrentDisplayRemoving gadget
[os4video_DeleteCurrentDisplayDisposing image
[os4video_DeleteCurrentDisplayClosing window 0x687FAF50
[os4video_VideoQuitChecking pubscreen
[os4video_FreeHWSurfaceFreeing HW surface 0x62C2CF80
[os4video_quitDeleting input device
[os4video_quitDeleting IORequest
[os4video_quitDeleting MsgPort
[os4video_quitDone
[os4thread_quitKilling all remaining processes
[os4thread_quitTerminating lists
[os4timer_DestroyFreeing timer for process 0x67D12C90
[os4thread_quitDone
[os4timer_quitCalled
[os4_quitSDL QUIT
[os4_quitNot initialized
[os4_quitSDL QUIT



And that serial log if i change in above test case 24 on 32 in the SetVideoMode call :

[os4_initializeSDL 1.2.15
[os4timer_initializetimer=0x6FF51050
[os4timer_initializeITimer=0x6FF9E380
[os4timer_InitInitializing timer for process 0x67D12C90
[os4timer_InitDone
[os4thread_initializePrimary process 0x67D12C90
[os4video_initializeDevice opened
[os4video_CreateDeviceCreating OS4 video device
[os4video_FindApplicationNameCurrent program name 'a'
[os4video_FindApplicationNameApplication name'a'
[os4video_CreateDeviceDevice created
[os4video_VideoInitFree video memory 203895552
[SDL_DestroyMutexNULL mutex
[os4video_CreateWMCursorCreating cursor 16x16
[os4video_CreateWMCursorcursor 0x639D8010
[os4video_ShowWMCursorSetting cursor 0x639D8010
[os4video_SetVideoModeRequesting new video mode 1024x768x32
[os4video_SetVideoModeRequested flagsANYFORMAT OPENGL
[os4video_SetVideoModeCurrent mode 0x0x32
[os4video_SetVideoModeCurrent mode flags
[os4video_SetVideoModeCurrent hwdata 0x00000000
[os4video_SetVideoModeCreating new display
[os4video_SetVideoModeDeleting old display
[os4video_SetVideoModeOpening new display
[os4video_CreateDisplayCreating a 1024x768x32 windowed display
[os4video_CreateDisplayScreen depth32 pixel format6
[os4video_GetBestWindowPositionVisible screen: (0,0)/(1920x1080)
[
os4video_OpenWindowTrying to open window at (443,140of size (1024x768)
[
os4video_CreateIconifyGadgetCalled
[os4video_GL_InitInitializing MiniGL (window 0x687FAF50)...
[
os4video_GL_InitMiniGLBase 0x63CB9018
[os4video_GL_InitIMiniGL 0x63D81430
[os4video_AllocateBitMapAllocating bitmap 1024*768*16
[os4video_AllocateBitMapAllocating bitmap 1024*768*16
[os4video_GL_InitMiniGL context 0x62F42F10 (0x62F42F10)
[
os4video_SetVideoMode] New display created
[os4video_SetVideoModeObtained flagsANYFORMAT OPENGL PREALLOC
[os4video_ShowWMCursorSetting cursor 0x639D8010
[os4video_ResetCursorCursor image set
[os4video_GL_GetProcAddress] Function 'glBegin' loaded at 0x7F5E404C
[os4video_GL_GetProcAddress] Function 'glBindTexture' loaded at 0x7F5E7150
[os4video_GL_GetProcAddress] Function 'glBlendFunc' loaded at 0x7F5E39FC
[os4video_GL_GetProcAddress] Function 'glColor4f' loaded at 0x7F5E4FB8
[os4video_GL_GetProcAddress] Function 'glCopyTexImage1D' loaded at 0x7F5E7240
[os4video_GL_GetProcAddress] Function 'glDisable' loaded at 0x7F5E3BB0
[os4video_GL_GetProcAddress] Function 'glEnable' loaded at 0x7F5E3B94
[os4video_GL_GetProcAddress] Function 'glEnd' loaded at 0x7F5E4064
[os4video_GL_GetProcAddress] Function 'glFlush' loaded at 0x7F5E3D44
[os4video_GL_GetProcAddress] Function 'glGenTextures' loaded at 0x7F5E7110
[os4video_GL_GetProcAddress] Function 'glGetString' loaded at 0x7F5E3D18
[os4video_GL_GetProcAddress] Function 'glLoadIdentity' loaded at 0x7F5E3E60
[os4video_GL_GetProcAddress] Function 'glMatrixMode' loaded at 0x7F5E3DD0
[os4video_GL_GetProcAddress] Function 'glOrtho' loaded at 0x7F5E3DE8
[os4video_GL_GetProcAddress] Function 'glPixelStorei' loaded at 0x7F5E6C4C
[os4video_GL_GetProcAddress] Function 'glPopAttrib' loaded at 0x7F5E3CAC
[os4video_GL_GetProcAddress] Function 'glPopClientAttrib' loaded at 0x7F5E3CD8
[os4video_GL_GetProcAddress] Function 'glPopMatrix' loaded at 0x7F5E3E4C
[os4video_GL_GetProcAddress] Function 'glPushAttrib' loaded at 0x7F5E3C94
[os4video_GL_GetProcAddress] Function 'glPushClientAttrib' loaded at 0x7F5E3CC0
[os4video_GL_GetProcAddress] Function 'glPushMatrix' loaded at 0x7F5E3E38
[os4video_GL_GetProcAddress] Function 'glTexCoord2f' loaded at 0x7F5E5B9C
[os4video_GL_GetProcAddress] Function 'glTexEnvf' loaded at 0x7F5E6E38
[os4video_GL_GetProcAddress] Function 'glTexImage2D' loaded at 0x7F5E7088
[os4video_GL_GetProcAddress] Function 'glTexParameteri' loaded at 0x7F5E6F30
[os4video_GL_GetProcAddress] Function 'glTexSubImage2D' loaded at 0x7F5E71E4
[os4video_GL_GetProcAddress] Function 'glVertex2i' loaded at 0x7F5E40D0
[os4video_GL_GetProcAddress] Function 'glViewport' loaded at 0x7F5E3E10
[os4video_GL_MakeCurrentContext 0x62F42F10
[os4video_ListModesListing 32-bit modes with format=6
[os4video_MakeResArray5 video modes (allocating a 64-byte array)
[
fillModeArrayAdded mode 640x480
[fillModeArrayAdded mode 800x600
[fillModeArrayAdded mode 1024x768
[fillModeArrayAdded mode 1280x768
[fillModeArrayAdded mode 1920x1080
[os4video_FreeWMCursorFreeing 0x639D8010
[os4video_VideoQuitIn VideoQuitthis 0x660F02F0
[os4video_VideoQuitDeleteCurrentDisplay
[os4video_GL_TermHere
[os4video_DeleteCurrentDisplayRemoving gadget
[os4video_DeleteCurrentDisplayDisposing image
[os4video_DeleteCurrentDisplayClosing window 0x687FAF50
[os4video_VideoQuitChecking pubscreen
[os4video_FreeHWSurfaceFreeing HW surface 0x63240F80
[os4video_quitDeleting input device
[os4video_quitDeleting IORequest
[os4video_quitDeleting MsgPort
[os4video_quitDone
[os4thread_quitKilling all remaining processes
[os4thread_quitTerminating lists
[os4timer_DestroyFreeing timer for process 0x67D12C90
[os4thread_quitDone
[os4timer_quitCalled
[os4_quitSDL QUIT



As i can see from both logs, it says "Listing 32-bit modes with format=6" when we do call SDL_ListModes, but then it fail on os4 if setvideomode call was with 16 or 24, or anything else but not 32. And when we want to list 32 bit modes after, it by some reasons didn't go till the point when call os4video_MakeResArray().

_________________
Join us to improve dopus5!
zerohero's mirror of os4/os3 crosscompiler suites
   Report Go to top


« 1 ... 12 13 14 (15)



[Advanced Search]


Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project