• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ ASSERT_MAIN_THREAD函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中ASSERT_MAIN_THREAD函数的典型用法代码示例。如果您正苦于以下问题:C++ ASSERT_MAIN_THREAD函数的具体用法?C++ ASSERT_MAIN_THREAD怎么用?C++ ASSERT_MAIN_THREAD使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了ASSERT_MAIN_THREAD函数的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: ASSERT_MAIN_THREAD

void sdl_window_info::destroy()
{
	sdl_window_info **prevptr;

	ASSERT_MAIN_THREAD();
	if (multithreading_enabled)
	{
		sdlwindow_sync();
	}

	//osd_event_wait(window->rendered_event, osd_ticks_per_second()*10);

	// remove us from the list
	for (prevptr = &sdl_window_list; *prevptr != NULL; prevptr = &(*prevptr)->m_next)
		if (*prevptr == this)
		{
			*prevptr = this->m_next;
			break;
		}

	// free the textures etc
	execute_async_wait(&sdlwindow_video_window_destroy_wt, worker_param(this));

	// free the render target, after the textures!
	this->machine().render().target_free(m_target);

	// free the event
	osd_event_free(m_rendered_event);

	// free the lock
	osd_lock_free(this->m_render_lock);
}
开发者ID:gregdickhudl,项目名称:mame,代码行数:32,代码来源:window.cpp


示例2: ASSERT_MAIN_THREAD

void ShaderState::DrawArrays(uint dt, size_t count) const
{
    ASSERT_MAIN_THREAD();
    glDrawArrays(dt, 0, (GLsizei)count);
    glReportError();
    graphicsDrawCount++;
}
开发者ID:ConConovaloff,项目名称:outlaws-core,代码行数:7,代码来源:Graphics.cpp


示例3: sdlwindow_exit

static void sdlwindow_exit(running_machine &machine)
{
	ASSERT_MAIN_THREAD();

	mame_printf_verbose("Enter sdlwindow_exit\n");

	// free all the windows
	while (sdl_window_list != NULL)
	{
		sdl_window_info *temp = sdl_window_list;
		sdl_window_list = temp->next;
		sdlwindow_video_window_destroy(machine, temp);
	}

	// if we're multithreaded, clean up the window thread
	if (multithreading_enabled)
	{
		sdlwindow_sync();
	}

	// kill the drawers
	(*draw.exit)();

	execute_async_wait(&sdlwindow_exit_wt, NULL);

	if (multithreading_enabled)
	{
		osd_work_queue_wait(work_queue, 1000000);
		osd_work_queue_free(work_queue);
	}
	mame_printf_verbose("Leave sdlwindow_exit\n");

}
开发者ID:clobber,项目名称:UME,代码行数:33,代码来源:window.c


示例4: ASSERT_MAIN_THREAD

int CScriptSystem::BeginCall(const char* sFuncName, const bool bRaiseError /* = true */)
{
    ASSERT_MAIN_THREAD();
    // Check for LUA stack corruption
    CheckStackOnBeginCall();
    lua_getglobal(m_pLS, sFuncName);
    m_nTempArg = 0;
#ifdef _DEBUG

    if (!lua_isfunction(m_pLS, -1))
    {
        if (bRaiseError)
        {
            RaiseError(m_pLS, "Function %s not found(check for syntax errors or if the file wasn't loaded)", sFuncName);
        }

        m_nTempArg = -1;
        lua_pop(m_pLS, 1);
        m_CurrentDeep--;
        return 0;
    }

#endif
    return 1;
}
开发者ID:CodeBees,项目名称:behaviac,代码行数:25,代码来源:scriptsystem.cpp


示例5: sdlwindow_video_window_update_hi

void sdlwindow_video_window_update_hi(running_machine &machine, sdl_window_info *window)
{

	ASSERT_MAIN_THREAD();

	// adjust the cursor state
	sdlwindow_update_cursor_state(machine, window);
}
开发者ID:j4y4r,项目名称:j4ymame,代码行数:8,代码来源:window.c


示例6: osd_malloc

