Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
99 user(s) are online (83 user(s) are browsing Forums)

Members: 1
Guests: 98

hotrod, more...

Support us!

Headlines

 
  Register To Post  

How to access to the intuition window when it created by SDL ?
Home away from home
Home away from home


See User information
Have anyone cluse how i can got pointer to the intuition window after it opened by SDL, so i can then do :

struct Window *i_need_window;

i_need_window = SDLblbal->inutitionwindow;

All i found currently , its that in SDL sources there some private SDL_PrivateVideoData structure which contain pointer to window, but that can't be accessed from user's code seems so:
http://code.google.com/p/os4sdl/sourc ... gaos4/SDL_os4video.h?r=12

Is there any other way ?

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: How to access to the intuition window when it created by SDL ?
Just can't stay away
Just can't stay away


See User information

Go to top
Re: How to access to the intuition window when it created by SDL ?
Quite a regular
Quite a regular


See User information
SDL_Window is an opaque structure, and it it's not the same as an intuition window. SDL 1.2 can return the window handle in SDL_SysWMinfo, but it is not implemented in the OS4 SDL.
When I had to do something like this, I iterated through the intuition window list, and picked one with the identical title. Crude, but this way you won't break the forward compatibility.

This is just like television, only you can see much further.
Go to top
Re: How to access to the intuition window when it created by SDL ?
Home away from home
Home away from home


See User information
@Bszili
Probably will be easy to implement to os4 sdl (checked win32 sdl sources, pretty easy). Even maybe worth to check itix's powersdl , its open source and maybe already have it. but if not making same by logic as on win32 should be way too

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: How to access to the intuition window when it created by SDL ?
Quite a regular
Quite a regular


See User information
It is easy to implement indeed, but neither the AROS or MorphOS port of SDL fills out the WM info.
The first step is defining a structure, since SDL_SysWMinfo on different platforms (Windows, X11, RISCOS etc.). A struct Window pointer should be enough, with maybe a couple of reserved fields for future extensions.

This is just like television, only you can see much further.
Go to top
Re: How to access to the intuition window when it created by SDL ?
Home away from home
Home away from home


See User information
@BSzili
Yep, its indeed was easy enough as expected. There not only structure was missing in sdl, but also whole sdl_getwminfo().
Added them all and already tested by simple test case:

// compile gcc test.c -o test -lauto
#define __USE_INLINE__ 

#include <stdio.h>

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

#include <proto/intuition.h>
#include <proto/dos.h>

SDL_Surface *screen;
SDL_Event event;
SDL_SysWMinfo info;

int main(int argcchar *argv[]) {

        
SDL_Init(SDL_INIT_VIDEO);

        
screen SDL_SetVideoMode(64048016SDL_SWSURFACE);

        
SDL_WM_SetCaption("SDL_GetWMInfo test""SDL_GetWMInfo test");

                 
         
SDL_VERSION(&info.version);
         if ( 
SDL_GetWMInfo(&info) ) {
         
            
Delay(200);
            
HideWindow(info.window);
            
Delay(200);
            
ShowWindow(info.window,WINDOW_FRONTMOST);        
            
Delay(200);
            
         }
        
                
        
SDL_Quit();

        return 
0;
}


As well as already include it to muimplayer , so now can iconify at one time output with SDL too , and its anyway tasty not only for mplayer: now anyone can add iconify gadgets to their sdl ports , or any other gadgets or whatever as pointer to intuition window is here , and that pretty helpful. Currently i do structures like this:

#elif defined(SDL_VIDEO_DRIVER_AMIGAOS4)
#include <proto/intuition.h>

/* The AmigaOS4 custom event structure */
struct SDL_SysWMmsg {
    
SDL_version version;
    
struct Window *window;    
};

/* The AmigaOS4 custom window manager information structure */
typedef struct SDL_SysWMinfo {
    
SDL_version version;
    
struct Window *window;    
SDL_SysWMinfo;


But that can be expanded later with no probs to any other info anyone need (all from SDL_PrivateVideoData can be added: screens/ofscreens/rects, whatever else).

In other words, check latest commit:
https://code.google.com/p/os4sdl/source/detail?r=57

(config.log and pthread/sdl_syscond.c not related, just some auto save do in them, so they uploaded as changed too, while they aren't). Files to check in ommit: sdl_syswm.h , sdl_sysvideo.h, sdl_os4video.c and sdl_os4wm.c

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top

  Register To Post

 




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




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project