Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
109 user(s) are online (73 user(s) are browsing Forums)

Members: 0
Guests: 109

more...

Headlines

 
  Register To Post  

« 1 ... 36 37 38 (39) 40 41 42 ... 72 »
Re: SDL2
Home away from home
Home away from home


See User information
@Capehill

Ah, yes, that makes sense.

The first PixelFormat is for creating the ScummVM mouse cursor, the second for the game screen and after the intro has finished another one for the game mouse cursor.

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: SDL2
Home away from home
Home away from home


See User information
@capehill

Worked around in PR#1825 in ScummVM.

Thank you for the 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
Re: SDL2
Home away from home
Home away from home


See User information
@Capehill
Tried your "mousepointer-inside-window" branch with irrlicht and that SDL2 device we do before : still same issues , and never ended spam in log about focus true/false.

I anyway want to create github repo with amigaos4 port of irrlicht, so you can easyly build it too and check test cases to see what wrong (same SDL2 code works ok on win32). Hope to do it today.

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

Yeah, I noticed afterwards that behaviour is the same with or without the Layers check. SDL2 tracks the mouse location and is able to indicate when mouse pointer goes outside the window or returns back...

But thanks for trying.

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


See User information
@Capehill
I am about to finish irrlicht-aos4 port repo , and have a question to you : are you doing all your work on cross-compiler or you build everything natively ? Why i ask, because i use cross-compiler all the time, so makefiles and stuff there a bit easer.

But to made you easy to build it , and if you use only real hardware for build things, i will need a little adapt it all so you will have only "unpack & make".

Through, while on my x86 i can build irrlicht engine for about 30 seconds (with usage of -j4 for use many cores), on amigaos on x5k it takes for about 15 minutes to compile :)

In other words, are you on native compile all the time or on cross-compile one ?

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

I work on Amiga projects natively, but I could theoretically use also Cygwin or Linux. I don't have any recent cross-compilers installed at the moment.

Regarding Irrlicht, it might also help to have serial logs (need manual activation in SDL_os4events.c). If they have been posted already, I have forgotten...

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


See User information
@Capehill
Aha ok, i will make sure then it compiles natively (almost deal with it already). I can compile it all myself of course and upload test cases, but it surely better if you will be able to experement with it too as well and be able to do fast-changes-checks.

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


See User information
..

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


See User information
@kas1e

If you've got your native toolchain set up and can compile stuff with it, i'd like to hear if -flto works natively for you, as i suspect a bug in the gcc.

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: SDL2
Home away from home
Home away from home


See User information
@Raziel
Will check, but that for later.

@Capehill

Ok, done ! Tested and on cross-compiler and on native builds, so it all should work as it.

Firstly download that archive: http://kas1e.mikendezign.com/aos4/gl4es/gl4es.zip

Then:

a). in SDK rename GL directory to GL_minigl_save and made a GL be with gl4es includes from archive
b). put in SDK/local/newlib/lib/ those 3 libs from archive: libSDL_gl4es.a , libSDL2_gl4es.a and libgl4es.a
c). in SDK/local/newlib/include/SDL/SDL_opengl.h comment out include of <mgl/gl.h> (so to avoid name conflicts and co)

Now download irrlicht from my repo: https://github.com/kas1e/Irrlicht

Then, go to source/Irrlicht , and type "make -f Makefile.amigaos4 NDEBUG=1". After about 15-20 minutes (on x5k, instead of 1 minute on my x86 cross-compiler) you will have in lib/AmigaOS4/ , libirrlicht.a.
Then go to any example in example directory and type "make -f Makefile.amigaos4". It will build example and put binary to bin/AmigaOS4/ directory, from which you will need to run them
(as they will take "media" directory which is placed in root).

So after you experiment with it and see how it all works (working renderer are OpenGL, Software Renderer and Burning Video (software one too, just more accurate)), you then can enable SDL2 instead of SDL1.
But its only for software mode currently, to make it short, before we can find why it didn't works on aos4 , but works on win32.

So to enable SDL2 mode, you just go to include/IrrCompileConfig.h, and there in amigaos4 ifdefs (almost at end of file) add that:

//#define _IRR_COMPILE_WITH_SDL_DEVICE_
#undef _IRR_COMPILE_WITH_SDL_DEVICE_
#define _IRR_COMPILE_WITH_SDL2_DEVICE_


Then rebuild by going to source/Irrlicht and running "make -f makefile.amigaos4 NDEBUG=1", and you will be able to build examples with SDL2, just now when you build example you compile it like "make -f Makefile.amigaos4 SDL2=1".

But good news now, that you can change SDL2_gl4es.a in example's makefiles on your pure SDL2 , just didn't try to run opengl mode after, as it will crashes of course. But you can check software mode ones.

I.e. you will be able yourself to build your own SDL2 as you do usually, and use it for normal tests (just remember to only choice "software renderer" when will run examples).

As testcase we can take 02.Quake3Map example. You can firstly compare how it works with SDL1 in software mode (yeah, not accurate, and not as it works over opengl, but that expected how it renders in software renderer. I.e. its ok as it, and in SDL1 version you can move camera, etc). And then, with SDL2 you can see how it didn't works in software mode: everything stops, give 1-2 fps, etc.

But to note: on win32 exactly the same code works as expected, same speed as with SDL1. I.e. i just download that branch from my repo with latest commits, and just build it for win32 with SDL2 instead of amigaos4, and there everything works in software mode with 1:1 same CirrDeviceSDL2.cpp/.h

