/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2005,2006,2007,2008,2009 Free Software Foundation, Inc.
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GRUB is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
#include <grub/video_fb.h>
GRUB_MOD_LICENSE ("GPLv3+");
static grub_err_t
struct grub_video_palette_data *palette_data);
static grub_err_t
grub_video_sdl_init (void)
{
window = 0;
if (SDL_Init (SDL_INIT_VIDEO) < 0)
SDL_GetError ());
return grub_video_fb_init ();
}
static grub_err_t
grub_video_sdl_fini (void)
{
SDL_Quit ();
window = 0;
return grub_video_fb_fini ();
}
static inline unsigned int
{
unsigned i;
for (i = 0; mask > 1U << i; i++);
return i;
}
static grub_err_t
{
int depth;
int flags = 0;
/* Decode depth from mode_type. If it is zero, then autodetect. */
if (depth == 0)
depth = 32;
{
width = 800;
height = 600;
}
flags |= SDL_DOUBLEBUF;
if (! window)
if (! window)
SDL_GetError ());
else
/* In index color mode, number of colors. In RGB mode this is 256. */
else
{
}
if (err)
return err;
/* Copy default palette to initialize emulated palette. */
grub_video_sdl_set_palette (0, (sizeof (grub_video_fbstd_colors)
/ sizeof (grub_video_fbstd_colors[0])),
/* Reset render target to SDL one. */
}
static grub_err_t
struct grub_video_palette_data *palette_data)
{
unsigned i;
{
for (i = 0; i < count; i++)
{
tmp[i].r = palette_data[i].r;
tmp[i].g = palette_data[i].g;
tmp[i].b = palette_data[i].b;
}
}
}
static grub_err_t
grub_video_sdl_swap_buffers (void)
{
SDL_GetError ());
return GRUB_ERR_NONE;
}
static grub_err_t
{
return grub_video_fb_set_active_render_target (target);
}
{
.name = "SDL Video Driver",
.next = 0
};
{
}
{
}