Browse Source

engine: platform: implement generic GetNativeObject for POSIX systems without SDL2

pull/2/head
Alibek Omarov 2 years ago
parent
commit
b84aba68fa
  1. 5
      engine/platform/linux/vid_fbdev.c
  2. 14
      engine/platform/posix/sys_posix.c

5
engine/platform/linux/vid_fbdev.c

@ -272,11 +272,6 @@ void Platform_RunEvents( void )
} }
void *Platform_GetNativeObject( const char *name )
{
return NULL;
}
void GAME_EXPORT Platform_GetMousePos( int *x, int *y ) void GAME_EXPORT Platform_GetMousePos( int *x, int *y )
{ {
*x = *y = 0; *x = *y = 0;

14
engine/platform/posix/sys_posix.c

@ -147,12 +147,20 @@ void Posix_Daemonize( void )
} }
#if !XASH_SDL && !XASH_ANDROID #if !XASH_SDL && !XASH_ANDROID
void Platform_Init( void ) void Platform_Init( void )
{ {
Posix_Daemonize(); Posix_Daemonize();
} }
void Platform_Shutdown( void ) {}
void Platform_Shutdown( void )
{
}
void *Platform_GetNativeObject( const char *name )
{
return NULL;
}
#endif #endif
#if XASH_TIMER == TIMER_POSIX #if XASH_TIMER == TIMER_POSIX
@ -161,7 +169,7 @@ double Platform_DoubleTime( void )
struct timespec ts; struct timespec ts;
#if XASH_IRIX #if XASH_IRIX
clock_gettime( CLOCK_SGI_CYCLE, &ts ); clock_gettime( CLOCK_SGI_CYCLE, &ts );
#else #else
clock_gettime( CLOCK_MONOTONIC, &ts ); clock_gettime( CLOCK_MONOTONIC, &ts );
#endif #endif
return (double) ts.tv_sec + (double) ts.tv_nsec/1000000000.0; return (double) ts.tv_sec + (double) ts.tv_nsec/1000000000.0;

Loading…
Cancel
Save