ps. Oh, and i use everywhere gcc 8.3.0 and on cross compiler, and native on x5k. Hope you too :)

ps2. And the only difference i see between aos4 and win32, that on aos4 we use 2.0.8 sdl2, and on win32 i have 2.0.9. But not sure that that can cause such an effect

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

Try setting mouse pointer visible first (for comedy and mystery):
https://github.com/kas1e/Irrlicht/blob ... 2.Quake3Map/main.cpp#L159

Then, test Irrlicht with this patch https://github.com/AmigaPorts/SDL/tree/fix-mousewarp

Better?

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


See User information
@Capehill
Quote:

Try setting mouse pointer visible first (for comedy and mystery):


Funny indeed, cursor can't go inside of the window :)

Quote:

Then, test Irrlicht with this patch https://github.com/AmigaPorts/SDL/tree/fix-mousewarp

Better?


Yes ! It works ! Thanks a bunch ! Now i can add opengl support to SDL2 version too, and later i even can try to use ogles2 directly in irrlicht. Through, GL4ES overhead as found in all tests (and on amigaos4, and on linux) are very little, so even if i will made pure ogles2 device works too, it will not give us anything too much better in terms of speed.

But still, have SDL2 now working are good thing for sure.

And i even measure a little : by default when i just run 02.quake3map in sdl1 mode in software rendering and doing nothing i have 28-29 fps. With SDL2 its 31-32.

Also when i move camera to the area where nothing is drawn (all white), then in SDL1 version i have 68 fps, while in SDL2 version i have 91 fps.

Through there a little difference in other way: when i move mouse (so camera) fast fast left-right, then in SDL1 version i have 30-40fps, but in SDL2 version i have 20-30fps. And visually i can see that in SDL2 version its a bit slower when move camera fast.

But that can be easy because of SDL2 implementation code in irrlicht driver currently (?) , or just SDL2 itself , as it more heavy anyway that SDL1. Or maybe missing/added double-buffering ? Anyway that of course not of big deal once it just software rendering. Will try to add opengl , to see how speed will be there.

Thanks again for fix !

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

Quote:


Funny indeed, cursor can't go inside of the window



Exactly, when mouse enters window area, Irrlicht does try to warp it to the middle, but thanks to my bug warping caused mouse jump out of the window. Lesson learned: when debugging a mouse issue, make the pointer visible first.

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


See User information
@Capehill
Oh, i found why SDL2 version was faster in 02.quake3map example when iddle, but didn't when move camera fast fast : while i build SDL2 without "-gstabs -DDEBUG" , the debug output still take place, because almost in all video/amigaos4/*.c files, it have:

#define DEBUG
#include "../../main/amigaos4/SDL_os4debug.h"

So, that not used "-DDEBUG" wasn't taken in account, and so, i just add manually in main/amigaos4/SDL_os4debug.h : #undef DEBUG, and now all builds without debug output to serial, and when i start to move camera in that quake3map example, it didn't throw to serial debug output about mouse, and so speed when i move camera fast fast also faster than in SDL1 now , yeah !






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
Added opengl support to SDL2 in irrlicht:
https://github.com/kas1e/Irrlicht/comm ... 95ae4a8a975c0338dec7b2c6e

+1-2 fps to all examples in opengl mode.

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
Is SDL_SetWindowResizable() works for us with opengl ? Why i ask, is that i understand it like we can create window with all opengl context, then , when we want we just call SDL_SetWindowResizable(window,SDL_TRUE); and it will have ability to be resized. At least on win32 it works like this, but on aos4 i didn't see any resizable gadget being added.

Probabaly that can be some issue, as we firstly create winndow without resize gadget, but then we need somehow attach it without closing the intuition window ..

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

I guess not implemented. Not sure exactly why, it's not a new feature (2.0.5). Not sure about possibility either, well, have to read Intuition Autodoc.

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


See User information
@Capehill
Checked the sources, and indeed didn't find anything about SetWindowResizable in amigaos4 sources (only in src/video/SDL_video.c , and implementation for win32 and x11)

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
Or maybe you know of any other way without SDL_SetWindowResizable, how to mimic that kind of SDL1 code, but on SDL2:

void CIrrDeviceSDL::setResizable(bool resize)
{
  if (
resize != Resizable)
  {
    if (
resize)
        
SDL_Flags |= SDL_RESIZABLE;
    else
        
SDL_Flags &= ~SDL_RESIZABLE;
    
Screen SDL_SetVideoMode000SDL_Flags );
    
Resizable resize;
    }
  }


I was in hope to do in SDL2 that:

void CIrrDeviceSDL2::setResizable(bool resize)
{
    if (
ScreenWindow && resize != Resizable)
    {
        
SDL_SetWindowResizable(ScreenWindow, (resize?SDL_TRUE:SDL_FALSE));
        
Resizable resize;
    }
}


The main problem that i can't create right at begining window with resizable flag : Irrlicht won't know if it will be resized at begining, as default in Irrlicht is : things are not resized unless that is requested. I.e. we can't tell SDL earlier because there's no flag in Irrlicht device creation parameters for this. And while with SDL1 they use that kind of code (that SDL_SetVideoMode with 0,0,0,0) , with SDL2 there is that SDL_SetWindowResizableI() can help. If of course, there is no other ways to tell window to be reasizable later.

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

It doesn't seem possible to add or remove resize gadget after window creation so there is no simple patch for this.

Go to top

  Register To Post
« 1 ... 36 37 38 (39) 40 41 42 ... 72 »

 




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




Powered by XOOPS 2.0 © 2001-2023 The XOOPS Project