当前位置: 首页>>代码示例>>C++>>正文


C++ SDL_Unlock_EventThread函数代码示例

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


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

示例1: ph_UpdateMouse

void ph_UpdateMouse(_THIS)
{
    PhCursorInfo_t phcursor;
    short abs_x;
    short abs_y;

    /* Lock the event thread, in multi-threading environments */
    SDL_Lock_EventThread();

    /* synchronizing photon mouse cursor position and SDL mouse position, if cursor appears over window. */
    PtGetAbsPosition(window, &abs_x, &abs_y);
    PhQueryCursor(PhInputGroup(NULL), &phcursor);
    if (((phcursor.pos.x >= abs_x) && (phcursor.pos.x <= abs_x + this->screen->w)) &&
        ((phcursor.pos.y >= abs_y) && (phcursor.pos.y <= abs_y + this->screen->h)))
    {
        SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);
        SDL_PrivateMouseMotion(0, 0, phcursor.pos.x-abs_x, phcursor.pos.y-abs_y);
    }
    else
    {
        SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS);
    }

    /* Unlock the event thread, in multi-threading environments */
    SDL_Unlock_EventThread();
}
开发者ID:johntalbain28,项目名称:Stepmania-AMX,代码行数:26,代码来源:SDL_ph_mouse.c

示例2: NX_SetVideoMode

SDL_Surface * NX_SetVideoMode (_THIS, SDL_Surface * current,
                int width, int height, int bpp, Uint32 flags)
{
    Dprintf ("enter NX_SetVideoMode\n") ;

    // Lock the event thread, in multi-threading environments
    SDL_Lock_EventThread () ;

    bpp = SDL_Visual.bpp ;
    if (NX_CreateWindow (this, current, width, height, bpp, flags) < 0) {
        current = NULL;
        goto done;
    }

    if (current -> w != width || current -> h != height) {
        current -> w = width ;
        current -> h = height ;
        current -> pitch = SDL_CalculatePitch (current) ;
        NX_ResizeImage (this, current, flags) ;
    }
    current -> flags |= (flags & (SDL_RESIZABLE | SDL_NOFRAME)) ;

  done:
    SDL_Unlock_EventThread () ;

    Dprintf ("leave NX_SetVideoMode\n") ;

    // We're done!
    return current ;
}
开发者ID:Goettsch,项目名称:game-editor,代码行数:30,代码来源:SDL_nxvideo.c

示例3: unlock_display

static void unlock_display(void)
{
	/* Make sure any X11 transactions are completed */
	SDL_VideoDevice *this = current_video;
	XSync(SDL_Display, False);
	SDL_Unlock_EventThread();
}
开发者ID:johntalbain28,项目名称:Stepmania-AMX,代码行数:7,代码来源:SDL_cgxwm.c

示例4: NX_UpdateMouse

// Update the current mouse state and position
static void NX_UpdateMouse (_THIS)
{
    int            x, y ;
    GR_WINDOW_INFO info ;
    GR_SCREEN_INFO si ;


    Dprintf ("enter NX_UpdateMouse\n") ;

    // Lock the event thread, in multi-threading environments
    SDL_Lock_EventThread () ;
    
    GrGetScreenInfo (& si) ;
    GrGetWindowInfo (SDL_Window, & info) ;
    x = si.xpos - info.x ;
    y = si.ypos - info.y ;
    if (x >= 0 && x <= info.width && y >= 0 && y <= info.height) {
        SDL_PrivateAppActive (1, SDL_APPMOUSEFOCUS) ;
        SDL_PrivateMouseMotion (0, 0, x, y);
    } else {
        SDL_PrivateAppActive (0, SDL_APPMOUSEFOCUS) ;
    }

    SDL_Unlock_EventThread () ;
    Dprintf ("leave NX_UpdateMouse\n") ;
}
开发者ID:Goettsch,项目名称:game-editor,代码行数:27,代码来源:SDL_nxvideo.c

示例5: SDL_JoystickQuit

void SDL_JoystickQuit(void)
{
	const int numsticks = SDL_numjoysticks;
	int i;

	
	SDL_Lock_EventThread();
	SDL_numjoysticks = 0;
	SDL_Unlock_EventThread();

	if (SDL_joysticks != NULL) {
		for (i = 0; i < numsticks; i++) {
			SDL_Joystick *stick = SDL_joysticks[i];
			if (stick && (stick->ref_count >= 1)) {
				stick->ref_count = 1;
				SDL_JoystickClose(stick);
			}
		}
	}

	
	SDL_SYS_JoystickQuit();
	if ( SDL_joysticks ) {
		SDL_free(SDL_joysticks);
		SDL_joysticks = NULL;
		SDL_allocatedjoysticks = 0;
	}
}
开发者ID:qtekfun,项目名称:htcDesire820Kernel,代码行数:28,代码来源:SDL_joystick.c

示例6: ph_GrabInput

