Browse Source

ref: add enum for screen rotation

pull/2/head
mittorn 5 years ago
parent
commit
1365020302
  1. 3
      engine/platform/android/vid_android.c
  2. 4
      engine/platform/linux/vid_fbdev.c
  3. 10
      engine/ref_api.h
  4. 2
      ref_gl/gl_context.c

3
engine/platform/android/vid_android.c

@ -332,7 +332,8 @@ rserr_t R_ChangeDisplaySettings( int width, int height, qboolean fullscreen ) @@ -332,7 +332,8 @@ rserr_t R_ChangeDisplaySettings( int width, int height, qboolean fullscreen )
Android_GetScreenRes(&width, &height);
render_w = width, render_h = height;
render_w = width;
render_h = height;
Con_Reportf( "R_ChangeDisplaySettings: forced resolution to %dx%d)\n", width, height);

4
engine/platform/linux/vid_fbdev.c

@ -125,7 +125,9 @@ rserr_t R_ChangeDisplaySettings( int width, int height, qboolean fullscreen ) @@ -125,7 +125,9 @@ rserr_t R_ChangeDisplaySettings( int width, int height, qboolean fullscreen )
uint rotate = vid_rotate->value;
FB_GetScreenRes( &width, &height );
render_w = width, render_h = height;
render_w = width;
render_h = height;
Con_Reportf( "R_ChangeDisplaySettings: forced resolution to %dx%d)\n", width, height );

10
engine/ref_api.h

@ -212,6 +212,14 @@ enum @@ -212,6 +212,14 @@ enum
REF_GL_CONTEXT_RESET_ISOLATION_FLAG = 0x0008
};
typedef enum ref_screen_rotation_e
{
REF_ROTATE_NONE = 0,
REF_ROTATE_CW = 1,
REF_ROTATE_UD = 2,
REF_ROTATE_CCW = 3,
} ref_screen_rotation_t;
typedef struct remap_info_s
{
unsigned short textures[MAX_SKINS];// alias textures
@ -436,7 +444,7 @@ typedef struct ref_interface_s @@ -436,7 +444,7 @@ typedef struct ref_interface_s
// const char *(*R_GetInitError)( void );
void (*R_Shutdown)( void );
const char *(*R_GetConfigName)( void ); // returns config name without extension
qboolean (*R_SetDisplayTransform)( uint rotate, int x, int y, float scale_x, float scale_y );
qboolean (*R_SetDisplayTransform)( ref_screen_rotation_t rotate, int x, int y, float scale_x, float scale_y );
// only called for GL contexts
void (*GL_SetupAttributes)( int safegl );

2
ref_gl/gl_context.c

@ -308,7 +308,7 @@ void R_ProcessEntData( qboolean allocate ) @@ -308,7 +308,7 @@ void R_ProcessEntData( qboolean allocate )
gEngfuncs.drawFuncs->R_ProcessEntData( allocate );
}
qboolean R_SetDisplayTransform( uint rotate, int offset_x, int offset_y, float scale_x, float scale_y )
qboolean R_SetDisplayTransform( ref_screen_rotation_t rotate, int offset_x, int offset_y, float scale_x, float scale_y )
{
qboolean ret = true;
if( rotate > 0 )

Loading…
Cancel
Save