[SDL] Re: sdl windows position on screen

Bill May wmay at cisco.com
Tue Nov 8 12:24:33 PST 2005


florence blabla wrote:
> when i open an sdl windows , windowed mode , it
> appears 
> at randon place on the screen...
> 
> is it possible to place window sdl at x , y
> coordinates 
> 
> (sorry for my english ) , under sdl or by another way.
> 
> under X11 and linux , programming in freepascal...
> 
> thanks ....

Do this after SDL_SetVideoMode:

     SDL_SysWMinfo info;
     SDL_VERSION(&info.version);
     int ret;
     ret = SDL_GetWMInfo(&info);
     if (ret > 0) {
#ifdef unix
       if (info.subsystem == SDL_SYSWM_X11) {
         info.info.x11.lock_func();
         XMoveWindow(info.info.x11.display, info.info.x11.wmwindow,
                     m_pos_x, m_pos_y);
         info.info.x11.unlock_func();
       }
#endif




More information about the SDL mailing list