int sdl_window_info::window_init()
{
	worker_param *wp = (worker_param *) osd_malloc(sizeof(worker_param));
	int result;

	ASSERT_MAIN_THREAD();

	// set the initial maximized state
	// FIXME: Does not belong here
	sdl_options &options = downcast<sdl_options &>(m_machine.options());
	m_startmaximized = options.maximize();

	// add us to the list
	*last_window_ptr = this;
	last_window_ptr = &this->m_next;

	set_renderer(draw.create(this));

	// create an event that we can use to skip blitting
	m_rendered_event = osd_event_alloc(FALSE, TRUE);

	// load the layout
	m_target = m_machine.render().target_alloc();

	// set the specific view
	set_starting_view(m_index, options.view(), options.view(m_index));

	// make the window title
	if (video_config.numscreens == 1)
		sprintf(m_title, "%s: %s [%s]", emulator_info::get_appname(), m_machine.system().description, m_machine.system().name);
	else
		sprintf(m_title, "%s: %s [%s] - Screen %d", emulator_info::get_appname(), m_machine.system().description, m_machine.system().name, m_index);

	wp->set_window(this);

	// FIXME: pass error back in a different way
	if (multithreading_enabled)
	{
		osd_work_item *wi;

		wi = osd_work_item_queue(work_queue, &sdl_window_info::complete_create_wt, (void *) wp, 0);
		sdlwindow_sync();
		result = *((int *) (osd_work_item_result)(wi));
		osd_work_item_release(wi);
	}
	else
		result = *((int *) sdl_window_info::complete_create_wt((void *) wp, 0));

	// handle error conditions
	if (result == 1)
		goto error;

	return 0;

error:
	destroy();
	return 1;
}
开发者ID:mbcoguno,项目名称:mame,代码行数:58,代码来源:window.c


示例7: sdlwindow_video_window_update

void sdlwindow_video_window_update(running_machine &machine, sdl_window_info *window)
{

	osd_ticks_t     event_wait_ticks;
	ASSERT_MAIN_THREAD();

	// adjust the cursor state
	sdlwindow_update_cursor_state(machine, window);

	// if we're visible and running and not in the middle of a resize, draw
	if (window->target != NULL)
	{
		int tempwidth, tempheight;

		// see if the games video mode has changed
		window->target->compute_minimum_size(tempwidth, tempheight);
		if (tempwidth != window->minwidth || tempheight != window->minheight)
		{
			window->minwidth = tempwidth;
			window->minheight = tempheight;
			if (!window->fullscreen)
			{
				sdlwindow_blit_surface_size(window, window->width, window->height);
				sdlwindow_resize(window, window->blitwidth, window->blitheight);
			}
			else if (video_config.switchres)
			{
				pick_best_mode(window, &tempwidth, &tempheight);
				sdlwindow_resize(window, tempwidth, tempheight);
			}
		}

		if (video_config.waitvsync && video_config.syncrefresh)
			event_wait_ticks = osd_ticks_per_second(); // block at most a second
		else
			event_wait_ticks = 0;

		if (osd_event_wait(window->rendered_event, event_wait_ticks))
		{
			worker_param wp;
			render_primitive_list *primlist;

			clear_worker_param(&wp);

			// ensure the target bounds are up-to-date, and then get the primitives
			primlist = &window->get_primitives(window);

			// and redraw now

			wp.list = primlist;
			wp.window = window;
			wp.m_machine = &machine;

			execute_async(&draw_video_contents_wt, &wp);
		}
	}
}
开发者ID:clobber,项目名称:UME,代码行数:57,代码来源:window.c


示例8: ASSERT_MAIN_THREAD

void sdl_window_info::resize(INT32 width, INT32 height)
{
	ASSERT_MAIN_THREAD();

	osd_dim cd = get_size();

	if (width != cd.width() || height != cd.height())
	{
		auto wp = std::make_unique<worker_param>(std::static_pointer_cast<sdl_window_info>(shared_from_this()), width, height);
		execute_async_wait(&sdlwindow_resize_wt, std::move(wp));
	}
}
开发者ID:chrisisonwildcode,项目名称:mame,代码行数:12,代码来源:window.cpp


示例9: sdlwindow_toggle_full_screen

void sdlwindow_toggle_full_screen(running_machine &machine, sdl_window_info *window)
{
	worker_param wp;

	ASSERT_MAIN_THREAD();

	clear_worker_param(&wp);
	wp.window = window;
	wp.m_machine = &machine;

	execute_async_wait(&sdlwindow_toggle_full_screen_wt, &wp);
}
开发者ID:clobber,项目名称:UME,代码行数:12,代码来源:window.c


示例10: sdlwindow_video_window_update

