Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
189 user(s) are online (176 user(s) are browsing Forums)

Members: 0
Guests: 189

more...

Support us!

Headlines

 
  Register To Post  

« 1 ... 11 12 13 (14) 15 16 17 18 »
Re: SDL1 open issues
Just can't stay away
Just can't stay away


See User information
@kas1e

I was testing the behaviour with SDL examples (graywin: pressing SPACE warps the mouse to center).

Go to top
Re: SDL1 open issues
Home away from home
Home away from home


See User information
@Capehill
Interseting, indeed "graywin" for sure works. But my test i post before, i.e. that one:

#include <SDL/SDL.h>
#include <stdbool.h>

SDL_Surface *screen;
SDL_Event event;

int main(int argcchar *argv[]) {
    
    
SDL_Init(SDL_INIT_VIDEO);
    
screen SDL_SetVideoMode(64048016SDL_SWSURFACE);

    
SDL_WarpMouse(640/2480/2);
    
    
SDL_WM_SetCaption("Simple Window""Simple Window");

    
bool done=false;

    while(!
done) {
        while(
SDL_PollEvent(&event)) {
                if (
event.type == SDL_QUIT) {
                    
done=true;
                }
        }
    }
    
    
SDL_Quit();

    return 
0;
}


Didn't (while works on win32). Strange ..

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


See User information
@kas1e

It might be because backend hasn't handled events and window flags are not updated. SDL doesn't know that window is active before SDL_PollEvent.

Go to top
Re: SDL1 open issues
Home away from home
Home away from home


See User information
@Capehill
Found some issue with makefile.amigaos4 which you may want to change:

1). CFLAGS = -ggdb -O2 -Wall

So it should be for first -gstabs for debug build, and for second, it should't be in CFLAGS, or it always in, even with release mode, which make library be much fatter.

2). -gstabs should be added only when we build debug mode

In other words right block at top of makefile should be like this:

SHELL    = /bin/sh
CC      
ppc-amigaos-gcc
INCLUDE = -I./include
CFLAGS  = -O2 -Wall
LDFLAGS 

AR    ppc-amigaos-ar
RANLIB    
ppc-amigaos-ranlib
PIC_CFLAGS 
= -fPIC -DPIC
#DEBUG_CFLAGS = -gstabs -DDEBUG
DEBUG_CFLAGS =


I.e. when one want debug build, he uncomment that string, and have and debug output from sdl, and -gstabs for stack traces , etc. And when one want release mode, then it builds without eveyrthing to speed things up and to remove debug alltogether.

With that, we have just 500kb of size of static libSDL.a in release mode, instead of almost 4mb in debug mode.

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


See User information
@Capehill
And seems found another bug with opengl-resizing in sdl1, this time it seems not related to PREALLOC fix (because i tried and old adtools version, and our new version with latest fix, etc). It just when you resize it again the same white. I didn't tried through previous fix with prealloc, will check too.

There is source code and binary for test:
http://kas1e.mikendezign.com/aos4/sdl1/lesson32.lha

It is nehe's lesson32.

Compile line are:

g++ -athread=native -Wno-write-strings lesson32.cpp -o lesson32 -lsdl_mixer -lmodplug -lmikmod -lflac -lsmpeg -lvorbisfile -lvorbis -logg -lsdl -lgl -lpthread

Just compile , run and try to resize.

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


See User information
@Capehill
I think i found why it fail to resize :

I have my screenmode as 32 bit in workbench.
Now, when we call from test case above:
bpp = videoInfo->vfmt->BitsPerPixel;
It correctly return 32 as it is.

Then, next line are:

surface = SDL_SetVideoMode( SCREEN_WIDTH, SCREEN_HEIGHT, bpp, videoFlags );

And that one fail to resize properly. But once i change bpp to "16" manually, then resizing start to work.

It also can be that this whole SDL example just done wrong. But from other side while it should fail to resize if bpp differs, expectually, when originally it renders fine, and only fail after resizing.

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


