PDA

View Full Version : Problem with SDL in a TPanel



jdarling
18-09-2007, 04:48 PM
A while back I converted the SDLMPEGPanel into a normal SDLPanel component (download at: http://www.eonclash.com/SDL/SDLPanel.pas) but am now having a problem with it. Everything works fine as long as the panel is never "hidden" from view. In my case I have a TPageControl that I have placed a TSDLPanel on. The first time you move to the page the panel is on everything works fine. Change to another page and come back and the panel is completely blank.

I've tried everything, closing SDL when the panels change and then re-initializing when you re-focus the panel, resetting the handle, resetting SDL, etc... Has anyone had success with placing SDL into a windows control on a notebook and have it work?

It may make a difference, I'm working in Lazarus under windows xp right now later will port to other platforms.

technomage
18-09-2007, 07:03 PM
Perhaps you need to reset the environment variable "SDL_WINDOWID" to the new handle of the panel. The problem with that is you need to unload SDL first (I think) If youy are using this environment variable it's worth noting that it is only supported on Windows and Linux.

Or perhaps use SDL_GetWMInfo to get the video information and check which handle SDL thinks it's using.