Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
80 user(s) are online (77 user(s) are browsing Forums)

Members: 0
Guests: 80

more...

Support us!

Headlines

 
  Register To Post  

« 1 ... 16 17 18 (19) 20 21 22 ... 74 »
Re: SDL2
Home away from home
Home away from home


See User information
@virgola
While Pingus indeed use SDL2, and other stuff which we have, it also use BOOST libs : modules such as signals2 and format. Probably , it can be not very hard to rewrite, but to someone who know programming well.

We have on os4depot very old version of boost, but there is only few modules done, most of them just stubs which do nothing.

It can be cool if , someday, someone, will properly port whole boost thing, but that very time consuming and hard part, to make it all properly, imho.



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

Mmm what about LibBoosty from Huno ?
It's somekind related to that, or it's completely another thing ?

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


See User information
@samo79
It's different , its his own library for his own projects. Word "Boost" there probably mean "yeahhhaa!", and not boost libs.

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

Here is a list of modules that need building:

http://www.boost.org/doc/libs/1_66_0/ ... tml#header-only-libraries

Boost is a giant set of headers mostly.

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


See User information
***

SDL2 project has now been imported from Sourceforge to Github, new address: https://github.com/AmigaPorts/sdl2-amigaos4

Contact me if you have any issues or would like to join the party. I have invited Bszili and Afxgroup as well.

Open tickets haven't been yet imported. Feel free to create tickets for open issues!

***

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


See User information
@Capehill
Found another error, which you may want to fix in sdl: If we request OpenGL ES 3.0 context (while we have 2.0), then it crashes after we try to do something GLES based.

I.e. there is testcase:

#include <SDL2/SDL.h>
#include <SDL2/SDL_opengles2.h>
#include <GLES2/gl2.h>
#include <cstdio>
#include <cstdlib>

const unsigned int DISP_WIDTH 800;
const 
unsigned int DISP_HEIGHT 600;

//int SDL_main(int argc, char *args[]) {
int main(int argcchar *args[]) {
    
// The window
    
SDL_Window *window NULL;
    
// The OpenGL context
    
SDL_GLContext context NULL;
    
// Init SDL
    
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
    
SDL_Log("SDL could not initialize! SDL_Error: %s\n"SDL_GetError());
    }
    
// Setup the exit hook
    
atexit(SDL_Quit);

    
// Request OpenGL ES 2.0
    
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASKSDL_GL_CONTEXT_PROFILE_ES);
    
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION2);
    
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION0);
    
    
// Want double-buffering
    
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER1);
    
    
    
// Create the window
    
window SDL_CreateWindow("GLES3+SDL2 Tutorial"SDL_WINDOWPOS_UNDEFINED,
        
SDL_WINDOWPOS_UNDEFINEDDISP_WIDTHDISP_HEIGHT,
        
SDL_WINDOW_OPENGL SDL_WINDOW_SHOWN);
    if (!
window) {
    
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR"Error",
        
"Couldn't create the main window."NULL);
        return 
EXIT_FAILURE;
    }

    
context SDL_GL_CreateContext(window);    
    if (!
context) {
        
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR"Error",
        
"Couldn't create an OpenGL context."NULL);
        return 
EXIT_FAILURE;
    }
    
    
// Clear to black
    
glClearColor(0.5f0.7f0.3f1.0f);
    
glClear(GL_COLOR_BUFFER_BIT);
    
// Update the window
    
SDL_GL_SwapWindow(window);
    
    
    
// Wait for the user to quit
    
bool quit false;
    
        while (!
quit) {
            
SDL_Event event;
                if (
SDL_WaitEvent(&event) != 0) {
                    if (
event.type == SDL_QUIT) {
                    
// User wants to quit
                        
quit true;
                    }
                }
        }
        return 
EXIT_SUCCESS;
}


Once you replace SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);
on
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);

(i.e. to request opengles3), then , instead of fallback to 2, or instead to quit with words "no gles3 possible", it continue to work, create instead opengl (so minigl) context, and then crashes.

With SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 1); (i.e. gles1), its fallback to version 2 fine.

Probably we need or the same fallback from 3 to 2 , or exit with words "sorry, no gles3 possible". But, most of gles3 code will works on gles2, so maybe fallback to 2 is better.

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
Quote:
Once you replace SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);
on
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);

(i.e. to request opengles3), then , instead of fallback to 2, or instead to quit with words "no gles3 possible", it continue to work, create instead opengl (so minigl) context, and then crashes.

SDL_GL_CreateContext(window) should return NULL if it can't create a context of the requested version.


Quote:
With SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 1); (i.e. gles1), its fallback to version 2 fine.

Wait, you're saying that GLES1 falls back to GLES2? If so, that needs to be changed immediately. GLES2 is completely incompatible with GLES1 (the old fixed pipeline is removed to make writing drivers easier). Falling back to MiniGL (so OpenGL 1.x) is probably okay.