SDL_GrabMode ph_GrabInput(_THIS, SDL_GrabMode mode)
{
    SDL_Lock_EventThread();
    mode = ph_GrabInputNoLock(this, mode);
    SDL_Unlock_EventThread();

    return(mode);
}
开发者ID:0omega,项目名称:platform_external_qemu,代码行数:8,代码来源:SDL_ph_wm.c

示例7: sdl_netbas_gi_CreateWMCursor

/* If not NULL, create a black/white window manager cursor */
WMcursor * sdl_netbas_gi_CreateWMCursor (_THIS, Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y)
{
	SDL_Lock_EventThread();
	WMcursor *cursor = (WMcursor *) malloc(sizeof(WMcursor));
	SDL_Unlock_EventThread();
	DEBUG_OUT("sdl_netbas_gi_CreateWMCursor\n");
	return cursor;
}
开发者ID:grimtraveller,项目名称:netbas,代码行数:9,代码来源:SDL_gicursor.c

示例8: sdl_netbas_gi_FreeWMCursor

/* Free a window manager cursor
   This function can be NULL if CreateWMCursor is also NULL.
 */
void sdl_netbas_gi_FreeWMCursor (_THIS, WMcursor *cursor)
{
	SDL_Lock_EventThread();
	if(cursor)
	free(cursor);
	SDL_Unlock_EventThread();
	DEBUG_OUT("sdl_netbas_gi_FreeWMCursor\n");
}
开发者ID:grimtraveller,项目名称:netbas,代码行数:11,代码来源:SDL_gicursor.c

示例9: ph_WarpWMCursor

void ph_WarpWMCursor(_THIS, Uint16 x, Uint16 y)
{
    short abs_x, abs_y;

    SDL_Lock_EventThread();
    PtGetAbsPosition( window, &abs_x, &abs_y );
    PhMoveCursorAbs( PhInputGroup(NULL), x + abs_x, y + abs_y );
    SDL_Unlock_EventThread();
}
开发者ID:johntalbain28,项目名称:Stepmania-AMX,代码行数:9,代码来源:SDL_ph_mouse.c

示例10: X11_SetVidModeGamma

int X11_SetVidModeGamma(_THIS, float red, float green, float blue)
{
    int result;

    SDL_Lock_EventThread();
    result = X11_SetGammaNoLock(this, red, green, blue);
    SDL_Unlock_EventThread();

    return(result);
}
开发者ID:cmb33595,项目名称:ozex,代码行数:10,代码来源:SDL_x11gamma.c

示例11: X11_FreeWMCursor

void X11_FreeWMCursor(_THIS, WMcursor *cursor)
{
	if ( SDL_Display != NULL ) {
		SDL_Lock_EventThread();
		XFreeCursor(SDL_Display, cursor->x_cursor);
		XSync(SDL_Display, False);
		SDL_Unlock_EventThread();
	}
	SDL_free(cursor);
}
开发者ID:BITINT,项目名称:DEFCON2,代码行数:10,代码来源:SDL_x11mouse.c

示例12: ph_SetCaption

/* Set window caption */
void ph_SetCaption(_THIS, const char *title, const char *icon)
{
    SDL_Lock_EventThread();

    /* sanity check for set caption call before window init */
    if (window!=NULL)
    {
        PtSetResource(window, Pt_ARG_WINDOW_TITLE, title, 0);
    }

    SDL_Unlock_EventThread();
}
开发者ID:0omega,项目名称:platform_external_qemu,代码行数:13,代码来源:SDL_ph_wm.c

示例13: ph_SetCaption

void ph_SetCaption(_THIS, const char *title, const char *icon)
{
    SDL_Lock_EventThread();

    
    if (window!=NULL)
    {
        PtSetResource(window, Pt_ARG_WINDOW_TITLE, title, 0);
    }

    SDL_Unlock_EventThread();
}
开发者ID:qtekfun,项目名称:htcDesire820Kernel,代码行数:12,代码来源:SDL_ph_wm.c

示例14: NX_SetCaption

void NX_SetCaption (_THIS, const char * title, const char * icon)
{
    Dprintf ("enter NX_SetCaption\n") ;

    // Lock the event thread, in multi-threading environments
    SDL_Lock_EventThread () ;
    
    if (SDL_Window) 
        GrSetWindowTitle (SDL_Window, title) ;
    
    SDL_Unlock_EventThread () ;
    Dprintf ("leave NX_SetCaption\n") ;
}
开发者ID:0omega,项目名称:platform_external_qemu,代码行数:13,代码来源:SDL_nxwm.c

示例15: NX_WarpWMCursor

void NX_WarpWMCursor(_THIS, Uint16 x, Uint16 y)
{
    GR_WINDOW_INFO info ;

    Dprintf ("enter NX_WarpWMCursor\n") ;
    SDL_Lock_EventThread () ;
    
    GrGetWindowInfo (SDL_Window, & info) ;
    GrMoveCursor (info.x + x, info.y + y) ;

    SDL_Unlock_EventThread () ;
    Dprintf ("leave NX_WarpWMCursor\n") ;
}
开发者ID:qtekfun,项目名称:htcDesire820Kernel,代码行数:13,代码来源:SDL_nxmouse.c


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