Login
Username:

Password:

Remember me



Lost Password?

Register now!
Sections
Who's Online
42 user(s) are online (33 user(s) are browsing Forums)

Members: 0
Guests: 42

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



« 1 ... 11 12 13 (14)


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

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

   Report Go to top

Re: SDL1 open issues
Home away from home
Joined:
2007/9/11 11:31
From Russia
Posts: 5385
@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!
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: 749
@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.

   Report Go to top

Re: SDL1 open issues
Home away from home
Joined:
2007/9/11 11:31
From Russia
Posts: 5385
@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!
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: 5385
@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!
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: 5385
@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!
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: 5385
@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!
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: 749
@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.

   Report Go to top

Re: SDL1 open issues
Home away from home
Joined:
2007/9/11 11:31
From Russia
Posts: 5385
@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!
zerohero's mirror of os4/os3 crosscompiler suites
   Report Go to top


« 1 ... 11 12 13 (14)



[Advanced Search]


Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project