(PS3) Create gfx_ctx_get_aspect_ratio

This commit is contained in:
Twinaphex 2012-08-10 07:20:49 +02:00
parent 28eb3604f9
commit e3e3e1f3bc
4 changed files with 17 additions and 17 deletions

View File

@ -1050,22 +1050,6 @@ PSGLdevice* psglCreateDeviceExtended(const PSGLdeviceParameters *parameters )
return device;
}
GLfloat psglGetDeviceAspectRatio(const PSGLdevice * device)
{
CellVideoOutState videoState;
cellVideoOutGetState(CELL_VIDEO_OUT_PRIMARY, 0, &videoState);
switch (videoState.displayMode.aspect)
{
case CELL_VIDEO_OUT_ASPECT_4_3:
return 4.0f/3.0f;
case CELL_VIDEO_OUT_ASPECT_16_9:
return 16.0f/9.0f;
}
return 16.0f/9.0f;
}
void psglGetDeviceDimensions(const PSGLdevice * device, GLuint *width, GLuint *height)
{
*width = device->deviceParameters.width;

View File

@ -1005,7 +1005,6 @@ extern void psglExit();
PSGLdevice *psglCreateDeviceAuto( GLenum colorFormat, GLenum depthFormat, GLenum multisamplingMode );
PSGLdevice *psglCreateDeviceExtended( const PSGLdeviceParameters *parameters );
GLfloat psglGetDeviceAspectRatio(const PSGLdevice *device );
void psglGetDeviceDimensions(const PSGLdevice *device, GLuint *width, GLuint *height );
void psglDestroyDevice( PSGLdevice* device );

View File

@ -58,6 +58,22 @@ unsigned gfx_ctx_get_resolution_height(unsigned resolution_id)
return resolution.height;
}
float gfx_ctx_get_aspect_ratio(void)
{
CellVideoOutState videoState;
cellVideoOutGetState(CELL_VIDEO_OUT_PRIMARY, 0, &videoState);
switch (videoState.displayMode.aspect)
{
case CELL_VIDEO_OUT_ASPECT_4_3:
return 4.0f/3.0f;
case CELL_VIDEO_OUT_ASPECT_16_9:
return 16.0f/9.0f;
}
return 16.0f/9.0f;
}
void gfx_ctx_get_available_resolutions (void)
{
bool defaultresolution;

View File

@ -19,6 +19,7 @@
void gfx_ctx_get_available_resolutions (void);
int gfx_ctx_check_resolution(unsigned resolution_id);
float gfx_ctx_get_aspect_ratio(void);
unsigned gfx_ctx_get_resolution_width(unsigned resolution_id);
unsigned gfx_ctx_get_resolution_height(unsigned resolution_id);
void gfx_ctx_set_projection(gl_t *gl, const struct gl_ortho *ortho, bool allow_rotate);