See User information
@Capehill
Found another little-non-important issue : at least in SDL1 , when we come back from iconification, the window is not active by default, while probabaly should be (?) At least one expect it to be active as all other amiga apps made ourself active after un-iconification

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


See User information
@kas1e

[The -g flag]

I disagree with you about the -g flag. Stripping is supposed to remove the debug symbols so if file size is an issue, then just strip the binary (or shared object) before release.

But I can change -ggdb to -gstabs. Please create a ticket.


[Iconification]

Reproduced, please create a ticket. SDL2 seems OK.


[NeHe #32]

What is on the serial? EDIT: wait, found the binary, will try myself. EDIT2: so it doesn't have debug but looking at its source, there are 2 calls to SDL_SetVideoMode and the main one uses "bpp" for depth and the second one uses "16" so there is the likely problem.

Go to top
Re: SDL1 open issues
Home away from home
Home away from home


See User information
@Capehill
Created 2 tickets about 2 first issues.

Quote:

What is on the serial? EDIT: wait, found the binary, will try myself.


Do not remember if i build it with debug sdl1 or not, but in case i didn't you can compile it from there:

https://github.com/gamedev-net/nehe-op ... /master/linuxsdl/lesson32

Quote:

there are 2 calls to SDL_SetVideoMode and the main one uses "bpp" for depth and the second one uses "16" so there is the likely problem.


Right .. Those nehe's examples never was good , most of developers says that they quite offten badly writen and should be avoided, but most of the time they works :) And maybe that SDL version done not by Nehe itself , which is not excuse of course, its just buggy code of example as was expected :)

Thanks !

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


See User information
@capehill
Checked your new fixes, and both last issues fixed. Thanks :)

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


See User information
When porting freedroidRPG and linking against the latest libSDL (1.2.15), I'm getting no transparency in the game's menu.

Problem: https://i.imgur.com/D68EOWg.png
How it should look: http://os4depot.net/filedata/snapshot/9499_1_snap.jpg

Any ideas? Note these pics are from 2 different versions of the game. So just take the 2nd one as an example of how it should look.

Edit: Clarification about which exact libSDL version has the issue.

Go to top
Re: SDL1 open issues
Home away from home
Home away from home


See User information
@Mick
By latest SDL1 you mean that one on os4depot, or that one which you builds from sources from https://github.com/AmigaPorts/SDL/tree/SDL-1.2 ?

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


See User information

Go to top
Re: SDL1 open issues
Home away from home
Home away from home


See User information
@Mick
Yeah, that one which on os4depot. Since that there was lots of fixes, include fixes of bmp/png loading, alpha channels and stuff. So very well it may deal with issue already. Want me to build a latest static lib of sdl1 for you so you can test ?

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


See User information
Yes please.

Go to top
Re: SDL1 open issues
Home away from home
Home away from home


See User information

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


See User information
That solved it, thanks.

Go to top
Re: SDL1 open issues
Home away from home
Home away from home


See User information
@Capehill
Maybe you aware about: is SDL_SetGamma and/or SDL_SetGammaRamp works on our side in SDL1 ?

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


See User information
@kas1e

No, I haven't heard about any gamma adjustment functionality in AmigaOS.

Go to top
Re: SDL1 open issues
Home away from home
Home away from home


See User information
@Capehill
Do you mean that should be done on the OS level, not software-implemented in SDL ?

Btw, found another little issue when fixing irrlicht : this time its about SDL_ListModes() and maybe togeter with SDL_GetVideoInfo().

Issue is (long story):

