mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-07 19:34:56 +00:00
parent
c68828519e
commit
f2d6e38cb4
@ -22,16 +22,27 @@
|
||||
#include <framebuffer_session/framebuffer_session.h>
|
||||
#include <cap_session/connection.h>
|
||||
#include <input/root.h>
|
||||
#include <os/config.h>
|
||||
|
||||
/* local includes */
|
||||
#include <input.h>
|
||||
|
||||
|
||||
/**
|
||||
* Read integer value from config attribute
|
||||
*/
|
||||
void config_arg(const char *attr, long *value)
|
||||
{
|
||||
try { Genode::config()->xml_node().attribute(attr).value(value); }
|
||||
catch (...) { }
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Variables for the libSDL output window
|
||||
*/
|
||||
static SDL_Surface *screen;
|
||||
static int scr_width = 1024, scr_height = 768;
|
||||
static long scr_width = 1024, scr_height = 768;
|
||||
static Framebuffer::Mode::Format scr_format = Framebuffer::Mode::RGB565;
|
||||
|
||||
/*
|
||||
@ -113,9 +124,8 @@ extern "C" int main(int, char**)
|
||||
using namespace Genode;
|
||||
using namespace Framebuffer;
|
||||
|
||||
/*
|
||||
* FIXME: Read configuration (screen parameters)
|
||||
*/
|
||||
config_arg("width", &scr_width);
|
||||
config_arg("height", &scr_height);
|
||||
|
||||
/*
|
||||
* Initialize libSDL window
|
||||
@ -130,7 +140,7 @@ extern "C" int main(int, char**)
|
||||
screen = SDL_SetVideoMode(scr_width, scr_height, bpp*8, SDL_SWSURFACE);
|
||||
SDL_ShowCursor(0);
|
||||
|
||||
Genode::printf("creating virtual framebuffer for mode %dx%d@%zd\n",
|
||||
Genode::printf("creating virtual framebuffer for mode %ldx%ld@%zd\n",
|
||||
scr_width, scr_height, bpp*8);
|
||||
|
||||
/*
|
||||
|
@ -1,5 +1,5 @@
|
||||
TARGET = fb_sdl
|
||||
LIBS = lx_hybrid
|
||||
LIBS = lx_hybrid config
|
||||
REQUIRES = linux sdl
|
||||
SRC_CC = fb_sdl.cc input.cc
|
||||
LX_LIBS = sdl
|
||||
|
Loading…
x
Reference in New Issue
Block a user