示例#1
0
bool VideoDecoderVAAPIPrivate::setup(void **hwctx, AVPixelFormat *chroma, int w, int h)
{
    if (surface_width == w && surface_height == h) {
        *hwctx = &hw_ctx;
        *chroma = surface_chroma;
        return true;
    }
    *hwctx = NULL;
    //*chroma = QTAV_PIX_FMT_C(NONE);
    if (surface_width || surface_height)
        destroySurfaces();
    if (w > 0 && h > 0)
        return createSurfaces(hwctx, chroma, w, h);
    return false;
}
示例#2
0
Isoeng::Isoeng(char* caption) {
	int img_init;

	srand(time(NULL));
	m_x = m_y = x_offset = y_offset = 0;

	/*	initialize SDL`*/
	putenv("SDL_VIDEO_WINDOW_POS");
	putenv("SDL_VIDEO_CENTERED=1");
	if(SDL_Init(SDL_INIT_EVERYTHING) < 0) {
		err = new char[256];
		sprintf(err, "Unable to initialize SDL: %s", SDL_GetError());
		throw CException("isoeng.cpp", err);
	}
	
	/* create main window SDL drawing surface */
	window_main = SDL_SetVideoMode(WM_WIDTH, WM_HEIGHT, 32, SDL_DOUBLEBUF);
	if(window_main == NULL) {
		err = new char[256];
		sprintf(err, "Unable to set %dx%d video mode: %s", WM_WIDTH, WM_HEIGHT, SDL_GetError());
		throw CException("isoeng.cpp", err);
	}
	SDL_WM_SetCaption(caption, caption);

	/* initialize SDL_Image */
	img_init = IMG_Init(IMG_INIT_PNG);
	if((img_init & IMG_INIT_PNG) != IMG_INIT_PNG) {
		err = new char[256];
		sprintf(err, "Failed to initialize PNG support: %s", IMG_GetError());
		throw CException("isoeng.cpp", err);
	}

	loadCursorImages();
	loadTileImages();
	IMG_Quit();

	createSurfaces();
	alive = true;
}
示例#3
0
	FileIOXmlGml()
	{
		createPoints();
		createPolylines();
		createSurfaces();
	}
示例#4
0
bool CVideoEngine::createSurfaces()
{
    return createSurfaces(m_VidConfig.m_GameRect);
}
void MakeCurrentPerfCase::init (void)
{
	chooseConfig();
	createContexts();
	createSurfaces();
}