亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? gameswf_test_ogl.cpp

?? 一個開源的嵌入式flash播放器的源代碼
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
// gameswf_test_ogl.cpp	-- Thatcher Ulrich <tu@tulrich.com> 2003 -*- coding: utf-8;-*-// This source code has been donated to the Public Domain.  Do// whatever you want with it.// A minimal test player app for the gameswf library.#include "SDL.h"#include "SDL_thread.h"#include "gameswf.h"#include <stdlib.h>#include <stdio.h>#include "base/ogl.h"#include "base/utility.h"#include "base/container.h"#include "base/tu_file.h"#include "base/tu_types.h"#include "gameswf_xmlsocket.h"#ifdef HAVE_LIBXMLextern int xml_fd;		// FIXME: this is the file descriptor				// from XMLSocket::connect(). This				// needs to be propogated up through				// the layers properly, but first I				// want to make sure it all works.#endif // HAVE_LIBXMLvoid	print_usage()// Brief instructions.{	printf(		"gameswf_test_ogl -- a test player for the gameswf library.\n"		"\n"		"This program has been donated to the Public Domain.\n"		"See http://tulrich.com/geekstuff/gameswf.html for more info.\n"		"\n"		"usage: gameswf_test_ogl [options] movie_file.swf\n"		"\n"		"Plays a SWF (Shockwave Flash) movie, using OpenGL and the\n"		"gameswf library.\n"		"\n"		"options:\n"		"\n"		"  -h          Print this info.\n"		"  -s <factor> Scale the movie up/down by the specified factor\n"		"  -c          Produce a core file instead of letting SDL trap it\n"		"  -d num      Number of milli-seconds to delay in main loop\n"		"  -a          Turn antialiasing on/off.  (obsolete)\n"		"  -v          Be verbose; i.e. print log messages to stdout\n"		"  -va         Be verbose about movie Actions\n"		"  -vp         Be verbose about parsing the movie\n"		"  -ml <bias>  Specify the texture LOD bias (float, default is -1)\n"		"  -p          Run full speed (no sleep) and log frame rate\n"		"  -e          Use SDL Event thread\n"		"  -1          Play once; exit when/if movie reaches the last frame\n"                "  -r <0|1|2>  0 disables renderering & sound (good for batch tests)\n"                "              1 enables rendering & sound (default setting)\n"                "              2 enables rendering & disables sound\n"		"  -t <sec>    Timeout and exit after the specified number of seconds\n"		"  -b <bits>   Bit depth of output window (16 or 32, default is 16)\n"		"\n"		"keys:\n"		"  CTRL-Q          Quit/Exit\n"		"  CTRL-W          Quit/Exit\n"		"  ESC             Quit/Exit\n"		"  CTRL-P          Toggle Pause\n"		"  CTRL-R          Restart the movie\n"		"  CTRL-[ or kp-   Step back one frame\n"		"  CTRL-] or kp+   Step forward one frame\n"		"  CTRL-A          Toggle antialiasing (doesn't work)\n"		"  CTRL-T          Debug.  Test the set_variable() function\n"		"  CTRL-G          Debug.  Test the get_variable() function\n"		"  CTRL-M          Debug.  Test the call_method() function\n"		"  CTRL-B          Toggle background color\n"		);}#define OVERSIZE	1.0fstatic int runThread(void *nothing);static int doneYet = 0;static float	s_scale = 1.0f;static bool	s_antialiased = false;static int	s_bit_depth = 16;static bool	s_verbose = false;static bool	s_background = true;static bool	s_measure_performance = false;static bool	s_event_thread = false;static void	message_log(const char* message)// Process a log message.{	if (s_verbose)	{		fputs(message, stdout);                fflush(stdout); // needed on osx for some reason	}}static void	log_callback(bool error, const char* message)// Error callback for handling gameswf messages.{	if (error)	{		// Log, and also print to stderr.		message_log(message);		fputs(message, stderr);	}	else	{		message_log(message);	}}static tu_file*	file_opener(const char* url)// Callback function.  This opens files for the gameswf library.{	return new tu_file(url, "rb");}static void	fs_callback(gameswf::movie_interface* movie, const char* command, const char* args)// For handling notification callbacks from ActionScript.{	message_log("fs_callback: '");	message_log(command);	message_log("' '");	message_log(args);	message_log("'\n");}static void	key_event(SDLKey key, bool down)// For forwarding SDL key events to gameswf.{	gameswf::key::code	c(gameswf::key::INVALID);	if (key >= SDLK_a && key <= SDLK_z)	{		c = (gameswf::key::code) ((key - SDLK_a) + gameswf::key::A);	}	else if (key >= SDLK_F1 && key <= SDLK_F15)	{		c = (gameswf::key::code) ((key - SDLK_F1) + gameswf::key::F1);	}	else if (key >= SDLK_KP0 && key <= SDLK_KP9)	{		c = (gameswf::key::code) ((key - SDLK_KP0) + gameswf::key::KP_0);	}	else	{		// many keys don't correlate, so just use a look-up table.		struct		{			SDLKey	sdlk;			gameswf::key::code	gs;		} table[] =			{				{ SDLK_RETURN, gameswf::key::ENTER },				{ SDLK_ESCAPE, gameswf::key::ESCAPE },				{ SDLK_LEFT, gameswf::key::LEFT },				{ SDLK_UP, gameswf::key::UP },				{ SDLK_RIGHT, gameswf::key::RIGHT },				{ SDLK_DOWN, gameswf::key::DOWN },				// @@ TODO fill this out some more				{ SDLK_UNKNOWN, gameswf::key::INVALID }			};		for (int i = 0; table[i].sdlk != SDLK_UNKNOWN; i++)		{			if (key == table[i].sdlk)			{				c = table[i].gs;				break;			}		}	}	if (c != gameswf::key::INVALID)	{		gameswf::notify_key_event(c, down);	}}int	main(int argc, char *argv[]){	assert(tu_types_validate());	const char* infile = NULL;	float	exit_timeout = 0;	bool	do_render = true;        bool    do_sound = true;	bool	do_loop = true;	bool	sdl_abort = true;	int     delay = 31;	float	tex_lod_bias;	// -1.0 tends to look good.	tex_lod_bias = -1.2f;		for (int arg = 1; arg < argc; arg++)	{		if (argv[arg][0] == '-')		{			// Looks like an option.			if (argv[arg][1] == 'h')			{				// Help.				print_usage();				exit(1);			}			if (argv[arg][1] == 'c')			{				sdl_abort = false;			}			else if (argv[arg][1] == 's')			{				// Scale.				arg++;				if (arg < argc)				{					s_scale = fclamp((float) atof(argv[arg]), 0.01f, 100.f);				}				else				{					fprintf(stderr, "-s arg must be followed by a scale value\n");					print_usage();					exit(1);				}			}			else if (argv[arg][1] == 'a')			{				// Set antialiasing on or off.				arg++;				if (arg < argc)				{					s_antialiased = atoi(argv[arg]) ? true : false;				}				else				{					fprintf(stderr, "-a arg must be followed by 0 or 1 to disable/enable antialiasing\n");					print_usage();					exit(1);				}			}			else if (argv[arg][1] == 'b')			{				// Set default bit depth.				arg++;				if (arg < argc)				{					s_bit_depth = atoi(argv[arg]);					if (s_bit_depth != 16 && s_bit_depth != 32)					{						fprintf(stderr, "Command-line supplied bit depth %d, but it must be 16 or 32", s_bit_depth);						print_usage();						exit(1);					}				}				else				{					fprintf(stderr, "-b arg must be followed by 16 or 32 to set bit depth\n");					print_usage();					exit(1);				}			}			else if (argv[arg][1] == 'd')			{				// Set a delay				arg++;				if (arg < argc)				{					delay = atoi(argv[arg]);				}				else				{					fprintf(stderr, "-d arg must be followed by number of milli-seconds to del in the main loop\n");					print_usage();					exit(1);				}			}			else if (argv[arg][1] == 'p')			{				// Enable frame-rate/performance logging.				s_measure_performance = true;			}			else if (argv[arg][1] == 'e')			{				// Use an SDL thread to handle events				s_event_thread = true;			}			else if (argv[arg][1] == '1')			{				// Play once; don't loop.				do_loop = false;			}			else if (argv[arg][1] == 'r')			{				// Set rendering on/off.				arg++;				if (arg < argc)				{					const int render_arg = atoi(argv[arg]);					switch (render_arg) {					case 0:						// Disable both						do_render = false;						do_sound = false;						break;					case 1:						// Enable both						do_render = true;						do_sound = true;						break;					case 2:						// Disable just sound						do_render = true;						do_sound = false;						break;					default:						fprintf(stderr, "-r must be followed by 0, 1 or 2 (%d is invalid)\n",							render_arg);						print_usage();						exit(1);						break;					}				} else {					fprintf(stderr, "-r must be followed by 0 an argument to disable/enable rendering\n");					print_usage();					exit(1);				}			}			else if (argv[arg][1] == 't')			{				// Set timeout.				arg++;				if (arg < argc)				{					exit_timeout = (float) atof(argv[arg]);				}				else				{					fprintf(stderr, "-t must be followed by an exit timeout, in seconds\n");					print_usage();					exit(1);				}			}			else if (argv[arg][1] == 'v')			{				// Be verbose; i.e. print log messages to stdout.				s_verbose = true;				if (argv[arg][2] == 'a')				{					// Enable spew re: action.					gameswf::set_verbose_action(true);				}				else if (argv[arg][2] == 'p')				{					// Enable parse spew.					gameswf::set_verbose_parse(true);				}				// ...			}			else if (argv[arg][1] == 'm')			{				if (argv[arg][2] == 'l') {					arg++;					tex_lod_bias = (float) atof(argv[arg]);					//printf("Texture LOD Bais is no %f\n", tex_lod_bias);				}				else				{					fprintf(stderr, "unknown variant of -m arg\n");					print_usage();					exit(1);				}			}		}		else		{			infile = argv[arg];		}	}	if (infile == NULL)	{		printf("no input file\n");		print_usage();		exit(1);	}	gameswf::register_file_opener_callback(file_opener);	gameswf::register_fscommand_callback(fs_callback);	if (s_verbose == true) {		gameswf::register_log_callback(log_callback);	}	//gameswf::set_antialiased(s_antialiased);	gameswf::sound_handler*	sound = NULL;	gameswf::render_handler*	render = NULL;	if (do_render)	{		if (do_sound) {			sound = gameswf::create_sound_handler_sdl();			gameswf::set_sound_handler(sound);		}		render = gameswf::create_render_handler_ogl();		gameswf::set_render_handler(render);	}	// Get info about the width & height of the movie.	int	movie_version = 0;	int	movie_width = 0;	int	movie_height = 0;	float	movie_fps = 30.0f;	gameswf::get_movie_info(infile, &movie_version, &movie_width, &movie_height, &movie_fps, NULL, NULL);	if (movie_version == 0)	{		fprintf(stderr, "error: can't get info about %s\n", infile);		exit(1);	}	int	width = int(movie_width * s_scale);	int	height = int(movie_height * s_scale);	if (do_render)	{		// Initialize the SDL subsystems we're using. Linux		// and Darwin use Pthreads for SDL threads, Win32		// doesn't. Otherwise the SDL event loop just polls.		if (sdl_abort) {			//  Other flags are SDL_INIT_JOYSTICK | SDL_INIT_CDROM#ifdef _WIN32			if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO))#else			if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_EVENTTHREAD ))#endif				{				fprintf(stderr, "Unable to init SDL: %s\n", SDL_GetError());					exit(1);			}		} else {			fprintf(stderr, "warning: SDL won't trap core dumps \n");#ifdef _WIN32			if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_NOPARACHUTE  | SDL_INIT_EVENTTHREAD))#else			if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_NOPARACHUTE))

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产人成综合网站| 国产欧美精品国产国产专区| 一区二区在线电影| 色偷偷88欧美精品久久久| 亚洲人成亚洲人成在线观看图片| 东方aⅴ免费观看久久av| 国产精品欧美综合在线| 99久久伊人网影院| 一区二区不卡在线播放 | 日韩一区二区麻豆国产| 秋霞成人午夜伦在线观看| 欧美电影免费观看高清完整版在| 国产一区二区三区精品视频| 国产精品久久久久四虎| 91国产成人在线| 免费欧美日韩国产三级电影| 欧美va亚洲va| 色网站国产精品| 日本不卡一二三区黄网| 国产精品热久久久久夜色精品三区| 色呦呦国产精品| 青椒成人免费视频| 日本一区二区三区国色天香| 欧美图片一区二区三区| 国产一区二区女| 一区二区三区在线视频观看58 | 黄页网站大全一区二区| 国产精品丝袜91| 欧美精品vⅰdeose4hd| 国产露脸91国语对白| 亚洲激情图片qvod| 精品久久人人做人人爱| 欧美亚一区二区| 国产盗摄一区二区| 午夜激情综合网| 亚洲国产高清aⅴ视频| 777a∨成人精品桃花网| 成人激情黄色小说| 久久成人18免费观看| 亚洲精品视频一区| 国产欧美一区二区三区网站| 欧美视频一区二区三区| 成人av网站大全| 精品一区二区三区不卡| 亚洲午夜久久久久久久久电影网| 26uuu精品一区二区在线观看| 欧美亚洲综合在线| 成人一级片网址| 精品在线一区二区三区| 天堂va蜜桃一区二区三区| 成人免费在线播放视频| 精品美女在线播放| 欧美视频在线一区| 97久久精品人人爽人人爽蜜臀| 国产在线播精品第三| 爽好久久久欧美精品| 亚洲免费观看高清| 国产欧美日韩精品在线| 欧美精品一区二区在线观看| 欧美日韩不卡在线| 91在线观看高清| 成人在线综合网| 国产精品一卡二卡| 久久超碰97中文字幕| 免费观看一级特黄欧美大片| 丝袜亚洲精品中文字幕一区| 亚洲综合精品自拍| 亚洲曰韩产成在线| 亚洲免费观看高清完整版在线观看| 国产精品久久久久久久久免费樱桃| 精品国产sm最大网站| 日韩精品一区二区三区中文精品| 欧美日韩视频在线一区二区| 在线视频中文字幕一区二区| 一本到不卡精品视频在线观看| 99热在这里有精品免费| caoporn国产一区二区| 99综合电影在线视频| 94-欧美-setu| 国产精品久久久久aaaa| av中文字幕在线不卡| 国产99精品国产| 久久精品国产99久久6| 亚洲午夜私人影院| 日韩专区一卡二卡| 麻豆精品国产传媒mv男同| 日韩在线观看一区二区| 美女国产一区二区| 极品少妇xxxx精品少妇偷拍| 国产精品66部| 午夜亚洲福利老司机| 91日韩一区二区三区| 五月综合激情网| 精品第一国产综合精品aⅴ| 国产美女av一区二区三区| 中文字幕免费在线观看视频一区| 成人免费高清视频在线观看| 日韩伦理av电影| 欧美精品乱码久久久久久按摩 | 精品国产一区久久| 国内成人自拍视频| 中文字幕亚洲区| 欧美久久久久中文字幕| 久久国产精品露脸对白| 亚洲色图都市小说| 9191久久久久久久久久久| 国产一区二区三区蝌蚪| 亚洲欧美国产77777| 日韩欧美久久久| 成人精品电影在线观看| 日韩精品乱码av一区二区| 精品动漫一区二区三区在线观看| 91免费观看在线| 久久精品国产精品青草| 亚洲欧美偷拍三级| 精品日韩欧美在线| 日本高清不卡aⅴ免费网站| 精品一二三四区| 亚洲一区二区三区不卡国产欧美 | 综合精品久久久| 日韩欧美国产一区二区在线播放| 成人深夜在线观看| 久久精品噜噜噜成人88aⅴ| 亚洲人成在线播放网站岛国| 2020国产精品久久精品美国| 欧美色精品在线视频| 成人精品免费视频| 久久精品国产99久久6| 午夜电影网一区| 亚洲精品国产第一综合99久久| 精品久久久久久久久久久久久久久 | 免费观看在线色综合| 亚洲精品视频免费观看| 欧美经典一区二区三区| 欧美一二三四在线| 欧美亚洲尤物久久| 色噜噜狠狠成人网p站| 丁香婷婷综合五月| 国内精品久久久久影院一蜜桃| 奇米777欧美一区二区| 亚洲va韩国va欧美va精品| 一区二区三区美女| 成人欧美一区二区三区1314| 国产精品伦理一区二区| 欧美—级在线免费片| 国产欧美一区二区三区鸳鸯浴 | 国产麻豆午夜三级精品| 天天综合色天天综合| 亚洲一区电影777| 亚洲一区在线电影| 一区二区三区.www| 亚洲精品久久久久久国产精华液| 中文字幕日本不卡| 日韩理论片一区二区| 一区精品在线播放| 一区二区三区精品视频| 亚洲欧美日韩综合aⅴ视频| 亚洲视频免费在线| 一级做a爱片久久| 亚洲一级二级在线| 日韩av高清在线观看| 日本美女一区二区三区视频| 美洲天堂一区二卡三卡四卡视频| 蜜桃视频在线一区| 国产精品456露脸| 成人美女视频在线看| 色综合天天综合网国产成人综合天 | 国产99久久久久久免费看农村| 国产精品99久久久久久有的能看| 国产精品亚洲成人| 97超碰欧美中文字幕| 欧美日韩精品一区二区在线播放| 欧美一区二区女人| 久久综合色8888| 亚洲蜜臀av乱码久久精品蜜桃| 一区二区三区不卡在线观看| 日韩精品视频网| 国产在线精品一区二区夜色| 丁香婷婷综合五月| 欧美日韩国产高清一区二区| 2021中文字幕一区亚洲| 亚洲少妇最新在线视频| 亚洲va欧美va天堂v国产综合| 国内外成人在线| 欧美专区日韩专区| 精品成人一区二区三区四区| 亚洲桃色在线一区| 麻豆精品一区二区av白丝在线| 成人深夜视频在线观看| 欧美人牲a欧美精品| 国产精品久久久久久久久快鸭| 午夜精品一区在线观看| 国产91在线看| 欧美丰满美乳xxx高潮www| 久久精品日产第一区二区三区高清版| 一区二区三区不卡在线观看| 国产乱子伦视频一区二区三区| 欧美在线观看视频一区二区| 国产欧美日韩三级| 久色婷婷小香蕉久久|