void sdlwindow_video_window_update(running_machine *machine, sdl_window_info *window)
{

	ASSERT_MAIN_THREAD();

	// adjust the cursor state
	sdlwindow_update_cursor_state(machine, window);

	// if we're visible and running and not in the middle of a resize, draw
	if (window->target != NULL)
	{
		int tempwidth, tempheight;

		// see if the games video mode has changed
		render_target_get_minimum_size(window->target, &tempwidth, &tempheight);
		if (tempwidth != window->minwidth || tempheight != window->minheight)
		{
			window->minwidth = tempwidth;
			window->minheight = tempheight;
			if (!window->fullscreen)
			{
				sdlwindow_blit_surface_size(window, window->width, window->height);
				sdlwindow_resize(window, window->blitwidth, window->blitheight);
			}
			else if (video_config.switchres)
			{
				pick_best_mode(window, &tempwidth, &tempheight);
				sdlwindow_resize(window, tempwidth, tempheight);
			}
		}

		// only render if we have been signalled
		if (osd_event_wait(window->rendered_event, 0))
		{
			worker_param wp;
			const render_primitive_list *primlist;

			clear_worker_param(&wp);

			// ensure the target bounds are up-to-date, and then get the primitives
			primlist = window->get_primitives(window);

			// and redraw now

			wp.list = primlist;
			wp.window = window;
			wp.machine = machine;

			execute_async(&draw_video_contents_wt, &wp);
		}
	}
}
开发者ID:DarrenBranford,项目名称:MAME4iOS,代码行数:52,代码来源:window.c


示例11: glReportValidateShaderError1

void glReportValidateShaderError1(const char *file, uint line, const char *function, GLuint program, const char *name)
{
    ASSERT_MAIN_THREAD();

    if (!(globals.debugRender&DBG_GLERROR) && globals.frameStep > kDebugFrames)
        return;

    glValidateProgram(program);
    GLint status = 0;
    glGetProgramiv(program, GL_VALIDATE_STATUS, &status);
    checkProgramInfoLog(program, "validate");
    glReportError1(file, line, function);
    ASSERT_(status == GL_TRUE, file, line, function, "%s", name);
}
开发者ID:ConConovaloff,项目名称:outlaws-core,代码行数:14,代码来源:Graphics.cpp


示例12: glReportFramebufferError1

static GLenum glReportFramebufferError1(const char *file, uint line, const char *function)
{
    ASSERT_MAIN_THREAD();

    if (!(globals.debugRender&DBG_GLERROR) && globals.frameStep > kDebugFrames)
        return GL_NO_ERROR;

	GLenum err = glCheckFramebufferStatus(GL_FRAMEBUFFER);
	if (GL_FRAMEBUFFER_COMPLETE != err)
    {
        OLG_OnAssertFailed(file, line, function, "glCheckFramebufferStatus", "%s", getGLFrameBufferStatusString(err).c_str());
    }
    
	return err;
}
开发者ID:ConConovaloff,项目名称:outlaws-core,代码行数:15,代码来源:Graphics.cpp


示例13: sdlwindow_resize

void sdlwindow_resize(sdl_window_info *window, INT32 width, INT32 height)
{
	worker_param wp;

	ASSERT_MAIN_THREAD();

	if (width == window->width && height == window->height)
		return;

	clear_worker_param(&wp);
	wp.resize_new_width = width;
	wp.resize_new_height = height;
	wp.window = window;

	execute_async_wait(&sdlwindow_resize_wt, &wp);
}
开发者ID:clobber,项目名称:UME,代码行数:16,代码来源:window.c


示例14: glReportError1

GLenum glReportError1(const char *file, uint line, const char *function)
{
    ASSERT_MAIN_THREAD();

    if (!(globals.debugRender&DBG_GLERROR) && globals.frameStep > kDebugFrames)
        return GL_NO_ERROR;

	GLenum err = GL_NO_ERROR;
	while (GL_NO_ERROR != (err = glGetError()))
    {
        const char* msg = (const char *)gluErrorString(err);
        OLG_OnAssertFailed(file, line, function, "glGetError", "%s", msg);
    }
    
	return err;
}
开发者ID:ConConovaloff,项目名称:outlaws-core,代码行数:16,代码来源:Graphics.cpp


示例15: set_starting_view

