1
SFML projects / A Shmup
« on: January 14, 2011, 05:11:54 am »
Updated! See OP.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
window = sfWindow_Create( vmode, "asdf", flags, settings );
myhandle = GetActiveWindow(); // Win32 API
...
SetForeGroundWindow( myhandle );
sfWindow* sfWindow_Create(sfVideoMode* Mode, const char* Title, unsigned long Style, sfWindowSettings* Params)
{
// Convert video mode
sf::VideoMode VideoMode(Mode->Width, Mode->Height, Mode->BitsPerPixel);
// Create the window
sfWindow* Window = new sfWindow;
sf::WindowSettings Settings(Params->DepthBits, Params->StencilBits, Params->AntialiasingLevel);
Window->This.Create(VideoMode, Title, Style, Settings);
Window->Input.This = &Window->This.GetInput();
return Window;
}
sfWindow* sfWindow_CreateFromHandle(sfWindowHandle Handle, sfWindowSettings* Params)
{
sfWindow* Window = new sfWindow;
sf::WindowSettings Settings(Params->DepthBits, Params->StencilBits, Params->AntialiasingLevel);
Window->This.Create(Handle, Settings);
Window->Input.This = &Window->This.GetInput();
return Window;
}
sfVideoMode Ret;
////////////////////////////////////////////////////////////
/// Get a valid video mode
/// Index must be in range [0, GetModesCount()[
/// Modes are sorted from best to worst
////////////////////////////////////////////////////////////
sfVideoMode* sfVideoMode_GetMode(size_t Index)
{
sf::VideoMode Mode = sf::VideoMode::GetMode(Index);
Ret.Width = Mode.Width;
Ret.Height = Mode.Height;
Ret.BitsPerPixel = Mode.BitsPerPixel;
return &Ret;
}