Does anyone know how to move my SDL.net video surface around the screen programtically?
Surface videoContext = Video.SetVideoMode(1024, 768, 32, false, false, false, true, true);
var a = System.Windows.Forms.Control.FromHandle(Video.WindowHandle);
var b = System.Windows.Forms.NativeWindow.FromHandle(Video.WindowHandle);
I can't find any properties in Surface
or Video
which do the job, and FromHandle
is returning Null.
The window is initializing falling off the bottom of the screen.
Any ideas?
Update:
I've seen this code but can't work out an equivilent C# implimentation. Can anyone help?
#ifdef WIN32
#include <SDL_syswm.h>
SDL_SysWMinfo i;
SDL_VERSION( &i.version );
if ( SDL_GetWMInfo ( &i) ) {
HWND hwnd = i.window;
SetWindowPos( hwnd, HWND_TOP, x, y, width, height, flags );
}
Failing that, how much work is involved in including some c++ in my c# project?
Thanks.