When you create a window/fullscreen via SetVideoMode where you provide bitdepth as anything you don't have (let's say "24"), then, while all creates well, SDL_ListModes() will fail to list video modes (that expected, as if you don't have 24 bit modes what it will list). So that are expected, and it the same for win32 too.

I.e. that kind of code are fail on both win32 and amigaos4:

#include <stdio.h>
#include <SDL/SDL.h>
 
 
int main(int argcchar *argv[])
{
    
SDL_Init(SDL_INIT_VIDEO);
       
    
SDL_Surface *Screen SDL_SetVideoMode(102476824SDL_ANYFORMAT SDL_OPENGL);
 
    const 
SDL_VideoInfo *vi SDL_GetVideoInfo();
    
SDL_Rect **modes SDL_ListModes(vi->vfmtSDL_FULLSCREEN);    
   
    
printf("bitserpixel = %d\n"vi->vfmt->BitsPerPixel);
      
    if(
modes == (SDL_Rect **)0){
        
printf("No modes available!\n");
        
SDL_Quit();
    }
   
    if (
modes != 0)
    {
        if (
modes == (SDL_Rect **)-1) {
            
printf("All mode available\n");
        }
        else
        {
            for (
int i=0modes[i]; ++i) {
                
printf(" %d x %d x %d\n"modes[i]->wmodes[i]->hvi->vfmt->BitsPerPixel);
            }
        }
    }
 
    
SDL_Quit();
   
}


So that is fine and expected to be like this.

But then, to make SDL_ListMode works even if we have set "24" in the SetVideoMode, we set manually pixel format to 32 , and then it should works. And it works on win32 and on linux, but fail on our side. There is that failing on os4 testcase:

#include <stdio.h>
#include <SDL/SDL.h>
 
 
int main(int argcchar *argv[])
{
    
SDL_Init(SDL_INIT_VIDEO);
       
    
SDL_Surface *Screen SDL_SetVideoMode(102476824SDL_ANYFORMAT SDL_OPENGL);
 
    const 
SDL_VideoInfo *vi SDL_GetVideoInfo();
   
    
SDL_PixelFormat pixelFormat = *(vi->vfmt);
    
pixelFormat.BitsPerPixel 32;
    
SDL_Rect **modes SDL_ListModes(&pixelFormatSDL_FULLSCREEN);    
   
    
printf("SDL: flags are set to %x\n"SDL_FULLSCREEN);
    
printf("bitserpixel = %d\n"vi->vfmt->BitsPerPixel);
   
    if (
modes != 0)
    {
        if (
modes == (SDL_Rect **)-1) {
            
printf("All mode available\n");
        }
        else
        {
            for (
int i=0modes[i]; ++i) {
            }
        }
    }
 
 
    
/* Check is there are any modes available */
    
if(modes == (SDL_Rect **)0){
        
printf("No modes available!\n");
        
SDL_Quit();
    }
 
    
/* Check if our resolution is restricted */
    
else if(modes == (SDL_Rect **)-1){
        
printf("All resolutions available.\n");
    }
    else{
    
/* Print valid modes */
    
printf("Available Modes\n");
    for(
int i=0;modes[i];++i)
        
printf("  %d x %d\n"modes[i]->wmodes[i]->h);
    }
 
    
SDL_Quit();
   
}


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 ?

I checked SDL_GetVideoInfo() call right after i call SetVideoMode, and in both case and on win32 and on os4 it return 24, as expected. But then, when i set pixelFormat.BitsPerPixel to 32, it then works on win32 when i call SDL_ListModes(&pixelFormat, SDL_FULLSCREEN);, but didn't on os4.

So my bet that there can be one of 2 issues:

1. just first argument of SDL_ListModes or do not parsed correctly

2. it is parsed correclty, but there maybe some "compare" , like if bits in 1st arg of pixelformat in the SDL_ListVideo mode do not equal to the bits used in the SetVideoMode call , then we fail (while should't). At least that prove while for example if we set in test case "16" to the SetVideoMode, but still keep 32 for SDL_ListModes it fail, but when we set 16 on both places , it works. Or if we have 32 in both places it works. But if SetVideoMode have one bits, and ListModes ask to list modes with other bits : then we fail.

While of course we should't fail , as we ask to list modes of bits we ask. And it works like this on win32 and linux, so probabaly that is bug on our side.


Edited by kas1e on 2019/10/10 12:48:43
Join us to improve dopus5!
AmigaOS4 on youtube
Go to top

  Register To Post
« 1 ... 11 12 13 (14) 15 16 17 18 »

 




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




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project