view Renderer/Engine/viewerFB.cc @ 761:c0a8af52fa43 draft

add lights
author yutaka@henri.cr.ie.u-ryukyu.ac.jp
date Sat, 06 Feb 2010 03:02:48 +0900
parents 18d31d18a6b2
children b662e9dd26b0
line wrap: on
line source

#include "viewerFB.h"
#include "fb.h"

#define default_sdl_flag SDL_INIT_TIMER | SDL_INIT_JOYSTICK
//extern void post2runLoop(void *);
ViewerFB::ViewerFB() {}
ViewerFB::~ViewerFB() {}

Uint32 *
ViewerFB::video_init(TaskManager *manager, int bpp, int width, int height)
{
    Uint32 sdl_flag = default_sdl_flag | SDL_INIT_VIDEO;

    if (SDL_Init(sdl_flag) < 0) {
	fprintf(stderr,"Couldn't initialize SDL: %s\n",SDL_GetError());
	exit(1);
    }

    Uint32 *pixels = (Uint32*)get_fbdev_addr();

    if (pixels == 0) {
    	pixels = (new Uint32[width*height*32/8]);
    }

    return pixels;
}

void
ViewerFB::clean_pixels()
{
    //bzero(pixels, sizeof(int)*width*height);
    //memset(pixels, 0xFF, sizeof(int)*width*height);
}

void
ViewerFB::clear_screen()
{
}


void
ViewerFB::free_device()
{
}