Quote:
Probably we need or the same fallback from 3 to 2 , or exit with words "sorry, no gles3 possible". But, most of gles3 code will works on gles2, so maybe fallback to 2 is better.

Hmm, not sure which is best. Part of me wants to say "just return a NULL context," but games/apps will quickly detect which GLES3 features are and aren't available (and they should be checking the error codes).

I prefer a GLES3 context just for being able to use layout(location = n) and layout(binding = n) in the shaders (which our GLES2 supports), even when I'm not using geometry shaders or any other advanced feature. Falling back to GLES2 (with the bits I want supported) would save me from having to manually select GLES2 and then query the extensions I want to use.

Hans

Join Kea Campus' Amiga Corner and support Amiga content creation
https://keasigmadelta.com/ - see more of my work
Go to top
Re: SDL2
Home away from home
Home away from home


See User information
@Hans
Thanks for input !
Probably from test-case above you got that i trying your gles3+sdl2 tutor adapting on os4 :) Example01 working with minigmal change (as you see just includes, sdl_main on main, and 3 on 2 in major version). And example02 works too with very minimal changes. If you in interest once i will make it all compiles and works on os4,i can put it somewhere.

Also that all can be good test case for our sdl2+gles2 combo. At least with example01 it already show us something to fix.

Quote:

Wait, you're saying that GLES1 falls back to GLES2? If so, that needs to be changed immediately. GLES2 is completely incompatible with GLES1 (the old fixed pipeline is removed to make writing drivers easier). Falling back to MiniGL (so OpenGL 1.x) is probably okay.


Yes, majorversoin 1 fallback to gles2 (so open ogles2.libary and co, checked that with snoopy), and majorversion3 fallback to opengl(so open minig.library, also checked that with snoopy).

In other words, we need probably version3 fallback to version2, and version 1 fallback to opengl, i.e. reverse to what is now.

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

Quote:
Thanks for input !
Probably from test-case above you got that i trying your gles3+sdl2 tutor adapting on os4 :) Example01 working with minigmal change (as you see just includes, sdl_main on main, and 3 on 2 in major version). And example02 works too with very minimal changes. If you in interest once i will make it all compiles and works on os4,i can put it somewhere.

Also that all can be good test case for our sdl2+gles2 combo. At least with example01 it already show us something to fix.

Nice! Once it's all fixed, if you send me the details then I can update the tutorial, or create an AmigaOS 4 version.

Hans

Join Kea Campus' Amiga Corner and support Amiga content creation
https://keasigmadelta.com/ - see more of my work
Go to top
Re: SDL2
Home away from home
Home away from home


See User information
@Capehill
Another error (or maybe feature, dunno), is that when i run any SDL2 based app (at least those which i test: gigalomania game and some simple sdl2+ogles2 based test examples), then, while SDL2 waits for their events, massive flood on timer.device is happens.

I.e. its just enough to run snoopy, then sdl2 based stuff, and log will fast growup with lots of :

Quote:

o.k. = [exec] OpenDevice("timer.device",0,0xXXXXXXXX,0x00000000) = 0


I checked SDL1 based apps (Grafx2 app and Beret game), and there is no such flood.

Probably that can slow down all SDL2 apps.. If you in interst, i can provide the minimal test case ,but its enough to just open window and wait for events.

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

There is only checking for OpenGL ES 2.0. In other cases is falls back to MiniGL and seems that this has to be removed because it conflicts with user intention (SDL_opengles2.h).

Preprocessor has replaced glCalls anyway with IOGLES->glCall so disaster waits if ogles.library wasn't opened correctly.

Regarding timer.device, please provide a minimal example that demonstrates it. SDL2 shouldn't explicitly open timer.device.

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


See User information
@Capehill
Quote:

There is only checking for OpenGL ES 2.0. In other cases is falls back to MiniGL and seems that this has to be removed because it conflicts with user intention (SDL_opengles2.h).

Preprocessor has replaced glCalls anyway with IOGLES->glCall so disaster waits if ogles.library wasn't opened correctly.


Its even not always fallback to MiniGL now, its fallback only when we request OpenGL ES 3.0, but if we request OpenGL ES 1.0, then it fallback to OpenGL ES 2.0. While in all cases it probably should just return NULL.. Or at least when coder request OpenGL ES 1.0 return NULL, but when he request OpenGL ES 3.0, fallback it to OpenGL ES 2.0.

Quote:

Regarding timer.device, please provide a minimal example that demonstrates it. SDL2 shouldn't explicitly open timer.device.


Sure, just opening of window and wait for quit is enough. There is test code:

#include <SDL2/SDL.h>
#include <cstdio>
#include <cstdlib>

const unsigned int DISP_WIDTH 640;
const 
unsigned int DISP_HEIGHT 480;

//int SDL_main(int argc, char *args[]) {
int main(int argcchar *args[]) {
    
// The window
    
SDL_Window *window NULL;
    
// Init SDL
    
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
    
SDL_Log("SDL could not initialize! SDL_Error: %s\n"SDL_GetError());
    }
    
// Setup the exit hook
    
atexit(SDL_Quit);

        
    
// Create the window
    
window SDL_CreateWindow("GLES3+SDL2 Tutorial"SDL_WINDOWPOS_UNDEFINED,
        
SDL_WINDOWPOS_UNDEFINEDDISP_WIDTHDISP_HEIGHT,
        
SDL_WINDOW_OPENGL SDL_WINDOW_SHOWN);
    if (!
window) {
    
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR"Error",
        
"Couldn't create the main window."NULL);
        return 
EXIT_FAILURE;
    }
    
    
    
// Wait for the user to quit
    
bool quit false;
    
        while (!
quit) {
            
SDL_Event event;
                if (
SDL_WaitEvent(&event) != 0) {
                    if (
event.type == SDL_QUIT) {
                    
// User wants to quit
                        
quit true;
                    }
                }
        }
        return 
EXIT_SUCCESS;
}


After you will compile it, run it , and then run "snoopy". You will see, that while sdl2 app is working, we have flood of opening of timer.devices. That with any SDL2 based app i test at moment. With SDL1 there is no such flood, that why i think it can be bug which slow things down..

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 have created a branch called fix-opengl. SDL2's OpenGL version defaulted to 2.1, changed to 1.3 (which is the MiniGL's OpenGL version I think). Then also MiniGL fallback was removed so it should be a little bit safer now.

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


See User information
@Capehill
Quote:

I have created a branch called fix-opengl. SDL2's OpenGL version defaulted to 2.1, changed to 1.3 (which is the MiniGL's OpenGL version I think). Then also MiniGL fallback was removed so it should be a little bit safer now.


Tested fix-opengl branch and result are:

For first tested to create pure opengl window: all works fine, minigl.library opens.


Then testes openglES:

- when request OGLES1, return error !window for sdl_createwidow() : probably good, but fallback to minigl in that case can be also ok imho.

- when request OGLES2, open ogles2.library, return ogels2 context, all works: good

- when request OGLES3, return error !window for sdl_createwidow() : probably good. Dunno if it make sense to fallback it to OGLES2, but that can be changed later if there will be demand imho.

Also for sake of fun trying to ask for OGLES0, and OGLES4 , and as expected return same !window for sdl_createwidow, which mean all handles good and well.

Also did more tests related to "flood of opening of timer.device" issue, and found that its because of "if (SDL_WaitEvent(&event) != 0)". I.e. SDL_WaitEvent doing something nasty (or tasty), which on os4 cause massive flood of open timer.device in loop.

And, i see something cool , its another branch together with opengl-fix :) Really nice ! Will you implement it just as default, so no needs for any flags and co, just window mode will have 3st gadget as usuall ones, without needs to worry about ?

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 src/timer/amigaos4/SDL_os4timer.c file is used at all for sdl2 ? I see it used for SDL1 (does not matter if i use ./configure and create new makefile, or use pure makefile.amigao4, in both cases SDL_os4timer.c compiles in), but in my build of SDL2 that file didn't used.

Instead, configure process seems to use just src/timer/SDL_timer.c and src/timer/unix/SDL_systimer.c. Probably that can be reassons of that "open timer.device flood", as it use bunch of posix kind functions realted to timing, so probably that cause those issues in end.

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

Quote:
Will you implement it just as default, so no needs for any flags and co, just window mode will have 3st gadget as usuall ones, without needs to worry about


I will vote for having 3 gadgets by default

Go to top
Re: SDL2
Quite a regular
Quite a regular


See User information
@Capehill

Don't know if this has already been reported, but seems that SDL2 doesn't work under WinUAE OS4.1 FE update 1

The SDL2 window is empty

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


See User information
@amigablitter
It works over winuae, just if your sdl app opengl based, it may cause problems, as minigl didnt work on winuae as it, as no hardware w3d support, and you need to use waZp3d to make minigl works on winuae, which, in turn, have some set of options with which you need to take care of.

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
Also progs that use Composition (SDL2?) will works with PatchCompositeTags inside WinUAE-ppc


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


See User information
@kas1e

Quote:


Instead, configure process seems to use just src/timer/SDL_timer.c and src/timer/unix/SDL_systimer.c. Probably that can be reassons of that "open timer.device flood", as it use bunch of posix kind functions realted to timing, so probably that cause those issues in end.



That is highly likely.

But just to check on another posibilty what gfx lib are you using and what machine?


One thing to note though, since the opening of timer.device is there to create a timed delay or some such, it's not likely to slow anythig down, unless you are running snoopy or similar....


Go to top

  Register To Post
« 1 ... 16 17 18 (19) 20 21 22 ... 74 »

 




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




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project