static void set_starting_view(running_machine &machine, int index, sdl_window_info *window, const char *defview, const char *view)
{
	int viewindex;

	ASSERT_MAIN_THREAD();

	// choose non-auto over auto
	if (strcmp(view, "auto") == 0 && strcmp(defview, "auto") != 0)
		view = defview;

	// query the video system to help us pick a view
	viewindex = window->target->configured_view(view, index, video_config.numscreens);

	// set the view
	window->target->set_view(viewindex);
	window->start_viewscreen=viewindex;
}
开发者ID:clobber,项目名称:UME,代码行数:17,代码来源:window.c


示例16: set_starting_view

static void set_starting_view(running_machine *machine, int index, sdl_window_info *window, const char *view)
{
	const char *defview = options_get_string(machine->options(), SDLOPTION_VIEW( ));
	int viewindex;

	ASSERT_MAIN_THREAD();

	// choose non-auto over auto
	if (strcmp(view, "auto") == 0 && strcmp(defview, "auto") != 0)
		view = defview;

	// query the video system to help us pick a view
	viewindex = video_get_view_for_target(machine, window->target, view, index, video_config.numscreens);

	// set the view
	render_target_set_view(window->target, viewindex);
	window->start_viewscreen=viewindex;
}
开发者ID:DarrenBranford,项目名称:MAME4iOS,代码行数:18,代码来源:window.c


示例17: wp_dummy

void sdl_osd_interface::window_exit()
{
	std::unique_ptr<worker_param> wp_dummy(nullptr);

	ASSERT_MAIN_THREAD();

	osd_printf_verbose("Enter sdlwindow_exit\n");

	// free all the windows
	while (!sdl_window_list.empty())
	{
		auto window = sdl_window_list.front();
		
		// Part of destroy removes the window from the list
		window->destroy();
	}

	switch(video_config.mode)
	{
		case VIDEO_MODE_SDL2ACCEL:
			renderer_sdl1::exit();
			break;
		case VIDEO_MODE_SOFT:
			renderer_sdl1::exit();
			break;
		case VIDEO_MODE_BGFX:
			renderer_bgfx::exit();
			break;
#if (USE_OPENGL)
		case VIDEO_MODE_OPENGL:
			renderer_ogl::exit();
			break;
#endif
		default:
			break;
	}

	execute_async_wait(&sdlwindow_exit_wt, std::move(wp_dummy));

	osd_printf_verbose("Leave sdlwindow_exit\n");

}
开发者ID:chrisisonwildcode,项目名称:mame,代码行数:42,代码来源:window.cpp


示例18: ASSERT_MAIN_THREAD

    void Context::RemoveAgent(Agent* pAgent)
    {
        ASSERT_MAIN_THREAD();

        int agentId = pAgent->GetId();
        int priority = pAgent->GetPriority();

        vector<behaviac::Context::HeapItem_t>::iterator it = std::find_if(this->m_agents.begin(), this->m_agents.end(), HeapFinder_t(priority));

        if (it != this->m_agents.end())
        {
            HeapItem_t& pa = *it;

            Agents_t::iterator ita = pa.agents.find(agentId);

            if (ita != pa.agents.end())
            {
                pa.agents.erase(ita);
            }
        }
    }
开发者ID:1414648814,项目名称:behaviac,代码行数:21,代码来源:context.cpp


示例19: sdlwindow_video_window_destroy

static void sdlwindow_video_window_destroy(running_machine *machine, sdl_window_info *window)
{
	sdl_window_info **prevptr;
	worker_param wp;

	ASSERT_MAIN_THREAD();
	if (multithreading_enabled)
	{
		sdlwindow_sync();
	}

	//osd_event_wait(window->rendered_event, osd_ticks_per_second()*10);

	// remove us from the list
	for (prevptr = &sdl_window_list; *prevptr != NULL; prevptr = &(*prevptr)->next)
		if (*prevptr == window)
		{
			*prevptr = window->next;
			break;
		}

	// free the textures etc
	clear_worker_param(&wp);
	wp.window = window;
	wp.machine = machine;
	execute_async_wait(&sdlwindow_video_window_destroy_wt, &wp);

	// free the render target, after the textures!
	if (window->target != NULL)
		render_target_free(window->target);

	// free the event
	osd_event_free(window->rendered_event);

	// free the window itself
	global_free(window);
}
开发者ID:DarrenBranford,项目名称:MAME4iOS,代码行数:37,代码来源:window.c



注:本文中的ASSERT_MAIN_THREAD函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ ASSERT_MESSAGE函数代码示例发布时间:2022-05-30
下一篇:
C++ ASSERT_M函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap